The class Base has 24 public methods. Consider refactoring Base to keep number of public methods under 10. Open
class Base
{
/** @var string Database section. */
public $dbType = 'base';
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Base
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Base
{
/** @var string Database section. */
public $dbType = 'base';
Function text
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function text(?string $length = null)
{
if ('mysql' === \App\Db::getInstance()->getDriverName()) {
if ($length <= 65535) {
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Class "Base" has 25 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Base
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
Avoid using static access to class '\App\Db' in method '__construct'. Open
$this->db = \App\Db::getInstance($this->dbType);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method text uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_CHAR, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder('LONGTEXT');
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_SMALLINT, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_FLOAT, $precision);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DATE);
- Exclude checks
Reference to constant TYPE_MONEY
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_MONEY, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UBIGPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Return type of char()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function char($length = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder('MEDIUMTEXT', $length);
- Exclude checks
Reference to constant TYPE_INTEGER
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_INTEGER, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_TIMESTAMP, $precision);
- Exclude checks
Reference to constant TYPE_TIME
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_TIME, $precision);
- Exclude checks
Reference to constant TYPE_BINARY
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BINARY, $length);
- Exclude checks
Reference to constant TYPE_TEXT
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Exclude checks
Returning type null
but text()
is declared to return \yii\db\ColumnSchemaBuilder
Open
return $columnSchemaBuilder;
- Exclude checks
Return type of smallInteger()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function smallInteger($length = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DOUBLE, $precision);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BOOLEAN);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DECIMAL, $length);
- Exclude checks
Return type of primaryKey()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function primaryKey($length = null)
- Exclude checks
Reference to constant TYPE_STRING
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_STRING, $length);
- Exclude checks
Return type of bigInteger()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function bigInteger($length = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DATETIME, $precision);
- Exclude checks
Return type of time()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function time($precision = null)
- Exclude checks
Return type of date()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function date()
- Exclude checks
Call to undeclared method \App\Db::getDriverName
Open
if ('mysql' === \App\Db::getInstance()->getDriverName()) {
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder('MEDIUMTEXT');
- Exclude checks
Reference to constant TYPE_DATETIME
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DATETIME, $precision);
- Exclude checks
Reference to constant TYPE_BOOLEAN
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BOOLEAN);
- Exclude checks
Reference to constant TYPE_PK
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_PK, $length)->notNull()->autoIncrement();
- Exclude checks
Return type of primaryKeyUnsigned()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function primaryKeyUnsigned($length = null)
- Exclude checks
Return type of stringType()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function stringType($length = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Exclude checks
Return type of tinyInteger()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function tinyInteger($length = 5)
- Exclude checks
Return type of integer()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function integer($length = null)
- Exclude checks
Return type of timestamp()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function timestamp($precision = null)
- Exclude checks
Return type of varbinary()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function varbinary($length = 255)
- Exclude checks
Property \App\Db\Importers\Base->schema
has undeclared type \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
protected $schema;
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Reference to constant TYPE_UBIGPK
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UBIGPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Return type of text()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function text(?string $length = null)
- Exclude checks
Reference to constant TYPE_TIMESTAMP
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_TIMESTAMP, $precision);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_PK, $length)->notNull()->autoIncrement();
- Exclude checks
Reference to constant TYPE_BIGPK
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BIGPK, $length)->notNull()->autoIncrement();
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Exclude checks
Return type of dateTime()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function dateTime($precision = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BINARY, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder('varbinary', $length);
- Exclude checks
Return type of bigPrimaryKey()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function bigPrimaryKey($length = null)
- Exclude checks
Reference to constant TYPE_TEXT
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder('tinyint', $length);
- Exclude checks
Reference to constant TYPE_SMALLINT
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_SMALLINT, $length);
- Exclude checks
Return type of double()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function double($precision = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_TIME, $precision);
- Exclude checks
Return type of mediumText()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function mediumText($length = null)
- Exclude checks
Reference to constant TYPE_BIGINT
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BIGINT, $length);
- Exclude checks
Return type of floatType()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function floatType($precision = null)
- Exclude checks
Reference to constant TYPE_FLOAT
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_FLOAT, $precision);
- Exclude checks
Reference to constant TYPE_DECIMAL
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DECIMAL, $length);
- Exclude checks
Reference to constant TYPE_DATE
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DATE);
- Exclude checks
Return type of binary()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function binary($length = null)
- Exclude checks
Return type of money()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function money($precision = null, $scale = null)
- Exclude checks
Call to undeclared method \App\Db::getSchema
Open
$this->schema = $this->db->getSchema();
- Exclude checks
Reference to constant TYPE_UPK
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Reference to constant TYPE_CHAR
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_CHAR, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_INTEGER, $length);
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BIGINT, $length);
- Exclude checks
Return type of boolean()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function boolean()
- Exclude checks
Return type of getSchema()
is undeclared type \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
public function getSchema()
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BIGPK, $length)->notNull()->autoIncrement();
- Exclude checks
Return type of bigPrimaryKeyUnsigned()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function bigPrimaryKeyUnsigned($length = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_STRING, $length);
- Exclude checks
Reference to constant TYPE_DOUBLE
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DOUBLE, $precision);
- Exclude checks
Return type of decimal()
is undeclared type \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
public function decimal($precision = null, $scale = null)
- Exclude checks
Call to method createColumnSchemaBuilder
from undeclared class \yii\db\Schema
(Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema) Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_MONEY, $length);
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
public $db;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
public $dropColumns = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Drop indexes. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BIGPK, $length)->notNull()->autoIncrement();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $dbType = 'base';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $db;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Construct.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \yii\db\Schema Database schema information. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a primary unsigned key column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Schema the schema information for the database opened by this connection.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $data = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Returns the schema information for the database opened by this connection.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $foreignKey = [];
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a big primary key column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a big primary unsigned key column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_PK, $length)->notNull()->autoIncrement();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Drop tables. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSchema()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Table structure. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Foreign keys. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Data to import. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \App\Db Database connection instance */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $dropIndexes = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function bigPrimaryKeyUnsigned($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Drop columns. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->schema = $this->db->getSchema();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Database section. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function primaryKeyUnsigned($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function bigPrimaryKey($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $tables = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $schema;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->db = \App\Db::getInstance($this->dbType);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $dropTables = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function primaryKey($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_STRING, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ($length > 16777215) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder('LONGTEXT');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision, which is usually the total number of digits.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function char($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder('MEDIUMTEXT', $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a primary key column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates an integer column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($length <= 65535) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder('MEDIUMTEXT');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a decimal column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function stringType($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $length
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $columnSchemaBuilder;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_INTEGER, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $precision) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UBIGPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a text column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a smallint column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function integer($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function floatType($precision = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_FLOAT, $precision);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$length = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. FLOAT(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_CHAR, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function mediumText($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a double column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_UBIGPK, $length)->notNull()->unsigned()->autoIncrement();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_SMALLINT, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* First parameter passed to the column type, e.g. DECIMAL(precision, scale).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$length[] = $precision;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $length
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function smallInteger($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a bigint column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. DOUBLE(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size definition i.e. the maximum string length.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('mysql' === \App\Db::getInstance()->getDriverName()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a medium text column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DOUBLE, $precision);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function text(?string $length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ($length <= 16777215) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BIGINT, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Second parameter passed to the column type, e.g. DECIMAL(precision, scale).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size definition i.e. the maximum string length.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$columnSchemaBuilder = $this->schema->createColumnSchemaBuilder(Schema::TYPE_TEXT);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function tinyInteger($length = 5)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a char column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a tiny int column. Available only in MySql.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder('tinyint', $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a float column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function double($precision = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function bigInteger($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function decimal($precision = null, $scale = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a datetime column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a varbinary column. Available only in MySql.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision, which is usually the total number of digits.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. TIME(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a binary column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder('varbinary', $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$length = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $scale) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a timestamp column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. TIMESTAMP(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a time column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_TIME, $precision);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $scale column value scale, which is usually the number of digits after the decimal point.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a string column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $scale column value scale, which is usually the number of digits after the decimal point.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function time($precision = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $scale) {
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. DATETIME(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function timestamp($precision = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BINARY, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function varbinary($length = 255)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function money($precision = null, $scale = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $precision) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a money column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DATETIME, $precision);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a boolean column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a date column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function date()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Second parameter passed to the column type, e.g. DECIMAL(precision, scale).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$length[] = $scale;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$length[] = $scale;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function dateTime($precision = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function binary($length = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_MONEY, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. DATETIME(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DATE);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $length column size or precision definition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \yii\db\ColumnSchemaBuilder the column instance which can be further customized
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function boolean()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_BOOLEAN);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* First parameter passed to the column type, e.g. DECIMAL(precision, scale).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$length[] = $precision;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This parameter will be ignored if not supported by the DBMS
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
* @param int $precision column value precision. First parameter passed to the column type, e.g. TIMESTAMP(precision).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_DECIMAL, $length);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->schema->createColumnSchemaBuilder(Schema::TYPE_TIMESTAMP, $precision);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks