netglue/prismic-php-kit

View on GitHub
src/Prismic/ApiData.php

Summary

Maintainability
A
1 hr
Test Coverage
A
100%

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        array $refs,
        array $bookmarks,
        array $types,
        array $tags,
        array $forms,
Severity: Major
Found in src/Prismic/ApiData.php - About 1 hr to fix

    Avoid using static access to class 'Prismic\Ref' in method 'withJsonObject'.
    Open

                        return Ref::parse($ref);
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    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 'Prismic\Experiments' in method 'withJsonObject'.
    Open

                         : Experiments::parse(new stdClass);
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    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 'Prismic\Experiments' in method 'withJsonObject'.
    Open

                         ? Experiments::parse($json->experiments)
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    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

    The parameter $oauth_initiate is not named in camelCase.
    Open

        private function __construct(
            array $refs,
            array $bookmarks,
            array $types,
            array $tags,
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The property $oauth_initiate is not named in camelCase.
    Open

    class ApiData
    {
        /**
         * An array of the usable refs for this API
         * @var array
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The parameter $oauth_token is not named in camelCase.
    Open

        private function __construct(
            array $refs,
            array $bookmarks,
            array $types,
            array $tags,
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The property $oauth_token is not named in camelCase.
    Open

    class ApiData
    {
        /**
         * An array of the usable refs for this API
         * @var array
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The variable $oauth_initiate is not named in camelCase.
    Open

        private function __construct(
            array $refs,
            array $bookmarks,
            array $types,
            array $tags,
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $oauth_token is not named in camelCase.
    Open

        private function __construct(
            array $refs,
            array $bookmarks,
            array $types,
            array $tags,
    Severity: Minor
    Found in src/Prismic/ApiData.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status