@@ -41,7 +41,7 @@ public function __construct(Request $request)
4141 $ classDescriptions = $ this ->parseCode ($ code );
4242
4343 $ dependsOnTheseNamespaces = new DependsOnlyOnTheseNamespaces (['Foo ' ]);
44- $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ classDescriptions [0 ], ' because ' );
44+ $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ classDescriptions [0 ]);
4545
4646 self ::assertCount (2 , $ violations );
4747 self ::assertEquals ('relativePathName ' , $ violations ->get (0 )->getFilePath ());
@@ -260,7 +260,7 @@ public function __construct(Request $request)
260260 $ cd = $ this ->parseCode ($ code );
261261
262262 $ dependsOnTheseNamespaces = new DependsOnlyOnTheseNamespaces (['Foo ' , 'Symfony ' , 'Doctrine ' ]);
263- $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ], ' we want to add this rule for our software ' );
263+ $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ]);
264264
265265 self ::assertCount (0 , $ violations );
266266 }
@@ -322,7 +322,7 @@ public function __construct()
322322 $ cd = $ this ->parseCode ($ code );
323323
324324 $ dependsOnTheseNamespaces = new DependsOnlyOnTheseNamespaces (['Foo ' , 'Symfony ' , 'Doctrine ' ]);
325- $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ], ' we want to add this rule for our software ' );
325+ $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ]);
326326
327327 self ::assertCount (0 , $ violations );
328328 }
@@ -356,7 +356,7 @@ public function doSomething(self $self, static $static)
356356 $ cd = $ this ->parseCode ($ code );
357357
358358 $ notHaveDependencyOutsideNamespace = new NotHaveDependencyOutsideNamespace ('Root\Animals ' );
359- $ violations = $ this ->evaluateRule ($ notHaveDependencyOutsideNamespace , $ cd [0 ], ' we want to add this rule for our software ' );
359+ $ violations = $ this ->evaluateRule ($ notHaveDependencyOutsideNamespace , $ cd [0 ]);
360360
361361 self ::assertCount (0 , $ violations );
362362 }
@@ -383,7 +383,7 @@ public function foo()
383383 $ cd = $ this ->parseCode ($ code );
384384
385385 $ dependsOnlyOnTheseNamespaces = new DependsOnlyOnTheseNamespaces ();
386- $ violations = $ this ->evaluateRule ($ dependsOnlyOnTheseNamespaces , $ cd [0 ], ' we want to add this rule for our software ' );
386+ $ violations = $ this ->evaluateRule ($ dependsOnlyOnTheseNamespaces , $ cd [0 ]);
387387
388388 self ::assertCount (1 , $ violations );
389389 }
@@ -419,7 +419,7 @@ public function getStatic(): self
419419 $ cd = $ this ->parseCode ($ code );
420420
421421 $ notHaveDependencyOutsideNamespace = new NotHaveDependencyOutsideNamespace ('Root\Cars ' );
422- $ violations = $ this ->evaluateRule ($ notHaveDependencyOutsideNamespace , $ cd [0 ], ' we want to add this rule for our software ' );
422+ $ violations = $ this ->evaluateRule ($ notHaveDependencyOutsideNamespace , $ cd [0 ]);
423423
424424 self ::assertCount (1 , $ violations );
425425 }
@@ -447,7 +447,7 @@ class Test implements Order
447447 $ cd = $ cd [2 ]; // class Test
448448
449449 $ implement = new Implement ('Foo\Order ' );
450- $ violations = $ this ->evaluateRule ($ implement , $ cd, ' we want to add this rule for our software ' );
450+ $ violations = $ this ->evaluateRule ($ implement , $ cd );
451451
452452 self ::assertCount (0 , $ violations );
453453 }
@@ -470,7 +470,7 @@ public function getBookList(): QueryBuilder;
470470 $ cd = $ this ->parseCode ($ code , TargetPhpVersion::PHP_8_1 );
471471
472472 $ dependsOnTheseNamespaces = new DependsOnlyOnTheseNamespaces (['MyProject\AppBundle\Application ' ]);
473- $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ], ' we want to add this rule for our software ' );
473+ $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ]);
474474
475475 self ::assertCount (1 , $ violations );
476476 }
@@ -533,7 +533,7 @@ public function getRequest(): Request //the violations is reported here
533533 $ cd = $ this ->parseCode ($ code );
534534
535535 $ dependsOnTheseNamespaces = new DependsOnlyOnTheseNamespaces (['Foo ' , 'Symfony ' , 'Doctrine ' ]);
536- $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ], ' we want to add this rule for our software ' );
536+ $ violations = $ this ->evaluateRule ($ dependsOnTheseNamespaces , $ cd [0 ]);
537537
538538 self ::assertCount (0 , $ violations );
539539 }
@@ -553,7 +553,7 @@ public function __construct() {
553553
554554 $ cd = $ this ->parseCode ($ code , TargetPhpVersion::PHP_8_4 );
555555 $ isFinal = new IsFinal ();
556- $ violations = $ this ->evaluateRule ($ isFinal , $ cd [0 ], ' we want to add this rule for our software ' );
556+ $ violations = $ this ->evaluateRule ($ isFinal , $ cd [0 ]);
557557
558558 self ::assertCount (0 , $ violations );
559559 }
@@ -575,7 +575,7 @@ abstract public function foo() {}
575575
576576 $ cd = $ this ->parseCode ($ code , TargetPhpVersion::PHP_8_4 );
577577 $ isAbstract = new IsAbstract ();
578- $ violations = $ this ->evaluateRule ($ isAbstract , $ cd [0 ], ' we want to add this rule for our software ' );
578+ $ violations = $ this ->evaluateRule ($ isAbstract , $ cd [0 ]);
579579
580580 self ::assertCount (0 , $ violations );
581581 }
@@ -595,7 +595,7 @@ public function __construct() {
595595
596596 $ cd = $ this ->parseCode ($ code , TargetPhpVersion::PHP_8_4 );
597597 $ isReadOnly = new IsReadonly ();
598- $ violations = $ this ->evaluateRule ($ isReadOnly , $ cd [0 ], ' we want to add this rule for our software ' );
598+ $ violations = $ this ->evaluateRule ($ isReadOnly , $ cd [0 ]);
599599
600600 self ::assertCount (0 , $ violations );
601601 }
@@ -608,10 +608,10 @@ private function parseCode(string $code, ?string $version = null): array
608608 return $ fp ->getClassDescriptions ();
609609 }
610610
611- private function evaluateRule ($ rule , ClassDescription $ classDescription, string $ reason = ' test reason ' ): Violations
611+ private function evaluateRule ($ rule , ClassDescription $ classDescription ): Violations
612612 {
613613 $ violations = new Violations ();
614- $ rule ->evaluate ($ classDescription , $ violations , $ reason );
614+ $ rule ->evaluate ($ classDescription , $ violations , ' we want to add this rule for our software ' );
615615
616616 return $ violations ;
617617 }
0 commit comments