PHPUnit and PHP_CodeSniffer are now installed by default. To execute tests and detect coding standards violations, run the following command:
$ composer check
However the command runs into an error (see below). To get it up and running one needs to composer require (dev) phpstan and create an empty phpstan.installer.neon file.
Since I'm new to Zend Expressive, I'm not sure, if the fix needs to be done in the code or the documentation is off. Please let me know, if this belongs to the docs. Thanks in advance.
A valid response of the phpstan check, something like
# [Test results of PHPUnit]
> phpstan analyze -l max -c ./phpstan.installer.neon ./src ./config
------ ------------------------------------------------------------
src\App\src\Handler\HomePageHandler.php 12/12 [============================] 100%
------ ------------------------------------------------------------
70 Class Zend\Expressive\Router\AuraRouter not found.
76 Class Zend\Expressive\Router\ZendRouter not found.
81 Class Zend\Expressive\Plates\PlatesRenderer not found.
84 Class Zend\Expressive\Twig\TwigRenderer not found.
87 Class Zend\Expressive\ZendView\ZendViewRenderer not found.
------ ------------------------------------------------------------
------ --------------------------------------------------------
Line config\config.php
------ --------------------------------------------------------
26 Class Zend\Expressive\Swoole\ConfigProvider not found.
27 Class Zend\Expressive\Swoole\ConfigProvider not found.
------ --------------------------------------------------------
Script phpstan analyze -l max -c ./phpstan.installer.neon ./src ./config handling the analyze event returned with error code 1
[ERROR] Found 7 errors
Script @analyze was called via check
Actual results
# [Test results of PHPUnit]
> phpstan analyze -l max -c ./phpstan.installer.neon ./src ./config
Project config file at path ./phpstan.installer.neon does not exist.
Script phpstan analyze -l max -c ./phpstan.installer.neon ./src ./config handling the analyze event returned with error code 1
Script @analyze was called via check
The documentation states:
However the command runs into an error (see below). To get it up and running one needs to composer require (dev) phpstan and create an empty
phpstan.installer.neon
file.Since I'm new to Zend Expressive, I'm not sure, if the fix needs to be done in the code or the documentation is off. Please let me know, if this belongs to the docs. Thanks in advance.
Code to reproduce the issue
Expected results
A valid response of the phpstan check, something like
Actual results