| Conditions | 1 |
| Paths | 1 |
| Total Lines | 55 |
| Code Lines | 42 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 78 | public function testIdplistStructured(): void |
||
| 79 | { |
||
| 80 | $refl = new ReflectionClass(self::$discoHandler); |
||
| 81 | $idplistStructured = $refl->getMethod('idplistStructured'); |
||
| 82 | $idplistStructured->setAccessible(true); |
||
| 83 | $idpList = $idplistStructured->invokeArgs(self::$discoHandler, [self::$idpList]); |
||
| 84 | |||
| 85 | $expected = [ |
||
| 86 | 'B' => [ |
||
| 87 | 'https://idp04.example.org' => [ |
||
| 88 | 'name' => ['en' => 'IdP 04'], |
||
| 89 | 'tags' => ['A', 'B'], |
||
| 90 | 'entityid' => 'https://idp04.example.org', |
||
| 91 | 'UIInfo' => ['Keywords' => ['en' => ['aap','noot','mies']]], |
||
| 92 | ], |
||
| 93 | 'https://idp06.example.org' => [ |
||
| 94 | 'name' => ['en' => 'IdP 06'], |
||
| 95 | 'tags' => ['B'], |
||
| 96 | 'entityid' => 'https://idp06.example.org', |
||
| 97 | 'UIInfo' => ['Keywords' => ['fr' => ['singue','noix','mies'], 'de' => ['Affe', 'Nuss', 'mies']]], |
||
| 98 | ], |
||
| 99 | 'https://idp05.example.org' => [ |
||
| 100 | 'tags' => ['B'], |
||
| 101 | 'entityid' => 'https://idp05.example.org', |
||
| 102 | ], |
||
| 103 | ], |
||
| 104 | 'A' => [ |
||
| 105 | 'https://idp03.example.org' => [ |
||
| 106 | 'name' => ['en' => 'IdP 03'], |
||
| 107 | 'discopower.weight' => 100, |
||
| 108 | 'tags' => ['A'], |
||
| 109 | 'entityid' => 'https://idp03.example.org', |
||
| 110 | ], |
||
| 111 | 'https://idp02.example.org' => [ |
||
| 112 | 'name' => ['en' => 'IdP 02'], |
||
| 113 | 'tags' => ['A'], |
||
| 114 | 'entityid' => 'https://idp02.example.org', |
||
| 115 | ], |
||
| 116 | 'https://idp04.example.org' => [ |
||
| 117 | 'name' => ['en' => 'IdP 04'], |
||
| 118 | 'tags' => ['A','B',], |
||
| 119 | 'entityid' => 'https://idp04.example.org', |
||
| 120 | 'UIInfo' => ['Keywords' => ['en' => ['aap','noot','mies']]], |
||
| 121 | ], |
||
| 122 | 'https://idp01.example.org' => [ |
||
| 123 | 'name' => ['en' => 'IdP 01'], |
||
| 124 | 'discopower.weight' => 1, |
||
| 125 | 'tags' => ['A'], |
||
| 126 | 'entityid' => 'https://idp01.example.org', |
||
| 127 | ], |
||
| 128 | ], |
||
| 129 | ]; |
||
| 130 | $this->assertEquals($expected, $idpList); |
||
| 131 | $this->assertEquals($expected['A'], $idpList['A']); |
||
| 132 | $this->assertEquals($expected['B'], $idpList['B']); |
||
| 133 | } |
||
| 181 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths