encoredigitalgroup/devtools
Composer 安装命令:
composer require --dev encoredigitalgroup/devtools
包简介
Development Tooling
关键字:
README 文档
README
Shared development tooling for Encore Digital Group PHP projects. It bundles a curated Rector rule set, ships a
standard .editorconfig and pint.json, and installs a Composer plugin that publishes those config files into the
consuming project's root automatically.
This package is intended to be installed as a development-only dependency. Because it pulls in the tools a project needs to lint, analyze, and refactor its code (Rector, PHPStan, Duster), those tools are declared as direct requirements rather than dev requirements.
Requirements
- PHP
^8.4 - Composer
^2.0
Installation
composer require --dev encoredigitalgroup/devtools
The package registers a Composer plugin. Composer will not run third-party plugins unless the consuming project trusts
them, so add it to allow-plugins:
{
"config": {
"allow-plugins": {
"encoredigitalgroup/devtools": true
}
}
}
Once trusted, every composer install, composer update, or composer dump-autoload publishes the latest
.editorconfig and pint.json to the project root. Shipping updated config is a matter of tagging a new release — no
changes to the consumer's composer.json scripts are required.
What it does
Publishes IDE and formatting config
On each autoload dump the plugin copies the packaged resources to the project root:
.editorconfigpint.json
These files are overwritten on every run so the project stays in sync with the shared standard.
Provides a Rector configuration
EncoreDigitalGroup\DevTools\Rector\Rector exposes a large, opinionated rule set along with helpers to build a
RectorConfigBuilder. Point your rector.php at it:
<?php
use EncoreDigitalGroup\DevTools\Rector\Rector;
return Rector::configure();
Customize the rule set by passing additional rules or exclusions:
<?php
use EncoreDigitalGroup\DevTools\Rector\Rector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([__DIR__ . '/src'])
->withRules(Rector::rules(rules: [], except: []))
->withSkip(Rector::skip());
Rector::rules(array $rules = [], array $except = [])returns the full rule list, merged with$rules, minus$except, filtered to rules whose classes actually exist in the installed Rector version.Rector::skip(array $rules = [])returns the default skip list, merged with$rules.
Bundled tooling
The following tools are required directly so they are available in any project that installs this package:
rector/rector— automated refactoring.phpstan/phpstan— static analysis.tightenco/duster— linting and code style.
phpstan/extension-installer is suggested rather than required. If you
use PHPStan extensions, install it and allow the plugin so extensions register automatically:
composer require --dev phpstan/extension-installer
{
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
Custom Rector rules
This package ships several custom rules under EncoreDigitalGroup\DevTools\Rector\Rules:
ReplaceSingleQuotesWithDoubleRector— converts single-quoted strings to double quotes where safe.ApplySingleItemDocBlockStyleRector— collapses single-item multi-line docblocks onto one line.ExpandSeeAnnotationClassNameRector— expands short class names in@seeannotations to fully qualified names.
License
This package is licensed under a modified version of the BSD-3-Clause License. The full license text is available at on the Docs Site.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-07-07