yousha/codecop
最新稳定版本:2.0.0
Composer 安装命令:
composer require yousha/codecop
包简介
A lightweight static analyzer that scan PHP files for quality issues.
关键字:
README 文档
README
A lightweight static analyzer that scan PHP files for quality issues.
Contents
Overview
CodeCop is a lightweight yet powerful static analysis tool designed specifically for PHP codebases. This command-line utility scans PHP files within a specified directory (and its subdirectories) to identify common code quality issues that can affect maintainability, reliability, and consistency of PHP applications. The tool focuses on enforcing modern PHP best practices and detecting potential problems before they make their way into production environments.
Features
- No external dependency/library
- Validates strict type(
declare(strict_types=1)) declaration - Enforces
finalorabstractfor all classes - Requires return types for all methods (except
__construct) - Skips non-project directories automatically
- Handles anonymous classes properly
- Detects non-UTF-8 encoded files
- Warns about UTF-8 BOM (Byte Order Mark)
- Supported PHP: 7.4 to 8.5
- Supported platforms: Windows, GNU/Linux, MacOS
Requirements
- PHP >= 7.4 to PHP == 8.5
- Composer >= 2
Installation
Via Composer:
composer require yousha/codecop --dev
Usage
php vendor/bin/codecop .
Or:
php vendor/bin/codecop src/
Check version:
php vendor/bin/codecop --version
Get help:
php vendor/bin/codecop --help
Support
Changelog
See CHANGELOG.txt file.
ToDo
See TODO.txt file.
Notice
See NOTICE.txt file.
License
This open-source software is distributed under the GPL-3.0 license. See LICENSE file.
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2025-04-07