| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | function toPng( $url ) { |
||
| 17 | global $AR; |
||
| 18 | $image = false; |
||
| 19 | if ( $AR->Webkit2png->path ) { |
||
| 20 | $url = ar::url($url); |
||
| 21 | if ( $url->host ) { // only allow remote fetches |
||
|
|
|||
| 22 | $cmd = $AR->Webkit2png->xvfbPath . ' ' . $AR->Webkit2png->xvfbOptions |
||
| 23 | . ' ' . $AR->Webkit2png->path . ' ' . $AR->Webkit2png->options . ' ' . escapeshellarg( (string) $url ); |
||
| 24 | //echo $cmd; |
||
| 25 | $image = shell_exec( $cmd ); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | return $image; |
||
| 29 | } |
||
| 30 | |||
| 32 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.