ApiBundle/Transformer/FieldTypeTransformer.php
Avoid unused parameters such as '$params'. Open
Open
public function transform($fieldType, array $params = array())
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Reference to undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractTransformer
Open
Open
parent::__construct($facadeClass);
- Create a ticketCreate a ticket
- Exclude checks
Parameter $fieldType
has undeclared type \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
public function transform($fieldType, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method getFieldId
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->fieldId = $fieldType->getFieldId();
- Create a ticketCreate a ticket
- Exclude checks
Call to method isSearchable
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->searchable = $fieldType->isSearchable();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getOptions
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
foreach ($fieldType->getOptions() as $option) {
- Create a ticketCreate a ticket
- Exclude checks
Call to method getDefaultValue
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->defaultValue = $fieldType->getDefaultValue();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getLabels
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->label = $this->multiLanguagesChoiceManagerInterface->choose($fieldType->getLabels());
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open
Open
throw new TransformerParameterTypeException();
- Create a ticketCreate a ticket
- Exclude checks
Parameter $multiLanguagesChoiceManagerInterface
has undeclared type \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\ApiBundle\Transformer\FieldTypeTransformer->fieldsParameters
(Did you mean $fieldsParameters) Open
Open
$this->fieldsParameters = $fieldsParameters;
- Create a ticketCreate a ticket
- Exclude checks
@throws type of transform
has undeclared type \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open
Open
public function transform($fieldType, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\FieldTypeTransformer::newFacade
Open
Open
$facade = $this->newFacade();
- Create a ticketCreate a ticket
- Exclude checks
Call to method choose
from undeclared class \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open
Open
$facade->label = $this->multiLanguagesChoiceManagerInterface->choose($fieldType->getLabels());
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
if (!$fieldType instanceof FieldTypeInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\ApiBundle\Transformer\FieldTypeTransformer->fieldsParameters
Open
Open
$facade->search = array_key_exists($fieldType->getType(), $this->fieldsParameters) && isset($this->fieldsParameters[$fieldType->getType()]['search']) ? $this->fieldsParameters[$fieldType->getType()]['search'] : '';
- Create a ticketCreate a ticket
- Exclude checks
Call to method getListable
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->listable = $fieldType->getListable();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getType
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->search = array_key_exists($fieldType->getType(), $this->fieldsParameters) && isset($this->fieldsParameters[$fieldType->getType()]['search']) ? $this->fieldsParameters[$fieldType->getType()]['search'] : '';
- Create a ticketCreate a ticket
- Exclude checks
Call to method getType
from undeclared class \OpenOrchestra\ModelInterface\Model\FieldTypeInterface
Open
Open
$facade->type = $fieldType->getType();
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractTransformer
Open
Open
class FieldTypeTransformer extends AbstractTransformer
- Create a ticketCreate a ticket
- Exclude checks
Return type of transform()
is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function transform($fieldType, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $multiLanguagesChoiceManagerInterface. Keep variable name length under 20. Open
Open
protected $multiLanguagesChoiceManagerInterface;
- 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 $multiLanguagesChoiceManagerInterface. Keep variable name length under 20. Open
Open
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManagerInterface,
- 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
Inline control structures are not allowed Open
Open
if (!is_string($value))
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 222 characters Open
Open
$facade->search = array_key_exists($fieldType->getType(), $this->fieldsParameters) && isset($this->fieldsParameters[$fieldType->getType()]['search']) ? $this->fieldsParameters[$fieldType->getType()]['search'] : '';
- Create a ticketCreate a ticket
- Exclude checks