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

nepada / message-bus / 6499378211

12 Oct 2023 06:00PM UTC coverage: 96.474% (+0.3%) from 96.19%
6499378211

push

github

xificurk
Add missing transitive dependency symfony/deprecation-contracts

This should have been required by symfony/messenger, but it's missing.

301 of 312 relevant lines covered (96.47%)

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

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

37
}
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

© 2025 Coveralls, Inc