@@ -92,13 +92,16 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | parent::init(); |
| 94 | 94 | |
| 95 | - if (empty($this->file)) |
|
| 96 | - throw new ErrorException(Yii::t('image', 'No path to file specified "file"')); |
|
| 97 | - if (empty($this->outFile)) |
|
| 98 | - throw new ErrorException('No Out File path to file specified "outFile"'); |
|
| 95 | + if (empty($this->file)) { |
|
| 96 | + throw new ErrorException(Yii::t('image', 'No path to file specified "file"')); |
|
| 97 | + } |
|
| 98 | + if (empty($this->outFile)) { |
|
| 99 | + throw new ErrorException('No Out File path to file specified "outFile"'); |
|
| 100 | + } |
|
| 99 | 101 | |
| 100 | - if (empty($this->watermarkFile)) |
|
| 101 | - $this->config['watermark'] = false; |
|
| 102 | + if (empty($this->watermarkFile)) { |
|
| 103 | + $this->config['watermark'] = false; |
|
| 104 | + } |
|
| 102 | 105 | } |
| 103 | 106 | |
| 104 | 107 | /** |
@@ -128,8 +131,9 @@ discard block |
||
| 128 | 131 | |
| 129 | 132 | $ImageDriver->resize(null, $config->height); |
| 130 | 133 | |
| 131 | - if ($config->crop) |
|
| 132 | - $ImageDriver->crop($config->width, $config->height); |
|
| 134 | + if ($config->crop) { |
|
| 135 | + $ImageDriver->crop($config->width, $config->height); |
|
| 136 | + } |
|
| 133 | 137 | |
| 134 | 138 | if ($config->watermark) { |
| 135 | 139 | $watermark = new Image(['driver' => $this->driver]); |
@@ -49,8 +49,9 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function load($file = null, $driver = null) |
| 51 | 51 | { |
| 52 | - if (empty($driver)) |
|
| 53 | - $driver = $this->driver; |
|
| 52 | + if (empty($driver)) { |
|
| 53 | + $driver = $this->driver; |
|
| 54 | + } |
|
| 54 | 55 | |
| 55 | 56 | if (empty($file)) { |
| 56 | 57 | throw new ErrorException('File name can not be empty'); |