Appearance
ToolConfigPublisher
php
final readonly class Zairakai\LaravelDevTools\Services\ToolConfigPublisherPublishes the configuration files of the tools (PHPStan, Rector, PHP Insights, Pint, Markdownlint, PHPUnit and the baseline) from the stubs of the package into the project.
Reached through ConfigStubPublisher, which keeps the groups and the keys.
Source: src/Services/ToolConfigPublisher.php
Methods
__construct()
php
public function __construct(PublishOutput $output, StubWriter $writer)publishBaseline()
php
public function publishBaseline(string $vendorPath, string $basePath): boolPublish the PHPStan baseline stub. Never force-overwritten - it accumulates user-accepted errors.
publishEnlightn()
php
public function publishEnlightn(string $vendorPath, string $basePath, bool $force): voidPublish the Enlightn configuration stub. Not part of any group - installed automatically on first setup.
publishInsights()
php
public function publishInsights(string $vendorPath, string $basePath, bool $force): boolPublish the PHP Insights configuration of the project into config/dev-tools/. No file at the root: no extension of an editor reads it, the commands do. User is expected to customize this file - protected against force overwrite.
publishMarkdownlint()
php
public function publishMarkdownlint(string $vendorPath, string $basePath, bool $force): boolPublish the Markdownlint configuration of the project into config/dev-tools/, and the thin file of the root that extends it, where the extension of the editor reads it.
publishMarkdownlintIgnore()
php
public function publishMarkdownlintIgnore(string $vendorPath, string $basePath, bool $force): boolPublish the Markdownlint ignore file at the root only: an ignore file cannot extend another file, and the tool reads it from the root.
publishPhpstan()
php
public function publishPhpstan(string $vendorPath, string $basePath, bool $force): boolPublish the PHPStan configuration of the project into config/dev-tools/, where it extends the one of this package, and the thin file of the root that includes it, where the editor reads it.
publishPhpunit()
php
public function publishPhpunit(string $vendorPath, string $basePath, bool $force): boolPublish the PHPUnit configuration into config/dev-tools/ only: PHPUnit cannot extend a file, and no editor extension runs the tests, so a copy at the root would be a second file to keep in step. Detects project type to choose between app and package config.
publishPint()
php
public function publishPint(string $vendorPath, string $basePath, bool $force = false): boolGenerate the pint.json of config/dev-tools/ only: Pint cannot extend a file, but the extension of an editor takes the path of the file in its settings (laravel-pint.configPath), so a copy at the root would be a second file.
publishRector()
php
public function publishRector(string $vendorPath, string $basePath, bool $force): boolPublish the Rector configuration of the project into config/dev-tools/. No file at the root: no extension of an editor reads it, the commands do. User is expected to customize this file - protected against force overwrite.