testDrawSimpleEntityWithFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace DoctrineORMModuleTest\Yuml;
4
5
use DoctrineORMModule\Yuml\MetadataGrapher;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Tests for the metadata to string converter
10
 *
11
 * @license MIT
12
 * @link    http://www.doctrine-project.org/
13
 * @author  Marco Pivetta <[email protected]>
14
 */
15
class MetadataGrapherTest extends TestCase
16
{
17
    /**
18
     * @var MetadataGrapher
19
     */
20
    protected $grapher;
21
22
    /**
23
     * {@inheritDoc}
24
     */
25
    public function setUp() : void
26
    {
27
        parent::setUp();
0 ignored issues
show
Bug introduced by
It seems like you code against a specific sub-type and not the parent class PHPUnit\Framework\TestCase as the method setUp() does only exist in the following sub-classes of PHPUnit\Framework\TestCase: AbstractIssue3881Test, AbstractTest, AssertionExampleTest, BankAccountTest, BankAccountWithCustomExtensionTest, BeforeAndAfterTest, BeforeClassAndAfterClassTest, BeforeClassWithOnlyDataProviderTest, ChangeCurrentWorkingDirectoryTest, ClonedDependencyTest, ConcreteTest, ConcreteWithMyCustomExtensionTest, ConsecutiveParametersTest, CoverageClassExtendedTest, CoverageClassNothingTest, CoverageClassTest, CoverageClassWithoutAnnotationsTest, CoverageCoversOverridesCoversNothingTest, CoverageFunctionParenthesesTest, CoverageFunctionParenthesesWhitespaceTest, CoverageFunctionTest, CoverageMethodNothingCoversMethod, CoverageMethodNothingTest, CoverageMethodOneLineAnnotationTest, CoverageMethodParenthesesTest, CoverageMethodParenthesesWhitespaceTest, CoverageMethodTest, CoverageNamespacedFunctionTest, CoverageNoneTest, CoverageNotPrivateTest, CoverageNotProtectedTest, CoverageNotPublicTest, CoveragePrivateTest, CoverageProtectedTest, CoveragePublicTest, DataProviderDebugTest, DataProviderDependencyTest, DataProviderFilterTest, DataProviderIncompleteTest, DataProviderSkippedTest, DataProviderTest, DataproviderExecutionOrderTest, DependencyFailureTest, DependencySuccessTest, DoNoAssertionTestCase, DoctrineORMModuleTest\Co...or\MappingCollectorTest, DoctrineORMModuleTest\Co...\SQLLoggerCollectorTest, DoctrineORMModuleTest\Form\AnnotationBuilderTest, DoctrineORMModuleTest\Fo...AnnotationsListenerTest, DoctrineORMModuleTest\Listener\CliConfiguratorTest, DoctrineORMModuleTest\Paginator\AdapterTestIgnore, DoctrineORMModuleTest\Se...onfigurationFactoryTest, DoctrineORMModuleTest\Se...ALConnectionFactoryTest, DoctrineORMModuleTest\Se...tionsCommandFactoryTest, DoctrineORMModuleTest\Se...gerCollectorFactoryTest, DoctrineORMModuleTest\Yuml\MetadataGrapherTest, DoctrineORMModuleTest\Yuml\YumlControllerTest, DoesNotPerformAssertions...erformingAssertionsTest, DummyBarTest, DummyFooTest, DuplicateKeyDataProviderTest, EmptyDataProviderTest, EmptyTestCaseTest, ExceptionInAssertPostConditionsTest, ExceptionInAssertPreConditionsTest, ExceptionInSetUpTest, ExceptionInTearDownAfterClassTest, ExceptionInTearDownTest, ExceptionInTest, ExceptionInTestDetectedInTeardown, ExceptionStackTest, ExceptionTest, Failure, FailureTest, FatalTest, Foo\DataProviderIssue2833\FirstTest, Foo\DataProviderIssue2833\SecondTest, Foo\DataProviderIssue2859\TestWithDataProviderTest, Foo\DataProviderIssue2922\FirstTest, Foo\DataProviderIssue2922\SecondHelloWorldTest, Foo_Bar_Issue684Test, Framework\Constraint\LogicalXorTest, GeneratorTest, IgnoreCodeCoverageClassTest, IncompleteTest, InheritanceA, InheritanceB, InheritedTestCase, IniTest, InvocationMockerTest, IsolationTest, Issue1021Test, Issue1149Test, Issue1216Test, Issue1265Test, Issue1330Test, Issue1335Test, Issue1337Test, Issue1348Test, Issue1351Test, Issue1374Test, Issue1437Test, Issue1468Test, Issue1471Test, Issue1472Test, Issue1570Test, Issue2085Test, Issue2137Test, Issue2145Test, Issue2158Test, Issue2366Test, Issue2380Test, Issue2382Test, Issue2435Test, Issue2725\BeforeAfterClassPidTest, Issue2731Test, Issue2811Test, Issue2830Test, Issue2972\Issue2972Test, Issue3093Test, Issue322Test, Issue3739\Issue3739Test, Issue3881Test, Issue3889Test, Issue3904Test, Issue3983Test, Issue433Test, Issue445Test, Issue498Test, Issue503Test, Issue578Test, Issue581Test, Issue74Test, Issue765Test, Issue797Test, MockBuilderTest, MockObjectTest, ModifiedConstructorTestCase, MultiDependencyTest, MultipleDataProviderTest, My\Space\ExceptionNamespaceTest, NamespaceCoverageClassExtendedTest, NamespaceCoverageClassTest, NamespaceCoverageCoversClassPublicTest, NamespaceCoverageCoversClassTest, NamespaceCoverageMethodTest, NamespaceCoverageNotPrivateTest, NamespaceCoverageNotProtectedTest, NamespaceCoverageNotPublicTest, NamespaceCoveragePrivateTest, NamespaceCoverageProtectedTest, NamespaceCoveragePublicTest, NoArgTestCaseTest, NoTestCases, NotExistingCoveredElementTest, NotPublicTestCase, NotVoidTestCase, NothingTest, NullTestResultCacheTest, NumericGroupAnnotationTest, OneTest, OneTestCase, OutputTestCase, OverrideTestCase, PHPUnit\Framework\AssertTest, PHPUnit\Framework\ConstraintTest, PHPUnit\Framework\Constraint\ArrayHasKeyTest, PHPUnit\Framework\Constraint\ArraySubsetTest, PHPUnit\Framework\Constraint\CallbackTest, PHPUnit\Framework\Constraint\ClassHasAttributeTest, PHPUnit\Framework\Constr...sHasStaticAttributeTest, PHPUnit\Framework\Constraint\ConstraintTestCase, PHPUnit\Framework\Constraint\CountTest, PHPUnit\Framework\Constraint\DirectoryExistsTest, PHPUnit\Framework\Constraint\ExceptionCodeTest, PHPUnit\Framework\Constr...eptionMessageRegExpTest, PHPUnit\Framework\Constraint\ExceptionMessageTest, PHPUnit\Framework\Constraint\ExceptionTest, PHPUnit\Framework\Constraint\FileExistsTest, PHPUnit\Framework\Constraint\GreaterThanTest, PHPUnit\Framework\Constraint\IsEmptyTest, PHPUnit\Framework\Constraint\IsEqualTest, PHPUnit\Framework\Constraint\IsIdenticalTest, PHPUnit\Framework\Constraint\IsInstanceOfTest, PHPUnit\Framework\Constraint\IsJsonTest, PHPUnit\Framework\Constraint\IsNullTest, PHPUnit\Framework\Constraint\IsReadableTest, PHPUnit\Framework\Constraint\IsTypeTest, PHPUnit\Framework\Constraint\IsWritableTest, PHPUnit\Framework\Constr...rrorMessageProviderTest, PHPUnit\Framework\Constraint\JsonMatchesTest, PHPUnit\Framework\Constraint\LessThanTest, PHPUnit\Framework\Constraint\LogicalAndTest, PHPUnit\Framework\Constraint\LogicalNotTest, PHPUnit\Framework\Constraint\LogicalOrTest, PHPUnit\Framework\Constr...\ObjectHasAttributeTest, PHPUnit\Framework\Constraint\RegularExpressionTest, PHPUnit\Framework\Constraint\SameSizeTest, PHPUnit\Framework\Constraint\StringContainsTest, PHPUnit\Framework\Constraint\StringEndsWithTest, PHPUnit\Framework\Constr...esFormatDescriptionTest, PHPUnit\Framework\Constraint\StringStartsWithTest, PHPUnit\Framework\Constr...TraversableContainsTest, PHPUnit\Framework\ExceptionTest, PHPUnit\Framework\ExceptionWrapperTest, PHPUnit\Framework\FunctionsTest, PHPUnit\Framework\IncompleteTestCase, PHPUnit\Framework\IncompleteTestCaseTest, PHPUnit\Framework\InvalidArgumentExceptionTest, PHPUnit\Framework\MockOb...\ConfigurableMethodTest, PHPUnit\Framework\MockOb...ConfigurableMethodsTest, PHPUnit\Framework\MockObject\InvocationHandlerTest, PHPUnit\Framework\MockObject\MatcherTest, PHPUnit\Framework\MockObject\MockClassTest, PHPUnit\Framework\MockObject\MockMethodTest, PHPUnit\Framework\MockObject\MockTraitTest, PHPUnit\Framework\SkippedTestCase, PHPUnit\Framework\SkippedTestCaseTest, PHPUnit\Framework\TestBuilderTest, PHPUnit\Framework\TestCaseTest, PHPUnit\Framework\TestFailureTest, PHPUnit\Framework\TestImplementorTest, PHPUnit\Framework\TestListenerTest, PHPUnit\Framework\TestSuiteIteratorTest, PHPUnit\Framework\TestSuiteTest, PHPUnit\Framework\WarningTestCase, PHPUnit\Runner\DefaultTestResultCacheTest, PHPUnit\Runner\Filter\NameFilterIteratorTest, PHPUnit\Runner\PhptTestCaseTest, PHPUnit\Runner\ResultCacheExtensionTest, PHPUnit\Runner\TestSuiteSorterTest, PHPUnit\SelfTest\Basic\SetUpBeforeClassTest, PHPUnit\SelfTest\Basic\SetUpTest, PHPUnit\SelfTest\Basic\StatusTest, PHPUnit\SelfTest\Basic\TearDownAfterClassTest, PHPUnit\StaticAnalysis\TestUsingMocks, PHPUnit\TestFixture\ActualOutputTest, PHPUnit\Test\HookTest, PHPUnit\Util\Annotation\RegistryTest, PHPUnit\Util\ColorTest, PHPUnit\Util\ConfigurationGeneratorTest, PHPUnit\Util\ConfigurationTest, PHPUnit\Util\GetoptTest, PHPUnit\Util\GlobalStateTest, PHPUnit\Util\JsonTest, PHPUnit\Util\PHP\AbstractPhpProcessTest, PHPUnit\Util\RegularExpressionTest, PHPUnit\Util\TestClassTest, PHPUnit\Util\TestDox\CliTestDoxPrinterColorTest, PHPUnit\Util\TestDox\CliTestDoxPrinterTest, PHPUnit\Util\TestDox\NamePrettifierTest, PHPUnit\Util\TestDox\ano...amePrettifierTest.php$0, PHPUnit\Util\TestDox\ano...amePrettifierTest.php$1, PHPUnit\Util\TestDox\ano...amePrettifierTest.php$2, PHPUnit\Util\TestDox\ano...amePrettifierTest.php$3, PHPUnit\Util\XDebugFilterScriptGeneratorTest, PHPUnit\Util\XmlTest, ProxyObjectTest, RequirementsClassBeforeClassHookTest, RequirementsTest, RouterTest, SeparateClassRunMethodInNewProcessTest, SeparateProcessesTest, StackTest, StopOnErrorTestSuite, StopsOnWarningTest, Success, TemplateMethodsTest, Test, Test3194, TestAutoreferenced, TestCaseWithExceptionInHook, TestDoxGroupTest, TestError, TestIncomplete, TestResultCacheTest, TestRisky, TestSkipped, TestWarning, TestWithAnnotations, TestWithDifferentDurations, TestWithDifferentNames, TestWithDifferentOutput, TestWithDifferentSizes, TestWithDifferentStatuses, TestWithTest, Test\Issue3156Test, Test\Issue3379Test, ThrowExceptionTestCase, ThrowNoExceptionTestCase, TwoTest, WasRun. Maybe you want to instanceof check for one of these explicitly?

Let’s take a look at an example:

abstract class User
{
    /** @return string */
    abstract public function getPassword();
}

class MyUser extends User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different sub-classes of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the parent class:

    abstract class User
    {
        /** @return string */
        abstract public function getPassword();
    
        /** @return string */
        abstract public function getDisplayName();
    }
    
Loading history...
28
29
        $this->grapher = new MetadataGrapher();
30
    }
31
32
    /**
33
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
34
     */
35
    public function testDrawSimpleEntity()
36
    {
37
        $class = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
38
        $class->expects($this->any())->method('getName')->will($this->returnValue('Simple\\Entity'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
        $class->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
40
        $class->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
41
42
        $this->assertSame('[Simple.Entity]', $this->grapher->generateFromMetadata([$class]));
0 ignored issues
show
Documentation introduced by
array($class) is of type array<integer,null,{"0":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
43
    }
44
45
    /**
46
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
47
     */
48
    public function testDrawSimpleEntityWithFields()
49
    {
50
        $class = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
51
        $class->expects($this->any())->method('getName')->will($this->returnValue('Simple\\Entity'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
52
        $class->expects($this->any())->method('getFieldNames')->will($this->returnValue(['a', 'b', 'c']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
53
        $class->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
54
        $class->expects($this->any())->method('isIdentifier')->will(
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
55
            $this->returnCallback(
0 ignored issues
show
Bug introduced by
The method returnCallback() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
56
                function ($field) {
57
                    return $field === 'a';
58
                }
59
            )
60
        );
61
62
        $this->assertSame('[Simple.Entity|+a;b;c]', $this->grapher->generateFromMetadata([$class]));
0 ignored issues
show
Documentation introduced by
array($class) is of type array<integer,null,{"0":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
    }
64
65
    /**
66
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
67
     */
68
    public function testDrawOneToOneUniDirectionalAssociation()
69
    {
70
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
71
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
72
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
74
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
75
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
76
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
77
78
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
79
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
80
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
81
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
82
83
        $this->assertSame('[A]-b 1>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
84
    }
85
86
    /**
87
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
88
     */
89
    public function testDrawOneToOneBiDirectionalAssociation()
90
    {
91
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
92
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
93
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
94
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
95
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
96
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
97
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
98
99
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
100
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
101
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
102
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
103
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
104
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
105
        $class2->expects($this->any())->method('getAssociationMappedByTargetField')->will($this->returnValue('b'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
106
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
107
108
        $this->assertSame('[A]<>a 1-b 1>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
109
    }
110
111
    /**
112
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
113
     */
114
    public function testDrawOneToOneBiDirectionalInverseAssociation()
115
    {
116
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
117
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
118
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
119
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
120
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
121
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
122
        $class1->expects($this->any())->method('getAssociationMappedByTargetField')->will($this->returnValue('a'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
123
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
124
125
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
126
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
127
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
128
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
129
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
130
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
131
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
132
133
        $this->assertSame('[A]<a 1-b 1<>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
134
    }
135
136
    /**
137
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
138
     */
139
    public function testDrawOneToManyBiDirectionalAssociation()
140
    {
141
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
142
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
143
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
144
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
145
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
146
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
147
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
148
149
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
150
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
151
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
152
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
153
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
154
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
155
        $class2->expects($this->any())->method('getAssociationMappedByTargetField')->will($this->returnValue('b'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
156
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
157
158
        $this->assertSame('[A]<>a 1-b *>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
159
    }
160
161
    /**
162
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
163
     */
164
    public function testDrawOneToManyBiDirectionalInverseAssociation()
165
    {
166
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
167
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
168
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
169
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
170
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
171
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
172
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
173
174
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
175
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
176
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
177
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
178
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
179
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
180
        $class2->expects($this->any())->method('getAssociationMappedByTargetField')->will($this->returnValue('b'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
181
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
182
183
        $this->assertSame('[A]<>a *-b 1>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
184
    }
185
186
    /**
187
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
188
     */
189
    public function testDrawManyToManyUniDirectionalAssociation()
190
    {
191
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
192
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
193
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
194
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
195
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
196
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
197
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
198
199
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
200
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
201
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
202
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
203
204
        $this->assertSame('[A]-b *>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
205
    }
206
207
    /**
208
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
209
     */
210
    public function testDrawManyToManyUniDirectionalInverseAssociation()
211
    {
212
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
213
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
214
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
215
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
216
217
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
218
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
219
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
220
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
221
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
222
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
223
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
224
225
        $this->assertSame('[A],[B]-a *>[A]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
226
    }
227
228
    /**
229
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
230
     */
231
    public function testDrawManyToManyBiDirectionalAssociation()
232
    {
233
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
234
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
235
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
236
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
237
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
238
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
239
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
240
241
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
242
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
243
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
244
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
245
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
246
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
247
        $class2->expects($this->any())->method('getAssociationMappedByTargetField')->will($this->returnValue('b'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
248
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
249
250
        $this->assertSame('[A]<>a *-b *>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
251
    }
252
253
    /**
254
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
255
     */
256
    public function testDrawManyToManyBiDirectionalInverseAssociation()
257
    {
258
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
259
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
260
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
261
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
262
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
263
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
264
        $class1->expects($this->any())->method('getAssociationMappedByTargetField')->will($this->returnValue('a'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
265
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
266
267
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
268
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
269
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
270
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
271
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
272
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
273
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
274
275
        $this->assertSame('[A]<a *-b *<>[B]', $this->grapher->generateFromMetadata([$class1, $class2]));
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
276
    }
277
278
    /**
279
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
280
     */
281
    public function testDrawManyToManyAssociationWithoutKnownInverseSide()
282
    {
283
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
284
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
285
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
286
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
287
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
288
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
289
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
290
291
        $this->assertSame('[A]<>-b *>[B]', $this->grapher->generateFromMetadata([$class1]));
0 ignored issues
show
Documentation introduced by
array($class1) is of type array<integer,null,{"0":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
292
    }
293
294
    /**
295
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
296
     */
297
    public function testDrawInheritance()
298
    {
299
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
300
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
301
        $child  = get_class($this->createMock('stdClass'));
302
        $class1->expects($this->any())->method('getName')->will($this->returnValue('stdClass'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
303
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
304
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
305
        $class2->expects($this->any())->method('getName')->will($this->returnValue($child));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
306
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
307
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
308
309
        $this->assertSame(
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
310
            '[stdClass]^[' . str_replace('\\', '.', $child) . ']',
311
            $this->grapher->generateFromMetadata([$class2, $class1])
0 ignored issues
show
Documentation introduced by
array($class2, $class1) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
312
        );
313
    }
314
315
    /**
316
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
317
     */
318
    public function testDrawInheritedFields()
319
    {
320
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
321
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
322
        $child  = get_class($this->createMock('stdClass'));
323
324
        $class1->expects($this->any())->method('getName')->will($this->returnValue('stdClass'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
325
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
326
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue(['inherited']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
327
328
        $class2->expects($this->any())->method('getName')->will($this->returnValue($child));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
329
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
330
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue(['inherited', 'field2']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
331
332
        $this->assertSame(
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
333
            '[stdClass|inherited]^[' . str_replace('\\', '.', $child) . '|field2]',
334
            $this->grapher->generateFromMetadata([$class2, $class1])
0 ignored issues
show
Documentation introduced by
array($class2, $class1) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
335
        );
336
    }
337
338
    /**
339
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
340
     */
341
    public function testDrawInheritedAssociations()
342
    {
343
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
344
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
345
        $class3 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class3 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
346
        $class4 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class4 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
347
        $child  = get_class($this->createMock('stdClass'));
348
349
        $class1->expects($this->any())->method('getName')->will($this->returnValue('stdClass'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
350
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
351
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
352
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
353
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
354
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
355
356
        $class2->expects($this->any())->method('getName')->will($this->returnValue($child));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
357
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['a', 'b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
358
        $class2
0 ignored issues
show
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
359
            ->expects($this->any())
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
360
            ->method('getAssociationTargetClass')
361
            ->will(
362
                $this->returnCallback(
0 ignored issues
show
Bug introduced by
The method returnCallback() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
363
                    function ($assoc) {
364
                        return strtoupper($assoc);
365
                    }
366
                )
367
            );
368
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
369
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
370
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
371
372
        $class3->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
373
        $class3->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
374
        $class3->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
375
376
        $class4->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class4 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
377
        $class4->expects($this->any())->method('getAssociationNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class4 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
378
        $class4->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class4 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
379
380
        $childName = str_replace('\\', '.', $child);
381
        $this->assertSame(
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
382
            '[stdClass]<>-a *>[A],[stdClass]^[' . $childName . '],[' . $childName . ']<>-b *>[B]',
383
            $this->grapher->generateFromMetadata([$class1, $class2])
0 ignored issues
show
Documentation introduced by
array($class1, $class2) is of type array<integer,null,{"0":"null","1":"null"}>, but the function expects a array<integer,object<Doc...Mapping\ClassMetadata>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
384
        );
385
    }
386
387
    /**
388
     * @covers \DoctrineORMModule\Yuml\MetadataGrapher
389
     * @dataProvider injectMultipleRelationsWithBothBiAndMonoDirectional
390
     */
391
    public function testDrawMultipleClassRelatedBothBiAndMonoDirectional($class1, $class2, $class3, $expected)
392
    {
393
        $this->assertSame(
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
394
            $expected,
395
            $this->grapher->generateFromMetadata([$class1, $class2,$class3])
396
        );
397
    }
398
399
    /**
400
     * dataProvider to inject classes in every order possible into the test
401
     *     testDrawMultipleClassRelatedBothBiAndMonoDirectional
402
     *
403
     * @return array
404
     */
405
    public function injectMultipleRelationsWithBothBiAndMonoDirectional()
406
    {
407
        $class1 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class1 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
408
        $class1->expects($this->any())->method('getName')->will($this->returnValue('A'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
409
        $class1->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['c']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
410
        $class1->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('C'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
411
        $class1->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
412
        $class1->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
413
        $class1->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class1 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
414
415
        $class2 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class2 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
416
        $class2->expects($this->any())->method('getName')->will($this->returnValue('B'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
417
        $class2->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['c']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
418
        $class2->expects($this->any())->method('getAssociationTargetClass')->will($this->returnValue('C'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
419
        $class2->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
420
        $class2->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(false));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
421
        $class2->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class2 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
422
423
        $class3 = $this->createMock(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $class3 is correct as $this->createMock(\Doctr...g\ClassMetadata::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
424
        $class3->expects($this->any())->method('getName')->will($this->returnValue('C'));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
425
        $class3->expects($this->any())->method('getAssociationNames')->will($this->returnValue(['b']));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
426
        $class3
0 ignored issues
show
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
427
            ->expects($this->any())
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
428
            ->method('getAssociationTargetClass')
429
            ->with($this->logicalOr($this->equalTo('b'), $this->equalTo('c')))
0 ignored issues
show
Bug introduced by
The method equalTo() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method logicalOr() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
430
            ->will($this->returnCallback([$this,'getAssociationTargetClassMock']));
0 ignored issues
show
Bug introduced by
The method returnCallback() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
431
        $class3->expects($this->any())->method('isAssociationInverseSide')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
432
        $class3->expects($this->any())->method('isCollectionValuedAssociation')->will($this->returnValue(true));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
433
        $class3->expects($this->any())->method('getFieldNames')->will($this->returnValue([]));
0 ignored issues
show
Bug introduced by
The method any() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method expects cannot be called on $class3 (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
Bug introduced by
The method returnValue() does not seem to exist on object<DoctrineORMModule...ml\MetadataGrapherTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
434
435
        return [
436
            [$class1, $class2, $class3, '[A]-c 1>[C],[B]<>b *-c 1>[C]'],
437
            [clone $class1, clone $class3, clone $class2, '[A]-c 1>[C],[C]<c 1-b *<>[B]'],
438
            [clone $class2, clone $class1, clone $class3, '[B]<>b *-c 1>[C],[A]-c 1>[C]'],
439
            [clone $class2, clone $class3, clone $class1, '[B]<>b *-c 1>[C],[A]-c 1>[C]'],
440
            [clone $class3, clone $class1, clone $class2, '[C]<c 1-b *<>[B],[A]-c 1>[C]'],
441
            [clone $class3, clone $class2, clone $class1, '[C]<c 1-b *<>[B],[A]-c 1>[C]'],
442
        ];
443
    }
444
445
    /**
446
     * To mock getAssociationTargetClass method with args
447
     *
448
     * @param  string $a
449
     * @return string
450
     */
451
    public function getAssociationTargetClassMock($a)
452
    {
453
        return strtoupper($a);
454
    }
455
}
456