slam / phpstan-zend-framework
Zend Framework 3 MVC controller plugin extension for PHPStan.
Installs: 9 285
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 7
Open Issues: 2
Type:phpstan-extension
Requires
- php: ^7.1
- phpstan/phpstan: ^0.11.8
- zendframework/zend-mvc: ^3.1
Requires (Dev)
- phpstan/phpstan-phpunit: ^0.11
- phpunit/phpunit: ^7.5
- roave/security-advisories: dev-master
- slam/php-cs-fixer-extensions: ^1.17
- slam/php-debug-r: ^1.4
- zendframework/zend-cache: ^2.8
- zendframework/zend-filter: ^2.9
- zendframework/zend-form: ^2.14
- zendframework/zend-hydrator: ^2.4 || ^3.0
- zendframework/zend-i18n: ^2.9
- zendframework/zend-inputfilter: ^2.10
- zendframework/zend-log: ^2.10
- zendframework/zend-mail: ^2.10
- zendframework/zend-mvc: ^3.1
- zendframework/zend-paginator: ^2.8
- zendframework/zend-validator: ^2.12
This package is auto-updated.
Last update: 2020-01-02 14:08:34 UTC
README
Repository abandoned 2019-12-31
This repository has moved to Slamdunk/phpstan-laminas-framework.
PHPStan extension for Zend Framework
This extension provides following features:
- Provide correct return types for
\Zend\ServiceManager\ServiceLocatorInterface::get()
using real service instances - Handle controller plugins that are called using magic
__call()
in subclasses of\Zend\Mvc\Controller\AbstractController
getApplication()
,getRenderer()
,getRequest()
andgetResponse()
methods on Controllers, MvcEvents, View, ViewEvent and Application returns the real instance instead of type-hinted interfacesgetView()
method on\Zend\View\Helper\AbstractHelper
returns the real Renderer instance instead of type-hinted interface\Zend\Stdlib\ArrayObject
is configured as a Universal object crate- Handle
\Zend\Stdlib\AbstractOptions
magic properties
Installation
To use this extension, require it in Composer:
composer require --dev slam/phpstan-zend-framework
If you also install phpstan/extension-installer then you're all set!
Manual installation
If you don't want to use phpstan/extension-installer
, include extension.neon in your project's PHPStan config:
includes:
- vendor/slam/phpstan-zend-framework/extension.neon
Configuration
This library already recognize built-in services and plugins.
You can opt in for more advanced analysis by providing the service manager from your own application:
parameters:
zendframework:
serviceManagerLoader: tests/service-manager.php
For example, tests/service-manager.php
would look something like this:
$app = \Zend\Mvc\Application::init($config); return $app->getServiceManager();