@@ -50,12 +50,12 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // prepare code & write |
| 53 | - $template = File::read('/Private/Carcase/' . $loader . '/Controller.tphp'); |
|
| 53 | + $template = File::read('/Private/Carcase/'.$loader.'/Controller.tphp'); |
|
| 54 | 54 | $code = Str::replace(['%name%'], [$name], $template); |
| 55 | 55 | |
| 56 | - $savePath = '/Apps/Controller/' . $loader . '/' . $name . '.php'; |
|
| 56 | + $savePath = '/Apps/Controller/'.$loader.'/'.$name.'.php'; |
|
| 57 | 57 | File::write($savePath, $code); |
| 58 | 58 | |
| 59 | - $output->write('Controller are successful created: ' . $savePath); |
|
| 59 | + $output->write('Controller are successful created: '.$savePath); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | \ No newline at end of file |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $output->write('Migration table is always exists!'); |
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | - DatabaseManager::schema($this->dbConnection)->create('migrations', function ($table){ |
|
| 39 | + DatabaseManager::schema($this->dbConnection)->create('migrations', function($table) { |
|
| 40 | 40 | $table->increments('id'); |
| 41 | 41 | $table->string('migration', 127)->unique(); |
| 42 | 42 | $table->timestamps(); |
@@ -44,10 +44,10 @@ |
||
| 44 | 44 | foreach (self::$installDirs as $obj) { |
| 45 | 45 | if (Directory::exist($obj)) { |
| 46 | 46 | Directory::recursiveChmod($obj, 0777); |
| 47 | - $output->writeln('Write recursive permissions 0777 for all directories in: ' . $obj); |
|
| 47 | + $output->writeln('Write recursive permissions 0777 for all directories in: '.$obj); |
|
| 48 | 48 | } elseif (File::exist($obj)) { |
| 49 | - chmod(root . $obj, 0777); |
|
| 50 | - $output->writeln('Write permissions 0777 for file: ' . $obj); |
|
| 49 | + chmod(root.$obj, 0777); |
|
| 50 | + $output->writeln('Write permissions 0777 for file: '.$obj); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | } |
| 56 | 56 | // get password and role and check validity |
| 57 | 57 | $password = $this->optionOrAsk('password', 'User password'); |
| 58 | - $roleId = (int)$this->optionOrAsk('role', 'RoleId', '1'); |
|
| 58 | + $roleId = (int) $this->optionOrAsk('role', 'RoleId', '1'); |
|
| 59 | 59 | $records = Role::all()->toArray(); |
| 60 | 60 | $roles = Arr::pluck('id', $records); |
| 61 | 61 | if (!Arr::in($roleId, $roles)) { |
@@ -32,16 +32,16 @@ |
||
| 32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | 34 | $output->writeln('Information about FFCMS package and environment:'); |
| 35 | - $output->writeln("\t PHP version: " . phpversion()); |
|
| 36 | - $output->writeln("\t Dist path: " . root); |
|
| 37 | - $output->writeln("\t Used version: " . Version::VERSION . ' [build: ' . Version::DATE . ']'); |
|
| 35 | + $output->writeln("\t PHP version: ".phpversion()); |
|
| 36 | + $output->writeln("\t Dist path: ".root); |
|
| 37 | + $output->writeln("\t Used version: ".Version::VERSION.' [build: '.Version::DATE.']'); |
|
| 38 | 38 | $output->writeln('Information about FFCMS cmf packages:'); |
| 39 | 39 | |
| 40 | 40 | $composerInfo = File::read('/composer.lock'); |
| 41 | 41 | if (false !== $composerInfo) { |
| 42 | 42 | $jsonInfo = json_decode($composerInfo); |
| 43 | 43 | foreach ($jsonInfo->packages as $item) { |
| 44 | - $output->writeln("\t Package: " . $item->name . ' => ' . $item->version); |
|
| 44 | + $output->writeln("\t Package: ".$item->name.' => '.$item->version); |
|
| 45 | 45 | } |
| 46 | 46 | } else { |
| 47 | 47 | $output->writeln("\t Composer is never be used - no information available."); |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | $allCfg['adminEmail'] = $email; |
| 125 | 125 | $allCfg['baseDomain'] = $domain; |
| 126 | 126 | $output->writeln('Generate password salt for BLOWFISH crypt'); |
| 127 | - $allCfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
| 127 | + $allCfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
| 128 | 128 | $output->writeln('Generate security cookies for debug panel'); |
| 129 | - $allCfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(8, 32)); |
|
| 129 | + $allCfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(8, 32)); |
|
| 130 | 130 | $allCfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
| 131 | 131 | // write config data |
| 132 | 132 | $writeCfg = Console::$Properties->writeConfig('default', $allCfg); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | return; |
| 136 | 136 | } |
| 137 | 137 | File::write('/Private/Install/install.lock', 'Install is locked'); |
| 138 | - $output->writeln('Congratulations! FFCMS are successful installed. Used version: ' . Version::VERSION . ' since ' . Version::DATE); |
|
| 138 | + $output->writeln('Congratulations! FFCMS are successful installed. Used version: '.Version::VERSION.' since '.Version::DATE); |
|
| 139 | 139 | $output->writeln(''); |
| 140 | 140 | $output->writeln('> Please, use "php console.php main:adduser" to add admin account(set role=4) or you are unavailable to manage cms.'); |
| 141 | 141 | } |
@@ -20,6 +20,6 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function actionRead($id) |
| 22 | 22 | { |
| 23 | - echo "Action read called" . $id; |
|
| 23 | + echo "Action read called".$id; |
|
| 24 | 24 | } |
| 25 | 25 | } |
@@ -28,14 +28,14 @@ |
||
| 28 | 28 | public function actionIndex() |
| 29 | 29 | { |
| 30 | 30 | // get search query value from GET headers |
| 31 | - $query = (string)$this->request->query->get('query', null); |
|
| 31 | + $query = (string) $this->request->query->get('query', null); |
|
| 32 | 32 | // strip html tags |
| 33 | 33 | $query = App::$Security->strip_tags(trim($query)); |
| 34 | 34 | // get configs |
| 35 | 35 | $configs = $this->getConfigs(); |
| 36 | 36 | |
| 37 | 37 | // check search query length |
| 38 | - if (Str::likeEmpty($query) || Str::length($query) < (int)$configs['minLength']) { |
|
| 38 | + if (Str::likeEmpty($query) || Str::length($query) < (int) $configs['minLength']) { |
|
| 39 | 39 | throw new NotFoundException(__('Search query is too short!')); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | // get configs |
| 44 | 44 | $configs = $this->getConfigs(); |
| 45 | - if (!App::$User->isAuth() && !(bool)$configs['guestAdd']) { |
|
| 45 | + if (!App::$User->isAuth() && !(bool) $configs['guestAdd']) { |
|
| 46 | 46 | throw new ForbiddenException(__('Feedback available only for authorized users')); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // initialize model |
| 50 | - $model = new FormFeedbackAdd((int)$configs['useCaptcha'] === 1); |
|
| 50 | + $model = new FormFeedbackAdd((int) $configs['useCaptcha'] === 1); |
|
| 51 | 51 | if ($model->send()) { |
| 52 | 52 | if ($model->validate()) { |
| 53 | 53 | // if validation is passed save data to db and get row |
| 54 | 54 | $record = $model->make(); |
| 55 | 55 | App::$Session->getFlashBag()->add('success', __('Your message was added successful')); |
| 56 | - $this->response->redirect('feedback/read/' . $record->id . '/' . $record->hash); |
|
| 56 | + $this->response->redirect('feedback/read/'.$record->id.'/'.$record->hash); |
|
| 57 | 57 | } else { |
| 58 | 58 | App::$Session->getFlashBag()->add('error', __('Message is not sended! Please, fix issues in form below')); |
| 59 | 59 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | // render output view |
| 63 | 63 | return $this->view->render('create', [ |
| 64 | 64 | 'model' => $model, |
| 65 | - 'useCaptcha' => (int)$configs['useCaptcha'] === 1 |
|
| 65 | + 'useCaptcha' => (int) $configs['useCaptcha'] === 1 |
|
| 66 | 66 | ]); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $userId = App::$User->isAuth() ? App::$User->identity()->getId() : 0; |
| 95 | 95 | $model = null; |
| 96 | 96 | // check if feedback post is not closed for answers |
| 97 | - if (!(bool)$recordPost->closed) { |
|
| 97 | + if (!(bool) $recordPost->closed) { |
|
| 98 | 98 | // init new answer add model |
| 99 | 99 | $model = new FormAnswerAdd($recordPost, $userId); |
| 100 | 100 | // if answer is sender lets try to make it model |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | // check if action is submited |
| 139 | 139 | if ($this->request->request->get('closeRequest', false)) { |
| 140 | 140 | // if created by authorized user |
| 141 | - if ((int)$record->user_id !== 0) { |
|
| 141 | + if ((int) $record->user_id !== 0) { |
|
| 142 | 142 | $user = App::$User->identity(); |
| 143 | 143 | // button is pressed not by request creator |
| 144 | - if ($user === null || $user->getId() !== (int)$record->user_id) { |
|
| 144 | + if ($user === null || $user->getId() !== (int) $record->user_id) { |
|
| 145 | 145 | throw new ForbiddenException(__('This feedback request was created by another user')); |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | // add notification and redirect |
| 154 | 154 | App::$Session->getFlashBag()->add('warning', __('Feedback request now is closed!')); |
| 155 | - $this->response->redirect('feedback/read/' . $id . '/' . $hash); |
|
| 155 | + $this->response->redirect('feedback/read/'.$id.'/'.$hash); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | return $this->view->render('close'); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | public function actionList() |
| 169 | 169 | { |
| 170 | 170 | // set current page and offset |
| 171 | - $page = (int)$this->request->query->get('page'); |
|
| 171 | + $page = (int) $this->request->query->get('page'); |
|
| 172 | 172 | $offset = $page * self::ITEM_PER_PAGE; |
| 173 | 173 | |
| 174 | 174 | // check if user is authorized or throw exception |