wvnderlab-agency / php-copyright-header
A custom fixer to provide copyright headers in each file via PHP-CS-Fixer
Installs: 7
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/wvnderlab-agency/php-copyright-header
Requires
- php: ^8.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.80
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.0.0
This package is not auto-updated.
Last update: 2025-11-27 09:42:41 UTC
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