• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nepada / message-bus / 4581487412

pending completion
4581487412

push

github

GitHub
Update spaze/phpstan-disallowed-calls requirement from 2.11.6 to 2.12.1 (#75)

303 of 315 relevant lines covered (96.19%)

0.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/MessageBus/StaticAnalysis/Rules/MethodParameterNameMatchesRule.php
1
<?php
2
declare(strict_types = 1);
3

4
namespace Nepada\MessageBus\StaticAnalysis\Rules;
5

6
use Nepada\MessageBus\StaticAnalysis\StaticAnalysisFailedException;
7
use ReflectionParameter;
8

9
final class MethodParameterNameMatchesRule
10
{
11

12
    private string $parameterName;
13

14
    public function __construct(string $parameterName)
1✔
15
    {
16
        $this->parameterName = $parameterName;
1✔
17
    }
1✔
18

19
    /**
20
     * @param ReflectionParameter $parameter
21
     * @throws StaticAnalysisFailedException
22
     */
23
    public function validate(ReflectionParameter $parameter): void
1✔
24
    {
25
        if ($parameter->getName() !== $this->parameterName) {
1✔
26
            $class = $parameter->getDeclaringClass();
1✔
27
            if ($class === null) {
1✔
28
                throw new \LogicException('Class must be set in this context.');
×
29
            }
30

31
            throw StaticAnalysisFailedException::with(
1✔
32
                sprintf('Method parameter name must be "%s"', $this->parameterName),
1✔
33
                $class->getName(),
1✔
34
            );
35
        }
36
    }
1✔
37

38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc