| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | public function generateSepia($gd) |
||
| 23 | { |
||
| 24 | $imageResource= $gd->getImageResource(); |
||
| 25 | if (!$imageResource) { |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | |||
| 29 | $conf = Config::inst()->forClass('SepiaImages'); |
||
| 30 | |||
| 31 | imagefilter($imageResource, IMG_FILTER_GRAYSCALE); |
||
| 32 | imagefilter($imageResource, IMG_FILTER_BRIGHTNESS, $conf->get('brightness')); |
||
| 33 | imagefilter($imageResource, IMG_FILTER_COLORIZE, |
||
| 34 | $conf->get('colorize_red'), $conf->get('colorize_green'), $conf->get('colorize_blue')); |
||
| 35 | |||
| 36 | $output = clone $gd; |
||
| 37 | $output->setImageResource($imageResource); |
||
| 38 | |||
| 39 | return $output; |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.