YetiForceCompany/YetiForceCRM

View on GitHub
app/Db/Drivers/SchemaTrait.php

Summary

Maintainability
A
1 hr
Test Coverage
F
50%

Function findForeignKeyToColumn has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function findForeignKeyToColumn(string $findTableName, string $findColumnName)
    {
        $foreignKeys = [];
        foreach ($this->getTableNames() as $tableName) {
            $tableSchema = $this->getTableSchema($tableName);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php - About 1 hr to fix

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

Function getTableMetadata has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getTableMetadata($name, $type, $refresh)
    {
        $rawName = $this->getRawTableName($name);
        $tableSchema = [];
        if (!$refresh && \App\Cache::has('tableSchema', $rawName)) {
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php - About 25 mins to fix

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

The method getTableIndexes has a boolean flag argument $refresh, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getTableIndexes($name, $refresh = false)
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method getTableNames has a boolean flag argument $refresh, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getTableNames($schema = '', $refresh = false)
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid using static access to class '\App\Cache' in method 'setTableMetadata'.
Open

            $tableSchema = \App\Cache::get('tableSchema', $rawName);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid using static access to class '\App\Cache' in method 'getTableMetadata'.
Open

            \App\Cache::save('tableSchema', $rawName, $tableSchema, \App\Cache::LONG);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid using static access to class '\App\Cache' in method 'getTableMetadata'.
Open

            $tableSchema = \App\Cache::get('tableSchema', $rawName);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid using static access to class '\App\Cache' in method 'setTableMetadata'.
Open

        \App\Cache::save('tableSchema', $rawName, $tableSchema, \App\Cache::LONG);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid using static access to class '\App\Cache' in method 'refresh'.
Open

        \App\Cache::clear();
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid using static access to class '\App\Cache' in method 'refreshTableSchema'.
Open

        \App\Cache::delete('tableSchema', $rawName);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid using static access to class '\App\Cache' in method 'getTableMetadata'.
Open

        if (!$refresh && \App\Cache::has('tableSchema', $rawName)) {
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Avoid assigning values to variables in if clauses and the like (line '209', column '43').
Open

    public function findForeignKeyToColumn(string $findTableName, string $findColumnName)
    {
        $foreignKeys = [];
        foreach ($this->getTableNames() as $tableName) {
            $tableSchema = $this->getTableSchema($tableName);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid using static access to class '\App\Cache' in method 'setTableMetadata'.
Open

        if (\App\Cache::has('tableSchema', $rawName)) {
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phpmd

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

Define a constant instead of duplicating this literal "tableSchema" 7 times.
Open

        \App\Cache::delete('tableSchema', $rawName);
Severity: Critical
Found in app/Db/Drivers/SchemaTrait.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Reference to undeclared property \App\Db\Drivers\SchemaTrait->db
Open

        $this->db->pdo->exec("SET TRANSACTION ISOLATION LEVEL $level");
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Reference to undeclared property \App\Db\Drivers\SchemaTrait->db
Open

        return str_replace('#__', $this->db->tablePrefix, $name);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Return type of getTableIndexes() is undeclared type \yii\db\IndexConstraint[]
Open

    public function getTableIndexes($name, $refresh = false)
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Reference to undeclared property \App\Db\Drivers\SchemaTrait->db
Open

        $this->db->pdo->exec("SAVEPOINT $name");
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Reference to undeclared property \App\Db\Drivers\SchemaTrait->db
Open

            return str_replace('%', $this->db->tablePrefix, $name);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Reference to undeclared property \App\Db\Drivers\SchemaTrait->db
Open

        $this->db->pdo->exec("RELEASE SAVEPOINT $name");
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Reference to undeclared property \App\Db\Drivers\SchemaTrait->db
Open

        $this->db->pdo->exec("ROLLBACK TO SAVEPOINT $name");
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.php by phan

Call to undeclared method \App\Db\Drivers\SchemaTrait::findTableNames
Open

            $this->_tableNames[$schema] = $this->findTableNames($schema);
Severity: Critical
Found in app/Db/Drivers/SchemaTrait.php by phan

Call to undeclared method \App\Db\Drivers\SchemaTrait::getTableSchema
Open

            $tableSchema = $this->getTableSchema($tableName);
Severity: Critical
Found in app/Db/Drivers/SchemaTrait.php by phan

Property name "$_tableNames" should not be prefixed with an underscore to indicate visibility
Open

    private $_tableNames = [];

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * to reflect the database schema change.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name the savepoint name

Spaces must be used to indent lines; tabs are not allowed
Open

     * This method cleans up all cached table schemas so that they can be re-created later

Spaces must be used to indent lines; tabs are not allowed
Open

     * Refreshes the particular table schema.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var array list of ALL table names in the database

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->_tableNames = [];

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    public function createSavepoint($name)

Spaces must be used to indent lines; tabs are not allowed
Open

    private $_tableNames = [];

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name table name.

Spaces must be used to indent lines; tabs are not allowed
Open

     * Creates a new savepoint.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name the savepoint name

Spaces must be used to indent lines; tabs are not allowed
Open

     * to reflect the database schema change.

Spaces must be used to indent lines; tabs are not allowed
Open

    public function refresh()

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Refreshes the schema.

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->_tableNames = [];

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Rolls back to a previously created savepoint.

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * Releases an existing savepoint.

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $rawName = $this->getRawTableName($name);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->db->pdo->exec("RELEASE SAVEPOINT $name");

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::clear();

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since 2.0.6

Spaces must be used to indent lines; tabs are not allowed
Open

    public function refreshTableSchema($name)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->db->pdo->exec("SAVEPOINT $name");

Spaces must be used to indent lines; tabs are not allowed
Open

    public function releaseSavepoint($name)

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::delete('tableSchema', $rawName);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name the savepoint name

Spaces must be used to indent lines; tabs are not allowed
Open

     * This method cleans up cached table schema so that it can be re-created later

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Returns the actual name of a given table name.

Spaces must be used to indent lines; tabs are not allowed
Open

        return str_replace('#__', $this->db->tablePrefix, $name);

Spaces must be used to indent lines; tabs are not allowed
Open

     * If there's no metadata in the cache, this method will call

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            $tableSchema = \App\Cache::get('tableSchema', $rawName);

Spaces must be used to indent lines; tabs are not allowed
Open

        return $tableSchema[$type];

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $type metadata type.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array

Spaces must be used to indent lines; tabs are not allowed
Open

                }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * and replace the percentage character '%' with [[Connection::tablePrefix]].

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string the real name of the given table name

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name table name.

Spaces must be used to indent lines; tabs are not allowed
Open

            $tableSchema = \App\Cache::get('tableSchema', $rawName);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            $name = preg_replace('/\\{\\{(.*?)\\}\\}/', '\1', $name);

Line exceeds 120 characters; contains 125 characters
Open

     * @param string $schema  the schema of the tables. Defaults to empty string, meaning the current or default schema name.

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->_tableNames[$schema] = $this->findTableNames($schema);

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $schema  the schema of the tables. Defaults to empty string, meaning the current or default schema name.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return mixed metadata.

Spaces must be used to indent lines; tabs are not allowed
Open

        if (\App\Cache::has('tableSchema', $rawName)) {

Line exceeds 120 characters; contains 147 characters
Open

     *                      This can be one of [[Transaction::READ_UNCOMMITTED]], [[Transaction::READ_COMMITTED]], [[Transaction::REPEATABLE_READ]]

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $findTableName

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    public function findForeignKeyToColumn(string $findTableName, string $findColumnName)

Spaces must be used to indent lines; tabs are not allowed
Open

     * a `'loadTable' . ucfirst($type)` named method with the table name to obtain the metadata.

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

                    if ($findTableName === $value[0] && ($key = array_search($findColumnName, $value))) {

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \yii\db\IndexConstraint[]

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->getTableMetadata($name, 'indexes', $refresh);

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Line exceeds 120 characters; contains 122 characters
Open

     *                      and [[Transaction::SERIALIZABLE]] but also a string containing DBMS specific syntax to be used

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getTableNames($schema = '', $refresh = false)

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$refresh && \App\Cache::has('tableSchema', $rawName)) {

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets the isolation level of the current transaction.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $level The transaction isolation level to use for this transaction.

Spaces must be used to indent lines; tabs are not allowed
Open

     *                      after `SET TRANSACTION ISOLATION LEVEL`.

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->db->pdo->exec("SET TRANSACTION ISOLATION LEVEL $level");

Spaces must be used to indent lines; tabs are not allowed
Open

            return str_replace('%', $this->db->tablePrefix, $name);

Spaces must be used to indent lines; tabs are not allowed
Open

     * Returns the metadata of the given type for the given table.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $type    metadata type.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool   $refresh whether to reload the table metadata even if it is found in the cache.

Spaces must be used to indent lines; tabs are not allowed
Open

        $rawName = $this->getRawTableName($name);

Spaces must be used to indent lines; tabs are not allowed
Open

        $tableSchema[$type] = $data;

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Returns all table names in the database.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool   $refresh whether to fetch the latest available table names. If this is false,

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name

Spaces must be used to indent lines; tabs are not allowed
Open

            $tableSchema = $this->getTableSchema($tableName);

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        return $foreignKeys;

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function setTableMetadata($name, $type, $data)

Spaces must be used to indent lines; tabs are not allowed
Open

                    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *                      This can be one of [[Transaction::READ_UNCOMMITTED]], [[Transaction::READ_COMMITTED]], [[Transaction::REPEATABLE_READ]]

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string[] all table names in the database.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $rawName = $this->getRawTableName($name);

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::save('tableSchema', $rawName, $tableSchema, \App\Cache::LONG);

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->_tableNames[$schema];

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $tableSchema = [];

Spaces must be used to indent lines; tabs are not allowed
Open

            $tableSchema[$type] = $this->{'loadTable' . ucfirst($type)}($rawName);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed  $data metadata.

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $findColumnName

Spaces must be used to indent lines; tabs are not allowed
Open

                        $foreignKeys[$tableName][$name] = ['sourceColumn' => $key];

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->db->pdo->exec("ROLLBACK TO SAVEPOINT $name");

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        if (false !== strpos($name, '{{')) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *                        table names fetched previously (if available) will be returned.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since 2.0.13

Spaces must be used to indent lines; tabs are not allowed
Open

                return $tableSchema[$type];

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Find foreign keys to column.

Spaces must be used to indent lines; tabs are not allowed
Open

        $foreignKeys = [];

Spaces must be used to indent lines; tabs are not allowed
Open

     * @see https://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setTransactionIsolationLevel($level)

Spaces must be used to indent lines; tabs are not allowed
Open

     * This method will strip off curly brackets from the given table name

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getRawTableName($name)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $tableSchema = [];

Spaces must be used to indent lines; tabs are not allowed
Open

     * Lists indexes for table.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getTableNames() as $tableName) {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function rollBackSavepoint($name)

Spaces must be used to indent lines; tabs are not allowed
Open

     *                        If not empty, the returned table names will be prefixed with the schema name.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name    table name. The table name may contain schema name if any. Do not quote the table name.

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function getTableMetadata($name, $type, $refresh)

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($tableSchema->foreignKeys) {

Spaces must be used to indent lines; tabs are not allowed
Open

            if (isset($tableSchema[$type])) {

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($refresh || !isset($tableSchema[$type])) {

Spaces must be used to indent lines; tabs are not allowed
Open

            \App\Cache::save('tableSchema', $rawName, $tableSchema, \App\Cache::LONG);

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets the metadata of the given type for the given table.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *                      and [[Transaction::SERIALIZABLE]] but also a string containing DBMS specific syntax to be used

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name the table name to be converted

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!isset($this->_tableNames[$schema]) || $refresh) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since 2.0.13

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool   $refresh

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getTableIndexes($name, $refresh = false)

Spaces must be used to indent lines; tabs are not allowed
Open

                foreach ($tableSchema->foreignKeys as $name => $value) {

There are no issues that match your filters.

Category
Status