Commit 8be4f377 by Carsten Brandt

updated properties of extensions

parent de1b533a
......@@ -11,6 +11,8 @@
// fcgi doesn't have STDIN defined by default
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
define('YII_DEBUG', true);
require(__DIR__ . '/../framework/yii/Yii.php');
$application = new yii\console\Application([
......
......@@ -7,6 +7,7 @@
namespace yii\build\controllers;
use Yii;
use yii\console\Controller;
use yii\helpers\Console;
use yii\helpers\FileHelper;
......@@ -38,10 +39,30 @@ class PhpDocController extends Controller
*
* @param null $root the directory to parse files from. Defaults to YII_PATH.
*/
public function actionProperty($root=null)
public function actionProperty($root = null)
{
$except = [];
if ($root === null) {
$root = YII_PATH;
$root = dirname(dirname(YII_PATH));
Yii::setAlias('@yii/bootstrap', $root . '/extensions/bootstrap');
Yii::setAlias('@yii/debug', $root . '/extensions/debug');
Yii::setAlias('@yii/elasticsearch', $root . '/extensions/elasticsearch');
Yii::setAlias('@yii/gii', $root . '/extensions/gii');
Yii::setAlias('@yii/jui', $root . '/extensions/jui');
Yii::setAlias('@yii/redis', $root . '/extensions/redis');
Yii::setAlias('@yii/smarty', $root . '/extensions/smarty');
Yii::setAlias('@yii/sphinx', $root . '/extensions/sphinx');
Yii::setAlias('@yii/swiftmailer', $root . '/extensions/swiftmailer');
Yii::setAlias('@yii/twig', $root . '/extensions/twig');
$except = [
'/apps/',
'/build/',
'/docs/',
'/extensions/composer/',
'/tests/',
'/vendor/',
];
}
$root = FileHelper::normalizePath($root);
$options = [
......@@ -55,14 +76,13 @@ class PhpDocController extends Controller
return null;
},
'only' => ['.php'],
'except' => [
'except' => array_merge($except, [
'BaseYii.php',
'Yii.php',
'/debug/views/',
'/views/',
'/requirements/',
'/gii/views/',
'/gii/generators/',
],
]),
];
$files = FileHelper::findFiles($root, $options);
$nFilesTotal = 0;
......@@ -216,20 +236,27 @@ class PhpDocController extends Controller
$ns = $this->match('#\nnamespace (?<name>[\w\\\\]+);\n#', $file);
$namespace = reset($ns);
$namespace = $namespace['name'];
$classes = $this->match('#\n(?:abstract )?class (?<name>\w+)( |\n)(extends )?.+\{(?<content>.*)\n\}(\n|$)#', $file);
$classes = $this->match('#\n(?:abstract )?class (?<name>\w+)( extends .+)?( implements .+)?\n\{(?<content>.*)\n\}(\n|$)#', $file);
if (count($classes) > 1) {
$this->stderr("[ERR] There should be only one class in a file: $fileName\n", Console::FG_RED);
return false;
}
if (count($classes) < 1) {
$interfaces = $this->match('#\ninterface (?<name>\w+)\n\{(?<content>.+)\n\}(\n|$)#', $file);
$interfaces = $this->match('#\ninterface (?<name>\w+)( extends .+)?\n\{(?<content>.+)\n\}(\n|$)#', $file);
if (count($interfaces) == 1) {
return false;
} elseif (count($interfaces) > 1) {
$this->stderr("[ERR] There should be only one interface in a file: $fileName\n", Console::FG_RED);
} else {
$this->stderr("[ERR] No class in file: $fileName\n", Console::FG_RED);
$traits = $this->match('#\ntrait (?<name>\w+)\n\{(?<content>.+)\n\}(\n|$)#', $file);
if (count($traits) == 1) {
return false;
} elseif (count($traits) > 1) {
$this->stderr("[ERR] There should be only one class/trait/interface in a file: $fileName\n", Console::FG_RED);
} else {
$this->stderr("[ERR] No class in file: $fileName\n", Console::FG_RED);
}
}
return false;
}
......
......@@ -14,7 +14,7 @@ use yii\helpers\Html;
/**
* Nav renders a nav HTML component.
*
*
* For example:
*
* ```php
......@@ -37,12 +37,12 @@ use yii\helpers\Html;
* ],
* ]);
* ```
*
*
* Note: Multilevel dropdowns beyond Level 1 are not supported in Bootstrap 3.
*
*
* @see http://getbootstrap.com/components.html#dropdowns
* @see http://getbootstrap.com/components/#nav
*
*
* @author Antonio Ramirez <amigo.cobos@gmail.com>
* @since 2.0
*/
......
......@@ -53,8 +53,6 @@ use yii\base\InvalidConfigException;
* ]
* ~~~
*
* @property Connection $connection The redis connection object. This property is read-only.
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
......
......@@ -26,11 +26,16 @@ use Yii;
* read-only.
* @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property array $oldAttributes The old attribute values (name-value pairs).
* @property integer $oldPrimaryKey The old primary key value. This property is read-only.
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be returned if the key
* value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only.
* @property integer $primaryKey The primary key value. This property is read-only.
* @property string $snippet current snippet value for this Active Record instance..
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite. A string is returned otherwise (null will be returned if the key value is null).
* This property is read-only.
* @property string $snippet Snippet value.
* @property string $snippetSource Snippet source string. This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
......@@ -1237,6 +1242,9 @@ abstract class ActiveRecord extends Model
* Returns the primary key value.
* @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column names as keys and column values as values.
* @property mixed The primary key value. An array (column name => column value) is returned if
* the primary key is composite. A string is returned otherwise (null will be returned if
* the key value is null).
* @return mixed the primary key value. An array (column name => column value) is returned
* if `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null).
......@@ -1263,6 +1271,9 @@ abstract class ActiveRecord extends Model
* @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column name as key and column value as value.
* If this is false (default), a scalar value will be returned.
* @property mixed The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be
* returned if the key value is null).
* @return mixed the old primary key value. An array (column name => column value) is returned if
* `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null).
......
......@@ -39,14 +39,17 @@ use yii\base\NotSupportedException;
*
* To build SELECT SQL statements, please use [[Query]] and [[QueryBuilder]] instead.
*
* @property \yii\sphinx\Connection $db the Sphinx connection that this command is associated with.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
class Command extends \yii\db\Command
{
/**
* @var \yii\sphinx\Connection the Sphinx connection that this command is associated with.
*/
public $db;
/**
* Creates a batch INSERT command.
* For example,
*
......
......@@ -47,11 +47,14 @@ use yii\base\NotSupportedException;
*
* Note: while this class extends "yii\db\Connection" some of its methods are not supported.
*
* @method \yii\sphinx\Schema getSchema() The schema information for this Sphinx connection
* @method \yii\sphinx\QueryBuilder getQueryBuilder() the query builder for this Sphinx connection
*
* @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the
* sequence object. This property is read-only.
* @property Schema $schema The schema information for this Sphinx connection. This property is read-only.
* @property \yii\sphinx\QueryBuilder $queryBuilder The query builder for this Sphinx connection. This property is
* read-only.
* @method \yii\sphinx\Schema getSchema() The schema information for this Sphinx connection
* @method \yii\sphinx\QueryBuilder getQueryBuilder() the query builder for this Sphinx connection
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
......
......@@ -41,6 +41,8 @@ use yii\db\QueryTrait;
*
* Warning: even if you do not set any query limit, implicit LIMIT 0,20 is present by default!
*
* @property Connection $connection Sphinx connection instance.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
......
......@@ -15,12 +15,12 @@ use yii\caching\GroupDependency;
/**
* Schema represents the Sphinx schema information.
*
* @property QueryBuilder $queryBuilder The query builder for this connection. This property is read-only.
* @property string[] $indexNames All index names in the Sphinx. This property is read-only.
* @property string[] $indexTypes ALL index types in the Sphinx (index name => index type).
* This property is read-only.
* @property IndexSchema[] $tableSchemas The metadata for all indexes in the Sphinx. Each array element is an
* @property IndexSchema[] $indexSchemas The metadata for all indexes in the Sphinx. Each array element is an
* instance of [[IndexSchema]] or its child class. This property is read-only.
* @property array $indexTypes All index types in the Sphinx in format: index name => index type. This
* property is read-only.
* @property QueryBuilder $queryBuilder The query builder for this connection. This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
......
......@@ -66,6 +66,10 @@ use yii\mail\BaseMailer;
*
* @see http://swiftmailer.org
*
* @property array|\Swift_Mailer $swiftMailer Swift mailer instance or array configuration. This property is
* read-only.
* @property array|\Swift_Transport $transport This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
......
......@@ -16,7 +16,8 @@ use yii\mail\BaseMessage;
* @see Mailer
*
* @method Mailer getMailer() returns mailer instance.
* @property \Swift_Message $swiftMessage vendor message instance.
*
* @property \Swift_Message $swiftMessage Swift message instance. This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
......
......@@ -27,13 +27,13 @@ use yii\helpers\Inflector;
* @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property array $oldAttributes The old attribute values (name-value pairs).
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be
* returned if the key value is null). This property is read-only.
* returned if the primary key is composite. A string is returned otherwise (null will be returned if the key
* value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only.
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). This property is read-only.
* the primary key is composite. A string is returned otherwise (null will be returned if the key value is null).
* This property is read-only.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carsten Brandt <mail@cebe.cc>
......@@ -1192,6 +1192,9 @@ class ActiveRecord extends Model
* @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column names as keys and column values as values.
* Note that for composite primary keys, an array will always be returned regardless of this parameter value.
* @property mixed The primary key value. An array (column name => column value) is returned if
* the primary key is composite. A string is returned otherwise (null will be returned if
* the key value is null).
* @return mixed the primary key value. An array (column name => column value) is returned if the primary key
* is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null).
......@@ -1218,6 +1221,9 @@ class ActiveRecord extends Model
* @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column name as key and column value as value.
* If this is false (default), a scalar value will be returned for non-composite primary key.
* @property mixed The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be
* returned if the key value is null).
* @return mixed the old primary key value. An array (column name => column value) is returned if the primary key
* is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null).
......
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