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, markdownlintignore
  • testing : phpunit
  • hooks : git hooks of laravel-dev-tools (core.hooksPath)
  • 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

The public methods are the entry points of the publication, one per publishable asset. The work is done by three classes: BaseFilesPublisher (Makefile, .editorconfig, .gitignore, Composer scripts), ToolConfigPublisher (the configuration of the tools) and PlatformFilesPublisher (GitLab CI and governance files).

Source: src/Services/ConfigStubPublisher.php

Methods ​

__construct() ​

php
public function __construct(PublishOutput $output)

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

See ToolConfigPublisher::publishBaseline().

publishByKey() ​

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

Publish a single file by its key name.

ParameterDescription
$keyOne of: phpstan, rector, insights, baseline, pint, markdownlint, markdownlintignore, 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

See ToolConfigPublisher::publishEnlightn().

publishGitlabCi() ​

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

See PlatformFilesPublisher::publishGitlabCi().

publishGitlabCiFullstack() ​

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

See PlatformFilesPublisher::publishGitlabCiFullstack().

publishGovernanceFiles() ​

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

See PlatformFilesPublisher::publishGovernanceFiles().

publishGroup() ​

php
public function publishGroup(string $group, string $vendorPath, string $basePath, bool $force, bool $fullstack = false): 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

Activate the git hooks of laravel-dev-tools (core.hooksPath): they are read in place, nothing is published.

publishInsights() ​

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

See ToolConfigPublisher::publishInsights().

publishMarkdownlint() ​

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

See ToolConfigPublisher::publishMarkdownlint().

publishMarkdownlintIgnore() ​

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

See ToolConfigPublisher::publishMarkdownlintIgnore().

publishPhpstan() ​

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

See ToolConfigPublisher::publishPhpstan().

publishPhpunit() ​

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

See ToolConfigPublisher::publishPhpunit().

publishPint() ​

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

See ToolConfigPublisher::publishPint().

publishRector() ​

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

See ToolConfigPublisher::publishRector().

publishTarget() ​

php
public function publishTarget(string $target, string $vendorPath, string $basePath, bool $force, bool $fullstack = false): bool

Publish a group or a key, as --publish=&lt;target&gt; says. The one entry of the two commands (Artisan and the shell setup).

ParameterDescription
$targetA group, or a key (phpstan-baseline is the old name of baseline)
$fullstackPublish the CI file of a project with PHP and JS

Returns bool false for an unknown target (a file left alone is not an error)

wantsFullstack() ​

php
public function wantsFullstack(string $basePath, bool $asked = false): bool

See PlatformFilesPublisher::wantsFullstack().

Documentation of 5.5.0 , built from 92a7387 on 5.5.0 by pipeline #3086393151 on 2026-11-18.