@@ -157,7 +157,7 @@ |
||
| 157 | 157 | $results = $this->find() |
| 158 | 158 | ->contain( |
| 159 | 159 | [ |
| 160 | - 'Users' => function (Query $query) { |
|
| 160 | + 'Users' => function(Query $query) { |
|
| 161 | 161 | $query->select(['Users.id', 'Users.username']); |
| 162 | 162 | |
| 163 | 163 | return $query; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->addBehavior( |
| 78 | 78 | 'Proffer.Proffer', |
| 79 | 79 | [ |
| 80 | - 'avatar' => [ // The name of your upload field (filename) |
|
| 80 | + 'avatar' => [// The name of your upload field (filename) |
|
| 81 | 81 | 'root' => $avatarRootDir, |
| 82 | 82 | 'dir' => 'avatar_dir', // field for upload directory |
| 83 | 83 | 'thumbnailSizes' => [ |
@@ -787,8 +787,8 @@ discard block |
||
| 787 | 787 | $User->set('user_category_custom', $newCats); |
| 788 | 788 | } else { |
| 789 | 789 | //=if set a single category |
| 790 | - $category = (int)$category; |
|
| 791 | - if ($category > 0 && $this->Entries->Categories->exists((int)$category) |
|
| 790 | + $category = (int) $category; |
|
| 791 | + if ($category > 0 && $this->Entries->Categories->exists((int) $category) |
|
| 792 | 792 | ) { |
| 793 | 793 | $active = $category; |
| 794 | 794 | } else { |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | // ->enableHydration(false) |
| 846 | 846 | ->contain( |
| 847 | 847 | [ |
| 848 | - 'UserIgnores' => function ($query) { |
|
| 848 | + 'UserIgnores' => function($query) { |
|
| 849 | 849 | return $query->enableHydration(false)->select( |
| 850 | 850 | ['blocked_user_id', 'user_id'] |
| 851 | 851 | ); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // ask if the permissions should be changed |
| 63 | 63 | if ($io->isInteractive()) { |
| 64 | - $validator = function ($arg) { |
|
| 64 | + $validator = function($arg) { |
|
| 65 | 65 | if (in_array($arg, ['Y', 'y', 'N', 'n'])) { |
| 66 | 66 | return $arg; |
| 67 | 67 | } |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public static function createAppConfig($dir, $io) |
| 99 | 99 | { |
| 100 | - $appConfig = $dir . '/config/app.php'; |
|
| 101 | - $defaultConfig = $dir . '/config/app.default.php'; |
|
| 100 | + $appConfig = $dir.'/config/app.php'; |
|
| 101 | + $defaultConfig = $dir.'/config/app.default.php'; |
|
| 102 | 102 | if (!file_exists($appConfig)) { |
| 103 | 103 | copy($defaultConfig, $appConfig); |
| 104 | 104 | $io->write('Created `config/app.php` file'); |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | public static function createWritableDirectories($dir, $io) |
| 116 | 116 | { |
| 117 | 117 | foreach (static::WRITABLE_DIRS as $path) { |
| 118 | - $path = $dir . '/' . $path; |
|
| 118 | + $path = $dir.'/'.$path; |
|
| 119 | 119 | if (!file_exists($path)) { |
| 120 | 120 | mkdir($path); |
| 121 | - $io->write('Created `' . $path . '` directory'); |
|
| 121 | + $io->write('Created `'.$path.'` directory'); |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public static function setFolderPermissions($dir, $io) |
| 136 | 136 | { |
| 137 | 137 | // Change the permissions on a path and output the results. |
| 138 | - $changePerms = function ($path) use ($io) { |
|
| 138 | + $changePerms = function($path) use ($io) { |
|
| 139 | 139 | $currentPerms = fileperms($path) & 0777; |
| 140 | 140 | $worldWritable = $currentPerms | 0007; |
| 141 | 141 | if ($worldWritable == $currentPerms) { |
@@ -144,16 +144,16 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $res = chmod($path, $worldWritable); |
| 146 | 146 | if ($res) { |
| 147 | - $io->write('Permissions set on ' . $path); |
|
| 147 | + $io->write('Permissions set on '.$path); |
|
| 148 | 148 | } else { |
| 149 | - $io->write('Failed to set permissions on ' . $path); |
|
| 149 | + $io->write('Failed to set permissions on '.$path); |
|
| 150 | 150 | } |
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | - $walker = function ($dir) use (&$walker, $changePerms) { |
|
| 153 | + $walker = function($dir) use (&$walker, $changePerms) { |
|
| 154 | 154 | $files = array_diff(scandir($dir), ['.', '..']); |
| 155 | 155 | foreach ($files as $file) { |
| 156 | - $path = $dir . '/' . $file; |
|
| 156 | + $path = $dir.'/'.$file; |
|
| 157 | 157 | |
| 158 | 158 | if (!is_dir($path)) { |
| 159 | 159 | continue; |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | }; |
| 166 | 166 | |
| 167 | - $walker($dir . '/tmp'); |
|
| 168 | - $changePerms($dir . '/tmp'); |
|
| 169 | - $changePerms($dir . '/logs'); |
|
| 167 | + $walker($dir.'/tmp'); |
|
| 168 | + $changePerms($dir.'/tmp'); |
|
| 169 | + $changePerms($dir.'/logs'); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public static function setSecuritySaltInFile($dir, $io, $newKey, $file) |
| 195 | 195 | { |
| 196 | - $config = $dir . '/config/' . $file; |
|
| 196 | + $config = $dir.'/config/'.$file; |
|
| 197 | 197 | $content = file_get_contents($config); |
| 198 | 198 | |
| 199 | 199 | $content = str_replace('__SALT__', $newKey, $content, $count); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $result = file_put_contents($config, $content); |
| 208 | 208 | if ($result) { |
| 209 | - $io->write('Updated Security.salt value in config/' . $file); |
|
| 209 | + $io->write('Updated Security.salt value in config/'.$file); |
|
| 210 | 210 | |
| 211 | 211 | return; |
| 212 | 212 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public static function setAppNameInFile($dir, $io, $appName, $file) |
| 226 | 226 | { |
| 227 | - $config = $dir . '/config/' . $file; |
|
| 227 | + $config = $dir.'/config/'.$file; |
|
| 228 | 228 | $content = file_get_contents($config); |
| 229 | 229 | $content = str_replace('__APP_NAME__', $appName, $content, $count); |
| 230 | 230 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | $result = file_put_contents($config, $content); |
| 238 | 238 | if ($result) { |
| 239 | - $io->write('Updated __APP_NAME__ value in config/' . $file); |
|
| 239 | + $io->write('Updated __APP_NAME__ value in config/'.$file); |
|
| 240 | 240 | |
| 241 | 241 | return; |
| 242 | 242 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |