定制 cspray/phinal 二次开发

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

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

cspray/phinal

最新稳定版本:2.1.1

Composer 安装命令:

composer require cspray/phinal

包简介

Enforce final on your classes!

README 文档

README

Do you like final? Really like it? Then enforce it on all your classes! When you have to fallback to inheritance you can do so by explicitly marking your class with an Attribute and explaining why it should be inherited.

Installation

Running Psalm 6

composer require --dev cspray/phinal
vendor/bin/psalm-plugin enable cspray/phinal

Running Psalm 5

composer require --dev cspray/phinal:2.1
vendor/bin/psalm-plugin enable cspray/phinal

Running Psalm 4

composer require --dev cspray/phinal:1.0.0
vendor/bin/psalm-plugin enable cspray/phinal

Code Examples

Good! 👍

<?php declare(strict_types=1);

use Cspray\Phinal\AllowInheritance;

final class ProperlyMarkedFinal {}

#[AllowInheritance('Explain why you would need to inherit this.')]
class YouCanInheritThis {}

Bad! 👎

<?php declare(strict_types=1);

class NotMarkedFinal {}

Why do you need to inherit this? You probably don't need to and should mark it final!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-08