open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Manager/ContentTypeManager.php

Summary

Maintainability
A
0 mins
Test Coverage

Call to method getFields from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

        foreach ($contentType->getFields() as $field) {
Severity: Critical
Found in Backoffice/Manager/ContentTypeManager.php by phan

Return type of duplicate() is undeclared type \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

    public function duplicate(ContentTypeInterface $contentType)

Call to method addFieldType from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

            $newContentType->addFieldType($newField);
Severity: Critical
Found in Backoffice/Manager/ContentTypeManager.php by phan

Call to method getDefaultListable from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

        $newContentType->setDefaultListable($this->updateDefaultListable($newContentType->getDefaultListable()));
Severity: Critical
Found in Backoffice/Manager/ContentTypeManager.php by phan

Return type of initializeNewContentType() is undeclared type \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

    public function initializeNewContentType()

Call to method setDefaultListable from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

        $newContentType->setDefaultListable($this->updateDefaultListable($newContentType->getDefaultListable()));
Severity: Critical
Found in Backoffice/Manager/ContentTypeManager.php by phan

Parameter $contentType has undeclared type \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

    public function duplicate(ContentTypeInterface $contentType)

Avoid excessively long variable names like $contentTypeDefaultListable. Keep variable name length under 20.
Open

    protected function updateDefaultListable(array $contentTypeDefaultListable)

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

Expected 1 space after closing parenthesis; found 13
Open

            foreach ($contentTypes as $contentType)

There are no issues that match your filters.

Category
Status