Skip to content

Commit

Permalink
Corrected or baselined static analysis issues caused by #58 `@interna…
Browse files Browse the repository at this point in the history
…l` addition or deletions

Signed-Off-By: Marco Pivetta <[email protected]>
  • Loading branch information
Ocramius committed Dec 9, 2020
1 parent 992c26e commit ab21223
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 1,772 deletions.
1,719 changes: 90 additions & 1,629 deletions psalm-baseline.xml

Large diffs are not rendered by default.

21 changes: 19 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,32 @@
</projectFiles>

<issueHandlers>
<InternalClass>
<errorLevel type="suppress">
<!-- the scanner internal component can be used by package internals -->
<referencedClass name="Laminas\Code\Generic\Prototype\PrototypeClassFactory"/>
<referencedClass name="Laminas\Code\Scanner\DocBlockScanner"/>
</errorLevel>
</InternalClass>

<InternalMethod>
<errorLevel type="suppress">
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::method"/>
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn"/>
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::with"/>
</errorLevel>

<!-- the scanner internal component can be used by package internals -->
<errorLevel type="suppress">
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn"/>
<referencedMethod name="Laminas\Code\Generic\Prototype\PrototypeClassFactory::addPrototype"/>
<referencedMethod name="Laminas\Code\Generic\Prototype\PrototypeClassFactory::getClonedPrototype"/>
<referencedMethod name="Laminas\Code\Generic\Prototype\PrototypeClassFactory::setGenericPrototype"/>
<referencedMethod name="Laminas\Code\Generic\Prototype\PrototypeInterface::getName"/>
<referencedMethod name="Laminas\Code\Scanner\DocBlockScanner::getLongDescription"/>
<referencedMethod name="Laminas\Code\Scanner\DocBlockScanner::getShortDescription"/>
<referencedMethod name="Laminas\Code\Scanner\DocBlockScanner::getTags"/>
</errorLevel>
<errorLevel type="suppress">
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::with"/>
</errorLevel>
</InternalMethod>
</issueHandlers>
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/DocBlockGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DocBlockGenerator extends AbstractGenerator
protected $wordwrap = true;

/**
* @var TagManager
* @var TagManager|null
*/
protected static $tagManager;

Expand Down
2 changes: 1 addition & 1 deletion src/Generic/Prototype/PrototypeClassFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PrototypeClassFactory
protected $prototypes = [];

/**
* @var PrototypeGenericInterface
* @var PrototypeGenericInterface|null
*/
protected $genericPrototype;

Expand Down
18 changes: 1 addition & 17 deletions src/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Laminas\Code\Reflection;

use Laminas\Code\Scanner\FileScanner;
use ReflectionClass;

use function array_shift;
Expand All @@ -23,7 +22,7 @@ class ClassReflection extends ReflectionClass implements ReflectionInterface
{

/**
* @var DocBlockReflection
* @var DocBlockReflection|null
*/
protected $docBlock;

Expand Down Expand Up @@ -225,19 +224,4 @@ public function __toString()
{
return parent::__toString();
}

/**
* Creates a new FileScanner instance.
*
* By having this as a separate method it allows the method to be overridden
* if a different FileScanner is needed.
*
* @param string $filename
*
* @return FileScanner
*/
protected function createFileScanner($filename)
{
return new FileScanner($filename);
}
}
16 changes: 0 additions & 16 deletions src/Reflection/MethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Laminas\Code\Reflection;

use Laminas\Code\Scanner\CachingFileScanner;
use ReflectionMethod as PhpReflectionMethod;

use function array_shift;
Expand Down Expand Up @@ -459,19 +458,4 @@ public function __toString()
{
return parent::__toString();
}

/**
* Creates a new FileScanner instance.
*
* By having this as a separate method it allows the method to be overridden
* if a different FileScanner is needed.
*
* @param string $filename
*
* @return CachingFileScanner
*/
protected function createFileScanner($filename)
{
return new CachingFileScanner($filename);
}
}
16 changes: 0 additions & 16 deletions src/Reflection/PropertyReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Laminas\Code\Reflection;

use Laminas\Code\Scanner\CachingFileScanner;
use ReflectionProperty as PhpReflectionProperty;

/**
Expand Down Expand Up @@ -61,19 +60,4 @@ public function toString()
{
return $this->__toString();
}

/**
* Creates a new FileScanner instance.
*
* By having this as a separate method it allows the method to be overridden
* if a different FileScanner is needed.
*
* @param string $filename
*
* @return CachingFileScanner
*/
protected function createFileScanner($filename)
{
return new CachingFileScanner($filename);
}
}
1 change: 0 additions & 1 deletion test/Reflection/MethodReflectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Laminas\Code\Reflection\MethodReflection;
use Laminas\Code\Reflection\ParameterReflection;
use Laminas\Code\Scanner\CachingFileScanner;
use LaminasTest\Code\Reflection\TestAsset\InjectableMethodReflection;
use PHPUnit\Framework\TestCase;

use function array_shift;
Expand Down
1 change: 0 additions & 1 deletion test/Reflection/PropertyReflectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Laminas\Code\Reflection\ClassReflection;
use Laminas\Code\Reflection\PropertyReflection;
use Laminas\Code\Scanner\CachingFileScanner;
use LaminasTest\Code\Reflection\TestAsset\InjectablePropertyReflection;
use PHPUnit\Framework\TestCase;

use function get_class;
Expand Down
20 changes: 0 additions & 20 deletions test/Reflection/TestAsset/InjectableClassReflection.php

This file was deleted.

20 changes: 0 additions & 20 deletions test/Reflection/TestAsset/InjectableMethodReflection.php

This file was deleted.

20 changes: 0 additions & 20 deletions test/Reflection/TestAsset/InjectablePropertyReflection.php

This file was deleted.

28 changes: 0 additions & 28 deletions test/TestAsset/Proxy/CachingFileScannerProxy.php

This file was deleted.

0 comments on commit ab21223

Please sign in to comment.