diff --git a/apps/advanced/init b/apps/advanced/init index f5d2691..c8f7f73 100755 --- a/apps/advanced/init +++ b/apps/advanced/init @@ -21,7 +21,7 @@ if (empty($params['env'])) { exit(1); } - if(isset($envNames[$answer])) { + if (isset($envNames[$answer])) { $envName = $envNames[$answer]; } } diff --git a/build/controllers/PhpDocController.php b/build/controllers/PhpDocController.php index a104dd5..760cb05 100644 --- a/build/controllers/PhpDocController.php +++ b/build/controllers/PhpDocController.php @@ -115,7 +115,7 @@ class PhpDocController extends Controller if (trim($lines[1]) == '*' || substr(trim($lines[1]), 0, 3) == '* @') { $this->stderr("[WARN] Class $className has no short description.\n", Console::FG_YELLOW, Console::BOLD); } - foreach($lines as $line) { + foreach ($lines as $line) { if (substr(trim($line), 0, 9) == '* @since ') { $seenSince = true; } elseif (substr(trim($line), 0, 10) == '* @author ') { @@ -138,7 +138,7 @@ class PhpDocController extends Controller $newFileContent = []; $n = count($fileContent); - for($i = 0; $i < $n; $i++) { + for ($i = 0; $i < $n; $i++) { if ($i > $start || $i < $docStart) { $newFileContent[] = $fileContent[$i]; } else { @@ -164,7 +164,7 @@ class PhpDocController extends Controller { $lines = explode("\n", $doc); $n = count($lines); - for($i = 0; $i < $n; $i++) { + for ($i = 0; $i < $n; $i++) { $lines[$i] = rtrim($lines[$i]); if (trim($lines[$i]) == '*' && trim($lines[$i + 1]) == '*') { unset($lines[$i]); @@ -184,7 +184,7 @@ class PhpDocController extends Controller $lines = explode("\n", $doc); $propertyPart = false; $propertyPosition = false; - foreach($lines as $i => $line) { + foreach ($lines as $i => $line) { if (substr(trim($line), 0, 12) == '* @property ') { $propertyPart = true; } elseif ($propertyPart && trim($line) == '*') { @@ -200,7 +200,7 @@ class PhpDocController extends Controller } } $finalDoc = ''; - foreach($lines as $i => $line) { + foreach ($lines as $i => $line) { $finalDoc .= $line . "\n"; if ($i == $propertyPosition) { $finalDoc .= $properties; diff --git a/docs/guide/controller.md b/docs/guide/controller.md index bb78120..39b7f0f 100644 --- a/docs/guide/controller.md +++ b/docs/guide/controller.md @@ -89,7 +89,7 @@ class BlogController extends Controller $post = Post::find($id); $text = $post->text; - if($version) { + if ($version) { $text = $post->getHistory($version); } @@ -121,13 +121,13 @@ class BlogController extends Controller public function actionUpdate($id) { $post = Post::find($id); - if(!$post) { + if (!$post) { throw new HttpException(404); } - if(\Yii::$app->request->isPost)) { + if (\Yii::$app->request->isPost)) { $post->load($_POST); - if($post->save()) { + if ($post->save()) { $this->redirect(['view', 'id' => $post->id]); } } diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index f04e849..628cf54 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -179,7 +179,7 @@ $model->save(); $postTags = []; $tagsCount = count($_POST['PostTag']); -while($tagsCount-- > 0){ +while ($tagsCount-- > 0) { $postTags[] = new PostTag(['post_id' => $model->id]); } Model::loadMultiple($postTags, $_POST); diff --git a/docs/guide/view.md b/docs/guide/view.md index 98e0140..2fdd974 100644 --- a/docs/guide/view.md +++ b/docs/guide/view.md @@ -305,7 +305,7 @@ Then we're using it in `index.php` view where we display a list of users: ```php