@@ -67,7 +67,7 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | protected static function getTempFile(string $content) |
| 69 | 69 | { |
| 70 | - $stream = fopen('php://memory','rb+'); |
|
| 70 | + $stream = fopen('php://memory', 'rb+'); |
|
| 71 | 71 | fwrite($stream, $content); // write file into stream |
| 72 | 72 | rewind($stream); // reset stream pointer to start |
| 73 | 73 | |
@@ -91,16 +91,16 @@ |
||
| 91 | 91 | public function rules(): array |
| 92 | 92 | { |
| 93 | 93 | return [ |
| 94 | - ['model', function ($attribute) { |
|
| 94 | + ['model', function($attribute) { |
|
| 95 | 95 | if ($this->$attribute->isNewRecord || $this->$attribute->id === null) { |
| 96 | 96 | $this->$attribute->addError($attribute, 'Parent model must be saved.'); |
| 97 | 97 | } |
| 98 | 98 | }], |
| 99 | 99 | [ |
| 100 | 100 | 'fileArray', |
| 101 | - function ($attribute) { |
|
| 101 | + function($attribute) { |
|
| 102 | 102 | // max count |
| 103 | - $fileArray = array_filter($this->fileArray, function (File $file) { |
|
| 103 | + $fileArray = array_filter($this->fileArray, function(File $file) { |
|
| 104 | 104 | return $file->isActual(); |
| 105 | 105 | }); |
| 106 | 106 | if (\count($fileArray) > $this->aliasConfig['maxCount']) { |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * @var array |
| 24 | 24 | */ |
| 25 | 25 | public static $iconPreviewArray = [ |
| 26 | - 'file' => ['txt', 'doc',], |
|
| 26 | + 'file' => ['txt', 'doc', ], |
|
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | // filters |
| 83 | 83 | [ |
| 84 | 84 | 'name', |
| 85 | - function ($attribute) { |
|
| 85 | + function($attribute) { |
|
| 86 | 86 | $name = $this->$attribute ?: static::DEFAULT_FILENAME; |
| 87 | 87 | // remove all wrong characters |
| 88 | 88 | $name = preg_replace('/[^A-zА-я0-9\s]+/u', '-', $name); |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | $uploadedFile, |
| 125 | 125 | $this->fileManager->getAliasConfig($this->ownerModelAlias), |
| 126 | 126 | $this->contentFS, |
| 127 | - [ // other config |
|
| 127 | + [// other config |
|
| 128 | 128 | 'parent_model' => $this->ownerModelAlias, |
| 129 | 129 | 'parent_model_id' => $this->ownerId, |
| 130 | 130 | ]); |
@@ -176,6 +176,6 @@ |
||
| 176 | 176 | $options['height'] = $height; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - return [$fileType, $options,]; |
|
| 179 | + return [$fileType, $options, ]; |
|
| 180 | 180 | } |
| 181 | 181 | } |