# trusted97/whitecat architecture

> Architecture diagram of the GitHub repository trusted97/whitecat, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trusted97/whitecat
- Repository: https://github.com/trusted97/whitecat

## Overview

Whitecat is a PHP developer-toolbox CLI that generates setup files in the current or specified project directory. A user selects a registered command; the command delegates to a generator service, which creates directories and copies bundled templates, optionally checking Composer dependencies for PHP tooling. The documented capabilities include Docker setup, GitHub repository files, issue and pull-request templates, workflows, PHP CS Fixer, PHPStan, and PHPUnit. Service/helper relationships are supported by the source index and excerpts; unsampled generator details are not expanded beyond documented capabilities.

Main entry points: [`src/Console/WhitecatApplicationFactory.php`](https://github.com/trusted97/whitecat/blob/master/src/Console/WhitecatApplicationFactory.php) (Command application), [`src/Helper/FileCopyHelper.php`](https://github.com/trusted97/whitecat/blob/master/src/Helper/FileCopyHelper.php) (File copy), [`src/Enums/DirectoryPath.php`](https://github.com/trusted97/whitecat/blob/master/src/Enums/DirectoryPath.php) (Path constants), [`src/Service/PhpUnitService.php`](https://github.com/trusted97/whitecat/blob/master/src/Service/PhpUnitService.php) (PHPUnit setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI entry"]
  node_application["Command application"]
  node_abstract_command["Base command"]
  node_docker_command["Docker command"]
  node_github_init_command["GitHub init command"]
  node_issue_command["Issue command"]
  node_pull_command["Pull request command"]
  node_workflow_command["Workflow command"]
  node_fixer_command["CS Fixer command"]
  node_stan_command["PHPStan command<br/>[PhpStanCommand.php]"]
  node_phpunit_command["PHPUnit command<br/>[PhpUnitCommand.php]"]
end

subgraph group_github["GitHub generators"]
  node_github_init["GitHub init generator"]
  node_issue_generator["Issue templates"]
  node_pull_generator["Pull templates"]
  node_workflow_generator["Workflow generator"]
end

subgraph group_project["Project setup"]
  node_docker_setup["Docker setup"]
  node_fixer_setup["CS Fixer setup"]
  node_stan_setup["PHPStan setup<br/>[PhpStanService.php]"]
  node_phpunit_setup["PHPUnit setup<br/>[PhpUnitService.php]"]
end

subgraph group_internal["Shared internals"]
  node_file_copy["File copy<br/>[FileCopyHelper.php]"]
  node_directory_copy["Directory copy"]
  node_package_check["Composer package check"]
  node_composer_read["Composer reader<br/>[ComposerHelper.php]"]
  node_composer_error["Invalid Composer error"]
  node_directory_paths["Path constants<br/>[DirectoryPath.php]"]
end

node_user(("Project developer"))

node_user -->|"runs CLI"| node_application
node_application -->|"registers"| node_docker_command
node_application -->|"registers"| node_github_init_command
node_application -->|"registers"| node_issue_command
node_application -->|"registers"| node_pull_command
node_application -->|"registers"| node_workflow_command
node_application -->|"registers"| node_fixer_command
node_application -->|"registers"| node_stan_command
node_application -->|"registers"| node_phpunit_command
node_docker_command -->|"delegates"| node_docker_setup
node_github_init_command -->|"delegates"| node_github_init
node_issue_command -->|"delegates"| node_issue_generator
node_pull_command -->|"delegates"| node_pull_generator
node_workflow_command -->|"delegates"| node_workflow_generator
node_fixer_command -->|"delegates"| node_fixer_setup
node_stan_command -->|"delegates"| node_stan_setup
node_phpunit_command -->|"delegates"| node_phpunit_setup
node_github_init -->|"copies files"| node_file_copy
node_issue_generator -->|"copies templates"| node_file_copy
node_pull_generator -->|"copies templates"| node_file_copy
node_workflow_generator -->|"copies workflows"| node_file_copy
node_docker_setup -->|"copies compose"| node_file_copy
node_docker_setup -->|"copies directory"| node_directory_copy
node_fixer_setup -->|"copies config"| node_file_copy
node_stan_setup -->|"copies config"| node_file_copy
node_phpunit_setup -->|"copies config"| node_file_copy
node_phpunit_setup -->|"copies directory"| node_directory_copy
node_fixer_setup -->|"checks package"| node_package_check
node_stan_setup -->|"checks package"| node_package_check
node_phpunit_setup -->|"checks package"| node_package_check
node_package_check -->|"reads manifest"| node_composer_read
node_composer_read -->|"throws"| node_composer_error
node_github_init -->|"uses paths"| node_directory_paths
node_issue_generator -->|"uses paths"| node_directory_paths
node_pull_generator -->|"uses paths"| node_directory_paths
node_workflow_generator -->|"uses paths"| node_directory_paths
node_docker_setup -->|"uses paths"| node_directory_paths
node_fixer_setup -->|"uses paths"| node_directory_paths
node_stan_setup -->|"uses paths"| node_directory_paths
node_phpunit_setup -->|"uses paths"| node_directory_paths

click node_application "https://github.com/trusted97/whitecat/blob/master/src/Console/WhitecatApplicationFactory.php"
click node_abstract_command "https://github.com/trusted97/whitecat/blob/master/src/Command/AbstractWhitecatCommand.php"
click node_docker_command "https://github.com/trusted97/whitecat/blob/master/src/Command/DockerSetupCommand.php"
click node_github_init_command "https://github.com/trusted97/whitecat/blob/master/src/Command/GithubInitCommand.php"
click node_issue_command "https://github.com/trusted97/whitecat/blob/master/src/Command/GithubIssueCommand.php"
click node_pull_command "https://github.com/trusted97/whitecat/blob/master/src/Command/GithubPullCommand.php"
click node_workflow_command "https://github.com/trusted97/whitecat/blob/master/src/Command/GithubWorkflowCommand.php"
click node_fixer_command "https://github.com/trusted97/whitecat/blob/master/src/Command/PhpCsFixerCommand.php"
click node_stan_command "https://github.com/trusted97/whitecat/blob/master/src/Command/PhpStanCommand.php"
click node_phpunit_command "https://github.com/trusted97/whitecat/blob/master/src/Command/PhpUnitCommand.php"
click node_github_init "https://github.com/trusted97/whitecat/blob/master/src/Service/GithubInitService.php"
click node_issue_generator "https://github.com/trusted97/whitecat/blob/master/src/Service/GithubIssueService.php"
click node_pull_generator "https://github.com/trusted97/whitecat/blob/master/src/Service/GithubPullService.php"
click node_workflow_generator "https://github.com/trusted97/whitecat/blob/master/src/Service/GithubWorkflowService.php"
click node_docker_setup "https://github.com/trusted97/whitecat/blob/master/src/Service/DockerSetupService.php"
click node_fixer_setup "https://github.com/trusted97/whitecat/blob/master/src/Service/PhpCsFixerService.php"
click node_stan_setup "https://github.com/trusted97/whitecat/blob/master/src/Service/PhpStanService.php"
click node_phpunit_setup "https://github.com/trusted97/whitecat/blob/master/src/Service/PhpUnitService.php"
click node_file_copy "https://github.com/trusted97/whitecat/blob/master/src/Helper/FileCopyHelper.php"
click node_directory_copy "https://github.com/trusted97/whitecat/blob/master/src/Helper/DirectoryCopyHelper.php"
click node_package_check "https://github.com/trusted97/whitecat/blob/master/src/Helper/ComposerPackageChecker.php"
click node_composer_read "https://github.com/trusted97/whitecat/blob/master/src/Helper/ComposerHelper.php"
click node_composer_error "https://github.com/trusted97/whitecat/blob/master/src/Exception/InvalidComposerException.php"
click node_directory_paths "https://github.com/trusted97/whitecat/blob/master/src/Enums/DirectoryPath.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_abstract_command,node_docker_command,node_github_init_command,node_issue_command,node_pull_command,node_workflow_command,node_fixer_command,node_stan_command,node_phpunit_command toneBlue
class node_github_init,node_issue_generator,node_pull_generator,node_workflow_generator toneAmber
class node_docker_setup,node_fixer_setup,node_stan_setup,node_phpunit_setup toneMint
class node_file_copy,node_directory_copy,node_package_check,node_composer_read,node_composer_error,node_directory_paths toneRose
class node_user toneIndigo
```

## Components

### CLI entry

- [Command application](https://github.com/trusted97/whitecat/blob/master/src/Console/WhitecatApplicationFactory.php): `src/Console/WhitecatApplicationFactory.php`
- [Base command](https://github.com/trusted97/whitecat/blob/master/src/Command/AbstractWhitecatCommand.php): `src/Command/AbstractWhitecatCommand.php`
- [Docker command](https://github.com/trusted97/whitecat/blob/master/src/Command/DockerSetupCommand.php): `src/Command/DockerSetupCommand.php`
- [GitHub init command](https://github.com/trusted97/whitecat/blob/master/src/Command/GithubInitCommand.php): `src/Command/GithubInitCommand.php`
- [Issue command](https://github.com/trusted97/whitecat/blob/master/src/Command/GithubIssueCommand.php): `src/Command/GithubIssueCommand.php`
- [Pull request command](https://github.com/trusted97/whitecat/blob/master/src/Command/GithubPullCommand.php): `src/Command/GithubPullCommand.php`
- [Workflow command](https://github.com/trusted97/whitecat/blob/master/src/Command/GithubWorkflowCommand.php): `src/Command/GithubWorkflowCommand.php`
- [CS Fixer command](https://github.com/trusted97/whitecat/blob/master/src/Command/PhpCsFixerCommand.php): `src/Command/PhpCsFixerCommand.php`
- [PHPStan command](https://github.com/trusted97/whitecat/blob/master/src/Command/PhpStanCommand.php): `src/Command/PhpStanCommand.php`
- [PHPUnit command](https://github.com/trusted97/whitecat/blob/master/src/Command/PhpUnitCommand.php): `src/Command/PhpUnitCommand.php`

### GitHub generators

- [GitHub init generator](https://github.com/trusted97/whitecat/blob/master/src/Service/GithubInitService.php): `src/Service/GithubInitService.php`
- [Issue templates](https://github.com/trusted97/whitecat/blob/master/src/Service/GithubIssueService.php): `src/Service/GithubIssueService.php`
- [Pull templates](https://github.com/trusted97/whitecat/blob/master/src/Service/GithubPullService.php): `src/Service/GithubPullService.php`
- [Workflow generator](https://github.com/trusted97/whitecat/blob/master/src/Service/GithubWorkflowService.php): `src/Service/GithubWorkflowService.php`

### Project setup

- [Docker setup](https://github.com/trusted97/whitecat/blob/master/src/Service/DockerSetupService.php): `src/Service/DockerSetupService.php`
- [CS Fixer setup](https://github.com/trusted97/whitecat/blob/master/src/Service/PhpCsFixerService.php): `src/Service/PhpCsFixerService.php`
- [PHPStan setup](https://github.com/trusted97/whitecat/blob/master/src/Service/PhpStanService.php): `src/Service/PhpStanService.php`
- [PHPUnit setup](https://github.com/trusted97/whitecat/blob/master/src/Service/PhpUnitService.php): `src/Service/PhpUnitService.php`

### Shared internals

- [File copy](https://github.com/trusted97/whitecat/blob/master/src/Helper/FileCopyHelper.php): `src/Helper/FileCopyHelper.php`
- [Directory copy](https://github.com/trusted97/whitecat/blob/master/src/Helper/DirectoryCopyHelper.php): `src/Helper/DirectoryCopyHelper.php`
- [Composer package check](https://github.com/trusted97/whitecat/blob/master/src/Helper/ComposerPackageChecker.php): `src/Helper/ComposerPackageChecker.php`
- [Composer reader](https://github.com/trusted97/whitecat/blob/master/src/Helper/ComposerHelper.php): `src/Helper/ComposerHelper.php`
- [Invalid Composer error](https://github.com/trusted97/whitecat/blob/master/src/Exception/InvalidComposerException.php): `src/Exception/InvalidComposerException.php`
- [Path constants](https://github.com/trusted97/whitecat/blob/master/src/Enums/DirectoryPath.php): `src/Enums/DirectoryPath.php`

### Other components

- **Project developer**

## Connections

- Project developer → Command application: runs CLI (evidence: `README.md`)
- Command application → Docker command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → GitHub init command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → Issue command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → Pull request command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → Workflow command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → CS Fixer command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → PHPStan command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Command application → PHPUnit command: registers (evidence: `src/Console/WhitecatApplicationFactory.php`)
- Docker command → Docker setup: delegates (evidence: `src/Command/DockerSetupCommand.php`)
- GitHub init command → GitHub init generator: delegates (evidence: `src/Command/GithubInitCommand.php`)
- Issue command → Issue templates: delegates (evidence: `src/Command/GithubIssueCommand.php`)
- Pull request command → Pull templates: delegates (evidence: `src/Command/GithubPullCommand.php`)
- Workflow command → Workflow generator: delegates (evidence: `src/Command/GithubWorkflowCommand.php`)
- CS Fixer command → CS Fixer setup: delegates (evidence: `src/Command/PhpCsFixerCommand.php`)
- PHPStan command → PHPStan setup: delegates (evidence: `src/Command/PhpStanCommand.php`)
- PHPUnit command → PHPUnit setup: delegates (evidence: `src/Command/PhpUnitCommand.php`)
- GitHub init generator → File copy: copies files (evidence: `src/Service/GithubInitService.php`)
- Issue templates → File copy: copies templates (evidence: `src/Service/GithubIssueService.php`)
- Pull templates → File copy: copies templates (evidence: `src/Service/GithubPullService.php`)
- Workflow generator → File copy: copies workflows (evidence: `src/Service/GithubWorkflowService.php`)
- Docker setup → File copy: copies compose (evidence: `src/Service/DockerSetupService.php`)
- Docker setup → Directory copy: copies directory (evidence: `src/Service/DockerSetupService.php`)
- CS Fixer setup → File copy: copies config (evidence: `src/Service/PhpCsFixerService.php`)
- PHPStan setup → File copy: copies config (evidence: `src/Service/PhpStanService.php`)
- PHPUnit setup → File copy: copies config (evidence: `src/Service/PhpUnitService.php`)
- PHPUnit setup → Directory copy: copies directory (evidence: `src/Service/PhpUnitService.php`)
- CS Fixer setup → Composer package check: checks package (evidence: `src/Service/PhpCsFixerService.php`)
- PHPStan setup → Composer package check: checks package (evidence: `src/Service/PhpStanService.php`)
- PHPUnit setup → Composer package check: checks package (evidence: `src/Service/PhpUnitService.php`)
- Composer package check → Composer reader: reads manifest (evidence: `src/Helper/ComposerPackageChecker.php`)
- Composer reader → Invalid Composer error: throws (evidence: `src/Helper/ComposerHelper.php`)
- GitHub init generator → Path constants: uses paths (evidence: `src/Service/GithubInitService.php`)
- Issue templates → Path constants: uses paths (evidence: `src/Service/GithubIssueService.php`)
- Pull templates → Path constants: uses paths (evidence: `src/Service/GithubPullService.php`)
- Workflow generator → Path constants: uses paths (evidence: `src/Service/GithubWorkflowService.php`)
- Docker setup → Path constants: uses paths (evidence: `src/Service/DockerSetupService.php`)
- CS Fixer setup → Path constants: uses paths (evidence: `src/Service/PhpCsFixerService.php`)
- PHPStan setup → Path constants: uses paths (evidence: `src/Service/PhpStanService.php`)
- PHPUnit setup → Path constants: uses paths (evidence: `src/Service/PhpUnitService.php`)
