| Conditions | 6 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 24 | public function pass(Stmt $stmt, Context $context) |
|
| 22 | { |
||
| 23 | // if it is private, protected or public return false |
||
| 24 | 24 | if ($stmt->isPrivate() || $stmt->isProtected() || ($stmt->type & Class_::MODIFIER_PUBLIC) !== 0) { |
|
| 25 | 24 | return false; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | if ($stmt instanceof Property) { |
|
| 29 | 1 | $context->notice( |
|
| 30 | 1 | 'missing_visibility', |
|
| 31 | 1 | 'Class property was defined with the deprecated var keyword. Use a visibility modifier instead.', |
|
| 32 | $stmt |
||
| 33 | 1 | ); |
|
| 34 | 1 | } elseif ($stmt instanceof ClassMethod) { |
|
| 35 | 1 | $context->notice( |
|
| 36 | 1 | 'missing_visibility', |
|
| 37 | 1 | 'Class method was defined without a visibility modifier.', |
|
| 38 | $stmt |
||
| 39 | 1 | ); |
|
| 40 | 1 | } |
|
| 41 | |||
| 42 | 1 | return true; |
|
| 43 | } |
||
| 44 | |||
| 69 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.