Conditions | 3 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public static function forVersion($version, array $knownVersions, $path = null, Exception $cause = null) |
||
39 | { |
||
40 | usort($knownVersions, 'version_compare'); |
||
41 | |||
42 | $isHigher = version_compare($version, end($knownVersions), '>'); |
||
43 | |||
44 | return new static(sprintf( |
||
45 | 'Cannot read module file%s at version %s. The supported versions '. |
||
46 | 'are %s.%s', |
||
47 | $path ? ' '.$path : '', |
||
48 | $version, |
||
49 | implode(', ', $knownVersions), |
||
50 | $isHigher ? ' Please run "puli self-update".' : '' |
||
51 | ), 0, $cause); |
||
52 | } |
||
53 | } |
||
54 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.