studioespresso/craft-seo-fields

View on GitHub
src/services/SchemaService.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::creativeWork()) => 'Creative Work',
Severity: Minor
Found in src/services/SchemaService.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 '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::organization()) => 'Organisation',
Severity: Minor
Found in src/services/SchemaService.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 '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::person()) => 'Person',
Severity: Minor
Found in src/services/SchemaService.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 '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::article()) => 'Article',
Severity: Minor
Found in src/services/SchemaService.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 '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::webPage()) => 'WebPage',
Severity: Minor
Found in src/services/SchemaService.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 '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::review()) => 'Review',
Severity: Minor
Found in src/services/SchemaService.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 '\Spatie\SchemaOrg\Schema' in method 'getDefaultOptions'.
Open

            get_class(Schema::recipe()) => 'Recipe',
Severity: Minor
Found in src/services/SchemaService.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

Call to method review from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::review()) => 'Review',
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method article from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::article()) => 'Article',
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method __construct from undeclared class \Spatie\SchemaOrg\Schema
Open

        return new Schema();
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method getInstance from undeclared class \studioespresso\seofields\SeoFields
Open

        $options = SeoFields::getInstance()->getSettings()->schemaOptions;
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method webPage from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::webPage()) => 'WebPage',
Severity: Critical
Found in src/services/SchemaService.php by phan

Class extends undeclared class \craft\base\Component
Open

class SchemaService extends Component
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method person from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::person()) => 'Person',
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method organization from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::organization()) => 'Organisation',
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method recipe from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::recipe()) => 'Recipe',
Severity: Critical
Found in src/services/SchemaService.php by phan

Call to method creativeWork from undeclared class \Spatie\SchemaOrg\Schema
Open

            get_class(Schema::creativeWork()) => 'Creative Work',
Severity: Critical
Found in src/services/SchemaService.php by phan

There are no issues that match your filters.

Category
Status