| 1 | <?php |
||
| 5 | class ImageHandler extends Handler |
||
| 6 | { |
||
| 7 | /** {@inheritdoc} */ |
||
| 8 | protected $validExt = [ |
||
| 9 | 'png', |
||
| 10 | 'jpeg', |
||
| 11 | 'jpg', |
||
| 12 | ]; |
||
| 13 | protected $args = [ |
||
| 14 | 'png' => ' -o2 %s', |
||
| 15 | 'jpg' => ' -progressive -copy none -optimize -outfile %s %s', // dest, src |
||
| 16 | 'jpeg' => ' -progressive -copy none -optimize -outfile %s %s', // dest, src |
||
| 17 | ]; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | public function handleQueue() |
||
| 59 | } |
||
| 60 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: