slam/phpstan-laminas-framework
最新稳定版本:v2.0.0
Composer 安装命令:
composer require slam/phpstan-laminas-framework
包简介
Laminas Framework 3 MVC controller plugin extension for PHPStan.
README 文档
README
This extension provides following features:
- Provide correct return type for
$container->get()calls on containers of type\Laminas\ServiceManager\ServiceLocatorInterface,\Interop\Container\ContainerInterfaceor\Psr\Container\ContainerInterface - Handle controller plugins that are called using magic
__call()in subclasses of\Laminas\Mvc\Controller\AbstractController - Provide correct return type for
pluginmethod ofAbstractController,FilterChain,PhpRendererandValidatorChain getApplication(),getRenderer(),getRequest()andgetResponse()methods on Controllers, MvcEvents, View, ViewEvent and Application returns the real instance instead of type-hinted interfacesgetView()method on\Laminas\View\Helper\AbstractHelperreturns the real Renderer instance instead of type-hinted interface\Laminas\Stdlib\ArrayObjectis configured as a Universal object crate- Handle
\Laminas\Stdlib\AbstractOptionsmagic properties
Installation
To use this extension, require it in Composer:
composer require --dev slam/phpstan-laminas-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-laminas-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: laminasframework: serviceManagerLoader: tests/service-manager.php
For example, tests/service-manager.php would look something like this:
$app = \Laminas\Mvc\Application::init($config); return $app->getServiceManager();
统计信息
- 总下载量: 235.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 1
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-02