定制 sustainabil-it/phpstan-higher-order-collections 二次开发

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

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

sustainabil-it/phpstan-higher-order-collections

Composer 安装命令:

composer require sustainabil-it/phpstan-higher-order-collections

包简介

Higher Order Collection Support for PHPStan

README 文档

README

This plugin adds PHPStan support to Higher Order Messaging on the Collection concept popularized by Laravel.

This extension provides following features:

  • Illuminate\Support\Collection knows the type(s) of its contents using PHPStan Generics, which ensures that methods called on the Proxy objects are actually valid, and have their return types correctly inferred.

Installation

To use this extension, require it in Composer:

composer require --dev sustainabil-it/phpstan-higher-order-collections

This plugin exposes a few configuration options if you happen to have special needs, like your own Collection implementation:

parameters:
    higherOrderCollection:
        - collectionClass: Illuminate\Support\Enumerable
        - proxyClass: Illuminate\Support\HigherOrderCollectionProxy
        - keyTemplate: TKey
        - typeTemplate: TValue
        - proxyTemplate: TReturn
        - proxyMethods:
            - map
            - filter

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/sustainabil-it/phpstan-higher-order-collections/extension.neon

统计信息

  • 总下载量: 86.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-07