From b7e493fca087fc4a2d801a73c718d1699bb985e5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Fri, 23 May 2014 16:51:38 +0200 Subject: [PATCH] Tabs to spaces to be consistent ``` vendor/bin/indent --spaces -r framework/ vendor/bin/indent --tabs -r . --pattern=*.json vendor/bin/indent --spaces -r . --pattern=*.md vendor/bin/indent --spaces -r . --pattern=yii.*.js vendor/bin/indent --spaces -r . --pattern=*.css ``` --- apps/advanced/backend/web/css/site.css | 74 +++---- apps/advanced/frontend/web/css/site.css | 74 +++---- apps/basic/README.md | 10 +- apps/basic/web/css/site.css | 74 +++---- composer.json | 3 +- docs/guide/db-dao.md | 10 +- docs/guide/output-data-widgets.md | 6 +- docs/guide/structure-applications.md | 8 +- docs/internals/core-code-style.md | 130 ++++++------- docs/internals/view-code-style.md | 28 +-- extensions/apidoc/composer.json | 2 +- extensions/apidoc/helpers/ApiIndexer.php | 42 ++-- .../apidoc/templates/bootstrap/assets/css/api.css | 52 ++--- .../templates/bootstrap/assets/css/style.css | 94 ++++----- extensions/authclient/README.md | 80 ++++---- extensions/bootstrap/composer.json | 54 +++--- extensions/codeception/README.md | 108 +++++------ extensions/composer/README.md | 54 +++--- extensions/debug/assets/main.css | 76 ++++---- extensions/debug/assets/toolbar.css | 216 ++++++++++----------- extensions/elasticsearch/README.md | 40 ++-- extensions/faker/README.md | 80 ++++---- extensions/gii/assets/main.css | 174 ++++++++--------- .../gii/generators/extension/default/composer.json | 32 +-- extensions/imagine/composer.json | 54 +++--- extensions/mongodb/README.md | 130 ++++++------- extensions/redis/README.md | 128 ++++++------ extensions/smarty/README.md | 22 +-- extensions/sphinx/README.md | 52 ++--- extensions/swiftmailer/README.md | 12 +- framework/views/errorHandler/exception.php | 12 +- 31 files changed, 966 insertions(+), 965 deletions(-) diff --git a/apps/advanced/backend/web/css/site.css b/apps/advanced/backend/web/css/site.css index 068d5fd..698be70 100644 --- a/apps/advanced/backend/web/css/site.css +++ b/apps/advanced/backend/web/css/site.css @@ -1,13 +1,13 @@ html, body { - height: 100%; + height: 100%; } .wrap { - min-height: 100%; - height: auto; - margin: 0 auto -60px; - padding: 0 0 60px; + min-height: 100%; + height: auto; + margin: 0 auto -60px; + padding: 0 0 60px; } .wrap > .container { @@ -15,61 +15,61 @@ body { } .footer { - height: 60px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - padding-top: 20px; + height: 60px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + padding-top: 20px; } .jumbotron { - text-align: center; - background-color: transparent; + text-align: center; + background-color: transparent; } .jumbotron .btn { - font-size: 21px; - padding: 14px 24px; + font-size: 21px; + padding: 14px 24px; } .not-set { - color: #c55; - font-style: italic; + color: #c55; + font-style: italic; } /* add sorting icons to gridview sort links */ a.asc:after, a.desc:after { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - padding-left: 5px; + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + padding-left: 5px; } a.asc:after { - content: /*"\e113"*/ "\e151"; + content: /*"\e113"*/ "\e151"; } a.desc:after { - content: /*"\e114"*/ "\e152"; + content: /*"\e114"*/ "\e152"; } .sort-numerical a.asc:after { - content: "\e153"; + content: "\e153"; } .sort-numerical a.desc:after { - content: "\e154"; + content: "\e154"; } .sort-ordinal a.asc:after { - content: "\e155"; + content: "\e155"; } .sort-ordinal a.desc:after { - content: "\e156"; + content: "\e156"; } .grid-view th { @@ -77,15 +77,15 @@ a.desc:after { } .hint-block { - display: block; - margin-top: 5px; - color: #999; + display: block; + margin-top: 5px; + color: #999; } .error-summary { - color: #a94442; - background: #fdf7f7; - border-left: 3px solid #eed3d7; - padding: 10px 20px; - margin: 0 0 15px 0; + color: #a94442; + background: #fdf7f7; + border-left: 3px solid #eed3d7; + padding: 10px 20px; + margin: 0 0 15px 0; } diff --git a/apps/advanced/frontend/web/css/site.css b/apps/advanced/frontend/web/css/site.css index 068d5fd..698be70 100644 --- a/apps/advanced/frontend/web/css/site.css +++ b/apps/advanced/frontend/web/css/site.css @@ -1,13 +1,13 @@ html, body { - height: 100%; + height: 100%; } .wrap { - min-height: 100%; - height: auto; - margin: 0 auto -60px; - padding: 0 0 60px; + min-height: 100%; + height: auto; + margin: 0 auto -60px; + padding: 0 0 60px; } .wrap > .container { @@ -15,61 +15,61 @@ body { } .footer { - height: 60px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - padding-top: 20px; + height: 60px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + padding-top: 20px; } .jumbotron { - text-align: center; - background-color: transparent; + text-align: center; + background-color: transparent; } .jumbotron .btn { - font-size: 21px; - padding: 14px 24px; + font-size: 21px; + padding: 14px 24px; } .not-set { - color: #c55; - font-style: italic; + color: #c55; + font-style: italic; } /* add sorting icons to gridview sort links */ a.asc:after, a.desc:after { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - padding-left: 5px; + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + padding-left: 5px; } a.asc:after { - content: /*"\e113"*/ "\e151"; + content: /*"\e113"*/ "\e151"; } a.desc:after { - content: /*"\e114"*/ "\e152"; + content: /*"\e114"*/ "\e152"; } .sort-numerical a.asc:after { - content: "\e153"; + content: "\e153"; } .sort-numerical a.desc:after { - content: "\e154"; + content: "\e154"; } .sort-ordinal a.asc:after { - content: "\e155"; + content: "\e155"; } .sort-ordinal a.desc:after { - content: "\e156"; + content: "\e156"; } .grid-view th { @@ -77,15 +77,15 @@ a.desc:after { } .hint-block { - display: block; - margin-top: 5px; - color: #999; + display: block; + margin-top: 5px; + color: #999; } .error-summary { - color: #a94442; - background: #fdf7f7; - border-left: 3px solid #eed3d7; - padding: 10px 20px; - margin: 0 0 15px 0; + color: #a94442; + background: #fdf7f7; + border-left: 3px solid #eed3d7; + padding: 10px 20px; + margin: 0 0 15px 0; } diff --git a/apps/basic/README.md b/apps/basic/README.md index d025b5e..452d030 100644 --- a/apps/basic/README.md +++ b/apps/basic/README.md @@ -75,11 +75,11 @@ Edit the file `config/db.php` with real data, for example: ```php return [ - 'class' => 'yii\db\Connection', - 'dsn' => 'mysql:host=localhost;dbname=yii2basic', - 'username' => 'root', - 'password' => '1234', - 'charset' => 'utf8', + 'class' => 'yii\db\Connection', + 'dsn' => 'mysql:host=localhost;dbname=yii2basic', + 'username' => 'root', + 'password' => '1234', + 'charset' => 'utf8', ]; ``` diff --git a/apps/basic/web/css/site.css b/apps/basic/web/css/site.css index 068d5fd..698be70 100644 --- a/apps/basic/web/css/site.css +++ b/apps/basic/web/css/site.css @@ -1,13 +1,13 @@ html, body { - height: 100%; + height: 100%; } .wrap { - min-height: 100%; - height: auto; - margin: 0 auto -60px; - padding: 0 0 60px; + min-height: 100%; + height: auto; + margin: 0 auto -60px; + padding: 0 0 60px; } .wrap > .container { @@ -15,61 +15,61 @@ body { } .footer { - height: 60px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - padding-top: 20px; + height: 60px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + padding-top: 20px; } .jumbotron { - text-align: center; - background-color: transparent; + text-align: center; + background-color: transparent; } .jumbotron .btn { - font-size: 21px; - padding: 14px 24px; + font-size: 21px; + padding: 14px 24px; } .not-set { - color: #c55; - font-style: italic; + color: #c55; + font-style: italic; } /* add sorting icons to gridview sort links */ a.asc:after, a.desc:after { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - padding-left: 5px; + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + padding-left: 5px; } a.asc:after { - content: /*"\e113"*/ "\e151"; + content: /*"\e113"*/ "\e151"; } a.desc:after { - content: /*"\e114"*/ "\e152"; + content: /*"\e114"*/ "\e152"; } .sort-numerical a.asc:after { - content: "\e153"; + content: "\e153"; } .sort-numerical a.desc:after { - content: "\e154"; + content: "\e154"; } .sort-ordinal a.asc:after { - content: "\e155"; + content: "\e155"; } .sort-ordinal a.desc:after { - content: "\e156"; + content: "\e156"; } .grid-view th { @@ -77,15 +77,15 @@ a.desc:after { } .hint-block { - display: block; - margin-top: 5px; - color: #999; + display: block; + margin-top: 5px; + color: #999; } .error-summary { - color: #a94442; - background: #fdf7f7; - border-left: 3px solid #eed3d7; - padding: 10px 20px; - margin: 0 0 15px 0; + color: #a94442; + background: #fdf7f7; + border-left: 3px solid #eed3d7; + padding: 10px 20px; + margin: 0 0 15px 0; } diff --git a/composer.json b/composer.json index aef3d47..22a31dd 100644 --- a/composer.json +++ b/composer.json @@ -83,7 +83,8 @@ "twig/twig": "*", "smarty/smarty": "*", "imagine/imagine": "v0.5.0", - "swiftmailer/swiftmailer": "*" + "swiftmailer/swiftmailer": "*", + "cebe/indent": "*" }, "suggest": { "phpdocumentor/reflection": "required by yii2-apidoc extension", diff --git a/docs/guide/db-dao.md b/docs/guide/db-dao.md index d5eac7d..bf7758e 100644 --- a/docs/guide/db-dao.md +++ b/docs/guide/db-dao.md @@ -52,11 +52,11 @@ connection `DSN` doesn't indicate uniquely what database type is being used. Tha ```php 'db' => [ - 'class' => 'yii\db\Connection', - 'driverName' => 'mysql', - 'dsn' => 'odbc:Driver={MySQL};Server=localhost;Database=test', - 'username' => 'root', - 'password' => '', + 'class' => 'yii\db\Connection', + 'driverName' => 'mysql', + 'dsn' => 'odbc:Driver={MySQL};Server=localhost;Database=test', + 'username' => 'root', + 'password' => '', ], ``` diff --git a/docs/guide/output-data-widgets.md b/docs/guide/output-data-widgets.md index ce6df16..632bd20 100644 --- a/docs/guide/output-data-widgets.md +++ b/docs/guide/output-data-widgets.md @@ -293,8 +293,8 @@ $searchModel = new PostSearch(); $dataProvider = $searchModel->search($_GET); return $this->render('myview', [ - 'dataProvider' => $dataProvider, - 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + 'searchModel' => $searchModel, ]); ``` @@ -303,7 +303,7 @@ And in the view you then assign the `$dataProvider` and `$searchModel` to the Gr ```php echo GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, + 'filterModel' => $searchModel, ]); ``` diff --git a/docs/guide/structure-applications.md b/docs/guide/structure-applications.md index 9e7724f..0e5b198 100644 --- a/docs/guide/structure-applications.md +++ b/docs/guide/structure-applications.md @@ -149,14 +149,14 @@ life cycle: 4. Initialize the application with [CApplication::init()] - Register application behaviors; - - Load static application components; + - Load static application components; 5. Raise an [onBeginRequest|CApplication::onBeginRequest] event; 6. Process the user request: - - Collect information about the request; - - Create a controller; - - Run the controller; + - Collect information about the request; + - Create a controller; + - Run the controller; 7. Raise an [onEndRequest|CApplication::onEndRequest] event; diff --git a/docs/internals/core-code-style.md b/docs/internals/core-code-style.md index c67302a..8a0923c 100644 --- a/docs/internals/core-code-style.md +++ b/docs/internals/core-code-style.md @@ -64,7 +64,7 @@ The term "class" refers to all classes and interfaces here. */ class MyClass extends \yii\Object implements MyInterface { - // code + // code } ``` @@ -77,8 +77,8 @@ For example: 'Yii', - 'options' => ['usePHP' => true], + 'name' => 'Yii', + 'options' => ['usePHP' => true], ]; ``` @@ -161,8 +161,8 @@ Changing type of an existing variable is considered as a bad practice. Try not t ```php public function save(Transaction $transaction, $argument2 = 100) { - $transaction = new Connection; // bad - $argument2 = 200; // good + $transaction = new Connection; // bad + $argument2 = 200; // good } ``` @@ -201,8 +201,8 @@ When string is long format is the following: ```php $sql = "SELECT *" - . "FROM `post` " - . "WHERE `id` = 121 "; + . "FROM `post` " + . "WHERE `id` = 121 "; ``` ### 5.3 arrays @@ -223,9 +223,9 @@ If there are too many elements for a single line: ```php $arr = [ - 3, 14, 15, - 92, 6, $test, - 'Yii', 'Framework', + 3, 14, 15, + 92, 6, $test, + 'Yii', 'Framework', ]; ``` @@ -235,8 +235,8 @@ Use the following format for associative arrays: ```php $config = [ - 'name' => 'Yii', - 'options' => ['usePHP' => true], + 'name' => 'Yii', + 'options' => ['usePHP' => true], ]; ``` @@ -250,16 +250,16 @@ $config = [ ```php if ($event === null) { - return new Event(); + return new Event(); } elseif ($event instanceof CoolEvent) { - return $event->instance(); + return $event->instance(); } else { - return null; + return null; } // the following is NOT allowed: if (!$model && null === $event) - throw new Exception('test'); + throw new Exception('test'); ``` #### switch @@ -268,18 +268,18 @@ Use the following formatting for switch: ```php switch ($this->phpType) { - case 'string': - $a = (string)$value; - break; - case 'integer': - case 'int': - $a = (integer)$value; - break; - case 'boolean': - $a = (boolean)$value; - break; - default: - $a = null; + case 'string': + $a = (string)$value; + break; + case 'integer': + case 'int': + $a = (integer)$value; + break; + case 'boolean': + $a = (boolean)$value; + break; + default: + $a = null; } ``` @@ -291,8 +291,8 @@ doIt(2, 3); doIt(['a' => 'b']); doIt('a', [ - 'a' => 'b', - 'c' => 'd', + 'a' => 'b', + 'c' => 'd', ]); ``` @@ -304,17 +304,17 @@ Note space between `function`/`use` tokens and open parenthesis: // good $n = 100; $sum = array_reduce($numbers, function ($r, $x) use ($n) { - $this->doMagic(); - $r += $x * $n; - return $r; + $this->doMagic(); + $r += $x * $n; + return $r; }); // bad $n = 100; $mul = array_reduce($numbers, function($r, $x) use($n) { - $this->doMagic(); - $r *= $x * $n; - return $r; + $this->doMagic(); + $r *= $x * $n; + return $r; }); ``` @@ -336,17 +336,17 @@ Documentation in `@return`. Here is an example: ```php - _e[$name])) { - $this->_e[$name] = new Vector; - } - $this->ensureBehaviors(); - return $this->_e[$name]; + if (!isset($this->_e[$name])) { + $this->_e[$name] = new Vector; + } + $this->ensureBehaviors(); + return $this->_e[$name]; } ``` diff --git a/docs/internals/view-code-style.md b/docs/internals/view-code-style.md index 7a115b0..19034cb 100644 --- a/docs/internals/view-code-style.md +++ b/docs/internals/view-code-style.md @@ -26,26 +26,26 @@ $this->title = 'Posts'; ?> - -

-

+ +

+

['id' => 'contact-message-form'], - 'fieldConfig' => ['inputOptions' => ['class' => 'common-input']], + 'options' => ['id' => 'contact-message-form'], + 'fieldConfig' => ['inputOptions' => ['class' => 'common-input']], ]); ?> - - field($contactMessage, 'name')->textInput() ?> - field($contactMessage, 'email')->textInput() ?> - field($contactMessage, 'subject')->textInput() ?> - field($contactMessage, 'body')->textArea(['rows' => 6]) ?> - -
- 'common-button']) ?> -
+ + field($contactMessage, 'name')->textInput() ?> + field($contactMessage, 'email')->textInput() ?> + field($contactMessage, 'subject')->textInput() ?> + field($contactMessage, 'body')->textArea(['rows' => 6]) ?> + +
+ 'common-button']) ?> +
diff --git a/extensions/apidoc/composer.json b/extensions/apidoc/composer.json index ff0e9f9..887403a 100644 --- a/extensions/apidoc/composer.json +++ b/extensions/apidoc/composer.json @@ -17,7 +17,7 @@ "email": "mail@cebe.cc" } ], - "minimum-stability": "dev", + "minimum-stability": "dev", "require": { "yiisoft/yii2": "*", "yiisoft/yii2-bootstrap": "*", diff --git a/extensions/apidoc/helpers/ApiIndexer.php b/extensions/apidoc/helpers/ApiIndexer.php index be882a4..8cb71c4 100644 --- a/extensions/apidoc/helpers/ApiIndexer.php +++ b/extensions/apidoc/helpers/ApiIndexer.php @@ -16,15 +16,15 @@ use yii\helpers\StringHelper; class ApiIndexer extends Indexer { protected function generateFileInfo($file, $contents, $basePath, $baseUrl) - { - // create file entry - if (preg_match('~

(.*?)

~s', $contents, $matches)) { - $title = str_replace('¶', '', strip_tags($matches[1])); - } elseif (preg_match('~(.*?)~s', $contents, $matches)) { - $title = strip_tags($matches[1]); - } else { - $title = 'No title'; - } + { + // create file entry + if (preg_match('~

(.*?)

~s', $contents, $matches)) { + $title = str_replace('¶', '', strip_tags($matches[1])); + } elseif (preg_match('~(.*?)~s', $contents, $matches)) { + $title = strip_tags($matches[1]); + } else { + $title = 'No title'; + } if (preg_match('~
\s*(.*?)~s', $contents, $matches)) { $description = strip_tags($matches[1]); @@ -37,24 +37,24 @@ class ApiIndexer extends Indexer $description = ''; } - return [ - 'u' => $baseUrl . str_replace('\\', '/', substr($file, strlen(rtrim($basePath, '\\/')))), - 't' => $title, - 'd' => $description, - ]; - } + return [ + 'u' => $baseUrl . str_replace('\\', '/', substr($file, strlen(rtrim($basePath, '\\/')))), + 't' => $title, + 'd' => $description, + ]; + } /** - * @return TokenizerInterface - */ - public function getTokenizer() - { + * @return TokenizerInterface + */ + public function getTokenizer() + { $tokenizer = parent::getTokenizer(); if ($tokenizer instanceof StandardTokenizer) { // yii is part of every doc and makes weird search results $tokenizer->stopWords[] = 'yii'; $tokenizer->stopWords = array_unique($tokenizer->stopWords); } - return $tokenizer; - } + return $tokenizer; + } } \ No newline at end of file diff --git a/extensions/apidoc/templates/bootstrap/assets/css/api.css b/extensions/apidoc/templates/bootstrap/assets/css/api.css index a3f53ec..6699d11 100644 --- a/extensions/apidoc/templates/bootstrap/assets/css/api.css +++ b/extensions/apidoc/templates/bootstrap/assets/css/api.css @@ -24,7 +24,7 @@ code { } div.code { - display: none; + display: none; color: #000000; background-color: #FFF5E6; font-family: "courier new", "times new roman", monospace; @@ -43,57 +43,57 @@ div.code { } table.summaryTable { - background: #E6ECFF; - border-collapse: collapse; - width: 100%; + background: #E6ECFF; + border-collapse: collapse; + width: 100%; } table.summaryTable th, table.summaryTable td { - border: 1px #BFCFFF solid; - padding: 0.2em; + border: 1px #BFCFFF solid; + padding: 0.2em; } table.summaryTable th { - background: #CCD9FF; - text-align: left; + background: #CCD9FF; + text-align: left; } #nav { - padding: 3px; - margin: 0 0 10px 0; - border-top: 1px #BFCFFF solid; + padding: 3px; + margin: 0 0 10px 0; + border-top: 1px #BFCFFF solid; } #classDescription { - padding: 5px; - margin: 10px 0 20px 0; - border-bottom: 1px solid #BFCFFF; + padding: 5px; + margin: 10px 0 20px 0; + border-bottom: 1px solid #BFCFFF; } .detailHeader { - font-weight: bold; - font-size: 12pt; - margin: 30px 0 5px 0; - border-bottom: 1px solid #BFCFFF; + font-weight: bold; + font-size: 12pt; + margin: 30px 0 5px 0; + border-bottom: 1px solid #BFCFFF; } .detailHeaderTag { - font-weight: normal; - font-size: 10pt; + font-weight: normal; + font-size: 10pt; } .paramNameCol { - width: 12%; - font-weight: bold; + width: 12%; + font-weight: bold; } .paramTypeCol { - width: 12%; + width: 12%; } .sourceCode { - margin: 5px 0; - padding:5px; - background:#FFF5E6; + margin: 5px 0; + padding:5px; + background:#FFF5E6; } \ No newline at end of file diff --git a/extensions/apidoc/templates/bootstrap/assets/css/style.css b/extensions/apidoc/templates/bootstrap/assets/css/style.css index 40ef62b..cd84db9 100644 --- a/extensions/apidoc/templates/bootstrap/assets/css/style.css +++ b/extensions/apidoc/templates/bootstrap/assets/css/style.css @@ -1,65 +1,65 @@ html, body { - height: 100%; + height: 100%; } .guide-content, .api-content { - max-width: 1250px; + max-width: 1250px; } .wrap { - min-height: 100%; - height: auto; - width: auto; - margin: 60px 30px 0 30px; - padding: 0; + min-height: 100%; + height: auto; + width: auto; + margin: 60px 30px 0 30px; + padding: 0; } .footer { - height: 60px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - padding: 20px 30px; + height: 60px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + padding: 20px 30px; } #navigation { - margin-top: 20px; + margin-top: 20px; } .submenu a { - background: #f5f5f5; - border-radius: 0; + background: #f5f5f5; + border-radius: 0; } .submenu a:hover, .submenu a:active, .submenu a.active, .submenu a.active:hover, .submenu a.active:active { - background: #44b5f6; - border-color: #44b5f6; - border-radius: 0; - color: #fff; + background: #44b5f6; + border-color: #44b5f6; + border-radius: 0; + color: #fff; } .signature, .table-striped > tbody > tr > td.signature { - margin: 10px 0 10px 0; - padding: 8px; + margin: 10px 0 10px 0; + padding: 8px; - color: #000000; - background: rgba(230, 236, 255, 0.81); - border: 1px rgba(191, 207, 255, 0.81) solid; + color: #000000; + background: rgba(230, 236, 255, 0.81); + border: 1px rgba(191, 207, 255, 0.81) solid; - font-family: "courier new", "times new roman", monospace; - line-height: 1.3em; - white-space: pre-line; - word-wrap: break-word; - word-break: break-all; + font-family: "courier new", "times new roman", monospace; + line-height: 1.3em; + white-space: pre-line; + word-wrap: break-word; + word-break: break-all; } blockquote { - font-size: 14px; + font-size: 14px; } td p { - margin: 0; + margin: 0; } table.detail-table .param-name-col { width: 15%; min-width: 100px; } @@ -73,41 +73,41 @@ table.summary-table .col-event { width: 20%; } table.summary-table .col-defined { width: 15%; } .detail-header { - margin-top: 30px; + margin-top: 30px; } .doc-description { - border-left: solid 1px #ddd; - border-right: solid 1px #ddd; - padding: 10px 8px; - margin: 0; + border-left: solid 1px #ddd; + border-right: solid 1px #ddd; + padding: 10px 8px; + margin: 0; } .event-doc .doc-description { - border-bottom: solid 1px #ddd; + border-bottom: solid 1px #ddd; } .doc-description p:last-child { - margin-bottom: 0; + margin-bottom: 0; } .tool-link { - float: right; - color: #ddd; - margin: 0 8px; + float: right; + color: #ddd; + margin: 0 8px; } .icon-hash:before { - content: '#'; - font-size: 32px; - font-weight: bold; - /*top: -10px;*/ - line-height: 0.5; + content: '#'; + font-size: 32px; + font-weight: bold; + /*top: -10px;*/ + line-height: 0.5; } .tool-link:hover { - color: #bbb; - text-decoration: none; + color: #bbb; + text-decoration: none; } diff --git a/extensions/authclient/README.md b/extensions/authclient/README.md index 1803a04..370e3b8 100644 --- a/extensions/authclient/README.md +++ b/extensions/authclient/README.md @@ -182,23 +182,23 @@ use yii\authclient\OAuth2; class MyAuthClient extends OAuth2 { - protected function defaultName() - { - return 'my_auth_client'; - } - - protected function defaultTitle() - { - return 'My Auth Client'; - } - - protected function defaultViewOptions() - { - return [ - 'popupWidth' => 800, - 'popupHeight' => 500, - ]; - } + protected function defaultName() + { + return 'my_auth_client'; + } + + protected function defaultTitle() + { + return 'My Auth Client'; + } + + protected function defaultViewOptions() + { + return [ + 'popupWidth' => 800, + 'popupHeight' => 500, + ]; + } } ``` @@ -215,16 +215,16 @@ use yii\authclient\OpenId; class MyAuthClient extends OpenId { - public $authUrl = 'https://www.my.com/openid/'; + public $authUrl = 'https://www.my.com/openid/'; - public $requiredAttributes = [ - 'contact/email', - ]; + public $requiredAttributes = [ + 'contact/email', + ]; - public $optionalAttributes = [ - 'namePerson/first', - 'namePerson/last', - ]; + public $optionalAttributes = [ + 'namePerson/first', + 'namePerson/last', + ]; } ``` @@ -243,16 +243,16 @@ use yii\authclient\OAuth2; class MyAuthClient extends OAuth2 { - public $authUrl = 'https://www.my.com/oauth2/auth'; + public $authUrl = 'https://www.my.com/oauth2/auth'; - public $tokenUrl = 'https://www.my.com/oauth2/token'; + public $tokenUrl = 'https://www.my.com/oauth2/token'; - public $apiBaseUrl = 'https://www.my.com/apis/oauth2/v1'; + public $apiBaseUrl = 'https://www.my.com/apis/oauth2/v1'; - protected function initUserAttributes() - { - return $this->api('userinfo', 'GET'); - } + protected function initUserAttributes() + { + return $this->api('userinfo', 'GET'); + } } ``` @@ -277,18 +277,18 @@ use yii\authclient\OAuth1; class MyAuthClient extends OAuth1 { - public $authUrl = 'https://www.my.com/oauth/auth'; + public $authUrl = 'https://www.my.com/oauth/auth'; - public $requestTokenUrl = 'https://www.my.com/oauth/request_token'; + public $requestTokenUrl = 'https://www.my.com/oauth/request_token'; - public $accessTokenUrl = 'https://www.my.com/oauth/access_token'; + public $accessTokenUrl = 'https://www.my.com/oauth/access_token'; - public $apiBaseUrl = 'https://www.my.com/apis/oauth/v1'; + public $apiBaseUrl = 'https://www.my.com/apis/oauth/v1'; - protected function initUserAttributes() - { - return $this->api('userinfo', 'GET'); - } + protected function initUserAttributes() + { + return $this->api('userinfo', 'GET'); + } } ``` diff --git a/extensions/bootstrap/composer.json b/extensions/bootstrap/composer.json index fd41fef..f0cb57b 100644 --- a/extensions/bootstrap/composer.json +++ b/extensions/bootstrap/composer.json @@ -1,29 +1,29 @@ { - "name": "yiisoft/yii2-bootstrap", - "description": "The Twitter Bootstrap extension for the Yii framework", - "keywords": ["yii2", "bootstrap"], - "type": "yii2-extension", - "license": "BSD-3-Clause", - "support": { - "issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Abootstrap", - "forum": "http://www.yiiframework.com/forum/", - "wiki": "http://www.yiiframework.com/wiki/", - "irc": "irc://irc.freenode.net/yii", - "source": "https://github.com/yiisoft/yii2" - }, - "authors": [ - { - "name": "Qiang Xue", - "email": "qiang.xue@gmail.com" - } - ], - "require": { - "yiisoft/yii2": "*", - "twbs/bootstrap": "3.1.* | 3.0.*" - }, - "autoload": { - "psr-4": { - "yii\\bootstrap\\": "" - } - } + "name": "yiisoft/yii2-bootstrap", + "description": "The Twitter Bootstrap extension for the Yii framework", + "keywords": ["yii2", "bootstrap"], + "type": "yii2-extension", + "license": "BSD-3-Clause", + "support": { + "issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Abootstrap", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2" + }, + "authors": [ + { + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com" + } + ], + "require": { + "yiisoft/yii2": "*", + "twbs/bootstrap": "3.1.* | 3.0.*" + }, + "autoload": { + "psr-4": { + "yii\\bootstrap\\": "" + } + } } diff --git a/extensions/codeception/README.md b/extensions/codeception/README.md index fe3d502..42e9de9 100644 --- a/extensions/codeception/README.md +++ b/extensions/codeception/README.md @@ -69,7 +69,7 @@ use Codeception\Event\TestEvent; public function testSomething() { - $this->fire('myevent', new TestEvent($this)); + $this->fire('myevent', new TestEvent($this)); } ``` this event can be catched in modules and helpers. If your test is in the group, then event name will be followed by the groupname, @@ -84,15 +84,15 @@ Execution of special tests methods is (for example on ```UserTest``` class): ``` tests\unit\models\UserTest::setUpBeforeClass(); - tests\unit\models\UserTest::_before(); + tests\unit\models\UserTest::_before(); - tests\unit\models\UserTest::setUp(); + tests\unit\models\UserTest::setUp(); - tests\unit\models\UserTest::testSomething(); + tests\unit\models\UserTest::testSomething(); - tests\unit\models\UserTest::tearDown(); + tests\unit\models\UserTest::tearDown(); - tests\unit\models\UserTest::_after(); + tests\unit\models\UserTest::_after(); tests\unit\models\UserTest::tearDownAfterClass(); ``` @@ -109,8 +109,8 @@ You may need to specify different configuration files per test cases, to do this SomeConsoleTest extends \yii\codeception\TestCase { - // this is the config file to load as application config - public $appConfig = '@app/path/to/my/custom/config/for/test.php'; + // this is the config file to load as application config + public $appConfig = '@app/path/to/my/custom/config/for/test.php'; } ``` @@ -120,14 +120,14 @@ application class in the config, for example for testing console commands or fea ```php return yii\helpers\ArrayHelper::merge( - require(__DIR__ . '/../../config/console.php'), - require(__DIR__ . '/../_config.php'), - [ - 'class' => 'yii\console\Application', - 'components' => [ - //override console components if needed - ], - ] + require(__DIR__ . '/../../config/console.php'), + require(__DIR__ . '/../_config.php'), + [ + 'class' => 'yii\console\Application', + 'components' => [ + //override console components if needed + ], + ] ); ``` @@ -139,7 +139,7 @@ use \yii\codeception\TestCase; class ConsoleTestCase extends TestCase { - public $appConfig = '@tests/unit/_console.php'; + public $appConfig = '@tests/unit/_console.php'; } ``` @@ -160,15 +160,15 @@ use Yii; class MailTest extends TestCase { - protected function setUp() - { - // don't forget to call parent method that will setup Yii application - parent::setUp(); + protected function setUp() + { + // don't forget to call parent method that will setup Yii application + parent::setUp(); - Yii::$app->mail->fileTransportCallback = function ($mailer, $message) { - return 'testing_message.eml'; - }; - } + Yii::$app->mail->fileTransportCallback = function ($mailer, $message) { + return 'testing_message.eml'; + }; + } } ``` @@ -186,29 +186,29 @@ use \yii\codeception\TestCase; class SomeMyTest extends TestCase { - public function testOne() - { - ... - } - - public function testTwo() - { - $this->mockApplication([ - 'language' => 'ru-RU', - 'components' => [ - 'db' => [ - //your custom configuration here - ], - ], - ]); - - //your expectations and assertions goes here - } - - public function testThree() - { - ... - } + public function testOne() + { + ... + } + + public function testTwo() + { + $this->mockApplication([ + 'language' => 'ru-RU', + 'components' => [ + 'db' => [ + //your custom configuration here + ], + ], + ]); + + //your expectations and assertions goes here + } + + public function testThree() + { + ... + } } ``` @@ -226,12 +226,12 @@ use Codeception\Util\Debug; SomeDebugTest extends \yii\codeception\TestCase { - public function testSmth() - { - Debug::debug('some string'); - Debug::debug($someArray); - Debug::debug($someObject); - } + public function testSmth() + { + Debug::debug('some string'); + Debug::debug($someArray); + Debug::debug($someObject); + } } ``` diff --git a/extensions/composer/README.md b/extensions/composer/README.md index d4ce101..e2d25fb 100644 --- a/extensions/composer/README.md +++ b/extensions/composer/README.md @@ -13,11 +13,11 @@ like the following: ```json { - "type": "yii2-extension", - "require": { - "yiisoft/yii2": "*" - }, - ... + "type": "yii2-extension", + "require": { + "yiisoft/yii2": "*" + }, + ... } ``` @@ -26,11 +26,11 @@ the Yii 2 application is responding to a request. For example, ```json { - "type": "yii2-extension", - ..., - "extra": { - "bootstrap": "yii\\jui\\Extension" - } + "type": "yii2-extension", + ..., + "extra": { + "bootstrap": "yii\\jui\\Extension" + } } ``` @@ -42,22 +42,22 @@ For example, ```json { - "name": "yiisoft/yii2-app-basic", - "type": "project", - ... - "scripts": { - "post-create-project-cmd": [ - "yii\\composer\\Installer::setPermission" - ] - }, - "extra": { - "writable": [ - "runtime", - "web/assets" - ], - "executable": [ - "yii" - ] - } + "name": "yiisoft/yii2-app-basic", + "type": "project", + ... + "scripts": { + "post-create-project-cmd": [ + "yii\\composer\\Installer::setPermission" + ] + }, + "extra": { + "writable": [ + "runtime", + "web/assets" + ], + "executable": [ + "yii" + ] + } } ``` diff --git a/extensions/debug/assets/main.css b/extensions/debug/assets/main.css index f53f731..248a094 100644 --- a/extensions/debug/assets/main.css +++ b/extensions/debug/assets/main.css @@ -1,46 +1,46 @@ span.indent { - color: #ccc; + color: #ccc; } ul.trace { - font-size: 12px; - color: #999; - margin: 2px 0 0 0; - padding: 0; - list-style: none; - white-space: normal; + font-size: 12px; + color: #999; + margin: 2px 0 0 0; + padding: 0; + list-style: none; + white-space: normal; } .callout-danger { - background-color: #fcf2f2; - border-color: #dFb5b4; + background-color: #fcf2f2; + border-color: #dFb5b4; } .callout { - margin: 0 0 10px 0; - padding: 5px; + margin: 0 0 10px 0; + padding: 5px; } .list-group .glyphicon { - float: right; + float: right; } td, th { - white-space: pre-wrap; - word-wrap: break-word; + white-space: pre-wrap; + word-wrap: break-word; } .request-table td { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - word-break: break-all; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + word-break: break-all; } .config-php-info-table td.v { - word-break: break-all; + word-break: break-all; } .not-set { - color: #c55; - font-style: italic; + color: #c55; + font-style: italic; } .detail-grid-view th { @@ -49,47 +49,47 @@ td, th { /* add sorting icons to gridview sort links */ a.asc:after, a.desc:after { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - padding-left: 5px; + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + padding-left: 5px; } a.asc:after { - content: /*"\e113"*/ "\e151"; + content: /*"\e113"*/ "\e151"; } a.desc:after { - content: /*"\e114"*/ "\e152"; + content: /*"\e114"*/ "\e152"; } .sort-numerical a.asc:after { - content: "\e153"; + content: "\e153"; } .sort-numerical a.desc:after { - content: "\e154"; + content: "\e154"; } .sort-ordinal a.asc:after { - content: "\e155"; + content: "\e155"; } .sort-ordinal a.desc:after { - content: "\e156"; + content: "\e156"; } .mail-sorter { - margin-top: 7px; + margin-top: 7px; } .mail-sorter li { - list-style: none; - float: left; - width: 12%; - font-weight: bold; + list-style: none; + float: left; + width: 12%; + font-weight: bold; } diff --git a/extensions/debug/assets/toolbar.css b/extensions/debug/assets/toolbar.css index b4c6619..bb361eb 100644 --- a/extensions/debug/assets/toolbar.css +++ b/extensions/debug/assets/toolbar.css @@ -1,187 +1,187 @@ #yii-debug-toolbar { - padding: 0; - font: 11px Verdana, Arial, sans-serif; - text-align: left; - min-height: 40px; - overflow: auto; - background: rgb(246,246,246); - background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); - background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); - background: rgb(246,246,246) url(data:image/svg+xml;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAYAAAA/tpB3AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB94BBQwuINct3v0AAAAjSURBVAjXY3j79u1/JgYGBgYkgpGRkYEYMSpKUGLK+/fvGQAaDAb6F86IsAAAAABJRU5ErkJggg==); /* generated using "cat assets/bg.png | base64" */ + padding: 0; + font: 11px Verdana, Arial, sans-serif; + text-align: left; + min-height: 40px; + overflow: auto; + background: rgb(246,246,246); + background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); + background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); + background: rgb(246,246,246) url(data:image/svg+xml;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAYAAAA/tpB3AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB94BBQwuINct3v0AAAAjSURBVAjXY3j79u1/JgYGBgYkgpGRkYEYMSpKUGLK+/fvGQAaDAb6F86IsAAAAABJRU5ErkJggg==); /* generated using "cat assets/bg.png | base64" */ } .yii-debug-toolbar-top { - margin: 0 0 20px 0; - border-bottom: 1px solid #e4e4e4; + margin: 0 0 20px 0; + border-bottom: 1px solid #e4e4e4; } .yii-debug-toolbar-bottom { - position: fixed; - left: 0; - right: 0; - bottom: 0; - margin: 0; - z-index: 1000000; - border-top: 1px solid #ccc; + position: fixed; + left: 0; + right: 0; + bottom: 0; + margin: 0; + z-index: 1000000; + border-top: 1px solid #ccc; } .yii-debug-toolbar-block { - float: left; - margin: 0; - border-right: 1px solid #e4e4e4; - padding: 4px 8px; - line-height: 32px; - white-space: nowrap; + float: left; + margin: 0; + border-right: 1px solid #e4e4e4; + padding: 4px 8px; + line-height: 32px; + white-space: nowrap; } .yii-debug-toolbar-block a { - text-decoration: none; - color: black; + text-decoration: none; + color: black; } .yii-debug-toolbar-block span { } .yii-debug-toolbar-block img { - vertical-align: middle; + vertical-align: middle; } #yii-debug-toolbar .label { - display: inline-block; - padding: 2px 4px; - font-size: 11.844px; - font-weight: normal; - line-height: 14px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - white-space: nowrap; - vertical-align: baseline; - background-color: #999999; + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: normal; + line-height: 14px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; } #yii-debug-toolbar .label { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } #yii-debug-toolbar .label:empty { - display: none; + display: none; } #yii-debug-toolbar a.label:hover, #yii-debug-toolbar a.label:focus { - color: #ffffff; - text-decoration: none; - cursor: pointer; + color: #ffffff; + text-decoration: none; + cursor: pointer; } #yii-debug-toolbar .label-important { - background-color: #b94a48; + background-color: #b94a48; } #yii-debug-toolbar .label-important[href] { - background-color: #953b39; + background-color: #953b39; } #yii-debug-toolbar .label-warning, #yii-debug-toolbar .badge-warning { - background-color: #f89406; + background-color: #f89406; } #yii-debug-toolbar .label-warning[href] { - background-color: #c67605; + background-color: #c67605; } #yii-debug-toolbar .label-success { - background-color: #468847; + background-color: #468847; } #yii-debug-toolbar .label-success[href] { - background-color: #356635; + background-color: #356635; } #yii-debug-toolbar .label-info { - background-color: #3a87ad; + background-color: #3a87ad; } #yii-debug-toolbar .label-info[href] { - background-color: #2d6987; + background-color: #2d6987; } #yii-debug-toolbar .label-inverse, #yii-debug-toolbar .badge-inverse { - background-color: #333333; + background-color: #333333; } #yii-debug-toolbar .label-inverse[href], #yii-debug-toolbar .badge-inverse[href] { - background-color: #1a1a1a; + background-color: #1a1a1a; } .yii-debug-toolbar-toggler { - cursor: pointer; - position: absolute; - right: 10px; - bottom: 4px; - width: 15px; - height: 30px; - font-size: 25px; - font-weight: 100; - line-height: 28px; - color: #ffffff; - text-align: center; - background: #666666; - -webkit-border-radius: 12px; - -moz-border-radius: 12px; - border-radius: 12px; - opacity: 0.5; - filter: alpha(opacity=50); + cursor: pointer; + position: absolute; + right: 10px; + bottom: 4px; + width: 15px; + height: 30px; + font-size: 25px; + font-weight: 100; + line-height: 28px; + color: #ffffff; + text-align: center; + background: #666666; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + border-radius: 12px; + opacity: 0.5; + filter: alpha(opacity=50); } .yii-debug-toolbar-toggler:hover, .yii-debug-toolbar-toggler:focus { - color: #ffffff; - text-decoration: none; - opacity: 0.9; - filter: alpha(opacity=90); + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); } #yii-debug-toolbar-min { - display: none; - position: fixed; - right: 0; - bottom: 0; - margin: 0; - padding: 0; - z-index: 1000000; - font: 11px Verdana, Arial, sans-serif; - text-align: left; - width: 63px; - height: 38px; - border-top: 1px solid #ccc; - border-left: 1px solid #ccc; - -webkit-border-top-left-radius: 6px; - -moz-border-top-left-radius: 6px; - border-top-left-radius: 6px; - background: rgb(237,237,237); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); - background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); + display: none; + position: fixed; + right: 0; + bottom: 0; + margin: 0; + padding: 0; + z-index: 1000000; + font: 11px Verdana, Arial, sans-serif; + text-align: left; + width: 63px; + height: 38px; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + -webkit-border-top-left-radius: 6px; + -moz-border-top-left-radius: 6px; + border-top-left-radius: 6px; + background: rgb(237,237,237); + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); + background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); } #yii-debug-toolbar-logo { - position: fixed; - right: 31px; - bottom: 4px; + position: fixed; + right: 31px; + bottom: 4px; } diff --git a/extensions/elasticsearch/README.md b/extensions/elasticsearch/README.md index 0875e8e..20e7052 100644 --- a/extensions/elasticsearch/README.md +++ b/extensions/elasticsearch/README.md @@ -9,8 +9,8 @@ To use this extension, you have to configure the Connection class in your applic ```php return [ - //.... - 'components' => [ + //.... + 'components' => [ 'elasticsearch' => [ 'class' => 'yii\elasticsearch\Connection', 'nodes' => [ @@ -18,7 +18,7 @@ return [ // configure more hosts if you have a cluster ], ], - ] + ] ]; ``` @@ -152,11 +152,11 @@ $result = Article::find()->query(["field" => ["title" => "yii"]])->all(); // art // http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-query.html $query = Article::find()->query([ - "fuzzy_like_this" => [ - "fields" => ["title", "description"], - "like_text" => "This query will return articles that are similar to this text :-)", + "fuzzy_like_this" => [ + "fields" => ["title", "description"], + "like_text" => "This query will return articles that are similar to this text :-)", "max_query_terms" : 12 - ] + ] ]); $query->all(); // gives you all the documents @@ -179,19 +179,19 @@ Add the following to you application config to enable it (if you already have th enabled, it is sufficient to just add the panels configuration): ```php - // ... - 'bootstrap' => ['debug'], - 'modules' => [ - 'debug' => [ - 'class' => 'yii\\debug\\Module', - 'panels' => [ - 'elasticsearch' => [ - 'class' => 'yii\\elasticsearch\\DebugPanel', - ], - ], - ], - ], - // ... + // ... + 'bootstrap' => ['debug'], + 'modules' => [ + 'debug' => [ + 'class' => 'yii\\debug\\Module', + 'panels' => [ + 'elasticsearch' => [ + 'class' => 'yii\\elasticsearch\\DebugPanel', + ], + ], + ], + ], + // ... ``` ![elasticsearch DebugPanel](images/README-debug.png) diff --git a/extensions/faker/README.md b/extensions/faker/README.md index ac09204..59afcfe 100644 --- a/extensions/faker/README.md +++ b/extensions/faker/README.md @@ -31,9 +31,9 @@ To use this extension, simply add the following code in your application config ```php 'controllerMap' => [ - 'fixture' => [ - 'class' => 'yii\faker\FixtureController', - ], + 'fixture' => [ + 'class' => 'yii\faker\FixtureController', + ], ], ``` Set valid ```test``` alias in your console config, for example for ```basic``` application template, this should be added @@ -44,17 +44,17 @@ generate fixtures template files, according to the given format: ```php //users.php file under template path (by default @tests/unit/templates/fixtures) return [ - [ - 'table_column0' => 'faker_formatter', - ... - 'table_columnN' => 'other_faker_formatter' - 'body' => function ($fixture, $faker, $index) { - //set needed fixture fields based on different conditions - - $fixture['body'] = $faker->sentence(7,true); //generate sentence exact with 7 words. - return $fixture; - } - ], + [ + 'table_column0' => 'faker_formatter', + ... + 'table_columnN' => 'other_faker_formatter' + 'body' => function ($fixture, $faker, $index) { + //set needed fixture fields based on different conditions + + $fixture['body'] = $faker->sentence(7,true); //generate sentence exact with 7 words. + return $fixture; + } + ], ]; ``` @@ -72,17 +72,17 @@ Another example of valid template: use yii\helpers\Security; return [ - 'name' => 'firstName', - 'phone' => 'phoneNumber', - 'city' => 'city', - 'password' => function ($fixture, $faker, $index) { - $fixture['password'] = Security::generatePasswordHash('password_' . $index); - return $fixture; - }, - 'auth_key' => function ($fixture, $faker, $index) { - $fixture['auth_key'] = Security::generateRandomKey(); - return $fixture; - }, + 'name' => 'firstName', + 'phone' => 'phoneNumber', + 'city' => 'city', + 'password' => function ($fixture, $faker, $index) { + $fixture['password'] = Security::generatePasswordHash('password_' . $index); + return $fixture; + }, + 'auth_key' => function ($fixture, $faker, $index) { + $fixture['auth_key'] = Security::generateRandomKey(); + return $fixture; + }, ]; ``` @@ -135,16 +135,16 @@ After you created custom provider, for example: ```php class Book extends \Faker\Provider\Base { - public function title($nbWords = 5) - { - $sentence = $this->generator->sentence($nbWords); - return mb_substr($sentence, 0, mb_strlen($sentence) - 1); - } + public function title($nbWords = 5) + { + $sentence = $this->generator->sentence($nbWords); + return mb_substr($sentence, 0, mb_strlen($sentence) - 1); + } - public function ISBN() - { - return $this->generator->randomNumber(13); - } + public function ISBN() + { + return $this->generator->randomNumber(13); + } } ``` @@ -153,11 +153,11 @@ You can use it by adding it to the ```$providers``` property of the current comm ```php 'controllerMap' => [ - 'fixture' => [ - 'class' => 'yii\faker\FixtureController', - 'providers' => [ - 'app\tests\unit\faker\providers\Book', - ], - ], + 'fixture' => [ + 'class' => 'yii\faker\FixtureController', + 'providers' => [ + 'app\tests\unit\faker\providers\Book', + ], + ], ] ``` diff --git a/extensions/gii/assets/main.css b/extensions/gii/assets/main.css index 329aaed..0fcde56 100644 --- a/extensions/gii/assets/main.css +++ b/extensions/gii/assets/main.css @@ -1,217 +1,217 @@ body { - padding-top: 70px; + padding-top: 70px; } .footer { - border-top: 1px solid #ddd; - margin-top: 30px; - padding: 15px 0 30px; + border-top: 1px solid #ddd; + margin-top: 30px; + padding: 15px 0 30px; } .jumbotron { - text-align: center; - background-color: transparent; + text-align: center; + background-color: transparent; } .jumbotron .btn { - font-size: 21px; - padding: 14px 24px; + font-size: 21px; + padding: 14px 24px; } .navbar-brand { - padding: 0; - margin: 0; + padding: 0; + margin: 0; } .default-index .generator { - min-height: 200px; - margin-bottom: 20px; + min-height: 200px; + margin-bottom: 20px; } .list-group .glyphicon { - float: right; + float: right; } .popover { - max-width: 400px; - width: 400px; + max-width: 400px; + width: 400px; } .hint-block { - display: none; + display: none; } .error-summary { - color: #a94442; - background: #fdf7f7; - border-left: 3px solid #eed3d7; - padding: 10px 20px; - margin: 0 0 15px 0; + color: #a94442; + background: #fdf7f7; + border-left: 3px solid #eed3d7; + padding: 10px 20px; + margin: 0 0 15px 0; } .default-view .sticky-value { - padding: 6px 12px; - background: lightyellow; - white-space: pre; - word-wrap: break-word; + padding: 6px 12px; + background: lightyellow; + white-space: pre; + word-wrap: break-word; } .default-view .form-group label.help { - border-bottom: 1px dashed #888; - cursor: help; + border-bottom: 1px dashed #888; + cursor: help; } .default-view .modal-dialog { - width: 800px; + width: 800px; } .default-view .modal-dialog .error { - color: #d9534f; + color: #d9534f; } .default-view .modal-dialog .content { - background: #fafafa; - border-left: #eee 5px solid; - padding: 5px 10px; - overflow: auto; + background: #fafafa; + border-left: #eee 5px solid; + padding: 5px 10px; + overflow: auto; } .default-view .modal-dialog code { - background: transparent; + background: transparent; } .default-view-files table .action { - width: 100px; + width: 100px; } .default-view-files table .check { - width: 25px; - text-align: center; + width: 25px; + text-align: center; } .default-view-results pre { - overflow: auto; - background-color: #333; - max-height: 300px; - color: white; - padding: 10px; - border-radius: 0; - white-space: nowrap; + overflow: auto; + background-color: #333; + max-height: 300px; + color: white; + padding: 10px; + border-radius: 0; + white-space: nowrap; } .default-view-results pre .error { - background: #FFE0E1; - color: black; - padding: 1px; + background: #FFE0E1; + color: black; + padding: 1px; } .default-view-results .alert pre { - background: white; + background: white; } .default-diff pre { - padding: 0; - margin: 0; - background: transparent; - border: none; + padding: 0; + margin: 0; + background: transparent; + border: none; } .default-diff pre del { - background: pink; + background: pink; } .default-diff pre ins { - background: lightgreen; - text-decoration: none; + background: lightgreen; + text-decoration: none; } .Differences { - width: 100%; - border-collapse: collapse; - border-spacing: 0; - empty-cells: show; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + empty-cells: show; } .Differences thead { - display: none; + display: none; } .Differences tbody th { - text-align: right; - background: #FAFAFA; - padding: 1px 2px; - border-right: 1px solid #eee; - vertical-align: top; - font-size: 13px; - font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; - font-weight: normal; - color: #999; - width: 5px; + text-align: right; + background: #FAFAFA; + padding: 1px 2px; + border-right: 1px solid #eee; + vertical-align: top; + font-size: 13px; + font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; + font-weight: normal; + color: #999; + width: 5px; } .Differences td { - padding: 1px 2px; - font-size: 13px; - font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; + padding: 1px 2px; + font-size: 13px; + font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; } .DifferencesSideBySide .ChangeInsert td.Left { - background: #dfd; + background: #dfd; } .DifferencesSideBySide .ChangeInsert td.Right { - background: #cfc; + background: #cfc; } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #f88; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #faa; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fe9; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #fd8; } .Differences ins, .Differences del { - text-decoration: none; + text-decoration: none; } .DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; + background: #fc0; } .Differences .Skipped { - background: #f7f7f7; + background: #f7f7f7; } .DifferencesInline .ChangeReplace .Left, .DifferencesInline .ChangeDelete .Left { - background: #fdd; + background: #fdd; } .DifferencesInline .ChangeReplace .Right, .DifferencesInline .ChangeInsert .Right { - background: #dfd; + background: #dfd; } .DifferencesInline .ChangeReplace ins { - background: #9e9; + background: #9e9; } .DifferencesInline .ChangeReplace del { - background: #e99; + background: #e99; } .DifferencesInline th[data-line-number]:before { - content: attr(data-line-number); + content: attr(data-line-number); } /* additional styles for typeahead.js-bootstrap.css */ diff --git a/extensions/gii/generators/extension/default/composer.json b/extensions/gii/generators/extension/default/composer.json index 941a9a5..f12ca23 100644 --- a/extensions/gii/generators/extension/default/composer.json +++ b/extensions/gii/generators/extension/default/composer.json @@ -1,18 +1,18 @@ { - "name": "vendorName ?>/packageName ?>", - "description": "description ?>", - "type": "type ?>", - "keywords": keywordsArrayJson ?>, - "license": "license ?>", - "authors": [ - { - "name": "authorName ?>", - "email": "authorEmail ?>" - } - ], - "autoload": { - "psr-4": { - "namespace) ?>": "" - } - } + "name": "vendorName ?>/packageName ?>", + "description": "description ?>", + "type": "type ?>", + "keywords": keywordsArrayJson ?>, + "license": "license ?>", + "authors": [ + { + "name": "authorName ?>", + "email": "authorEmail ?>" + } + ], + "autoload": { + "psr-4": { + "namespace) ?>": "" + } + } } diff --git a/extensions/imagine/composer.json b/extensions/imagine/composer.json index 84f227c..e4ec8ec 100644 --- a/extensions/imagine/composer.json +++ b/extensions/imagine/composer.json @@ -1,29 +1,29 @@ { - "name": "yiisoft/yii2-imagine", - "description": "The Imagine integration for the Yii framework", - "keywords": ["yii2", "imagine", "image", "helper"], - "type": "yii2-extension", - "license": "BSD-3-Clause", - "support": { - "issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Aimagine", - "forum": "http://www.yiiframework.com/forum/", - "wiki": "http://www.yiiframework.com/wiki/", - "irc": "irc://irc.freenode.net/yii", - "source": "https://github.com/yiisoft/yii2" - }, - "authors": [ - { - "name": "Antonio Ramirez", - "email": "amigo.cobos@gmail.com" - } - ], - "require": { - "yiisoft/yii2": "*", - "imagine/imagine": "v0.5.0" - }, - "autoload": { - "psr-4": { - "yii\\imagine\\": "" - } - } + "name": "yiisoft/yii2-imagine", + "description": "The Imagine integration for the Yii framework", + "keywords": ["yii2", "imagine", "image", "helper"], + "type": "yii2-extension", + "license": "BSD-3-Clause", + "support": { + "issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Aimagine", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2" + }, + "authors": [ + { + "name": "Antonio Ramirez", + "email": "amigo.cobos@gmail.com" + } + ], + "require": { + "yiisoft/yii2": "*", + "imagine/imagine": "v0.5.0" + }, + "autoload": { + "psr-4": { + "yii\\imagine\\": "" + } + } } diff --git a/extensions/mongodb/README.md b/extensions/mongodb/README.md index fd43960..4ce2832 100644 --- a/extensions/mongodb/README.md +++ b/extensions/mongodb/README.md @@ -33,13 +33,13 @@ To use this extension, simply add the following code in your application configu ```php return [ - //.... - 'components' => [ - 'mongodb' => [ - 'class' => '\yii\mongodb\Connection', - 'dsn' => 'mongodb://developer:password@localhost:27017/mydatabase', - ], - ], + //.... + 'components' => [ + 'mongodb' => [ + 'class' => '\yii\mongodb\Connection', + 'dsn' => 'mongodb://developer:password@localhost:27017/mydatabase', + ], + ], ]; ``` @@ -59,8 +59,8 @@ use yii\mongodb\Query; $query = new Query; // compose the query $query->select(['name', 'status']) - ->from('customer') - ->limit(10); + ->from('customer') + ->limit(10); // execute the query $rows = $query->all(); ``` @@ -103,17 +103,17 @@ use yii\mongodb\Query; class ItemController extends Controller { - /** - * @param string $id MongoId string (not object) - */ - public function actionUpdate($id) - { - $query = new Query; - $row = $query->from('item') - where(['_id' => $id]) // implicit typecast to [[\MongoId]] - ->one(); - ... - } + /** + * @param string $id MongoId string (not object) + */ + public function actionUpdate($id) + { + $query = new Query; + $row = $query->from('item') + where(['_id' => $id]) // implicit typecast to [[\MongoId]] + ->one(); + ... + } } ``` @@ -133,21 +133,21 @@ use yii\mongodb\ActiveRecord; class Customer extends ActiveRecord { - /** - * @return string the name of the index associated with this ActiveRecord class. - */ - public static function collectionName() - { - return 'customer'; - } - - /** - * @return array list of attribute names. - */ - public function attributes() - { - return ['_id', 'name', 'email', 'address', 'status']; - } + /** + * @return string the name of the index associated with this ActiveRecord class. + */ + public static function collectionName() + { + return 'customer'; + } + + /** + * @return array list of attribute names. + */ + public function attributes() + { + return ['_id', 'name', 'email', 'address', 'status']; + } } ``` @@ -162,10 +162,10 @@ use yii\mongodb\Query; $query = new Query; $query->from('customer')->where(['status' => 2]); $provider = new ActiveDataProvider([ - 'query' => $query, - 'pagination' => [ - 'pageSize' => 10, - ] + 'query' => $query, + 'pagination' => [ + 'pageSize' => 10, + ] ]); $models = $provider->getModels(); ``` @@ -175,10 +175,10 @@ use yii\data\ActiveDataProvider; use app\models\Customer; $provider = new ActiveDataProvider([ - 'query' => Customer::find(), - 'pagination' => [ - 'pageSize' => 10, - ] + 'query' => Customer::find(), + 'pagination' => [ + 'pageSize' => 10, + ] ]); $models = $provider->getModels(); ``` @@ -193,11 +193,11 @@ For example: instead of: ``` { - content: "some content", - author: { - name: author1, - email: author1@domain.com - } + content: "some content", + author: { + name: author1, + email: author1@domain.com + } } ``` @@ -205,9 +205,9 @@ use following: ``` { - content: "some content", - author_name: author1, - author_email: author1@domain.com + content: "some content", + author_name: author1, + author_email: author1@domain.com } ``` @@ -231,13 +231,13 @@ you also have to configure the `cache` component to be `yii\mongodb\Cache`: ```php return [ - //.... - 'components' => [ - // ... - 'cache' => [ - 'class' => 'yii\mongodb\Cache', - ], - ] + //.... + 'components' => [ + // ... + 'cache' => [ + 'class' => 'yii\mongodb\Cache', + ], + ] ]; ``` @@ -250,12 +250,12 @@ you also have to configure the `session` component to be `yii\mongodb\Session`: ```php return [ - //.... - 'components' => [ - // ... - 'session' => [ - 'class' => 'yii\mongodb\Session', - ], - ] + //.... + 'components' => [ + // ... + 'session' => [ + 'class' => 'yii\mongodb\Session', + ], + ] ]; ``` \ No newline at end of file diff --git a/extensions/redis/README.md b/extensions/redis/README.md index 931be61..0e76b00 100644 --- a/extensions/redis/README.md +++ b/extensions/redis/README.md @@ -9,15 +9,15 @@ To use this extension, you have to configure the Connection class in your applic ```php return [ - //.... - 'components' => [ + //.... + 'components' => [ 'redis' => [ 'class' => 'yii\redis\Connection', 'hostname' => 'localhost', 'port' => 6379, 'database' => 0, ], - ] + ] ]; ``` @@ -54,13 +54,13 @@ you also have to configure the `cache` component to be `yii\redis\Cache`: ```php return [ - //.... - 'components' => [ - // ... - 'cache' => [ - 'class' => 'yii\redis\Cache', - ], - ] + //.... + 'components' => [ + // ... + 'cache' => [ + 'class' => 'yii\redis\Cache', + ], + ] ]; ``` @@ -69,18 +69,18 @@ cache component (no connection application component needs to be configured in t ```php return [ - //.... - 'components' => [ - // ... - 'cache' => [ - 'class' => 'yii\redis\Cache', - 'redis' => [ - 'hostname' => 'localhost', - 'port' => 6379, - 'database' => 0, - ], - ], - ] + //.... + 'components' => [ + // ... + 'cache' => [ + 'class' => 'yii\redis\Cache', + 'redis' => [ + 'hostname' => 'localhost', + 'port' => 6379, + 'database' => 0, + ], + ], + ] ]; ``` @@ -92,13 +92,13 @@ you also have to configure the `session` component to be `yii\redis\Session`: ```php return [ - //.... - 'components' => [ - // ... - 'session' => [ - 'class' => 'yii\redis\Session', - ], - ] + //.... + 'components' => [ + // ... + 'session' => [ + 'class' => 'yii\redis\Session', + ], + ] ]; ``` @@ -107,18 +107,18 @@ cache component (no connection application component needs to be configured in t ```php return [ - //.... - 'components' => [ - // ... - 'session' => [ - 'class' => 'yii\redis\Session', - 'redis' => [ - 'hostname' => 'localhost', - 'port' => 6379, - 'database' => 0, - ], - ], - ] + //.... + 'components' => [ + // ... + 'session' => [ + 'class' => 'yii\redis\Session', + 'redis' => [ + 'hostname' => 'localhost', + 'port' => 6379, + 'database' => 0, + ], + ], + ] ]; ``` @@ -139,29 +139,29 @@ The following is an example model called `Customer`: ```php class Customer extends \yii\redis\ActiveRecord { - /** - * @return array the list of attributes for this record - */ - public function attributes() - { - return ['id', 'name', 'address', 'registration_date']; - } - - /** - * @return ActiveQuery defines a relation to the Order record (can be in other database, e.g. elasticsearch or sql) - */ - public function getOrders() - { - return $this->hasMany(Order::className(), ['customer_id' => 'id']); - } - - /** - * Defines a scope that modifies the `$query` to return only active(status = 1) customers - */ - public static function active($query) - { - $query->andWhere(['status' => 1]); - } + /** + * @return array the list of attributes for this record + */ + public function attributes() + { + return ['id', 'name', 'address', 'registration_date']; + } + + /** + * @return ActiveQuery defines a relation to the Order record (can be in other database, e.g. elasticsearch or sql) + */ + public function getOrders() + { + return $this->hasMany(Order::className(), ['customer_id' => 'id']); + } + + /** + * Defines a scope that modifies the `$query` to return only active(status = 1) customers + */ + public static function active($query) + { + $query->andWhere(['status' => 1]); + } } ``` diff --git a/extensions/smarty/README.md b/extensions/smarty/README.md index 3aaf449..d13f609 100644 --- a/extensions/smarty/README.md +++ b/extensions/smarty/README.md @@ -7,17 +7,17 @@ To use this extension, simply add the following code in your application configu ```php return [ - //.... - 'components' => [ - 'view' => [ - 'renderers' => [ - 'tpl' => [ - 'class' => 'yii\smarty\ViewRenderer', - //'cachePath' => '@runtime/Smarty/cache', - ], - ], - ], - ], + //.... + 'components' => [ + 'view' => [ + 'renderers' => [ + 'tpl' => [ + 'class' => 'yii\smarty\ViewRenderer', + //'cachePath' => '@runtime/Smarty/cache', + ], + ], + ], + ], ]; ``` diff --git a/extensions/sphinx/README.md b/extensions/sphinx/README.md index 36e8afd..7634810 100644 --- a/extensions/sphinx/README.md +++ b/extensions/sphinx/README.md @@ -33,8 +33,8 @@ In order to setup Sphinx "searchd" to support MySQL protocol following configura ``` searchd { - listen = localhost:9306:mysql41 - ... + listen = localhost:9306:mysql41 + ... } ``` @@ -46,15 +46,15 @@ To use this extension, simply add the following code in your application configu ```php return [ - //.... - 'components' => [ - 'sphinx' => [ - 'class' => 'yii\sphinx\Connection', - 'dsn' => 'mysql:host=127.0.0.1;port=9306;', - 'username' => '', - 'password' => '', - ], - ], + //.... + 'components' => [ + 'sphinx' => [ + 'class' => 'yii\sphinx\Connection', + 'dsn' => 'mysql:host=127.0.0.1;port=9306;', + 'username' => '', + 'password' => '', + ], + ], ]; ``` @@ -67,13 +67,13 @@ use yii\sphinx\ActiveRecord; class Article extends ActiveRecord { - /** - * @return string the name of the index associated with this ActiveRecord class. - */ - public static function indexName() - { - return 'idx_article'; - } + /** + * @return string the name of the index associated with this ActiveRecord class. + */ + public static function indexName() + { + return 'idx_article'; + } } ``` @@ -86,10 +86,10 @@ use yii\sphinx\Query; $query = new Query; $query->from('yii2_test_article_index')->match('development'); $provider = new ActiveDataProvider([ - 'query' => $query, - 'pagination' => [ - 'pageSize' => 10, - ] + 'query' => $query, + 'pagination' => [ + 'pageSize' => 10, + ] ]); $models = $provider->getModels(); ``` @@ -99,10 +99,10 @@ use yii\data\ActiveDataProvider; use app\models\Article; $provider = new ActiveDataProvider([ - 'query' => Article::find(), - 'pagination' => [ - 'pageSize' => 10, - ] + 'query' => Article::find(), + 'pagination' => [ + 'pageSize' => 10, + ] ]); $models = $provider->getModels(); ``` diff --git a/extensions/swiftmailer/README.md b/extensions/swiftmailer/README.md index e21998d..fa987c8 100644 --- a/extensions/swiftmailer/README.md +++ b/extensions/swiftmailer/README.md @@ -7,12 +7,12 @@ To use this extension, simply add the following code in your application config ```php return [ - //.... - 'components' => [ - 'mail' => [ - 'class' => 'yii\swiftmailer\Mailer', - ], - ], + //.... + 'components' => [ + 'mail' => [ + 'class' => 'yii\swiftmailer\Mailer', + ], + ], ]; ``` diff --git a/framework/views/errorHandler/exception.php b/framework/views/errorHandler/exception.php index d0148c1..26bc05c 100644 --- a/framework/views/errorHandler/exception.php +++ b/framework/views/errorHandler/exception.php @@ -88,7 +88,7 @@ html,body{ line-height: 1.25; } .header pre{ - margin: 10px 0; + margin: 10px 0; } /* previous exceptions */ @@ -134,8 +134,8 @@ html,body{ color: #aaa; } .header .previous pre{ - font-size: 14px; - margin: 10px 0; + font-size: 14px; + margin: 10px 0; } /* call stack */ @@ -355,9 +355,9 @@ html,body{

htmlEncode($exception->getMessage())) ?>

- errorInfo)) { - echo '
Error Info: ' . print_r($exception->errorInfo, true) . '
'; - } ?> + errorInfo)) { + echo '
Error Info: ' . print_r($exception->errorInfo, true) . '
'; + } ?> renderPreviousExceptions($exception) ?>