main accesses the super-global variable $GLOBALS. Open
public static function main(?string $arg = null, $default = null)
{
if ($arg && isset($GLOBALS[$arg])) {
return $GLOBALS[$arg];
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
main accesses the super-global variable $GLOBALS. Open
public static function main(?string $arg = null, $default = null)
{
if ($arg && isset($GLOBALS[$arg])) {
return $GLOBALS[$arg];
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The class Config has 14 public methods. Consider refactoring Config to keep number of public methods under 10. Open
class Config
{
/**
* Js environment variables.
*
- 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
Function get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function get(string $class, ?string $arg = null, $default = null)
{
$value = $default;
if (\class_exists($class)) {
if (null === $arg) {
- 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
Missing class import via use statement (line '307', column '20'). Open
$object = (new \ReflectionClass($class));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method getMaxUploadSize has a boolean flag argument $checkMain, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getMaxUploadSize(bool $checkMain = true, bool $returnInMb = false): int
- Read upRead up
- Exclude checks
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 getMaxUploadSize has a boolean flag argument $returnInMb, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getMaxUploadSize(bool $checkMain = true, bool $returnInMb = false): int
- Read upRead up
- Exclude checks
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\Json' in method 'getJsEnv'. Open
return Json::encode(self::$jsEnv);
- 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
Avoid assigning values to variables in if clauses and the like (line '336', column '7'). Open
public static function set(): bool
{
if (4 === \func_num_args()) {
[$component, $type, $key, $value] = \func_get_args();
$component = ucfirst($component) . 's\\';
- Read upRead up
- Exclude checks
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 '\vtlib\Functions' in method 'getMaxUploadSize'. Open
$size = \vtlib\Functions::parseBytes(ini_get('upload_max_filesize'));
- 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
Avoid using static access to class '\vtlib\Functions' in method 'getMaxUploadSize'. Open
$maxPostSize = \vtlib\Functions::parseBytes(ini_get('post_max_size'));
- 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 set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
[$type, $key, $value] = \func_get_args();
$type = ucfirst($type);
}
- 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
Reference to static property upload_maxsize
from undeclared class \Config\Main
Open
$size = (int) \Config\Main::$upload_maxsize;
- Exclude checks
Reference to static property upload_maxsize
from undeclared class \Config\Main
Open
if ($checkMain && \Config\Main::$upload_maxsize < $size) {
- Exclude checks
Avoid using short method names like Config::db(). The configured minimum method name length is 3. Open
public static function db(?string $arg = null, $default = null)
{
$class = '\\Config\\Db';
return self::get($class, $arg, $default);
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
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
self::$jsEnv[$key] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- 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 mixed
- 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
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $key
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $key
- 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
* @throws \ReflectionException
- 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
* @throws \ReflectionException
- 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 mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var array
- 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
* Gets main configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = "\\Config\\Components\\$component";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getJsEnv()
- 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
* Gets module configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function module(string $moduleName, ?string $arg = null, $default = 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
public static function getJsEnvByKey(string $key)
- 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
$class = '\\Config\\Performance';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get all js configuration in json.
- 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
* @throws \App\Exceptions\AppException
- 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 static function setJsEnv($key, $value)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \ReflectionException
- 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 $component
- 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 mixed
- 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
* Gets api configuration.
- 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
* @throws \ReflectionException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- 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 static function securityKeys(?string $arg = null, $default = 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 string
- 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
$class = "\\Config\\Modules\\$moduleName";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function component(string $component, ?string $arg = null, $default = 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
$class = '\\Config\\Api';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- 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
* Gets search configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \ReflectionException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \ReflectionException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \ReflectionException
- 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
$class = '\\Config\\SecurityKeys';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get js configuration by key.
- 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 static function main(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- 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 mixed $default
- 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
* Set js environment variables.
- 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 self::get($class, $arg, $default);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- 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 self::get($class, $arg, $default);
- 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 static function security(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- 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 static function sounds(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $jsEnv = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $value
- 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 $GLOBALS[$arg];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- 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
* Gets debug configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- 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
$class = '\\Config\\Layout';
- 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 static function search(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = '\\Config\\Search';
- 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 mixed
- 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 $arg
- 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 static function api(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- 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 ($arg && isset($GLOBALS[$arg])) {
- 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
* Gets component configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets performance configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- 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
* Gets developer configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = '\\Config\\Developer';
- 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
$component = ucfirst($component) . 's\\';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = '\Config\\' . ($component ?? '') . $type;
- 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 Json::encode(self::$jsEnv);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::$jsEnv[$key] ?? 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
$class = '\\Config\\Main';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = '\\Config\\Debug';
- 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 $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- 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 $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- 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
* Gets configuration for class.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function get(string $class, ?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $class::${$arg};
- 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 $size;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Js environment variables.
- 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 self::get($class, $arg, $default);
- 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
* Gets layout configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- 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
return self::get($class, $arg, $default);
- 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 int
- 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
* @throws \ReflectionException
- 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
* @throws \ReflectionException
- 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 bool $checkMain
- 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
* @throws \ReflectionException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function debug(?string $arg = null, $default = 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 mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function layout(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets sounds configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets relation configuration.
- 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
* Get the maximum size of an uploaded file to the server taking into account CRM configuration and server settings.
- 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 static function performance(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- 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 mixed $default
- 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 self::get($class, $arg, $default);
- 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 (\class_exists($class)) {
- 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
$size = floor($size / 1048576);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \ReflectionException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- 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 === $arg) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$size = (int) \Config\Main::$upload_maxsize;
- 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 $arg
- 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
* @throws \ReflectionException
- 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
$class = '\\Config\\Security';
- 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 mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function relation(?string $arg = null, $default = 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
foreach ($object->getMethods() as $method) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value[$method->getName()] = \call_user_func("{$class}::{$method->getName()}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = ucfirst($type);
- 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
* @throws \ReflectionException
- 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 self::get($class, $arg, $default);
- 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
$class = '\\Config\\Sounds';
- 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
* Gets database configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $class
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $object->getStaticProperties();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = \call_user_func("{$class}::{$arg}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($maxPostSize < $size) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($returnInMb) {
- 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 static function developer(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = '\\Config\\Relation';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $default
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- 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
$value = $default;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[$type, $key, $value] = \func_get_args();
- 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
* @throws \ReflectionException
- 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
* Gets security configuration.
- 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 mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $arg
- 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
* Gets security keys configuration.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function db(?string $arg = null, $default = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class = '\\Config\\Db';
- 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
[$component, $type, $key, $value] = \func_get_args();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($result = (class_exists($class) && isset($class::${$key}))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::get($class, $arg, $default);
- 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 $arg
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function set(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$class::${$key} = $value;
- 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
$object = (new \ReflectionClass($class));
- 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
$size = $maxPostSize;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($class::${$arg})) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set config value.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (4 === \func_num_args()) {
- 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
public static function getMaxUploadSize(bool $checkMain = true, bool $returnInMb = false): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxPostSize = \vtlib\Functions::parseBytes(ini_get('post_max_size'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($checkMain && \Config\Main::$upload_maxsize < $size) {
- 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
} elseif (\method_exists($class, $arg)) {
- 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 bool $returnInMb
- 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
* @throws \ReflectionException
- 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 $result;
- 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
$size = \vtlib\Functions::parseBytes(ini_get('upload_max_filesize'));
- Exclude checks