承接 samlitowitz/phpstan-opinionated-nomenclature 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

samlitowitz/phpstan-opinionated-nomenclature

Composer 安装命令:

composer require samlitowitz/phpstan-opinionated-nomenclature

包简介

Opinionated PHPStan rules for naming things

README 文档

README

Opinionated PHPStan rules for naming things.

Table of Contents

  1. Installation
    1. PHPStan Extension Installer
    2. Manual Installation
  2. Rules
    1. Namespace
    2. Class Like (Class, Interface, Trait)
    3. Class
    4. Interface

Installation

Install the extension via Composer.

composer require --dev samlitowitz/phpstan-opinionated-nomenclature

This extension requires PHPStan to use.

PHPStan Extension Installer

Use the PHPStan Extension Installer to automatically install PHPStan extensions.

Manual Installation

Add vendor/samlitowitz/phpstan-opinionated-nomenclature/extension.neon to the includes section of your phpstan.neon or phpstan.neon.dist file, i.e.

includes:
    - vendor/samlitowitz/phpstan-opinionated-nomenclature/extension.neon

Rules

Namespace

  1. Namespace names MUST NOT be equal to or end in DTO of any case (case-insensitive)

    <?php
    namespace DTO; // bad
    namespace Client\Dto; // bad
  2. Namespace names MUST NOT be equal to Helper of any case (case-insensitive)

    <?php
    namespace Helper; // bad
    namespace Client\helper; // bad
  3. Namespace names MUST NOT be equal to Util of any case (case-insensitive)

    <?php
    namespace Util; // bad
    namespace Client\util; // bad

Class Like (Class, Interface, Trait)

  1. Class like names MUST NOT be equal to or end in DTO of any case (case-insensitive)

    <?php
    class DTO {} // bad
    class ClientDTO {} // bad
  2. Class like names MUST NOT be equal to Helper of any case (case-insensitive)

    <?php
    class Helper {} // bad
  3. Class like names MUST NOT be equal to Util of any case (case-insensitive)

    <?php
    class Util {} // bad
  4. Class like names MUST NOT be equal to or start with any case (case-insensitive) of the namespace name it resides in

    <?php
    namespace Client;
    class ClientRequest {} // bad
    
    namespace Client\Request;
    class Request {} // bad
  5. Class like names MUST NOT end with their type name of any case (case-insensitive)

    <?php
    class ClientClass {} // bad
    interface FileInterface {} // bad
    trait TransactionTrait {} // bad

Class

  1. No non-final classes without children

    <?php
    class NonFinalNoChildren {} // bad

Interface

  1. Interface names MUST NOT be prefixed with I

    <?php
    interface IWriter {} // bad

samlitowitz/phpstan-opinionated-nomenclature 适用场景与选型建议

samlitowitz/phpstan-opinionated-nomenclature 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 11 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 samlitowitz/phpstan-opinionated-nomenclature 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 samlitowitz/phpstan-opinionated-nomenclature 我们能提供哪些服务?
定制开发 / 二次开发

基于 samlitowitz/phpstan-opinionated-nomenclature 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-11-25