@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | if ($this->_request->file($name)) { |
128 | 128 | $file = $this->_request->file($name); |
129 | 129 | $chunk = (int) $this->_request->getBodyParam("chunk", 0); |
130 | - $chunks = (int) $this->_request->getBodyParam("chunks", 0 ); |
|
130 | + $chunks = (int) $this->_request->getBodyParam("chunks", 0); |
|
131 | 131 | $originalName = $this->_request->getBodyParam('name'); |
132 | 132 | $filePath = $this->getPath().'/'.$originalName.'.part'; |
133 | 133 | $this->_removeOldData($filePath); |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | * @param string $path Optional firefly media virtual path |
165 | 165 | * @return array |
166 | 166 | */ |
167 | - public function receiveToFirefly($name, $path='/') |
|
167 | + public function receiveToFirefly($name, $path = '/') |
|
168 | 168 | { |
169 | - return $this->receive($name, function (UploadedFile $file) use ($path) { |
|
169 | + return $this->receive($name, function(UploadedFile $file) use ($path) { |
|
170 | 170 | // save file to firefly |
171 | 171 | $id = neon()->firefly->fileManager->saveFile($file); |
172 | 172 | $meta = neon()->firefly->mediaManager->addFile($id, $path); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function receiveToFireflyFileManager($name) |
195 | 195 | { |
196 | - return $this->receive($name, function (UploadedFile $file) { |
|
196 | + return $this->receive($name, function(UploadedFile $file) { |
|
197 | 197 | // save file to firefly |
198 | 198 | $id = neon()->firefly->fileManager->saveFile($file); |
199 | 199 | return neon()->firefly->fileManager->getMeta($id); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param string $path GET variable 'path' e.g. /my/folder |
94 | 94 | * @return array |
95 | 95 | */ |
96 | - public function actionList($path='', $deleted=0) |
|
96 | + public function actionList($path = '', $deleted = 0) |
|
97 | 97 | { |
98 | 98 | $items = neon()->firefly->mediaManager->listContents($path, $deleted); |
99 | 99 | return ['data' => [ |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $transform = neon()->request->getBodyParam('transform'); |
129 | 129 | // information of the current file |
130 | 130 | $sourceMeta = neon()->firefly->getMeta($transform['sourceImage']); |
131 | - $transform['rotate'] = Arr::get($transform, 'crop.rotate', false); |
|
131 | + $transform['rotate'] = Arr::get($transform, 'crop.rotate', false); |
|
132 | 132 | $width = Arr::get($transform, 'crop.width', false); |
133 | 133 | $height = Arr::get($transform, 'crop.height', false); |
134 | 134 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | private function convertFireflyGetsToFiles($search, $replace) |
34 | 34 | { |
35 | 35 | $potentiallyAffected = $this->db->createCommand("SELECT `class_type`, `member_ref` FROM `dds_member` WHERE `data_type_ref`='textlong'")->queryAll(); |
36 | - if (count($potentiallyAffected)==0) |
|
36 | + if (count($potentiallyAffected) == 0) |
|
37 | 37 | return; |
38 | 38 | $classes = []; |
39 | 39 | foreach ($potentiallyAffected as $pa) |
@@ -70,21 +70,21 @@ discard block |
||
70 | 70 | |
71 | 71 | $dds = neon('dds')->IDdsObjectManagement; |
72 | 72 | foreach ($wysiwygFields as $classType => $fields) { |
73 | - $start=0; |
|
73 | + $start = 0; |
|
74 | 74 | do { |
75 | 75 | $found = $dds->listObjects($classType, $total, true, true, $start, 100); |
76 | 76 | $start += count($found); |
77 | 77 | foreach ($found as $objectData) { |
78 | 78 | $changes = []; |
79 | 79 | foreach ($fields as $field) { |
80 | - if (!empty($objectData[$field]) && strpos($objectData[$field],$search)!==false) |
|
80 | + if (!empty($objectData[$field]) && strpos($objectData[$field], $search) !== false) |
|
81 | 81 | $changes[$field] = str_replace($search, $replace, $objectData[$field]); |
82 | 82 | } |
83 | 83 | if (count($changes)) { |
84 | 84 | $dds->editObject($objectData['_uuid'], $changes); |
85 | 85 | } |
86 | 86 | } |
87 | - } while (count($found)>0); |
|
87 | + } while (count($found) > 0); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return true; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * @inheritdoc |
205 | 205 | */ |
206 | - public function getImage($uuid, $params=[]) |
|
206 | + public function getImage($uuid, $params = []) |
|
207 | 207 | { |
208 | 208 | return $this->fileManager->getImage($uuid, $params); |
209 | 209 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | * @param string $name |
301 | 301 | * @return \neon\firefly\services\driveManager\interfaces\IFileSystem |
302 | 302 | */ |
303 | - public function drive($name=null) |
|
303 | + public function drive($name = null) |
|
304 | 304 | { |
305 | 305 | return $this->driveManager->drive($name); |
306 | 306 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | /** |
309 | 309 | * @inheritdoc |
310 | 310 | */ |
311 | - public function sendFile($uuid, $download=false) |
|
311 | + public function sendFile($uuid, $download = false) |
|
312 | 312 | { |
313 | 313 | return $this->fileManager->sendFile($uuid, $download); |
314 | 314 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * @param boolean $throwExceptions - whether to throw exceptions on validation failure |
365 | 365 | * @return boolean |
366 | 366 | */ |
367 | - public function isFileObjectValid($file, $throwExceptions=true) |
|
367 | + public function isFileObjectValid($file, $throwExceptions = true) |
|
368 | 368 | { |
369 | 369 | if ($file instanceof IFile) |
370 | 370 | return true; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | && method_exists($file, 'getRealPath') |
375 | 375 | && method_exists($file, 'getFilename'); |
376 | 376 | // the $file param must be an object with getRealPath and getFilename functions |
377 | - if (! $objectIsValid && $throwExceptions) { |
|
377 | + if (!$objectIsValid && $throwExceptions) { |
|
378 | 378 | throw new \InvalidArgumentException('$file param must be an object with a getRealPath and getFilename method'); |
379 | 379 | } |
380 | 380 | return $objectIsValid; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @param array &$read - the set of read components to prevent infinite looping |
67 | 67 | * @return array the set of components |
68 | 68 | */ |
69 | - private static function &getComponents($path, &$components=[], &$read=[]) |
|
69 | + private static function &getComponents($path, &$components = [], &$read = []) |
|
70 | 70 | { |
71 | 71 | $root = self::getRoot(); |
72 | 72 | $configFile = $root.$path.'/_config.php'; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | } catch (\Exception $e) { |
94 | - throw new \InvalidArgumentException("Something went wrong when trying to parse the config file $configFile. The error was ".$e->getMessage(). ". The file contained <pre>".print_r($config,true)."</pre>."); |
|
94 | + throw new \InvalidArgumentException("Something went wrong when trying to parse the config file $configFile. The error was ".$e->getMessage().". The file contained <pre>".print_r($config, true)."</pre>."); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | return $components; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | public function bulkStaticContentRequest($requests) |
44 | 44 | { |
45 | 45 | $requestedData = []; |
46 | - if (count($requests)>0) { |
|
46 | + if (count($requests) > 0) { |
|
47 | 47 | $query = CmsStaticContent::find() |
48 | 48 | ->select("`key`, `page_id` as `pageId`, `content`"); |
49 | 49 | foreach ($requests as $id => $request) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->run('Generating Page UUIDs and nice_ids', function() { |
45 | 45 | // the soft delete column has not been added yet - so lets turn off this behaviour! |
46 | 46 | CmsPage::$softDelete = false; |
47 | - foreach(CmsPage::find()->each(100) as $page) { |
|
47 | + foreach (CmsPage::find()->each(100) as $page) { |
|
48 | 48 | $page->id = CmsPage::uuid64(); |
49 | 49 | $page->nice_id = "page_{$page->old_id}"; |
50 | 50 | $page->save(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | "UPDATE $cms_url INNER JOIN $cms_page ON $cms_page.nice_id = $cms_url.page_id SET `page_id` = $cms_page.old_id" |
93 | 93 | ); |
94 | 94 | $this->execute("UPDATE $cms_page SET `id` = `old_id`"); |
95 | - $this->alterColumn($cms_page, 'id', $this->integer(11) . ' NOT NULL AUTO_INCREMENT'); |
|
95 | + $this->alterColumn($cms_page, 'id', $this->integer(11).' NOT NULL AUTO_INCREMENT'); |
|
96 | 96 | $this->dropColumn($cms_page, 'old_id'); |
97 | 97 | $this->dropColumn($cms_page, 'nice_id'); |
98 | 98 | $this->alterColumn($cms_url, 'page_id', $this->integer(11)->comment('cms_page foreign key')); |
@@ -27,14 +27,14 @@ |
||
27 | 27 | // - note the `member_ref` as the $column in the ddt table - this column will hold the previous integer based page id |
28 | 28 | // which will match the cms_page.old_id column |
29 | 29 | foreach ($members as $member) { |
30 | - $class_type = $member['class_type']; |
|
31 | - $ddt_table_name = 'ddt_' . $class_type; |
|
30 | + $class_type = $member['class_type']; |
|
31 | + $ddt_table_name = 'ddt_'.$class_type; |
|
32 | 32 | $column = $member['member_ref']; |
33 | 33 | |
34 | 34 | // Step 3 |
35 | 35 | // ------ |
36 | 36 | // Alter the $column in $ddt_table_name to be a uuid64 (char(22)) |
37 | - $exists = $this->db->createCommand("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE `table_name` = '$ddt_table_name' AND `table_schema` = '". env('DB_NAME')."' AND column_name = '$column'")->queryScalar(); |
|
37 | + $exists = $this->db->createCommand("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE `table_name` = '$ddt_table_name' AND `table_schema` = '".env('DB_NAME')."' AND column_name = '$column'")->queryScalar(); |
|
38 | 38 | if ($exists) { |
39 | 39 | $this->alterColumn($ddt_table_name, $column, $this->char(22)->comment("A uuid using base 64")); |
40 | 40 | // Update the $column value in every row in the $ddt_table_name by matching it to the cms_page.old_id |
@@ -27,7 +27,7 @@ |
||
27 | 27 | 'layout' => 'string COMMENT "the name of the layout template to load for this page"', |
28 | 28 | 'template' => 'string COMMENT "the name of the template file"' |
29 | 29 | ]); |
30 | - $this->createTable(CmsUrl::tableName(),[ |
|
30 | + $this->createTable(CmsUrl::tableName(), [ |
|
31 | 31 | 'id' => 'pk', |
32 | 32 | 'url' => 'string', |
33 | 33 | 'page_id' => 'int', |