marek-d-lis/phpstan-symfony-rules 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

marek-d-lis/phpstan-symfony-rules

最新稳定版本:1.0.2

Composer 安装命令:

composer require marek-d-lis/phpstan-symfony-rules

包简介

My PHPStan rules for Symfony i like to include in my projects

README 文档

README

Description

This package provides custom PHPStan rules for Symfony projects to enforce better coding practices by preventing the use of debugging and execution-halting functions such as:

  • var_dump()
  • dump()
  • dd()
  • die()
  • exit()

Installation

Require the package via Composer:

composer require --dev marek-d-lis/phpstan-symfony-rules

Configuration

Include the package's rules in your phpstan.neon configuration file:

includes:
  - vendor/marek-d-lis/phpstan-symfony-rules/extension.neon

Rules

1. NoDumpRule

  • Prevents the use of var_dump() and dump().
  • Example violation:
    var_dump($data); // ❌ Not allowed
    dump($data); // ❌ Not allowed

2. NoDieRule

  • Prevents the use of die(), exit(), and dd().
  • Example violation:
    die("Fatal error"); // ❌ Not allowed
    exit(1); // ❌ Not allowed
    dd($data); // ❌ Not allowed

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Marek D. Lis - Website

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-29