Commit 83b80027 by Qiang Xue

Merge branch 'master' of git://github.com/yiisoft/yii2

parents a0d19e92 77368538
...@@ -9,6 +9,7 @@ namespace yii\build\controllers; ...@@ -9,6 +9,7 @@ namespace yii\build\controllers;
use Yii; use Yii;
use yii\console\Controller; use yii\console\Controller;
use yii\helpers\Console;
use yii\helpers\VarDumper; use yii\helpers\VarDumper;
/** /**
...@@ -33,7 +34,10 @@ class MimeTypeController extends Controller ...@@ -33,7 +34,10 @@ class MimeTypeController extends Controller
if ($outFile === null) { if ($outFile === null) {
$outFile = Yii::getAlias('@yii/helpers/mimeTypes.php'); $outFile = Yii::getAlias('@yii/helpers/mimeTypes.php');
} }
$this->stdout('downloading mime-type file from apache httpd repository...');
if ($content = file_get_contents('http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=co')) { if ($content = file_get_contents('http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=co')) {
$this->stdout("done.\n", Console::FG_GREEN);
$this->stdout("generating file $outFile...");
$mimeMap = []; $mimeMap = [];
foreach(explode("\n", $content) as $line) { foreach(explode("\n", $content) as $line) {
$line = trim($line); $line = trim($line);
...@@ -65,6 +69,7 @@ return $array; ...@@ -65,6 +69,7 @@ return $array;
EOD; EOD;
file_put_contents($outFile, $content); file_put_contents($outFile, $content);
$this->stdout("done.\n", Console::FG_GREEN);
} else { } else {
$this->stderr("Failed to download mime.types file from apache SVN.\n"); $this->stderr("Failed to download mime.types file from apache SVN.\n");
} }
......
...@@ -85,6 +85,7 @@ class PhpDocController extends Controller ...@@ -85,6 +85,7 @@ class PhpDocController extends Controller
$this->fixFileDoc($lines); $this->fixFileDoc($lines);
$this->fixDocBlockIndentation($lines); $this->fixDocBlockIndentation($lines);
$lines = array_values($this->fixLineSpacing($lines));
$newContent = implode("\n", $lines); $newContent = implode("\n", $lines);
if ($sha !== sha1($newContent)) { if ($sha !== sha1($newContent)) {
...@@ -163,6 +164,9 @@ class PhpDocController extends Controller ...@@ -163,6 +164,9 @@ class PhpDocController extends Controller
return FileHelper::findFiles($root, $options); return FileHelper::findFiles($root, $options);
} }
/**
* Fix file PHPdoc
*/
protected function fixFileDoc(&$lines) protected function fixFileDoc(&$lines)
{ {
// find namespace // find namespace
...@@ -170,14 +174,17 @@ class PhpDocController extends Controller ...@@ -170,14 +174,17 @@ class PhpDocController extends Controller
$namespaceLine = ''; $namespaceLine = '';
$contentAfterNamespace = false; $contentAfterNamespace = false;
foreach($lines as $i => $line) { foreach($lines as $i => $line) {
if (substr_compare(trim($line), 'namespace', 0, 9) === 0) { $line = trim($line);
if (!empty($line)) {
if (strncmp($line, 'namespace', 9) === 0) {
$namespace = $i; $namespace = $i;
$namespaceLine = trim($line); $namespaceLine = $line;
} elseif ($namespace !== false && trim($line) !== '') { } elseif ($namespace !== false) {
$contentAfterNamespace = $i; $contentAfterNamespace = $i;
break; break;
} }
} }
}
if ($namespace !== false && $contentAfterNamespace !== false) { if ($namespace !== false && $contentAfterNamespace !== false) {
while($contentAfterNamespace > 0) { while($contentAfterNamespace > 0) {
...@@ -254,6 +261,116 @@ class PhpDocController extends Controller ...@@ -254,6 +261,116 @@ class PhpDocController extends Controller
} }
} }
/**
* Fixes line spacing code style for properties and constants
*/
protected function fixLineSpacing($lines)
{
$propertiesOnly = false;
// remove blank lines between properties
$skip = true;
foreach($lines as $i => $line) {
if (strpos($line, 'class ') !== false) {
$skip = false;
}
if ($skip) {
continue;
}
if (trim($line) === '') {
unset($lines[$i]);
} elseif (ltrim($line)[0] !== '*' && strpos($line, 'function ') !== false) {
break;
} elseif (trim($line) === '}') {
$propertiesOnly = true;
break;
}
}
$lines = array_values($lines);
// add back some
$endofUse = false;
$endofConst = false;
$endofPublic = false;
$endofProtected = false;
$endofPrivate = false;
$skip = true;
$level = 0; // track array properties
$property = '';
foreach($lines as $i => $line) {
if (strpos($line, 'class ') !== false) {
$skip = false;
}
if ($skip) {
continue;
}
// check for multi line array
if ($level > 0) {
${'endof'.$property} = $i;
}
$line = trim($line);
if (strncmp($line, 'public $', 8) === 0 || strncmp($line, 'public static $', 15) === 0) {
$endofPublic = $i;
$property = 'Public';
$level = 0;
} elseif (strncmp($line, 'protected $', 11) === 0 || strncmp($line, 'protected static $', 18) === 0) {
$endofProtected = $i;
$property = 'Protected';
$level = 0;
} elseif (strncmp($line, 'private $', 9) === 0 || strncmp($line, 'private static $', 16) === 0) {
$endofPrivate = $i;
$property = 'Private';
$level = 0;
} elseif (substr($line,0 , 6) === 'const ') {
$endofConst = $i;
$property = false;
} elseif (substr($line,0 , 4) === 'use ') {
$endofUse = $i;
$property = false;
} elseif (!empty($line) && $line[0] === '*') {
$property = false;
} elseif (!empty($line) && $line[0] !== '*' && strpos($line, 'function ') !== false || $line === '}') {
break;
}
// check for multi line array
if ($property !== false && strncmp($line, "'SQLSTATE[", 10) !== 0) {
$level += substr_count($line, '[') - substr_count($line, ']');
}
}
$endofAll = false;
foreach(['Private', 'Protected', 'Public', 'Const', 'Use'] as $var) {
if (${'endof'.$var} !== false) {
$endofAll = ${'endof'.$var};
break;
}
}
// $this->checkPropertyOrder($lineInfo);
$result = [];
foreach($lines as $i => $line) {
$result[] = $line;
if (!($propertiesOnly && $i === $endofAll)) {
if ($i === $endofUse || $i === $endofConst || $i === $endofPublic ||
$i === $endofProtected || $i === $endofPrivate) {
$result[] = '';
}
if ($i === $endofAll) {
$result[] = '';
}
}
}
return $result;
}
protected function checkPropertyOrder($lineInfo)
{
// TODO
}
protected function updateClassPropertyDocs($file, $className, $propertyDoc) protected function updateClassPropertyDocs($file, $className, $propertyDoc)
{ {
$ref = new \ReflectionClass($className); $ref = new \ReflectionClass($className);
...@@ -275,13 +392,15 @@ class PhpDocController extends Controller ...@@ -275,13 +392,15 @@ class PhpDocController extends Controller
// TODO move these checks to different action // TODO move these checks to different action
$lines = explode("\n", $newDoc); $lines = explode("\n", $newDoc);
if (trim($lines[1]) == '*' || substr_compare(trim($lines[1]), '* @', 0, 3) === 0) { $firstLine = trim($lines[1]);
if ($firstLine === '*' || strncmp($firstLine, '* @', 3) === 0) {
$this->stderr("[WARN] Class $className has no short description.\n", Console::FG_YELLOW, Console::BOLD); $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_compare(trim($line), '* @since ', 0, 9) === 0) { $line = trim($line);
if (strncmp($line, '* @since ', 9) === 0) {
$seenSince = true; $seenSince = true;
} elseif (substr_compare(trim($line), '* @author ', 0, 10) === 0) { } elseif (strncmp($line, '* @author ', 10) === 0) {
$seenAuthor = true; $seenAuthor = true;
} }
} }
...@@ -350,13 +469,14 @@ class PhpDocController extends Controller ...@@ -350,13 +469,14 @@ class PhpDocController extends Controller
$propertyPart = false; $propertyPart = false;
$propertyPosition = false; $propertyPosition = false;
foreach ($lines as $i => $line) { foreach ($lines as $i => $line) {
if (substr_compare(trim($line), '* @property ', 0, 12) === 0) { $line = trim($line);
if (strncmp($line, '* @property ', 12) === 0) {
$propertyPart = true; $propertyPart = true;
} elseif ($propertyPart && trim($line) == '*') { } elseif ($propertyPart && $line == '*') {
$propertyPosition = $i; $propertyPosition = $i;
$propertyPart = false; $propertyPart = false;
} }
if (substr_compare(trim($line), '* @author ', 0, 10) === 0 && $propertyPosition === false) { if (strncmp($line, '* @author ', 10) === 0 && $propertyPosition === false) {
$propertyPosition = $i - 1; $propertyPosition = $i - 1;
$propertyPart = false; $propertyPart = false;
} }
......
...@@ -20,7 +20,7 @@ All Rights Reserved. ...@@ -20,7 +20,7 @@ All Rights Reserved.
* [Встановлення Yii](start-installation.md) * [Встановлення Yii](start-installation.md)
* [Запуск додатка](start-workflow.md) * [Запуск додатка](start-workflow.md)
* [Говоримо «привіт»](start-hello.md) * [Говоримо «Привіт»](start-hello.md)
* [Робота з формами](start-forms.md) * [Робота з формами](start-forms.md)
* [Робота з базами даних](start-databases.md) * [Робота з базами даних](start-databases.md)
* [Генерація коду за допомогою Gii](start-gii.md) * [Генерація коду за допомогою Gii](start-gii.md)
......
Запуск додатка
====================
Після встановлення Yii, базовий додаток буде доступний або по URL `http://hostname/basic/web/index.php`, або по `http://hostname/index.php`, в залежності від налаштування Web сервера. Даний розділ - загальне введення в організацію коду, вбудований функціонал і опрацювання звернень додатком Yii.
> Інформація: Далі, в даному посібнику передбачається що Yii встановлений в теку `basic/web`, яка, в свою чергу, встановлена як коренева директорія в налаштуваннях Web сервера. В результаті, звернувшись по URL `http://hostname/index.php` ви отримаєте доступ до додатку, розміщенному в `basic/web`. Детальніше з процесом початкового налаштування можна ознайомитись в розділі [Встановлення Yii](start-installation.md).
Функціонал <a name="functionality"></a>
---------------
Вбудований шаблон простого додатку складається з чотирьох сторінок:
* домашня сторінка, відображається при переході по URL `http://hostname/index.php`
* "About" ("Про нас")
* на сторінці "Contact" знаходиться форма зворотнього зв’язку, на якій користувач може звернутися до розробника по e-mail
* на сторінці "Login" відображається форма авторизації. Спробуйте авторизуватись з логіном/паролем "admin/admin". Зверніть увагу на зміну розділу "Login" в головному меню на "Logout".
Ці сторінки використовують суміжний хедер (шапка сайта) і футер (підвал). В "шапці" знаходиться головне меню, за допомогою якого користувач переміщається по сайту. В "підвалі" - копірайт і загальна інформація.
В самій верхній частині вікна ви будете бачити системні повідомлення Yii - журнал, відлагоджувальну інформацію, повідомлення про помилки, запити до бази даних і т.п. Відображенням данної інформацію керує [вбудований відладчик](tool-debugger.md), він записує і відображає інформацію про хід виконання додатку.
Структура додатка Yii <a name="application-structure"></a>
---------------------
Нижще наведений перелік основних директорій і файлів вашого додатку (вважаєм, що додаток встановлений в директорію `basic`):
```
basic/ кореневий каталог додатка
composer.json використовується Composer'ом, містить опис додатку
config/ конфігураційні файли
console.php конфігурація консольного додатка
web.php конфігурація Web додатка
commands/ містить класи консольних команд
controllers/ контролери
models/ моделі
runtime/ файли, які генерує Yii під час виконання додатку (логи, кеш і т.п.)
vendor/ містить пакунки Composer'а і, власне, сам фреймворк Yii
views/ представлення додатку
web/ коренева директорія Web додатку. Містить файли, доступні через Web
assets/ скрипти, які використовуються додатком (js, css)
index.php місце входження в додаток Yii. З нього розпочинається виконання додатку
yii скрипт виконання консольного додатку Yii
```
В цілому, додаток Yii можна розділити на дві категорії файлів: розміщенні в `basic/web` і розміщенні в інших директоріях. Перша категорія доступна через Web (наприклад, браузером), друга недоступна зовні та і не повинна бути так як містить службову інформацію.
В Yii реалізована схема проектування [модель-представлення-контролер (MVC)](http://http://uk.wikipedia.org/wiki/Model-View-Controller),
яка відповідає структурі директорій додатка. В директорії `models` знаходяться [Моделі](structure-models.md),
в `views` розміщені [Представлення](structure-views.md), а в каталозі `controllers` всі [Контролери](structure-controllers.md) додатка.
Діаграма нижче демонструє внутрішню будову додатка.
![внутрішня будова додатка](../guide/images/application-structure.png)
В кожному додатку Yii є місце входження в додаток, `web/index.php` це єдиний PHP-скрипт доступний для виконання через Web. Він отримує вхідний запит і створює екземпляр [додатку](structure-applications.md).
[Додаток](structure-applications.md) опрацьовує вхідні запити з допомогою [компонентів](concept-components.md) і відправляє запит контролеру. [Віджети](structure-widgets.md) використовуються у [Представленнях](structure-views.md) для побудови динамічних інтерфейсів сайта.
Життєвий цикл запиту користувача <a name="request-lifecycle"></a>
-----------------
На діаграмі показано як додаток опрацьовує запит.
![Життєвий цикл запиту](../guide/images/application-lifecycle.png)
1. Користувач звертається до [місця входження](structure-entry-scripts.md) `web/index.php`.
2. Скрипт завантажує конфігурацію [configuration](concept-configurations.md) і створює екземпляр [додатку](structure-applications.md) для наступного опрацювання запиту.
3. Додаток визначає [маршрут](runtime-routing.md) запиту за допомогою компонента додатка [запит](runtime-requests.md).
4. Додаток створює екземпляр [контролера](structure-controllers.md) для виконання запиту.
5. Контролер, в свою чергу, створює [подію](structure-controllers.md) і накладає на неї фільтри.
6. Якщо хоч один фільтр поверне помилку - виконання додатку зупиняється.
7. Якщо всі фільтри пройдені - додаток виконується.
8. Подія завантажує модель даних. Скоріше за все із бази даних.
9. Подія генерує представлення, відображаючи в ньому дані (в т.ч. і отримані із моделі).
10. Згенерований вид додатку передається як компонент [відповідь](runtime-responses.md).
11. Компонент "відповідь" відправляє готовий результат роботи додатку браузеру користувача.
...@@ -151,7 +151,7 @@ For example, ...@@ -151,7 +151,7 @@ For example,
During the bootstrapping process, each component will be instantiated. If the component class During the bootstrapping process, each component will be instantiated. If the component class
implements [[yii\base\BootstrapInterface]], its [[yii\base\BootstrapInterface::bootstrap()|bootstrap()]] method implements [[yii\base\BootstrapInterface]], its [[yii\base\BootstrapInterface::bootstrap()|bootstrap()]] method
will be also be called. will also be called.
Another practical example is in the application configuration for the [Basic Application Template](start-installation.md), Another practical example is in the application configuration for the [Basic Application Template](start-installation.md),
where the `debug` and `gii` modules are configured as bootstrapping components when the application is running where the `debug` and `gii` modules are configured as bootstrapping components when the application is running
...@@ -391,11 +391,11 @@ does not specify one. The route may consist of child module ID, controller ID, a ...@@ -391,11 +391,11 @@ does not specify one. The route may consist of child module ID, controller ID, a
For example, `help`, `post/create`, `admin/post/create`. If action ID is not given, it will take the default For example, `help`, `post/create`, `admin/post/create`. If action ID is not given, it will take the default
value as specified in [[yii\base\Controller::defaultAction]]. value as specified in [[yii\base\Controller::defaultAction]].
For [yii\web\Application|Web applications], the default value of this property is `'site'`, which means For [[yii\web\Application|Web applications]], the default value of this property is `'site'`, which means
the `SiteController` controller and its default action should be used. As a result, if you access the `SiteController` controller and its default action should be used. As a result, if you access
the application without specifying a route, it will show the result of `app\controllers\SiteController::actionIndex()`. the application without specifying a route, it will show the result of `app\controllers\SiteController::actionIndex()`.
For [yii\console\Application|console applications], the default value is `'help'`, which means the core command For [[yii\console\Application|console applications]], the default value is `'help'`, which means the core command
[[yii\console\controllers\HelpController::actionIndex()]] should be used. As a result, if you run the command `yii` [[yii\console\controllers\HelpController::actionIndex()]] should be used. As a result, if you run the command `yii`
without providing any arguments, it will display the help information. without providing any arguments, it will display the help information.
...@@ -556,7 +556,7 @@ For example, ...@@ -556,7 +556,7 @@ For example,
``` ```
Note that the same `beforeAction` event is also triggered by [modules](structure-modules.md) Note that the same `beforeAction` event is also triggered by [modules](structure-modules.md)
and [controllers)(structure-controllers.md). Application objects are the first ones and [controllers](structure-controllers.md). Application objects are the first ones
triggering this event, followed by modules (if any), and finally controllers. If an event handler triggering this event, followed by modules (if any), and finally controllers. If an event handler
sets [[yii\base\ActionEvent::isValid]] to be `false`, all the following events will NOT be triggered. sets [[yii\base\ActionEvent::isValid]] to be `false`, all the following events will NOT be triggered.
...@@ -582,7 +582,7 @@ For example, ...@@ -582,7 +582,7 @@ For example,
``` ```
Note that the same `afterAction` event is also triggered by [modules](structure-modules.md) Note that the same `afterAction` event is also triggered by [modules](structure-modules.md)
and [controllers)(structure-controllers.md). These objects trigger this event in the reverse order and [controllers](structure-controllers.md). These objects trigger this event in the reverse order
as for that of `beforeAction`. That is, controllers are the first objects triggering this event, as for that of `beforeAction`. That is, controllers are the first objects triggering this event,
followed by modules (if any), and finally applications. followed by modules (if any), and finally applications.
......
...@@ -28,8 +28,8 @@ class ApiController extends BaseController ...@@ -28,8 +28,8 @@ class ApiController extends BaseController
*/ */
public $guide; public $guide;
// TODO add force update option
// TODO add force update option
/** /**
* Renders API documentation files * Renders API documentation files
* @param array $sourceDirs * @param array $sourceDirs
......
...@@ -28,6 +28,7 @@ class GuideController extends BaseController ...@@ -28,6 +28,7 @@ class GuideController extends BaseController
*/ */
public $apiDocs; public $apiDocs;
/** /**
* Renders API documentation files * Renders API documentation files
* @param array $sourceDirs * @param array $sourceDirs
......
...@@ -30,6 +30,7 @@ abstract class BaseController extends Controller ...@@ -30,6 +30,7 @@ abstract class BaseController extends Controller
*/ */
public $exclude; public $exclude;
protected function normalizeTargetDir($target) protected function normalizeTargetDir($target)
{ {
$target = rtrim(Yii::getAlias($target), '\\/'); $target = rtrim(Yii::getAlias($target), '\\/');
......
<?php <?php
/** /**
* * @link http://www.yiiframework.com/
* * @copyright Copyright (c) 2008 Yii Software LLC
* @author Carsten Brandt <mail@cebe.cc> * @license http://www.yiiframework.com/license/
*/ */
namespace yii\apidoc\helpers; namespace yii\apidoc\helpers;
use cebe\jssearch\Indexer; use cebe\jssearch\Indexer;
use cebe\jssearch\tokenizer\StandardTokenizer; use cebe\jssearch\tokenizer\StandardTokenizer;
use cebe\jssearch\TokenizerInterface; use cebe\jssearch\TokenizerInterface;
......
...@@ -31,6 +31,7 @@ class ApiMarkdown extends GithubMarkdown ...@@ -31,6 +31,7 @@ class ApiMarkdown extends GithubMarkdown
protected $renderingContext; protected $renderingContext;
/** /**
* Renders a code block * Renders a code block
*/ */
......
...@@ -29,6 +29,7 @@ class ApiMarkdownLaTeX extends GithubMarkdown ...@@ -29,6 +29,7 @@ class ApiMarkdownLaTeX extends GithubMarkdown
protected $renderingContext; protected $renderingContext;
protected function inlineMarkers() protected function inlineMarkers()
{ {
return array_merge(parent::inlineMarkers(), [ return array_merge(parent::inlineMarkers(), [
......
...@@ -17,6 +17,7 @@ class IndexFileAnalyzer extends Markdown ...@@ -17,6 +17,7 @@ class IndexFileAnalyzer extends Markdown
private $_chapter = 0; private $_chapter = 0;
private $_chapters = []; private $_chapters = [];
public function analyze($text) public function analyze($text)
{ {
$this->parse($text); $this->parse($text);
......
...@@ -24,24 +24,21 @@ class BaseDoc extends Object ...@@ -24,24 +24,21 @@ class BaseDoc extends Object
* @var \phpDocumentor\Reflection\DocBlock\Context * @var \phpDocumentor\Reflection\DocBlock\Context
*/ */
public $phpDocContext; public $phpDocContext;
public $name; public $name;
public $sourceFile; public $sourceFile;
public $startLine; public $startLine;
public $endLine; public $endLine;
public $shortDescription; public $shortDescription;
public $description; public $description;
public $since; public $since;
public $deprecatedSince; public $deprecatedSince;
public $deprecatedReason; public $deprecatedReason;
/** /**
* @var \phpDocumentor\Reflection\DocBlock\Tag[] * @var \phpDocumentor\Reflection\DocBlock\Tag[]
*/ */
public $tags = []; public $tags = [];
public function hasTag($name) public function hasTag($name)
{ {
foreach ($this->tags as $tag) { foreach ($this->tags as $tag) {
......
...@@ -18,10 +18,8 @@ namespace yii\apidoc\models; ...@@ -18,10 +18,8 @@ namespace yii\apidoc\models;
class ClassDoc extends TypeDoc class ClassDoc extends TypeDoc
{ {
public $parentClass; public $parentClass;
public $isAbstract; public $isAbstract;
public $isFinal; public $isFinal;
/** /**
* @var string[] * @var string[]
*/ */
...@@ -29,7 +27,6 @@ class ClassDoc extends TypeDoc ...@@ -29,7 +27,6 @@ class ClassDoc extends TypeDoc
public $traits = []; public $traits = [];
// will be set by Context::updateReferences() // will be set by Context::updateReferences()
public $subclasses = []; public $subclasses = [];
/** /**
* @var EventDoc[] * @var EventDoc[]
*/ */
...@@ -39,6 +36,7 @@ class ClassDoc extends TypeDoc ...@@ -39,6 +36,7 @@ class ClassDoc extends TypeDoc
*/ */
public $constants = []; public $constants = [];
public function findSubject($subjectName) public function findSubject($subjectName)
{ {
if (($subject = parent::findSubject($subjectName)) !== null) { if (($subject = parent::findSubject($subjectName)) !== null) {
......
...@@ -18,6 +18,7 @@ class ConstDoc extends BaseDoc ...@@ -18,6 +18,7 @@ class ConstDoc extends BaseDoc
public $definedBy; public $definedBy;
public $value; public $value;
/** /**
* @param \phpDocumentor\Reflection\ClassReflector\ConstantReflector $reflector * @param \phpDocumentor\Reflection\ClassReflector\ConstantReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -33,9 +33,9 @@ class Context extends Component ...@@ -33,9 +33,9 @@ class Context extends Component
* @var TraitDoc[] * @var TraitDoc[]
*/ */
public $traits = []; public $traits = [];
public $errors = []; public $errors = [];
public function getType($type) public function getType($type)
{ {
$type = ltrim($type, '\\'); $type = ltrim($type, '\\');
......
...@@ -20,6 +20,7 @@ class EventDoc extends ConstDoc ...@@ -20,6 +20,7 @@ class EventDoc extends ConstDoc
public $type; public $type;
public $types; public $types;
/** /**
* @param \phpDocumentor\Reflection\ClassReflector\ConstantReflector $reflector * @param \phpDocumentor\Reflection\ClassReflector\ConstantReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -30,6 +30,7 @@ class FunctionDoc extends BaseDoc ...@@ -30,6 +30,7 @@ class FunctionDoc extends BaseDoc
public $returnTypes; public $returnTypes;
public $isReturnByReference; public $isReturnByReference;
/** /**
* @param \phpDocumentor\Reflection\FunctionReflector $reflector * @param \phpDocumentor\Reflection\FunctionReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -16,10 +16,10 @@ namespace yii\apidoc\models; ...@@ -16,10 +16,10 @@ namespace yii\apidoc\models;
class InterfaceDoc extends TypeDoc class InterfaceDoc extends TypeDoc
{ {
public $parentInterfaces = []; public $parentInterfaces = [];
// will be set by Context::updateReferences() // will be set by Context::updateReferences()
public $implementedBy = []; public $implementedBy = [];
/** /**
* @param \phpDocumentor\Reflection\InterfaceReflector $reflector * @param \phpDocumentor\Reflection\InterfaceReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -17,14 +17,12 @@ class MethodDoc extends FunctionDoc ...@@ -17,14 +17,12 @@ class MethodDoc extends FunctionDoc
{ {
public $isAbstract; public $isAbstract;
public $isFinal; public $isFinal;
public $isStatic; public $isStatic;
public $visibility; public $visibility;
// will be set by creating class // will be set by creating class
public $definedBy; public $definedBy;
/** /**
* @param \phpDocumentor\Reflection\ClassReflector\MethodReflector $reflector * @param \phpDocumentor\Reflection\ClassReflector\MethodReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -23,13 +23,13 @@ class ParamDoc extends Object ...@@ -23,13 +23,13 @@ class ParamDoc extends Object
public $isOptional; public $isOptional;
public $defaultValue; public $defaultValue;
public $isPassedByReference; public $isPassedByReference;
// will be set by creating class // will be set by creating class
public $description; public $description;
public $type; public $type;
public $types; public $types;
public $sourceFile; public $sourceFile;
/** /**
* @param \phpDocumentor\Reflection\FunctionReflector\ArgumentReflector $reflector * @param \phpDocumentor\Reflection\FunctionReflector\ArgumentReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -20,18 +20,16 @@ class PropertyDoc extends BaseDoc ...@@ -20,18 +20,16 @@ class PropertyDoc extends BaseDoc
{ {
public $visibility; public $visibility;
public $isStatic; public $isStatic;
public $type; public $type;
public $types; public $types;
public $defaultValue; public $defaultValue;
// will be set by creating class // will be set by creating class
public $getter; public $getter;
public $setter; public $setter;
// will be set by creating class // will be set by creating class
public $definedBy; public $definedBy;
public function getIsReadOnly() public function getIsReadOnly()
{ {
return $this->getter !== null && $this->setter === null; return $this->getter !== null && $this->setter === null;
......
...@@ -18,9 +18,9 @@ class TraitDoc extends TypeDoc ...@@ -18,9 +18,9 @@ class TraitDoc extends TypeDoc
// classes using the trait // classes using the trait
// will be set by Context::updateReferences() // will be set by Context::updateReferences()
public $usedBy = []; public $usedBy = [];
public $traits = []; public $traits = [];
/** /**
* @param \phpDocumentor\Reflection\TraitReflector $reflector * @param \phpDocumentor\Reflection\TraitReflector $reflector
* @param Context $context * @param Context $context
......
...@@ -34,9 +34,9 @@ class TypeDoc extends BaseDoc ...@@ -34,9 +34,9 @@ class TypeDoc extends BaseDoc
* @var PropertyDoc[] * @var PropertyDoc[]
*/ */
public $properties = []; public $properties = [];
public $namespace; public $namespace;
public function findSubject($subjectName) public function findSubject($subjectName)
{ {
if ($subjectName[0] != '$') { if ($subjectName[0] != '$') {
...@@ -46,7 +46,7 @@ class TypeDoc extends BaseDoc ...@@ -46,7 +46,7 @@ class TypeDoc extends BaseDoc
} }
} }
} }
if (substr_compare($subjectName, '()', -2, 2) === 0) { if (!empty($subjectName) && substr_compare($subjectName, '()', -2, 2) === 0) {
return null; return null;
} }
if ($this->properties === null) { if ($this->properties === null) {
......
...@@ -42,10 +42,10 @@ abstract class BaseRenderer extends Component ...@@ -42,10 +42,10 @@ abstract class BaseRenderer extends Component
* @var Controller the apidoc controller instance. Can be used to control output. * @var Controller the apidoc controller instance. Can be used to control output.
*/ */
public $controller; public $controller;
public $guideUrl; public $guideUrl;
public $guideReferences = []; public $guideReferences = [];
public function init() public function init()
{ {
ApiMarkdown::$renderer = $this; ApiMarkdown::$renderer = $this;
...@@ -72,7 +72,7 @@ abstract class BaseRenderer extends Component ...@@ -72,7 +72,7 @@ abstract class BaseRenderer extends Component
foreach ($types as $type) { foreach ($types as $type) {
$postfix = ''; $postfix = '';
if (is_string($type)) { if (is_string($type)) {
if (substr_compare($type, '[]', -2, 2) === 0) { if (!empty($type) && substr_compare($type, '[]', -2, 2) === 0) {
$postfix = '[]'; $postfix = '[]';
$type = substr($type, 0, -2); $type = substr($type, 0, -2);
} }
......
...@@ -24,6 +24,7 @@ class ApiRenderer extends \yii\apidoc\templates\html\ApiRenderer ...@@ -24,6 +24,7 @@ class ApiRenderer extends \yii\apidoc\templates\html\ApiRenderer
public $layout = '@yii/apidoc/templates/bootstrap/layouts/api.php'; public $layout = '@yii/apidoc/templates/bootstrap/layouts/api.php';
public $indexView = '@yii/apidoc/templates/bootstrap/views/index.php'; public $indexView = '@yii/apidoc/templates/bootstrap/views/index.php';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -23,6 +23,7 @@ class GuideRenderer extends \yii\apidoc\templates\html\GuideRenderer ...@@ -23,6 +23,7 @@ class GuideRenderer extends \yii\apidoc\templates\html\GuideRenderer
public $layout = '@yii/apidoc/templates/bootstrap/layouts/guide.php'; public $layout = '@yii/apidoc/templates/bootstrap/layouts/guide.php';
/** /**
* @inheritDoc * @inheritDoc
*/ */
......
...@@ -78,6 +78,7 @@ class SideNavWidget extends \yii\bootstrap\Widget ...@@ -78,6 +78,7 @@ class SideNavWidget extends \yii\bootstrap\Widget
*/ */
public $activeUrl; public $activeUrl;
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -46,12 +46,14 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface ...@@ -46,12 +46,14 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
* @var string path or alias of the view file to use for rendering the index page. * @var string path or alias of the view file to use for rendering the index page.
*/ */
public $indexView = '@yii/apidoc/templates/html/views/index.php'; public $indexView = '@yii/apidoc/templates/html/views/index.php';
/** /**
* @var View * @var View
*/ */
private $_view; private $_view;
private $_targetDir; private $_targetDir;
public function init() public function init()
{ {
parent::init(); parent::init();
......
...@@ -34,6 +34,7 @@ abstract class GuideRenderer extends BaseGuideRenderer ...@@ -34,6 +34,7 @@ abstract class GuideRenderer extends BaseGuideRenderer
private $_view; private $_view;
private $_targetDir; private $_targetDir;
public function init() public function init()
{ {
parent::init(); parent::init();
......
...@@ -23,10 +23,12 @@ if (empty($see)) { ...@@ -23,10 +23,12 @@ if (empty($see)) {
} else { } else {
echo '<p>See also:</p><ul>'; echo '<p>See also:</p><ul>';
foreach ($see as $ref) { foreach ($see as $ref) {
if (!empty($ref)) {
if (substr_compare($ref, '>', -1, 1)) { if (substr_compare($ref, '>', -1, 1)) {
$ref .= '.'; $ref .= '.';
} }
echo "<li>$ref</li>"; echo "<li>$ref</li>";
} }
}
echo '</ul>'; echo '</ul>';
} }
...@@ -20,9 +20,9 @@ class ApiRenderer extends \yii\apidoc\templates\html\ApiRenderer ...@@ -20,9 +20,9 @@ class ApiRenderer extends \yii\apidoc\templates\html\ApiRenderer
{ {
public $layout = false; public $layout = false;
public $indexView = '@yii/apidoc/templates/online/views/index.php'; public $indexView = '@yii/apidoc/templates/online/views/index.php';
public $pageTitle = 'Yii Framework 2.0 API Documentation'; public $pageTitle = 'Yii Framework 2.0 API Documentation';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -93,6 +93,8 @@ class AuthAction extends Action ...@@ -93,6 +93,8 @@ class AuthAction extends Action
* @var string the redirect url after unsuccessful authorization (e.g. user canceled). * @var string the redirect url after unsuccessful authorization (e.g. user canceled).
*/ */
private $_cancelUrl = ''; private $_cancelUrl = '';
/** /**
* @var string name or alias of the view file, which should be rendered in order to perform redirection. * @var string name or alias of the view file, which should be rendered in order to perform redirection.
* If not set default one will be used. * If not set default one will be used.
......
...@@ -58,6 +58,7 @@ abstract class BaseClient extends Component implements ClientInterface ...@@ -58,6 +58,7 @@ abstract class BaseClient extends Component implements ClientInterface
*/ */
private $_viewOptions; private $_viewOptions;
/** /**
* @param string $id service id. * @param string $id service id.
*/ */
......
...@@ -39,12 +39,6 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface ...@@ -39,12 +39,6 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface
*/ */
public $version = '1.0'; public $version = '1.0';
/** /**
* @var string URL, which user will be redirected after authentication at the OAuth provider web site.
* Note: this should be absolute URL (with http:// or https:// leading).
* By default current URL will be used.
*/
private $_returnUrl;
/**
* @var string API base URL. * @var string API base URL.
*/ */
public $apiBaseUrl; public $apiBaseUrl;
...@@ -56,6 +50,13 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface ...@@ -56,6 +50,13 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface
* @var string auth request scope. * @var string auth request scope.
*/ */
public $scope; public $scope;
/**
* @var string URL, which user will be redirected after authentication at the OAuth provider web site.
* Note: this should be absolute URL (with http:// or https:// leading).
* By default current URL will be used.
*/
private $_returnUrl;
/** /**
* @var array cURL request options. Option values from this field will overwrite corresponding * @var array cURL request options. Option values from this field will overwrite corresponding
* values from [[defaultCurlOptions()]]. * values from [[defaultCurlOptions()]].
...@@ -70,6 +71,7 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface ...@@ -70,6 +71,7 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface
*/ */
private $_signatureMethod = []; private $_signatureMethod = [];
/** /**
* @param string $returnUrl return URL * @param string $returnUrl return URL
*/ */
......
...@@ -47,6 +47,7 @@ class Collection extends Component ...@@ -47,6 +47,7 @@ class Collection extends Component
*/ */
private $_clients = []; private $_clients = [];
/** /**
* @param array $clients list of auth clients * @param array $clients list of auth clients
*/ */
......
...@@ -26,6 +26,7 @@ class InvalidResponseException extends Exception ...@@ -26,6 +26,7 @@ class InvalidResponseException extends Exception
*/ */
public $responseBody = ''; public $responseBody = '';
/** /**
* Constructor. * Constructor.
* @param array $responseHeaders response headers * @param array $responseHeaders response headers
......
...@@ -62,6 +62,7 @@ class OAuth1 extends BaseOAuth ...@@ -62,6 +62,7 @@ class OAuth1 extends BaseOAuth
*/ */
public $accessTokenMethod = 'GET'; public $accessTokenMethod = 'GET';
/** /**
* Fetches the OAuth request token. * Fetches the OAuth request token.
* @param array $params additional request params. * @param array $params additional request params.
......
...@@ -50,6 +50,7 @@ class OAuth2 extends BaseOAuth ...@@ -50,6 +50,7 @@ class OAuth2 extends BaseOAuth
*/ */
public $tokenUrl; public $tokenUrl;
/** /**
* Composes user authorization URL. * Composes user authorization URL.
* @param array $params additional auth GET params. * @param array $params additional auth GET params.
......
...@@ -43,6 +43,8 @@ class OAuthToken extends Object ...@@ -43,6 +43,8 @@ class OAuthToken extends Object
* @var array token parameters. * @var array token parameters.
*/ */
private $_params = []; private $_params = [];
/** /**
* @var integer object creation timestamp. * @var integer object creation timestamp.
*/ */
......
...@@ -68,7 +68,6 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -68,7 +68,6 @@ class OpenId extends BaseClient implements ClientInterface
* ~~~ * ~~~
*/ */
public $optionalAttributes = []; public $optionalAttributes = [];
/** /**
* @var boolean whether to verify the peer's certificate. * @var boolean whether to verify the peer's certificate.
*/ */
...@@ -83,7 +82,6 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -83,7 +82,6 @@ class OpenId extends BaseClient implements ClientInterface
* This value will take effect only if [[verifyPeer]] is set. * This value will take effect only if [[verifyPeer]] is set.
*/ */
public $cainfo; public $cainfo;
/** /**
* @var string authentication return URL. * @var string authentication return URL.
*/ */
...@@ -96,6 +94,8 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -96,6 +94,8 @@ class OpenId extends BaseClient implements ClientInterface
* @var string client trust root (realm), by default [[\yii\web\Request::hostInfo]] value will be used. * @var string client trust root (realm), by default [[\yii\web\Request::hostInfo]] value will be used.
*/ */
private $_trustRoot; private $_trustRoot;
/** /**
* @var array data, which should be used to retrieve the OpenID response. * @var array data, which should be used to retrieve the OpenID response.
* If not set combination of GET and POST will be used. * If not set combination of GET and POST will be used.
...@@ -761,7 +761,7 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -761,7 +761,7 @@ class OpenId extends BaseClient implements ClientInterface
} else { } else {
// 'ax' prefix is either undefined, or points to another extension, so we search for another prefix // 'ax' prefix is either undefined, or points to another extension, so we search for another prefix
foreach ($this->data as $key => $value) { foreach ($this->data as $key => $value) {
if (substr_compare($key, 'openid_ns_', 0, 10) === 0 && $value == 'http://openid.net/srv/ax/1.0') { if (strncmp($key, 'openid_ns_', 10) === 0 && $value == 'http://openid.net/srv/ax/1.0') {
$alias = substr($key, strlen('openid_ns_')); $alias = substr($key, strlen('openid_ns_'));
break; break;
} }
...@@ -775,7 +775,7 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -775,7 +775,7 @@ class OpenId extends BaseClient implements ClientInterface
$attributes = []; $attributes = [];
foreach ($this->data as $key => $value) { foreach ($this->data as $key => $value) {
$keyMatch = 'openid_' . $alias . '_value_'; $keyMatch = 'openid_' . $alias . '_value_';
if (substr_compare($key, $keyMatch, 0, strlen($keyMatch))) { if (strncmp($key, $keyMatch, strlen($keyMatch))) {
continue; continue;
} }
$key = substr($key, strlen($keyMatch)); $key = substr($key, strlen($keyMatch));
...@@ -802,7 +802,7 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -802,7 +802,7 @@ class OpenId extends BaseClient implements ClientInterface
$sregToAx = array_flip($this->axToSregMap); $sregToAx = array_flip($this->axToSregMap);
foreach ($this->data as $key => $value) { foreach ($this->data as $key => $value) {
$keyMatch = 'openid_sreg_'; $keyMatch = 'openid_sreg_';
if (substr_compare($key, $keyMatch, 0, strlen($keyMatch))) { if (strncmp($key, $keyMatch, strlen($keyMatch))) {
continue; continue;
} }
$key = substr($key, strlen($keyMatch)); $key = substr($key, strlen($keyMatch));
......
...@@ -57,6 +57,7 @@ class Facebook extends OAuth2 ...@@ -57,6 +57,7 @@ class Facebook extends OAuth2
*/ */
public $scope = 'email'; public $scope = 'email';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -53,6 +53,7 @@ class GitHub extends OAuth2 ...@@ -53,6 +53,7 @@ class GitHub extends OAuth2
*/ */
public $apiBaseUrl = 'https://api.github.com'; public $apiBaseUrl = 'https://api.github.com';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -55,6 +55,7 @@ class GoogleOAuth extends OAuth2 ...@@ -55,6 +55,7 @@ class GoogleOAuth extends OAuth2
*/ */
public $apiBaseUrl = 'https://www.googleapis.com/plus/v1'; public $apiBaseUrl = 'https://www.googleapis.com/plus/v1';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -48,6 +48,7 @@ class GoogleOpenId extends OpenId ...@@ -48,6 +48,7 @@ class GoogleOpenId extends OpenId
'pref/language', 'pref/language',
]; ];
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -56,6 +56,7 @@ class LinkedIn extends OAuth2 ...@@ -56,6 +56,7 @@ class LinkedIn extends OAuth2
*/ */
public $apiBaseUrl = 'https://api.linkedin.com/v1'; public $apiBaseUrl = 'https://api.linkedin.com/v1';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -53,6 +53,7 @@ class Live extends OAuth2 ...@@ -53,6 +53,7 @@ class Live extends OAuth2
*/ */
public $apiBaseUrl = 'https://apis.live.net/v5.0'; public $apiBaseUrl = 'https://apis.live.net/v5.0';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -65,6 +65,7 @@ class Twitter extends OAuth1 ...@@ -65,6 +65,7 @@ class Twitter extends OAuth1
*/ */
public $apiBaseUrl = 'https://api.twitter.com/1.1'; public $apiBaseUrl = 'https://api.twitter.com/1.1';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -14,7 +14,6 @@ use yii\authclient\OAuth2; ...@@ -14,7 +14,6 @@ use yii\authclient\OAuth2;
* *
* In order to use VKontakte OAuth you must register your application at <http://vk.com/editapp?act=create>. * In order to use VKontakte OAuth you must register your application at <http://vk.com/editapp?act=create>.
* *
*
* Example application configuration: * Example application configuration:
* *
* ~~~ * ~~~
...@@ -54,6 +53,7 @@ class VKontakte extends OAuth2 ...@@ -54,6 +53,7 @@ class VKontakte extends OAuth2
*/ */
public $apiBaseUrl = 'https://api.vk.com/method'; public $apiBaseUrl = 'https://api.vk.com/method';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -53,6 +53,7 @@ class YandexOAuth extends OAuth2 ...@@ -53,6 +53,7 @@ class YandexOAuth extends OAuth2
*/ */
public $apiBaseUrl = 'https://login.yandex.ru'; public $apiBaseUrl = 'https://login.yandex.ru';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -46,6 +46,7 @@ class YandexOpenId extends OpenId ...@@ -46,6 +46,7 @@ class YandexOpenId extends OpenId
'contact/email', 'contact/email',
]; ];
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -33,6 +33,8 @@ class RsaSha1 extends BaseMethod ...@@ -33,6 +33,8 @@ class RsaSha1 extends BaseMethod
* This value can be fetched from file specified by [[publicCertificateFile]]. * This value can be fetched from file specified by [[publicCertificateFile]].
*/ */
protected $_publicCertificate; protected $_publicCertificate;
/** /**
* @var string path to the file, which holds private key certificate. * @var string path to the file, which holds private key certificate.
*/ */
......
...@@ -96,6 +96,7 @@ class AuthChoice extends Widget ...@@ -96,6 +96,7 @@ class AuthChoice extends Widget
*/ */
private $_clients; private $_clients;
/** /**
* @param ClientInterface[] $clients auth providers * @param ClientInterface[] $clients auth providers
*/ */
......
...@@ -95,17 +95,14 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -95,17 +95,14 @@ class ActiveField extends \yii\widgets\ActiveField
* @var bool whether to render [[checkboxList()]] and [[radioList()]] inline. * @var bool whether to render [[checkboxList()]] and [[radioList()]] inline.
*/ */
public $inline = false; public $inline = false;
/** /**
* @var string|null optional template to render the `{input}` placeholder content * @var string|null optional template to render the `{input}` placeholder content
*/ */
public $inputTemplate; public $inputTemplate;
/** /**
* @var array options for the wrapper tag, used in the `{beginWrapper}` placeholder * @var array options for the wrapper tag, used in the `{beginWrapper}` placeholder
*/ */
public $wrapperOptions = []; public $wrapperOptions = [];
/** /**
* @var null|array CSS grid classes for horizontal layout. This must be an array with these keys: * @var null|array CSS grid classes for horizontal layout. This must be an array with these keys:
* - 'offset' the offset grid class to append to the wrapper if no label is rendered * - 'offset' the offset grid class to append to the wrapper if no label is rendered
...@@ -115,47 +112,40 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -115,47 +112,40 @@ class ActiveField extends \yii\widgets\ActiveField
* - 'hint' the hint grid class * - 'hint' the hint grid class
*/ */
public $horizontalCssClasses; public $horizontalCssClasses;
/** /**
* @var string the template for checkboxes in default layout * @var string the template for checkboxes in default layout
*/ */
public $checkboxTemplate = "<div class=\"checkbox\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n{error}\n{hint}\n</div>"; public $checkboxTemplate = "<div class=\"checkbox\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n{error}\n{hint}\n</div>";
/** /**
* @var string the template for radios in default layout * @var string the template for radios in default layout
*/ */
public $radioTemplate = "<div class=\"radio\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n{error}\n{hint}\n</div>"; public $radioTemplate = "<div class=\"radio\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n{error}\n{hint}\n</div>";
/** /**
* @var string the template for checkboxes in horizontal layout * @var string the template for checkboxes in horizontal layout
*/ */
public $horizontalCheckboxTemplate = "{beginWrapper}\n<div class=\"checkbox\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n</div>\n{error}\n{endWrapper}\n{hint}"; public $horizontalCheckboxTemplate = "{beginWrapper}\n<div class=\"checkbox\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n</div>\n{error}\n{endWrapper}\n{hint}";
/** /**
* @var string the template for radio buttons in horizontal layout * @var string the template for radio buttons in horizontal layout
*/ */
public $horizontalRadioTemplate = "{beginWrapper}\n<div class=\"radio\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n</div>\n{error}\n{endWrapper}\n{hint}"; public $horizontalRadioTemplate = "{beginWrapper}\n<div class=\"radio\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n</div>\n{error}\n{endWrapper}\n{hint}";
/** /**
* @var string the template for inline checkboxLists * @var string the template for inline checkboxLists
*/ */
public $inlineCheckboxListTemplate = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}"; public $inlineCheckboxListTemplate = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}";
/** /**
* @var string the template for inline radioLists * @var string the template for inline radioLists
*/ */
public $inlineRadioListTemplate = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}"; public $inlineRadioListTemplate = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}";
/** /**
* @var bool whether to render the error. Default is `true` except for layout `inline`. * @var bool whether to render the error. Default is `true` except for layout `inline`.
*/ */
public $enableError = true; public $enableError = true;
/** /**
* @var bool whether to render the label. Default is `true`. * @var bool whether to render the label. Default is `true`.
*/ */
public $enableLabel = true; public $enableLabel = true;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -69,7 +69,6 @@ class ActiveForm extends \yii\widgets\ActiveForm ...@@ -69,7 +69,6 @@ class ActiveForm extends \yii\widgets\ActiveForm
* @var array HTML attributes for the form tag. Default is `['role' => 'form']`. * @var array HTML attributes for the form tag. Default is `['role' => 'form']`.
*/ */
public $options = ['role' => 'form']; public $options = ['role' => 'form'];
/** /**
* @var string the form layout. Either 'default', 'horizontal' or 'inline'. * @var string the form layout. Either 'default', 'horizontal' or 'inline'.
* By choosing a layout, an appropriate default field configuration is applied. This will * By choosing a layout, an appropriate default field configuration is applied. This will
...@@ -79,6 +78,7 @@ class ActiveForm extends \yii\widgets\ActiveForm ...@@ -79,6 +78,7 @@ class ActiveForm extends \yii\widgets\ActiveForm
*/ */
public $layout = 'default'; public $layout = 'default';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -68,6 +68,7 @@ class Alert extends Widget ...@@ -68,6 +68,7 @@ class Alert extends Widget
*/ */
public $closeButton = []; public $closeButton = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -39,6 +39,7 @@ class Button extends Widget ...@@ -39,6 +39,7 @@ class Button extends Widget
*/ */
public $encodeLabel = true; public $encodeLabel = true;
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
......
...@@ -59,6 +59,7 @@ class ButtonDropdown extends Widget ...@@ -59,6 +59,7 @@ class ButtonDropdown extends Widget
*/ */
public $encodeLabel = true; public $encodeLabel = true;
/** /**
* Renders the widget. * Renders the widget.
*/ */
......
...@@ -52,6 +52,7 @@ class ButtonGroup extends Widget ...@@ -52,6 +52,7 @@ class ButtonGroup extends Widget
*/ */
public $encodeLabels = true; public $encodeLabels = true;
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
......
...@@ -66,6 +66,7 @@ class Carousel extends Widget ...@@ -66,6 +66,7 @@ class Carousel extends Widget
*/ */
public $items = []; public $items = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -59,6 +59,7 @@ class Collapse extends Widget ...@@ -59,6 +59,7 @@ class Collapse extends Widget
*/ */
public $items = []; public $items = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -46,6 +46,7 @@ class Dropdown extends Widget ...@@ -46,6 +46,7 @@ class Dropdown extends Widget
*/ */
protected $_containerOptions = []; protected $_containerOptions = [];
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
......
...@@ -82,6 +82,7 @@ class Modal extends Widget ...@@ -82,6 +82,7 @@ class Modal extends Widget
*/ */
public $toggleButton; public $toggleButton;
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -93,6 +93,7 @@ class Nav extends Widget ...@@ -93,6 +93,7 @@ class Nav extends Widget
*/ */
public $params; public $params;
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -85,6 +85,7 @@ class NavBar extends Widget ...@@ -85,6 +85,7 @@ class NavBar extends Widget
*/ */
public $innerContainerOptions = []; public $innerContainerOptions = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -89,6 +89,7 @@ class Progress extends Widget ...@@ -89,6 +89,7 @@ class Progress extends Widget
*/ */
public $bars; public $bars;
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
......
...@@ -102,6 +102,7 @@ class Tabs extends Widget ...@@ -102,6 +102,7 @@ class Tabs extends Widget
*/ */
public $navType = 'nav-tabs'; public $navType = 'nav-tabs';
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -39,6 +39,7 @@ class Widget extends \yii\base\Widget ...@@ -39,6 +39,7 @@ class Widget extends \yii\base\Widget
*/ */
public $clientEvents = []; public $clientEvents = [];
/** /**
* Initializes the widget. * Initializes the widget.
* This method will register the bootstrap asset bundle. If you override this method, * This method will register the bootstrap asset bundle. If you override this method,
......
...@@ -27,11 +27,13 @@ abstract class BasePage extends Component ...@@ -27,11 +27,13 @@ abstract class BasePage extends Component
* the route and the rest of the name-value pairs are treated as GET parameters, e.g. `array('site/page', 'name' => 'about')`. * the route and the rest of the name-value pairs are treated as GET parameters, e.g. `array('site/page', 'name' => 'about')`.
*/ */
public $route; public $route;
/** /**
* @var \Codeception\AbstractGuy the testing guy object * @var \Codeception\AbstractGuy the testing guy object
*/ */
protected $guy; protected $guy;
/** /**
* Constructor. * Constructor.
* *
......
...@@ -33,6 +33,7 @@ class TestCase extends Test ...@@ -33,6 +33,7 @@ class TestCase extends Test
*/ */
public $appConfig = '@tests/unit/_config.php'; public $appConfig = '@tests/unit/_config.php';
/** /**
* Returns the value of an object property. * Returns the value of an object property.
* *
......
...@@ -23,9 +23,9 @@ class Installer extends LibraryInstaller ...@@ -23,9 +23,9 @@ class Installer extends LibraryInstaller
const EXTRA_WRITABLE = 'writable'; const EXTRA_WRITABLE = 'writable';
const EXTRA_EXECUTABLE = 'executable'; const EXTRA_EXECUTABLE = 'executable';
const EXTRA_CONFIG = 'config'; const EXTRA_CONFIG = 'config';
const EXTENSION_FILE = 'yiisoft/extensions.php'; const EXTENSION_FILE = 'yiisoft/extensions.php';
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -25,6 +25,7 @@ class LogTarget extends Target ...@@ -25,6 +25,7 @@ class LogTarget extends Target
public $module; public $module;
public $tag; public $tag;
/** /**
* @param \yii\debug\Module $module * @param \yii\debug\Module $module
* @param array $config * @param array $config
......
...@@ -194,8 +194,7 @@ class Module extends \yii\base\Module implements BootstrapInterface ...@@ -194,8 +194,7 @@ class Module extends \yii\base\Module implements BootstrapInterface
return true; return true;
} }
} }
Yii::warning('Access to debugger is denied due to IP address restriction. The requested IP is ' . $ip, __METHOD__); Yii::warning('Access to debugger is denied due to IP address restriction. The requesting IP address is ' . $ip, __METHOD__);
return false; return false;
} }
......
...@@ -49,6 +49,7 @@ class Panel extends Component ...@@ -49,6 +49,7 @@ class Panel extends Component
*/ */
public $actions = []; public $actions = [];
/** /**
* @return string name of the panel * @return string name of the panel
*/ */
......
...@@ -23,6 +23,7 @@ class Filter extends Component ...@@ -23,6 +23,7 @@ class Filter extends Component
*/ */
protected $rules = []; protected $rules = [];
/** /**
* Adds data filtering rule. * Adds data filtering rule.
* *
......
...@@ -22,6 +22,7 @@ abstract class Base extends Component implements MatcherInterface ...@@ -22,6 +22,7 @@ abstract class Base extends Component implements MatcherInterface
*/ */
protected $baseValue; protected $baseValue;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -20,6 +20,7 @@ class SameAs extends Base ...@@ -20,6 +20,7 @@ class SameAs extends Base
*/ */
public $partial = false; public $partial = false;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -33,6 +33,7 @@ class DefaultController extends Controller ...@@ -33,6 +33,7 @@ class DefaultController extends Controller
*/ */
public $summary; public $summary;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -23,12 +23,12 @@ class Db extends Base ...@@ -23,12 +23,12 @@ class Db extends Base
* @var string type of the input search value * @var string type of the input search value
*/ */
public $type; public $type;
/** /**
* @var integer query attribute input search value * @var integer query attribute input search value
*/ */
public $query; public $query;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -23,47 +23,40 @@ class Debug extends Base ...@@ -23,47 +23,40 @@ class Debug extends Base
* @var string tag attribute input search value * @var string tag attribute input search value
*/ */
public $tag; public $tag;
/** /**
* @var string ip attribute input search value * @var string ip attribute input search value
*/ */
public $ip; public $ip;
/** /**
* @var string method attribute input search value * @var string method attribute input search value
*/ */
public $method; public $method;
/** /**
* @var integer ajax attribute input search value * @var integer ajax attribute input search value
*/ */
public $ajax; public $ajax;
/** /**
* @var string url attribute input search value * @var string url attribute input search value
*/ */
public $url; public $url;
/** /**
* @var string status code attribute input search value * @var string status code attribute input search value
*/ */
public $statusCode; public $statusCode;
/** /**
* @var integer sql count attribute input search value * @var integer sql count attribute input search value
*/ */
public $sqlCount; public $sqlCount;
/** /**
* @var integer total mail count attribute input search value * @var integer total mail count attribute input search value
*/ */
public $mailCount; public $mailCount;
/** /**
* @var array critical codes, used to determine grid row options. * @var array critical codes, used to determine grid row options.
*/ */
public $criticalCodes = [400, 404, 500]; public $criticalCodes = [400, 404, 500];
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -23,17 +23,16 @@ class Log extends Base ...@@ -23,17 +23,16 @@ class Log extends Base
* @var string ip attribute input search value * @var string ip attribute input search value
*/ */
public $level; public $level;
/** /**
* @var string method attribute input search value * @var string method attribute input search value
*/ */
public $category; public $category;
/** /**
* @var integer message attribute input search value * @var integer message attribute input search value
*/ */
public $message; public $message;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -22,52 +22,44 @@ class Mail extends Base ...@@ -22,52 +22,44 @@ class Mail extends Base
* @var string from attribute input search value * @var string from attribute input search value
*/ */
public $from; public $from;
/** /**
* @var string to attribute input search value * @var string to attribute input search value
*/ */
public $to; public $to;
/** /**
* @var string reply attribute input search value * @var string reply attribute input search value
*/ */
public $reply; public $reply;
/** /**
* @var string cc attribute input search value * @var string cc attribute input search value
*/ */
public $cc; public $cc;
/** /**
* @var string bcc attribute input search value * @var string bcc attribute input search value
*/ */
public $bcc; public $bcc;
/** /**
* @var string subject attribute input search value * @var string subject attribute input search value
*/ */
public $subject; public $subject;
/** /**
* @var string body attribute input search value * @var string body attribute input search value
*/ */
public $body; public $body;
/** /**
* @var string charset attribute input search value * @var string charset attribute input search value
*/ */
public $charset; public $charset;
/** /**
* @var string headers attribute input search value * @var string headers attribute input search value
*/ */
public $headers; public $headers;
/** /**
* @var string file attribute input search value * @var string file attribute input search value
*/ */
public $file; public $file;
public function rules() public function rules()
{ {
return [ return [
......
...@@ -23,12 +23,12 @@ class Profile extends Base ...@@ -23,12 +23,12 @@ class Profile extends Base
* @var string method attribute input search value * @var string method attribute input search value
*/ */
public $category; public $category;
/** /**
* @var integer info attribute input search value * @var integer info attribute input search value
*/ */
public $info; public $info;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -28,16 +28,17 @@ class DbPanel extends Panel ...@@ -28,16 +28,17 @@ class DbPanel extends Panel
* the execution is considered taking critical number of DB queries. * the execution is considered taking critical number of DB queries.
*/ */
public $criticalQueryThreshold; public $criticalQueryThreshold;
/** /**
* @var array db queries info extracted to array as models, to use with data provider. * @var array db queries info extracted to array as models, to use with data provider.
*/ */
private $_models; private $_models;
/** /**
* @var array current database request timings * @var array current database request timings
*/ */
private $_timings; private $_timings;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -25,6 +25,7 @@ class LogPanel extends Panel ...@@ -25,6 +25,7 @@ class LogPanel extends Panel
*/ */
private $_models; private $_models;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -29,11 +29,13 @@ class MailPanel extends Panel ...@@ -29,11 +29,13 @@ class MailPanel extends Panel
* @var string path where all emails will be saved. should be an alias. * @var string path where all emails will be saved. should be an alias.
*/ */
public $mailPath = '@runtime/debug/mail'; public $mailPath = '@runtime/debug/mail';
/** /**
* @var array current request sent messages * @var array current request sent messages
*/ */
private $_messages = []; private $_messages = [];
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -25,6 +25,7 @@ class ProfilingPanel extends Panel ...@@ -25,6 +25,7 @@ class ProfilingPanel extends Panel
*/ */
private $_models; private $_models;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -56,6 +56,7 @@ class ActiveRecord extends BaseActiveRecord ...@@ -56,6 +56,7 @@ class ActiveRecord extends BaseActiveRecord
private $_version; private $_version;
private $_highlight; private $_highlight;
/** /**
* Returns the database connection used by this AR class. * Returns the database connection used by this AR class.
* By default, the "elasticsearch" application component is used as the database connection. * By default, the "elasticsearch" application component is used as the database connection.
......
...@@ -43,9 +43,9 @@ class Command extends Component ...@@ -43,9 +43,9 @@ class Command extends Component
* @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html * @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html
*/ */
public $highlight; public $highlight;
public $options = []; public $options = [];
/** /**
* @param array $options * @param array $options
* @return mixed * @return mixed
......
...@@ -46,7 +46,6 @@ class Connection extends Component ...@@ -46,7 +46,6 @@ class Connection extends Component
* @var array the active node. key of [[nodes]]. Will be randomly selected on [[open()]]. * @var array the active node. key of [[nodes]]. Will be randomly selected on [[open()]].
*/ */
public $activeNode; public $activeNode;
// TODO http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html#_example_configuring_http_basic_auth // TODO http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html#_example_configuring_http_basic_auth
public $auth = []; public $auth = [];
/** /**
...@@ -62,6 +61,7 @@ class Connection extends Component ...@@ -62,6 +61,7 @@ class Connection extends Component
*/ */
public $dataTimeout = null; public $dataTimeout = null;
public function init() public function init()
{ {
foreach ($this->nodes as $node) { foreach ($this->nodes as $node) {
......
...@@ -36,6 +36,7 @@ class DebugAction extends Action ...@@ -36,6 +36,7 @@ class DebugAction extends Action
*/ */
public $controller; public $controller;
public function run($logId, $tag) public function run($logId, $tag)
{ {
$this->controller->loadData($tag); $this->controller->loadData($tag);
......
...@@ -24,6 +24,7 @@ class DebugPanel extends Panel ...@@ -24,6 +24,7 @@ class DebugPanel extends Panel
{ {
public $db = 'elasticsearch'; public $db = 'elasticsearch';
public function init() public function init()
{ {
$this->actions['elasticsearch-query'] = [ $this->actions['elasticsearch-query'] = [
......
...@@ -137,7 +137,6 @@ class Query extends Component implements QueryInterface ...@@ -137,7 +137,6 @@ class Query extends Component implements QueryInterface
* on one or more fields. * on one or more fields.
*/ */
public $highlight; public $highlight;
public $facets = []; public $facets = [];
......
...@@ -24,6 +24,7 @@ class QueryBuilder extends \yii\base\Object ...@@ -24,6 +24,7 @@ class QueryBuilder extends \yii\base\Object
*/ */
public $db; public $db;
/** /**
* Constructor. * Constructor.
* @param Connection $connection the database connection. * @param Connection $connection the database connection.
......
...@@ -164,6 +164,7 @@ class FixtureController extends \yii\console\controllers\FixtureController ...@@ -164,6 +164,7 @@ class FixtureController extends \yii\console\controllers\FixtureController
* More info in [Faker](https://github.com/fzaninotto/Faker.) library docs. * More info in [Faker](https://github.com/fzaninotto/Faker.) library docs.
*/ */
public $providers = []; public $providers = [];
/** /**
* @var \Faker\Generator Faker generator instance * @var \Faker\Generator Faker generator instance
*/ */
......
...@@ -54,6 +54,7 @@ class CodeFile extends Object ...@@ -54,6 +54,7 @@ class CodeFile extends Object
*/ */
public $operation; public $operation;
/** /**
* Constructor. * Constructor.
* @param string $path the file path that the new code should be saved to. * @param string $path the file path that the new code should be saved to.
......
...@@ -58,6 +58,7 @@ abstract class Generator extends Model ...@@ -58,6 +58,7 @@ abstract class Generator extends Model
*/ */
public $messageCategory = 'app'; public $messageCategory = 'app';
/** /**
* @return string name of the code generator * @return string name of the code generator
*/ */
......
...@@ -21,6 +21,7 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -21,6 +21,7 @@ class ActiveField extends \yii\widgets\ActiveField
*/ */
public $model; public $model;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment