zendframework / zend-expressive-skeleton

Begin developing PSR-7 middleware applications in seconds!
BSD 3-Clause "New" or "Revised" License
136 stars 90 forks source link

PHPStan is not required and phpstan.installer.neon is missing #263

Closed arueckauer closed 6 years ago

arueckauer commented 6 years ago

The documentation states:

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.

Code to reproduce the issue

$ composer create-project zendframework/zend-expressive-skeleton expressive
$ cd expressive
$ composer check

Expected results

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
geerteltink commented 6 years ago

Duplicate of #261