Skip to content

ConfigStubPublisher ​

php
final readonly class Zairakai\LaravelDevTools\Services\ConfigStubPublisher

Publishes configuration stubs from the vendor package into the project.

Handles force overwrites, protects user-modified files, and provides console feedback for each operation.

Publishing groups:

  • quality : phpstan, rector, insights, baseline
  • style : pint, markdownlint
  • testing : phpunit
  • hooks : .githooks/ directory
  • gitlab-ci : .gitlab-ci.yml (opt-in, not in 'all')
  • governance : CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md (opt-in, not in 'all')
  • all : all groups above except gitlab-ci and governance

Each public method corresponds to one publishable asset — intentional by design. Splitting into sub-publishers would add indirection without benefit.

Source: src/Services/ConfigStubPublisher.php

Methods ​

__construct() ​

php
public function __construct(Factory $componentsFactory)

availableGroups() ​

php
public function availableGroups(): array

Returns valid publishable group names.

Returns array<int, string>

availableKeys() ​

php
public function availableKeys(): array

Returns valid publishable individual key names.

Returns array<int, string>

publishBaseline() ​

php
public function publishBaseline(string $vendorPath, string $basePath): bool

Publish the PHPStan baseline stub. Never force-overwritten — it accumulates user-accepted errors.

publishByKey() ​

php
public function publishByKey(string $key, string $vendorPath, string $basePath, bool $force): bool

Publish a single file by its key name.

ParameterDescription
$keyOne of: phpstan, rector, insights, baseline, pint, markdownlint, phpunit, hooks
$vendorPathAbsolute path to the vendor package root
$basePathAbsolute path to the project root
$forceOverwrite existing files if true

publishEnlightn() ​

php
public function publishEnlightn(string $vendorPath, string $basePath, bool $force): void

Publish the Enlightn configuration stub. Not part of any group — installed automatically on first setup.

publishGitlabCi() ​

php
public function publishGitlabCi(string $vendorPath, string $basePath, bool $force): bool

Publish the GitLab CI pipeline stub (.gitlab-ci.yml) into the project root.

publishGitlabCiFullstack() ​

php
public function publishGitlabCiFullstack(string $vendorPath, string $basePath, bool $force): bool

Publish the full-stack GitLab CI pipeline stub (.gitlab-ci.yml) into the project root.

publishGovernanceFiles() ​

php
public function publishGovernanceFiles(string $vendorPath, string $basePath, bool $force): bool

Publish governance files (CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md) to project root.

publishGroup() ​

php
public function publishGroup(string $group, string $vendorPath, string $basePath, bool $force): bool

Publish all files belonging to the given group.

ParameterDescription
$groupOne of: quality, style, testing, hooks, all
$vendorPathAbsolute path to the vendor package root
$basePathAbsolute path to the project root
$forceOverwrite existing files if true

publishHooks() ​

php
public function publishHooks(string $vendorPath, string $basePath, bool $force): bool

Publish git hooks stubs into .githooks/ directory.

publishInsights() ​

php
public function publishInsights(string $vendorPath, string $basePath, bool $force): bool

Publish the PHP Insights configuration stub. User is expected to customize this file — protected against force overwrite.

publishMarkdownlint() ​

php
public function publishMarkdownlint(string $vendorPath, string $basePath, bool $force): bool

Publish the Markdownlint configuration into config/dev-tools/.

publishPhpstan() ​

php
public function publishPhpstan(string $vendorPath, string $basePath, bool $force): bool

Publish the PHPStan config (library.neon) into config/dev-tools/.

publishPhpunit() ​

php
public function publishPhpunit(string $vendorPath, string $basePath, bool $force): bool

Publish the PHPUnit configuration stub. Detects project type to choose between app and package config.

publishPint() ​

php
public function publishPint(string $vendorPath, string $basePath, bool $force): bool

Publish the Pint configuration into config/dev-tools/.

publishRector() ​

php
public function publishRector(string $vendorPath, string $basePath, bool $force): bool

Publish the Rector configuration stub. User is expected to customize this file — protected against force overwrite.

Documentation of 4.3.0 , built from 0bcdf31 on 4.3.0 by pipeline #2936310886 on 2026-10-11.