ApiBundle/Transformer/ContentTypeTransformer.php
Method transform
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function transform($contentType, array $params = array())
{
if (!$contentType instanceof ContentTypeInterface) {
throw new TransformerParameterTypeException();
}
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$facadeClass,
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
ContentRepositoryInterface $contentRepository,
ContentTypeRepositoryInterface $contentTypeRepository,
AuthorizationCheckerInterface $authorizationChecker,
- Create a ticketCreate a ticket
Avoid unused parameters such as '$params'. Open
Open
public function reverseTransform(FacadeInterface $facade, 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
Avoid unused parameters such as '$params'. Open
Open
public function transform($contentType, 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
@throws type of transform
has undeclared type \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open
Open
public function transform($contentType, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method getVersion
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->version = $contentType->getVersion();
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, ContentTypeInterface::ENTITY_TYPE)
- Create a ticketCreate a ticket
- Exclude checks
Parameter $contentRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Call to method choose
from undeclared class \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open
Open
$facade->name = $this->multiLanguagesChoiceManager->choose($contentType->getNames());
- Create a ticketCreate a ticket
- Exclude checks
Call to method isDefiningStatusable
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->definingStatusable = $contentType->isDefiningStatusable();
- Create a ticketCreate a ticket
- Exclude checks
Call to method isLinkedToSite
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$contentType->isLinkedToSite() && $contentType->isAlwaysShared(),
- Create a ticketCreate a ticket
- Exclude checks
Call to method findOneByContentTypeIdInLastVersion
from undeclared class \OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface
Open
Open
return $this->contentTypeRepository->findOneByContentTypeIdInLastVersion($facade->contentTypeId);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer::hasGroup
Open
Open
if ($this->hasGroup(CMSGroupContext::AUTHORIZATIONS)) {
- Create a ticketCreate a ticket
- Exclude checks
Parameter $multiLanguagesChoiceManager
has undeclared type \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $contentType
has undeclared type \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
public function transform($contentType, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer->authorizationChecker
Open
Open
$this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, ContentTypeInterface::ENTITY_TYPE)
- Create a ticketCreate a ticket
- Exclude checks
Return type of reverseTransform()
is undeclared type \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
public function reverseTransform(FacadeInterface $facade, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method getId
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->id = $contentType->getId();
- Create a ticketCreate a ticket
- Exclude checks
Call to method isLinkedToSite
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->linkedToSite = $contentType->isLinkedToSite();
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractSecurityCheckerAwareTransformer
Open
Open
parent::__construct($facadeClass, $authorizationChecker);
- Create a ticketCreate a ticket
- Exclude checks
Return type of transform()
is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function transform($contentType, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method isDefiningVersionable
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->definingVersionable = $contentType->isDefiningVersionable();
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer->authorizationChecker
Open
Open
$facade->addRight('can_duplicate', $this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, ContentTypeInterface::ENTITY_TYPE));
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer->authorizationChecker
Open
Open
$facade->addRight('can_delete', $this->authorizationChecker->isGranted(ContributionActionInterface::DELETE, $contentType) &&
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer::hasGroup
Open
Open
if ($this->hasGroup(CMSGroupContext::FIELD_TYPES)) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer::getContext
Open
Open
$facade->addField($this->getContext()->transform('field_type', $field));
- Create a ticketCreate a ticket
- Exclude checks
Parameter $authorizationChecker
has undeclared type \Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer::newFacade
Open
Open
$facade = $this->newFacade();
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property contentTypeId
from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
return $this->contentTypeRepository->findOneByContentTypeIdInLastVersion($facade->contentTypeId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method getContentTypeId
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->contentTypeId = $contentType->getContentTypeId();
- Create a ticketCreate a ticket
- Exclude checks
Call to method isDefiningStatusable
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$contentType->isDefiningStatusable()
- Create a ticketCreate a ticket
- Exclude checks
Parameter $facade
has undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function reverseTransform(FacadeInterface $facade, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
if (!$contentType instanceof ContentTypeInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\ApiBundle\Transformer\ContentTypeTransformer->authorizationChecker
Open
Open
$this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, $content)
- Create a ticketCreate a ticket
- Exclude checks
Call to method getFields
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
foreach ($contentType->getFields() as $field) {
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property contentTypeId
from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
if (null !== $facade->contentTypeId) {
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractSecurityCheckerAwareTransformer
Open
Open
class ContentTypeTransformer extends AbstractSecurityCheckerAwareTransformer
- Create a ticketCreate a ticket
- Exclude checks
Call to method getDefaultListable
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->defaultListable = $contentType->getDefaultListable();
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->addRight('can_duplicate', $this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, ContentTypeInterface::ENTITY_TYPE));
- Create a ticketCreate a ticket
- Exclude checks
Call to method isAlwaysShared
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$contentType->isLinkedToSite() && $contentType->isAlwaysShared(),
- 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
Call to method getNames
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$facade->name = $this->multiLanguagesChoiceManager->choose($contentType->getNames());
- Create a ticketCreate a ticket
- Exclude checks
Call to method getContentTypeId
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
Open
$contentType->getContentTypeId(),
- Create a ticketCreate a ticket
- Exclude checks
Parameter $contentTypeRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $contentTypeRepository. Keep variable name length under 20. Open
Open
protected $contentTypeRepository;
- 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 $multiLanguagesChoiceManager. Keep variable name length under 20. Open
Open
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
- 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 $multiLanguagesChoiceManager. Keep variable name length under 20. Open
Open
protected $multiLanguagesChoiceManager;
- 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 $contentTypeRepository. Keep variable name length under 20. Open
Open
ContentTypeRepositoryInterface $contentTypeRepository,
- 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
Blank line found at start of control structure Open
Open
if ($this->hasGroup(CMSGroupContext::AUTHORIZATIONS)) {
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
Open
$facade->addRight('can_duplicate', $this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, ContentTypeInterface::ENTITY_TYPE));
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
Open
$facade->addRight('can_delete', $this->authorizationChecker->isGranted(ContributionActionInterface::DELETE, $contentType) &&
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
Open
$this->authorizationChecker->isGranted(ContributionActionInterface::CREATE, ContentTypeInterface::ENTITY_TYPE)
- Create a ticketCreate a ticket
- Exclude checks