| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function check( ...$args ) { |
||
| 35 | $result = apply_filters( $this->filter_name, $this->initial_value ); |
||
| 36 | |||
| 37 | if ( $result === $this->required_value ) { |
||
| 38 | return new PermissionGranted(); |
||
| 39 | } |
||
| 40 | |||
| 41 | return new PermissionDenied( |
||
| 42 | // translators: Argument is a WordPress filter name. |
||
| 43 | sprintf( __( 'Accessed blocked by filter %s', 'jetpack' ), $this->filter_name ) |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: