Skip to content

CodeOwnersGenerator

github-actions edited this page Apr 20, 2026 · 1 revision

Generates CODEOWNERS content from repository metadata.


  • Full name: \FastForward\DevTools\CodeOwners\CodeOwnersGenerator
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

__construct

Creates a new generator instance.

public __construct(\FastForward\DevTools\Composer\Json\ComposerJsonInterface $composer, \FastForward\DevTools\Filesystem\FilesystemInterface $filesystem, \Symfony\Component\Config\FileLocatorInterface $fileLocator): mixed

Parameters:

Parameter Type Description
$composer \FastForward\DevTools\Composer\Json\ComposerJsonInterface the composer metadata accessor
$filesystem \FastForward\DevTools\Filesystem\FilesystemInterface the filesystem used to read the packaged template
$fileLocator \Symfony\Component\Config\FileLocatorInterface the locator used to find the packaged template

inferOwners

Returns the automatically inferred CODEOWNERS handles.

public inferOwners(): list<string>

normalizeOwners

Normalizes user-provided owner tokens.

public normalizeOwners(string $owners): list<string>

Parameters:

Parameter Type Description
$owners string the raw owner input

generate

Generates CODEOWNERS contents.

public generate(list<string>|null $owners = null): string

Parameters:

Parameter Type Description
$owners list|null explicit owners to render; inferred owners are used when null

Return Value:

the rendered CODEOWNERS file contents


inferGroupOwner

Returns the repository or organization owner inferred from support metadata.

public inferGroupOwner(): string|null

Return Value:

the inferred group owner with @, or null when unavailable


Clone this wiki locally