| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public static function createImageSetFromPostValues($postValues) |
||
| 22 | { |
||
| 23 | if (isset($postValues['title'], $postValues['width'], $postValues['height'], $postValues['method'])) { |
||
| 24 | $imageSetObject = new \stdClass(); |
||
| 25 | |||
| 26 | $imageSetObject->title = $postValues['title']; |
||
| 27 | $imageSetObject->slug = slugify($postValues['title']); |
||
| 28 | $imageSetObject->width = $postValues['width']; |
||
| 29 | $imageSetObject->height = $postValues['height']; |
||
| 30 | $imageSetObject->method = $postValues['method']; |
||
| 31 | |||
| 32 | return $imageSetObject; |
||
| 33 | } else { |
||
| 34 | throw new \Exception('Trying to create image set with invalid data.'); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |