Development Tooling

Maintainers

Package info

gitlab.encoredigitalgroup.com/oss/php-dev-tools

Type:composer-plugin

pkg:composer/encoredigitalgroup/devtools

Transparency log

Statistics

Installs: 31

Dependents: 0

Suggesters: 0

v0.1.1 2026-07-07 18:24 UTC

This package is auto-updated.

Last update: 2026-07-07 18:25:30 UTC


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:

  • .editorconfig
  • pint.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:

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 @see annotations 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.