Method testAttachImageToRecord
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAttachImageToRecord($module, $field, $file): void
{
switch ($module) {
case 'Users':
$record = self::$cache['Users'] ?? \App\User::getUserIdByName('admin');
Method testAddMultiImage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAddMultiImage(): void
{
$recordModel = \Vtiger_Record_Model::getInstanceById(\Tests\Base\C_RecordActions::createProductRecord(false)->getId(), 'Products');
$attach = [];
foreach (self::$files as $i => $name) {
Avoid using undefined variables such as '$attach' which will lead to PHP notices. Open
$attach[] = [
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$hash' which will lead to PHP notices. Open
'key' => $hash[$i],
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$attach' which will lead to PHP notices. Open
$recordModel->set($field, \App\Json::encode($attach));
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$hash' which will lead to PHP notices. Open
$hash[$i] = $fileObj->generateHash(true, $filePathDst);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using static access to class '\Vtiger_Record_Model' in method 'testAttachImageToRecord'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById($record, $module);
- 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 '\Vtiger_Record_Model' in method 'testAttachImageToRecord'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById($record, $module);
- 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 '\App\Json' in method 'testAttachImageToRecord'. Open
}
- 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 '\App\User' in method 'testAttachImageToRecord'. Open
$record = self::$cache['Users'] ?? \App\User::getUserIdByName('admin');
- 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 '\App\Purifier' in method 'testAttachImageToRecord'. Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get($field), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- 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 '\App\Fields\File' in method 'testAttachImageToRecord'. Open
$fileObj = \App\Fields\File::loadFromPath($filePathDst);
- 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 '\App\Json' in method 'testDeleteImage'. Open
$data = \App\Json::decode($recordModel->get($field));
- 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 '\App\Json' in method 'testAttachImageToRecord'. Open
$recordModel->set($field, \App\Json::encode($attach));
- 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 '\App\Purifier' in method 'testAddMultiImage'. Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('imagename'), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- 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 '\App\Json' in method 'testAttachImageToRecord'. Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get($field), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- 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 '\Vtiger_Record_Model' in method 'testAddMultiImage'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById(\Tests\Base\C_RecordActions::createProductRecord(false)->getId(), 'Products');
- 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 '\App\Fields\File' in method 'testAddMultiImage'. Open
$fileObj = \App\Fields\File::loadFromPath($filePathDst);
- 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 'tearDownAfterClass'. Open
\vtlib\Functions::recurseDelete('tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR, true);
- 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 '\App\Json' in method 'testAddMultiImage'. Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('imagename'), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- 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 '\Vtiger_Record_Model' in method 'testDeleteImage'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$cache[$module], $module);
- 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 '\Vtiger_Record_Model' in method 'testDeleteImage'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$cache[$module], $module);
- 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 '\App\Json' in method 'testAddMultiImage'. Open
$recordModel->set('imagename', \App\Json::encode($attach));
- 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 '\Vtiger_Record_Model' in method 'testAddMultiImage'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById($recordModel->getId(), 'Products');
- 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
Define a constant instead of duplicating this literal "Users" 4 times. Open
$data[] = ['Users', 'imagename', $i];
- Read upRead up
- Exclude checks
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.
Define a constant instead of duplicating this literal "Contacts" 4 times. Open
$data[] = ['Contacts', 'imagename', $i];
- Read upRead up
- Exclude checks
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.
Define a constant instead of duplicating this literal "tests" 4 times. Open
\mkdir(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage', 0777, true);
- Read upRead up
- Exclude checks
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.
Define a constant instead of duplicating this literal "MultiImage" 4 times. Open
\mkdir(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage', 0777, true);
- Read upRead up
- Exclude checks
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.
Define a constant instead of duplicating this literal "Products" 7 times. Open
$data[] = ['Products', 'imagename', $i];
- Read upRead up
- Exclude checks
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.
Define a constant instead of duplicating this literal "imagename" 10 times. Open
$data[] = ['Users', 'imagename', $i];
- Read upRead up
- Exclude checks
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.
Define a constant instead of duplicating this literal "File should exists" 3 times. Open
$this->assertFileExists($dataPath, 'File should exists');
- Read upRead up
- Exclude checks
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.
Call to method getUserIdByName
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$record = self::$cache['Users'] ?? \App\User::getUserIdByName('admin');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame('', $recordModel->get($field), 'Value should be empty');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame(self::$files[$file], $data[0]['name'], 'File name should be equal');
- Exclude checks
Variable $attach
was undeclared, but array fields are being added to it. Open
$attach[] = [
- Exclude checks
Argument 1 (str)
is int
but \md5()
takes string
Open
$filePathDst = 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . md5(random_int(0, 9999)) . substr($name, \strpos($name, '.'));
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertFileExists
Open
$this->assertFileExists($attach[$i]['path'], 'File should exists');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($hash, $data[0]['key'], 'Key should be equal');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($module, $url['module'], 'Module in image url should be equal to provided');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($record, $recordModel->getId(), 'Record ' . $record . '(' . $module . ') load error');
- Exclude checks
Call to undeclared method \Vtiger_Base_UIType::getDisplayValueEncoded
Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('imagename'), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertFileExists
Open
$this->assertFileExists($dataPath, 'File should exists');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($field, $url['field'], 'Field name in image url should be equal to provided');
- Exclude checks
Variable $hash
was undeclared, but array fields are being added to it. Open
$hash[$i] = $fileObj->generateHash(true, $filePathDst);
- Exclude checks
Call to undeclared method \Vtiger_Base_UIType::getDisplayValueEncoded
Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get($field), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertNotEmpty
Open
$this->assertNotEmpty($data);
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame('Products', $url['module'], 'Module in image url should be equal to provided');
- Exclude checks
Assigning array{}
to property but \Tests\Base\Z_MultiImage::$cache
is bool
Open
private static $cache = [];
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertFileExists
Open
$this->assertFileExists($data[0]['path'], 'File should exists');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($hash, $url['key'], 'Key in image url should be equal to provided');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($fileObj->getSize(), $data[0]['size'], 'File size should be equal');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($name, $data[$i]['name'], 'File name should be equal');
- Exclude checks
Argument 1 (str)
is int
but \md5()
takes string
Open
$filePathDst = ROOT_DIRECTORY . '/storage/MultiImage/' . md5(random_int(0, 9999)) . substr(self::$files[$file], \strpos(self::$files[$file], '.'));
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertFileDoesNotExist
Open
$this->assertFileDoesNotExist($data[0]['path'], 'File should be removed');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($attach[$i]['size'], $data[$i]['size'], 'File size should be equal');
- Exclude checks
Saw an @param annotation for record,
but it was not found in the param list of function testAttachImageToRecord($module, $field, $file) : void
Open
* @param $record
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertNotEmpty
Open
$this->assertNotEmpty($data);
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame((string) $record, $url['record'], 'Record in image url should be equal to provided');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($attach[$i]['key'], $data[$i]['key'], 'Key should be equal');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame($data[$i]['key'], $url['key'], 'Key in image url should be equal to provided');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame((string) $recordModel->getId(), $url['record'], 'Record in image url should be equal to provided');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertSame
Open
$this->assertSame('imagename', $url['field'], 'Field name in image url should be equal to provided');
- Exclude checks
Call to undeclared method \Tests\Base\Z_MultiImage::assertFileDoesNotExist
Open
$this->assertFileDoesNotExist($info['path'], 'File should be removed');
- Exclude checks
Remove the code after this "return". Open
return; // @codeCoverageIgnore
- Read upRead up
- Exclude checks
Jump statements (return
, break
, continue
, and goto
) and throw
expressions move
control flow out of the current code block. Typically, any statements in a block that come after a jump or throw
are simply wasted
keystrokes lying in wait to confuse the unwary.
Rarely, as illustrated below, code after a jump or throw
is reachable. However, such code is difficult to understand, and should be
refactored.
Noncompliant Code Example
function fun($a) { $i = 10; return $i + $a; $i++; // this is never executed } function foo($a) { if ($a == 5) { goto error; } else { // do the job } return; error: printf("don't use 5"); // this is reachable but unreadable }
Compliant Solution
function fun($a) { $i = 10; return $i + $a; } function foo($a) { if ($a == 5) { handleError(); } else { // do the job } return; }
See
- MISRA C:2004, 14.1 - There shall be no unreachable code
- MISRA C++:2008, 0-1-1 - A project shall not contain unreachable code
- MISRA C++:2008, 0-1-9 - There shall be no dead code
- MISRA C:2012, 2.1 - A project shall not contain unreachable code
- MISRA C:2012, 2.2 - There shall be no dead code
- MITRE, CWE-561 - Dead Code
- CERT, MSC56-J. - Detect and remove superfluous code and values
- CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
- CERT, MSC07-CPP. - Detect and remove dead code
The class Z_MultiImage is not named in CamelCase. Open
class Z_MultiImage extends \Tests\Base
{
/** @var string[] Files array. */
public static $files = ['0.jpg', '1.png', '2.png', '3.jpg'];
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string[] Files 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
* @return 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
case 'Products':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return; // @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get($field), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataPath = \App\Json::decode($recordModel->get($field))[0]['path'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(self::$files[$file], $data[0]['name'], 'File name should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record = self::$cache['Products'] ?? \Tests\Base\C_RecordActions::createProductRecord(false)->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$hash = $fileObj->generateHash(true, $filePathDst);
- Exclude checks
Spaces must 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 setUpBeforeClass(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = [];
- Exclude checks
Spaces must 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 $field
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$cache[$module], $module);
- Exclude checks
Spaces must 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
case 'Contacts':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$files as $i => $name) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePathDst = ROOT_DIRECTORY . '/storage/MultiImage/' . md5(random_int(0, 9999)) . substr(self::$files[$file], \strpos(self::$files[$file], '.'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePathSrc = 'tests' . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . $name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set($field, \App\Json::encode($attach));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$hash[$i] = $fileObj->generateHash(true, $filePathDst);
- Exclude checks
Line exceeds 120 characters; contains 204 characters Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get($field), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'key' => $hash[$i],
- Exclude checks
Spaces must 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->assertSame('', $recordModel->get($field), 'Value should be empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
$filePathSrc = 'tests' . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . $name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $record
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Delete record image test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFileExists($data[0]['path'], 'File should exists');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'path' => $fileObj->getPath(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $cache = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['Users', 'imagename'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Users':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record = self::$cache['Users'] ?? \App\User::getUserIdByName('admin');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($hash, $data[0]['key'], 'Key should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set($field, '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFileDoesNotExist($data[0]['path'], 'File should be removed');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add multi image test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$attach[$i] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById($recordModel->getId(), 'Products');
- Exclude checks
Spaces must 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
* @dataProvider providerImageForRecord
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($data);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @dataProvider providerDeleteImageForRecord
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$cache[$module], $module);
- Exclude checks
Spaces must 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 bool Cache */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($module) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePathSrc = ROOT_DIRECTORY . '/tests/data/MultiImage/' . self::$files[$file];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($record, $recordModel->getId(), 'Record ' . $record . '(' . $module . ') load error');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parse_str(\parse_url($data[0]['imageSrc'])['query'], $url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($module, $url['module'], 'Module in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$attach = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePathDst = 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . md5(random_int(0, 9999)) . substr($name, \strpos($name, '.'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileObj = \App\Fields\File::loadFromPath($filePathDst);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data[] = ['Contacts', 'imagename', $i];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
$this->assertSame($field, $url['field'], 'Field name in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Setting of tests.
- Exclude checks
Spaces must 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
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'path' => $fileObj->getPath(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById($record, $module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFileExists($dataPath, 'File should exists');
- Exclude checks
Spaces must 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 testDeleteImage($module, $field): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testAddMultiImage(): void
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
$recordModel = \Vtiger_Record_Model::getInstanceById(\Tests\Base\C_RecordActions::createProductRecord(false)->getId(), 'Products');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $files = ['0.jpg', '1.png', '2.png', '3.jpg'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\mkdir(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage', 0777, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Data provider for the attach image to record test.
- Exclude checks
Spaces must 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 $data;
- Exclude checks
Spaces must 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 testAttachImageToRecord($module, $field, $file): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$attach[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame((string) $record, $url['record'], 'Record in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 191 characters Open
$filePathDst = 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . md5(random_int(0, 9999)) . substr($name, \strpos($name, '.'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data[] = ['Products', 'imagename', $i];
- Exclude checks
Spaces must 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
$recordModel = \Vtiger_Record_Model::getInstanceById($record, $module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'size' => $fileObj->getSize(),
- Exclude checks
Spaces must 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 [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => self::$files[$file],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'key' => $hash,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = \App\Json::decode($recordModel->get($field));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById(\Tests\Base\C_RecordActions::createProductRecord(false)->getId(), 'Products');
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
\mkdir(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage', 0777, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
for ($i = 0; $i < 4; ++$i) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data[] = ['Users', 'imagename', $i];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function providerDeleteImageForRecord()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $file
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record = self::$cache['Contacts'] ?? \Tests\Base\C_RecordActions::createContactRecord(false)->getId();
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
$filePathDst = ROOT_DIRECTORY . '/storage/MultiImage/' . md5(random_int(0, 9999)) . substr(self::$files[$file], \strpos(self::$files[$file], '.'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\copy($filePathSrc, $filePathDst);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileObj = \App\Fields\File::loadFromPath($filePathDst);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'size' => $fileObj->getSize(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($fileObj->getSize(), $data[0]['size'], 'File size should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $field
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Data provider for the delete record images test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @codeCoverageIgnore
- Exclude checks
Spaces must 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 $module
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Attach image to record test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$cache[$module] = $record;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($hash, $url['key'], 'Key in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\copy($filePathSrc, $filePathDst);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('imagename', \App\Json::encode($attach));
- Exclude checks
Spaces must 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
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function providerImageForRecord()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['Contacts', 'imagename'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['Products', 'imagename'],
- Exclude checks
Spaces must 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 $module
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $recordModel->getField($field);
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($attach as $info) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($data);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFileExists($attach[$i]['path'], 'File should exists');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame((string) $recordModel->getId(), $url['record'], 'Record in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFileDoesNotExist($info['path'], 'File should be removed');
- Exclude checks
Spaces must 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
\vtlib\Functions::recurseDelete('tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($data[$i]['key'], $url['key'], 'Key in image url should be equal to provided');
- Exclude checks
Line exceeds 120 characters; contains 209 characters Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('imagename'), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$files as $i => $name) {
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$this->assertSame((string) $recordModel->getId(), $url['record'], 'Record in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $recordModel->getField('imagename');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($attach[$i]['key'], $data[$i]['key'], 'Key should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('Products', $url['module'], 'Module in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('imagename'), $recordModel->getId(), $fieldModel->getFieldInfo()['limit'])));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($attach[$i]['size'], $data[$i]['size'], 'File size should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($name, $data[$i]['name'], 'File name should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('imagename', $url['field'], 'Field name in image url should be equal to provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->delete();
- Exclude checks
Spaces must 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
* Cleaning after tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function tearDownAfterClass(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
\vtlib\Functions::recurseDelete('tests' . \DIRECTORY_SEPARATOR . 'tmp' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parse_str(\parse_url($data[$i]['imageSrc'])['query'], $url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Class name "Z_MultiImage" is not in camel caps format Open
class Z_MultiImage extends \Tests\Base
- Exclude checks