@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $status = $this->_record->disabled; |
| 32 | 32 | |
| 33 | - $this->_record->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 33 | + $this->_record->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 34 | 34 | $this->_record->save(); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function before() |
| 33 | 33 | { |
| 34 | - $this->snippet = (int)$this->_configs['snippet']; |
|
| 35 | - $this->count = (int)$this->_configs['count']; |
|
| 36 | - $this->cache = (int)$this->_configs['cache']; |
|
| 34 | + $this->snippet = (int) $this->_configs['snippet']; |
|
| 35 | + $this->count = (int) $this->_configs['count']; |
|
| 36 | + $this->cache = (int) $this->_configs['cache']; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -69,10 +69,10 @@ |
||
| 69 | 69 | ->orWhere('sender_id', '=', $uid) |
| 70 | 70 | ->delete(); |
| 71 | 71 | // delete avatars |
| 72 | - File::remove('/upload/user/avatar/big/' . $uid . '.jpg'); |
|
| 73 | - File::remove('/upload/user/avatar/medium/' . $uid . '.jpg'); |
|
| 74 | - File::remove('/upload/user/avatar/small/' . $uid . '.jpg'); |
|
| 75 | - File::remove('/upload/user/avatar/original/' . $uid . '.jpg'); |
|
| 72 | + File::remove('/upload/user/avatar/big/'.$uid.'.jpg'); |
|
| 73 | + File::remove('/upload/user/avatar/medium/'.$uid.'.jpg'); |
|
| 74 | + File::remove('/upload/user/avatar/small/'.$uid.'.jpg'); |
|
| 75 | + File::remove('/upload/user/avatar/original/'.$uid.'.jpg'); |
|
| 76 | 76 | // delete user profile and auth data |
| 77 | 77 | $user->profile()->delete(); |
| 78 | 78 | // delete user provider data |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | $this->categories = $this->_configs['categories']; |
| 39 | - $this->count = (int)$this->_configs['count']; |
|
| 40 | - $this->cache = (int)$this->_configs['cache']; |
|
| 39 | + $this->count = (int) $this->_configs['count']; |
|
| 40 | + $this->cache = (int) $this->_configs['cache']; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $name = Str::firstIn($fullName, '-'); |
| 44 | 44 | // get update version number from migration name |
| 45 | 45 | list($type, $obj, $version) = explode('_', $name); |
| 46 | - $intVersion = (int)Str::replace('.', '', $this->dbVersion); |
|
| 46 | + $intVersion = (int) Str::replace('.', '', $this->dbVersion); |
|
| 47 | 47 | // if migration version > db version - implement it |
| 48 | 48 | if ($version > $intVersion) { |
| 49 | 49 | $this->updateQueries[] = $file; |
@@ -105,14 +105,14 @@ |
||
| 105 | 105 | $cfg['baseDomain'] = $this->baseDomain; |
| 106 | 106 | $cfg['database'] = $this->db; |
| 107 | 107 | $cfg['singleLanguage'] = $this->singleLanguage; |
| 108 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
| 109 | - $cfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
| 110 | - $cfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(4, 16)); |
|
| 108 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
| 109 | + $cfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
| 110 | + $cfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(4, 16)); |
|
| 111 | 111 | $cfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
| 112 | 112 | $cfg['mail'] = $this->mail; |
| 113 | 113 | |
| 114 | 114 | // initialize migrations table |
| 115 | - App::$Database->getConnection('install')->getSchemaBuilder()->create('migrations', function ($table) { |
|
| 115 | + App::$Database->getConnection('install')->getSchemaBuilder()->create('migrations', function($table) { |
|
| 116 | 116 | $table->increments('id'); |
| 117 | 117 | $table->string('migration', 128)->unique(); |
| 118 | 118 | $table->timestamps(); |
@@ -52,12 +52,12 @@ |
||
| 52 | 52 | throw new \Exception('Wrong definition for loader. You shoud use front, admin, api'); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $namespace = 'Apps\Model\\' . $loader . '\\' . $controller; |
|
| 55 | + $namespace = 'Apps\Model\\'.$loader.'\\'.$controller; |
|
| 56 | 56 | $tpl = File::read('/Private/Carcase/Model.tphp'); |
| 57 | 57 | $code = Str::replace(['%namespace%', '%name%'], [$namespace, $name], $tpl); |
| 58 | - $path = '/Apps/Model/' . $loader . '/' . $controller . '/' . $name . '.php'; |
|
| 58 | + $path = '/Apps/Model/'.$loader.'/'.$controller.'/'.$name.'.php'; |
|
| 59 | 59 | File::write($path, $code); |
| 60 | - $output->writeln('Model are successful created: ' . $path); |
|
| 60 | + $output->writeln('Model are successful created: '.$path); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | \ No newline at end of file |
@@ -51,11 +51,11 @@ |
||
| 51 | 51 | // require confirmation from user each ever migration file |
| 52 | 52 | $fired = false; |
| 53 | 53 | foreach ($search as $migration) { |
| 54 | - if (!$this->confirm('Are you sure to apply migration: ' . $migration, true)) { |
|
| 54 | + if (!$this->confirm('Are you sure to apply migration: '.$migration, true)) { |
|
| 55 | 55 | continue; |
| 56 | 56 | } |
| 57 | 57 | $manager->makeUp($migration); |
| 58 | - $fired = true; |
|
| 58 | + $fired = true; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if ($fired) { |
@@ -58,9 +58,9 @@ |
||
| 58 | 58 | // work with migration template: read & parse & save |
| 59 | 59 | $tpl = File::read('/Private/Carcase/Migration.tphp'); |
| 60 | 60 | $classContent = Str::replace(['%class%', '%table%'], [$name, $table], $tpl); |
| 61 | - $fullPath = $dir . $name . '-' . $suffix . '.php'; |
|
| 61 | + $fullPath = $dir.$name.'-'.$suffix.'.php'; |
|
| 62 | 62 | File::write($fullPath, $classContent); |
| 63 | 63 | // show success msg |
| 64 | - $output->write('New migration is created: ' . $fullPath); |
|
| 64 | + $output->write('New migration is created: '.$fullPath); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | \ No newline at end of file |