Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof-of-Concept: Implementation of an ApplicationPipeline class for better static code analysis #107

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 0 additions & 217 deletions phpstan-baseline.neon

This file was deleted.

60 changes: 5 additions & 55 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.13.1@5cf660f63b548ccd4a56f62d916ee4d6028e01a3">
<files psalm-version="4.20.0@f82a70e7edfc6cf2705e9374c8a0b6a974a779ed">
<file src="src/Application.php">
<PossiblyInvalidCast occurrences="1">
<code>$path</code>
</PossiblyInvalidCast>
</file>
<file src="src/ConfigProvider.php">
<MixedArrayOffset occurrences="2"/>
<UndefinedClass occurrences="3">
<code>ApplicationPipeline</code>
<code>ApplicationPipeline</code>
<code>\Zend\Expressive\ApplicationPipeline</code>
</UndefinedClass>
</file>
<file src="src/Container/ApplicationConfigInjectionDelegator.php">
<MissingClosureParamType occurrences="1">
<code>$item</code>
Expand All @@ -32,11 +24,10 @@
<code>$spec['middleware']</code>
<code>$spec['path']</code>
</MixedArrayAccess>
<MixedAssignment occurrences="8">
<MixedAssignment occurrences="7">
<code>$config</code>
<code>$methods</code>
<code>$name</code>
<code>$options</code>
<code>$path</code>
<code>$queue</code>
<code>$serial</code>
Expand All @@ -47,15 +38,11 @@
</MixedOperand>
</file>
<file src="src/Container/ApplicationFactory.php">
<MixedArgument occurrences="5">
<MixedArgument occurrences="4">
<code>$container-&gt;get(ApplicationPipeline::class)</code>
<code>$container-&gt;get(MiddlewareFactory::class)</code>
<code>$container-&gt;get(RequestHandlerRunnerInterface::class)</code>
<code>ApplicationPipeline::class</code>
</MixedArgument>
<UndefinedClass occurrences="1">
<code>ApplicationPipeline</code>
</UndefinedClass>
</file>
<file src="src/Container/ErrorHandlerFactory.php">
<MixedArgument occurrences="2">
Expand Down Expand Up @@ -104,16 +91,12 @@
</MixedAssignment>
</file>
<file src="src/Container/RequestHandlerRunnerFactory.php">
<MixedArgument occurrences="5">
<MixedArgument occurrences="4">
<code>$container-&gt;get(ApplicationPipeline::class)</code>
<code>$container-&gt;get(EmitterInterface::class)</code>
<code>$container-&gt;get(ServerRequestErrorResponseGenerator::class)</code>
<code>$container-&gt;get(ServerRequestInterface::class)</code>
<code>ApplicationPipeline::class</code>
</MixedArgument>
<UndefinedClass occurrences="1">
<code>ApplicationPipeline</code>
</UndefinedClass>
</file>
<file src="src/Container/ServerRequestErrorResponseGeneratorFactory.php">
<MixedArgument occurrences="3">
Expand Down Expand Up @@ -236,7 +219,7 @@
<InvalidFunctionCall occurrences="1">
<code>$configProvider()</code>
</InvalidFunctionCall>
<MixedArgument occurrences="34">
<MixedArgument occurrences="33">
<code>$alias</code>
<code>$alias</code>
<code>$alias</code>
Expand Down Expand Up @@ -270,7 +253,6 @@
<code>$name</code>
<code>$name</code>
<code>$name</code>
<code>ApplicationPipeline::class</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="1">
<code>$dependencies</code>
Expand Down Expand Up @@ -298,15 +280,8 @@
<RedundantCondition occurrences="1">
<code>assertIsArray</code>
</RedundantCondition>
<UndefinedClass occurrences="1">
<code>ApplicationPipeline</code>
</UndefinedClass>
</file>
<file src="test/Container/ApplicationConfigInjectionDelegatorTest.php">
<MissingClosureParamType occurrences="2">
<code>$found</code>
<code>$route</code>
</MissingClosureParamType>
<MixedArgument occurrences="1">
<code>$pipeline</code>
</MixedArgument>
Expand All @@ -328,19 +303,6 @@
<code>$r-&gt;getValue($pipeline)</code>
</MixedReturnStatement>
</file>
<file src="test/Container/ApplicationFactoryTest.php">
<MixedArgument occurrences="1">
<code>ApplicationPipeline::class</code>
</MixedArgument>
<UndefinedClass occurrences="1">
<code>ApplicationPipeline</code>
</UndefinedClass>
</file>
<file src="test/Container/EmitterFactoryTest.php">
<MixedAssignment occurrences="1">
<code>$emitter</code>
</MixedAssignment>
</file>
<file src="test/Container/ErrorHandlerFactoryTest.php">
<InvalidArgument occurrences="1">
<code>$generator</code>
Expand All @@ -361,9 +323,6 @@
<InvalidFunctionCall occurrences="1">
<code>$errorGenerator($e)</code>
</InvalidFunctionCall>
<MixedArgument occurrences="1">
<code>ApplicationPipeline::class</code>
</MixedArgument>
<MixedAssignment occurrences="2">
<code>$toTest</code>
<code>$toTest</code>
Expand All @@ -372,9 +331,6 @@
<code>$toTest($e)</code>
<code>$toTest()</code>
</MixedFunctionCall>
<UndefinedClass occurrences="1">
<code>ApplicationPipeline</code>
</UndefinedClass>
</file>
<file src="test/Container/ResponseFactoryFactoryTest.php">
<RedundantCondition occurrences="1">
Expand Down Expand Up @@ -461,9 +417,6 @@
</PossiblyFalseOperand>
</file>
<file src="test/Middleware/ErrorResponseGeneratorTest.php">
<MissingClosureParamType occurrences="1">
<code>$body</code>
</MissingClosureParamType>
<MixedArgument occurrences="1">
<code>$body</code>
</MixedArgument>
Expand Down Expand Up @@ -560,9 +513,6 @@
<MixedReturnStatement occurrences="1">
<code>$res-&gt;withBody($stream)</code>
</MixedReturnStatement>
<PossiblyInvalidArgument occurrences="1">
<code>testMatchWithAllHttpMethods</code>
</PossiblyInvalidArgument>
<UnusedClosureParam occurrences="18">
<code>$handler</code>
<code>$handler</code>
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<DeprecatedClass>
<errorLevel type="suppress">
<referencedClass name="Mezzio\Response\CallableResponseFactoryDecorator"/>
<referencedClass name="Mezzio\ApplicationPipeline"/>
</errorLevel>
</DeprecatedClass>
<InternalMethod>
Expand Down
Loading