定制 slam/phpstan-laminas-framework 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Latest Stable Version Downloads Integrate Code Coverage

This extension provides following features:

  1. Provide correct return type for $container->get() calls on containers of type \Laminas\ServiceManager\ServiceLocatorInterface, \Interop\Container\ContainerInterface or \Psr\Container\ContainerInterface
  2. Handle controller plugins that are called using magic __call() in subclasses of \Laminas\Mvc\Controller\AbstractController
  3. Provide correct return type for plugin method of AbstractController, FilterChain, PhpRenderer and ValidatorChain
  4. getApplication(), getRenderer(), getRequest() and getResponse() methods on Controllers, MvcEvents, View, ViewEvent and Application returns the real instance instead of type-hinted interfaces
  5. getView() method on \Laminas\View\Helper\AbstractHelper returns the real Renderer instance instead of type-hinted interface
  6. \Laminas\Stdlib\ArrayObject is configured as a Universal object crate
  7. Handle \Laminas\Stdlib\AbstractOptions magic 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

GitHub 信息

  • Stars: 18
  • Watchers: 2
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-02