Issues (126)

src/ModelVisitorConcerns/ProcessTerms.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlgoWeb\ODataMetadata\ModelVisitorConcerns;
6
7
use AlgoWeb\ODataMetadata\EdmModelVisitor;
8
use AlgoWeb\ODataMetadata\Interfaces\ISchemaElement;
9
use AlgoWeb\ODataMetadata\Interfaces\ITerm;
10
use AlgoWeb\ODataMetadata\Interfaces\ITypeReference;
11
use AlgoWeb\ODataMetadata\Interfaces\IValueTerm;
12
13
trait ProcessTerms
14
{
15
    protected function processTerm(ITerm $term): void
0 ignored issues
show
The parameter $term is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

15
    protected function processTerm(/** @scrutinizer ignore-unused */ ITerm $term): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17
        // Do not visit NamedElement as that gets visited by other means.
18
    }
19
20
    protected function processValueTerm(IValueTerm $term): void
21
    {
22
        /** @var EdmModelVisitor $this */
23
        $this->processSchemaElement($term);
24
        $this->processTerm($term);
25
        $this->visitTypeReference($term->getType());
0 ignored issues
show
It seems like $term->getType() can also be of type null; however, parameter $reference of AlgoWeb\ODataMetadata\Ed...r::visitTypeReference() does only seem to accept AlgoWeb\ODataMetadata\Interfaces\ITypeReference, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        $this->visitTypeReference(/** @scrutinizer ignore-type */ $term->getType());
Loading history...
26
    }
27
}
28