Avoid using static access to class '\Tests\Base\C_RecordActions' in method 'testTextTruncate'. Open
$this->assertSame(13, \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), 10, true)), 'string should be truncated in expexted format (text length: 10)');
- 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 '\Tests\Base\C_RecordActions' in method 'testHtmlTruncateByWords'. Open
$this->assertSame(15, \strlen(strip_tags(\App\TextUtils::htmlTruncateByWords(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 40, ''))), 'html should be truncated in expected format (text length: 10)');
- 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 '\Tests\Base\C_RecordActions' in method 'testHtmlTruncate'. Open
$htmlTruncate = \App\TextUtils::htmlTruncate(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 200);
- 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\TextUtils' in method 'testTextLength'. Open
$this->assertSame(0, \App\TextUtils::getTextLength(null));
- 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\TextUtils' in method 'testHtmlTruncateByWords'. Open
$this->assertSame(15, \strlen(strip_tags(\App\TextUtils::htmlTruncateByWords(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 40, ''))), 'html should be truncated in expected format (text length: 10)');
- 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\TextUtils' in method 'testTextLength'. Open
$this->assertSame(4, \App\TextUtils::getTextLength('test'));
- 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\TextUtils' in method 'testTextTruncate'. Open
$this->assertSame((\App\Config::main('listview_max_textlength') + 3), \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), false, true)), 'string should be truncated in expexted format (default length)');
- 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\TextUtils' in method 'testGetTagAttributes'. Open
$attributes = \App\TextUtils::getTagAttributes('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>');
- 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 '\Tests\Base\C_RecordActions' in method 'testTextTruncate'. Open
$this->assertSame((\App\Config::main('listview_max_textlength') + 3), \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), false, true)), 'string should be truncated in expexted format (default length)');
- 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\Config' in method 'testTextTruncate'. Open
$this->assertSame((\App\Config::main('listview_max_textlength') + 3), \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), false, true)), 'string should be truncated in expexted format (default length)');
- 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\TextUtils' in method 'testTextTruncate'. Open
$this->assertSame(13, \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), 10, true)), 'string should be truncated in expexted format (text length: 10)');
- 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\TextUtils' in method 'testHtmlTruncate'. Open
$htmlTruncate = \App\TextUtils::htmlTruncate(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 200);
- 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
Call to undeclared method \Tests\App\TextUtils::assertArrayHasKey
Open
$this->assertArrayHasKey('type', $attributes);
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertArrayHasKey
Open
$this->assertArrayHasKey('attachment-id', $attributes);
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame(4, \App\TextUtils::getTextLength('test'));
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertNotEmpty
Open
$this->assertNotEmpty($attributes);
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame(13, \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), 10, true)), 'string should be truncated in expexted format (text length: 10)');
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame(15, \strlen(strip_tags(\App\TextUtils::htmlTruncateByWords(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 40, ''))), 'html should be truncated in expected format (text length: 10)');
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame(138, \strlen($htmlTruncate), 'html should be truncated in expected format (default length=138)');
- Exclude checks
Argument 1 (text)
is null
but \App\TextUtils::getTextLength()
takes string
defined at /code/app/TextUtils.php:26
Open
$this->assertSame(0, \App\TextUtils::getTextLength(null));
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame(0, \App\TextUtils::getTextLength(null));
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertArrayHasKey
Open
$this->assertArrayHasKey('crm-id', $attributes);
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame((\App\Config::main('listview_max_textlength') + 3), \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), false, true)), 'string should be truncated in expexted format (default length)');
- Exclude checks
Call to undeclared method \Tests\App\TextUtils::assertSame
Open
$this->assertSame(18, \strlen(strip_tags($htmlTruncate)), 'html should be truncated in expected format (length=18)');
- Exclude checks
Spaces must 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
Line exceeds 120 characters; contains 131 characters Open
$attributes = \App\TextUtils::getTagAttributes('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>');
- Exclude checks
Spaces must 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
* @see \App\TextUtils::getTagAttributes()
- Exclude checks
Spaces must 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 testTextTruncate()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @see \App\TextUtils::htmlTruncate()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testHtmlTruncate()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests `\App\TextUtils::textTruncate` methods.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$this->assertSame(18, \strlen(strip_tags($htmlTruncate)), 'html should be truncated in expected format (length=18)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @see \App\TextUtils::htmlTruncateByWords()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests `\App\TextUtils::getTagAttributes` methods.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(0, \App\TextUtils::getTextLength(null));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(4, \App\TextUtils::getTextLength('test'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame((\App\Config::main('listview_max_textlength') + 3), \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), false, true)), 'string should be truncated in expexted format (default length)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertArrayHasKey('crm-id', $attributes);
- Exclude checks
Spaces must 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 testTextLength()
- Exclude checks
Spaces must 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
* @see \App\TextUtils::textTruncate()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($attributes);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @see \App\TextUtils::getTextLength()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests `\App\TextUtils::htmlTruncateByWords` methods.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests `\App\TextUtils::htmlTruncate` methods.
- Exclude checks
Line exceeds 120 characters; contains 214 characters Open
$this->assertSame(15, \strlen(strip_tags(\App\TextUtils::htmlTruncateByWords(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 40, ''))), 'html should be truncated in expected format (text length: 10)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(15, \strlen(strip_tags(\App\TextUtils::htmlTruncateByWords(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 40, ''))), 'html should be truncated in expected format (text length: 10)');
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$this->assertSame(138, \strlen($htmlTruncate), 'html should be truncated in expected format (default length=138)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertArrayHasKey('type', $attributes);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests `\App\TextUtils::getTextLength` methods.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testHtmlTruncateByWords()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$htmlTruncate = \App\TextUtils::htmlTruncate(\Tests\Base\C_RecordActions::createLoremIpsumHtml(), 200);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 249 characters Open
$this->assertSame((\App\Config::main('listview_max_textlength') + 3), \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), false, true)), 'string should be truncated in expexted format (default length)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(13, \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), 10, true)), 'string should be truncated in expexted format (text length: 10)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$attributes = \App\TextUtils::getTagAttributes('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>');
- Exclude checks
Line exceeds 120 characters; contains 199 characters Open
$this->assertSame(13, \strlen(\App\TextUtils::textTruncate(\Tests\Base\C_RecordActions::createLoremIpsumText(), 10, true)), 'string should be truncated in expexted format (text length: 10)');
- Exclude checks
Spaces must 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(18, \strlen(strip_tags($htmlTruncate)), 'html should be truncated in expected format (length=18)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(138, \strlen($htmlTruncate), 'html should be truncated in expected format (default length=138)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGetTagAttributes()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertArrayHasKey('attachment-id', $attributes);
- Exclude checks