wvnderlab-agency/php-copyright-header
最新稳定版本:0.1.3
Composer 安装命令:
composer require wvnderlab-agency/php-copyright-header
包简介
A custom fixer to provide copyright headers in each file via PHP-CS-Fixer
README 文档
README
/** * ################ * ## ## Copyright (c) 2025 Wvnderlab Agency * ## * ## ## ### ## ✉️ moin@wvnderlab.com * ## #### #### 🔗 https://wvnderlab.com * ##### ## ### */
Table of Contents
Usage
Installation
via Packagist
You can install the package via Composer by running the following command:
composer require --dev wvnderlab-agency/php-copyright-header
manually
If you prefer to install the package manually, you can add the following lines to your composer.json file:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/wvnderlab-agency/php-copyright-header"
}
],
"require-dev": {
"wvnderlab-agency/php-copyright-header": "^0.1.0"
}
}
If you want to update the package to the latest version, run the following command:
composer update wvnderlab-agency/php-copyright-header
Configuration
with PHP-CS-Fixer
You can configure the package by creating a php-cs-fixer.php file in the root directory of your project. The following
example shows how to set up the package with PHP CS Fixer:
<?php use PhpCsFixer\Config; use PhpCsFixer\Finder; use WvnderlabAgency\CopyrightHeader\CopyrightHeaderFixer; if (!class_exists(CopyrightHeaderFixer::class)) { require_once __DIR__ . '/vendor/autoload.php'; } $finder = Finder::create() ->in(__DIR__ . '/src') ->name('*.php') ->exclude(['vendor']); return (new Config()) ->setRules([ '@PSR12' => true, 'WvnderlabAgency/copyright_header' => true, ]) ->setFinder($finder) ->registerCustomFixers([ 'WvnderlabAgency/copyright_header' => new CopyrightHeaderFixer() ]);
Add a script to your composer.json file to run the PHP CS Fixer with the configuration file:
{
"scripts": {
"format": "./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php"
}
}
Now you can run the following command to apply the code styles defined in the project:
composer format
Development
Project Structure
├── src/ # Package source code
└── tests/ # Unit tests
Install Dependencies
Run the following command to install the required dependencies for the project:
composer install
Apply Code-Styles
Run the following command to apply the code styles defined in the project:
composer format
Analyze Code
Run the following command to analyze the code for potential issues:
composer analyze
Run Unit Tests
Run the following command to execute the unit tests for the project:
composer test
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-15