Completed
Push — master ( 21f966...8b1dc6 )
by Vitaly
06:14
created

global.php ➔ dbQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 2
Metric Value
cc 1
eloc 2
c 2
b 0
f 2
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 1
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * DataBase(База данных) - Получить класс для работы с базой данных
5
 * @param string $link_id Идентификатор подключения к БД
6
 * @return samson\activerecord\dbMySQL Класс для работы с базой данных
7
 */
8
function & db($link_id = NULL)
0 ignored issues
show
Unused Code introduced by
The parameter $link_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
TRUE, FALSE and NULL must be lowercase; expected null, but found NULL.
Loading history...
9
{
10
    static $_db;
11
    $_db = isset($_db) ? $_db : new \samson\activerecord\dbMySQL();
12
    return $_db;
13
}
14
15
/**
16
 * Шорткат для создания параметризированного запроса
17
 *
18
 * @param string $class_name Имя класса для которого создается запрос к БД
19
 * @param mixed $link Указатель на экземпляр подключения к БД
20
 *
21
 * @return samson\activerecord\dbQuery Объект для формирования запроса к БД
22
 */
23
function dbQuery($class_name, & $link = null)
24
{
25
    return new \samson\activerecord\dbQuery($class_name, $link);
0 ignored issues
show
Unused Code introduced by
The call to dbQuery::__construct() has too many arguments starting with $link.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
26
}
27