creof/doctrine2-spatial

View on GitHub
tests/CrEOF/Spatial/Tests/ORM/Query/WrappingTest.php

Summary

Maintainability
A
1 hr
Test Coverage

Method testTypeWrappingSelect has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testTypeWrappingSelect()
    {
        $lineString = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/ORM/Query/WrappingTest.php - About 1 hr to fix

Avoid using static access to class '\Doctrine\ORM\Version' in method 'testTypeWrappingWhere'.
Open

        if (Version::compare('2.5') <= 0) {

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 '\Doctrine\ORM\Version' in method 'testTypeWrappingSelect'.
Open

        if (Version::compare('2.5') <= 0) {

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

Line exceeds 120 characters; contains 147 characters
Open

                throw new UnsupportedPlatformException(sprintf('DBAL platform "%s" is not currently supported.', $this->getPlatform()->getName()));

Line exceeds 120 characters; contains 148 characters
Open

        $query = $this->getEntityManager()->createQuery('SELECT g FROM CrEOF\Spatial\Tests\Fixtures\GeometryEntity g WHERE g.geometry = :geometry');

There are no issues that match your filters.

Category
Status