Method provideEntityAndKeywords
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideEntityAndKeywords()
{
$nodeId = 'nodeId';
$node = $this->createPhakeNode($nodeId);
$contentId = 'contentId';
- Create a ticketCreate a ticket
Avoid using static access to class '\Phake' in method 'setUp'. Open
$this->keywordRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\KeywordRepositoryInterface');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Phake' in method 'provideEntityAndKeywords'. Open
$optionWithKeyword = Phake::Mock('OpenOrchestra\ModelInterface\Model\FieldOptionInterface');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Phake' in method 'provideEntityAndKeywords'. Open
$fieldWithoutKeyword = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Phake' in method 'provideEntityAndKeywords'. Open
$optionWithoutKeyword = Phake::Mock('OpenOrchestra\ModelInterface\Model\FieldOptionInterface');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Phake' in method 'provideEntityAndKeywords'. Open
$fieldWithKeyword = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');
- Read upRead up
- Create a ticketCreate a ticket
- 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 method when
from undeclared class \Phake
Open
Phake::when($contentTypeWithoutKeyword)->getFields()->thenReturn(array($fieldWithoutKeyword));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($fieldWithoutKeyword)->getOptions()->thenReturn(array($optionWithoutKeyword));
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
parent::checkRemoveReferencesToEntity($entity, $entityId, $keywords, ContentTypeInterface::ENTITY_TYPE, $this->keywordRepository);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($entity)->getKeywords()->thenReturn($keywords);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$fieldWithoutKeyword = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$fieldWithKeyword = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($optionWithoutKeyword)->getValue()->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method Mock
from undeclared class \Phake
Open
$optionWithoutKeyword = Phake::Mock('OpenOrchestra\ModelInterface\Model\FieldOptionInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentTypeWithKeyword)->getFields()->thenReturn(array($fieldWithoutKeyword, $fieldWithKeyword));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($fieldWithKeyword)->getOptions()->thenReturn(array($optionWithoutKeyword, $optionWithKeyword));
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
parent::checkAddReferencesToEntity($entity, $entityId, $keywords, ContentTypeInterface::ENTITY_TYPE, $this->keywordRepository);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($optionWithKeyword)->getValue()->thenReturn(array('keywords' => 'keyword AND fake'));
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->keywordRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\KeywordRepositoryInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method Mock
from undeclared class \Phake
Open
$optionWithKeyword = Phake::Mock('OpenOrchestra\ModelInterface\Model\FieldOptionInterface');
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $contentTypeWithoutKeyword. Keep variable name length under 20. Open
$contentTypeWithoutKeyword = $this->createPhakeContentType($contentTypeWithoutKeywordId);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $contentTypeWithKeyword. Keep variable name length under 20. Open
$contentTypeWithKeyword = $this->createPhakeContentType($contentTypeWithKeywordId);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $contentTypeWithoutKeywordId. Keep variable name length under 20. Open
$contentTypeWithoutKeywordId = 'contentTypeWithoutKeywordId';
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $contentTypeWithKeywordId. Keep variable name length under 20. Open
$contentTypeWithKeywordId = 'contentTypeWithKeywordId';
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Line exceeds 120 characters; contains 121 characters Open
'Content type with no keyword' => array($contentTypeWithoutKeyword, $contentTypeWithoutKeywordId, array()),
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
parent::checkRemoveReferencesToEntity($entity, $entityId, $keywords, ContentTypeInterface::ENTITY_TYPE, $this->keywordRepository);
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
'Content type with one keyword' => array($contentTypeWithKeyword, $contentTypeWithKeywordId, array($keywordId => $keyword))
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
parent::checkAddReferencesToEntity($entity, $entityId, $keywords, ContentTypeInterface::ENTITY_TYPE, $this->keywordRepository);
- Create a ticketCreate a ticket
- Exclude checks