PHPackages                             team-mate-pro/tmp-standards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. team-mate-pro/tmp-standards

ActiveSymfony-bundle[PSR &amp; Standards](/categories/psr-standards)

team-mate-pro/tmp-standards
===========================

TMP coding standards, PHPStan rules, and architectural guidelines

1.5.0(1mo ago)01.6k↓41.7%1proprietaryPHPPHP ^8.3

Since Feb 21Pushed 1mo agoCompare

[ Source](https://github.com/team-mate-pro/tmp-standards)[ Packagist](https://packagist.org/packages/team-mate-pro/tmp-standards)[ RSS](/packages/team-mate-pro-tmp-standards/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (21)Versions (9)Used By (1)

   title TMP Standards   subtitle Composer package aggregating coding standards, architectural guidelines and PHPStan rules   author TMP Standards   version v1.0   date 2026-05-04   template sh   cover true   toc true   toc-depth 3  TMP Standards
=============

[](#tmp-standards)

A Composer package aggregating coding standards, architectural guidelines, and PHPStan rules for TMP organization.

Check Methods
-------------

[](#check-methods)

Each standard defines HOW it should be verified. Use this table to understand how to check compliance:

```
┌─────────────┬──────────────────────────────────────────────────────────────┐
│ Method      │ How to Check                                                 │
├─────────────┼──────────────────────────────────────────────────────────────┤
│ PHPSTAN     │ composer phpstan                                             │
│             │ Rule configured in phpstan-extension.neon                    │
├─────────────┼──────────────────────────────────────────────────────────────┤
│ SCRIPT      │ ./vendor/team-mate-pro/tmp-standards/definitions/            │
│             │    {category}/{STANDARD_ID}.sh                               │
├─────────────┼──────────────────────────────────────────────────────────────┤
│ AI          │ claude -p "$(cat vendor/team-mate-pro/tmp-standards/         │
│             │    definitions/{category}/{STANDARD_ID}.prompt.txt)"         │
│             │    --cwd .                                                   │
├─────────────┼──────────────────────────────────────────────────────────────┤
│ MANUAL      │ Human review required - see standard definition              │
└─────────────┴──────────────────────────────────────────────────────────────┘

```

Project Structure
-----------------

[](#project-structure)

```
tmp-standards/
├── definitions/                    # Standard definitions (markdown + scripts/prompts)
│   ├── clean-code/
│   │   ├── CC-001-no-persist-in-creational-patterns.md
│   │   └── CC-001-no-persist-in-creational-patterns.prompt.txt  # AI prompt
│   ├── design-patterns/
│   │   └── solid/
│   │       ├── SOLID-001-single-responsibility-principle.md
│   │       ├── SOLID-001-single-responsibility-principle.prompt.txt
│   │       ├── SOLID-002-open-closed-principle.md
│   │       ├── SOLID-002-open-closed-principle.prompt.txt
│   │       ├── SOLID-003-liskov-substitution-principle.md
│   │       ├── SOLID-003-liskov-substitution-principle.prompt.txt
│   │       ├── SOLID-004-interface-segregation-principle.md
│   │       ├── SOLID-004-interface-segregation-principle.prompt.txt
│   │       ├── SOLID-005-dependency-inversion-principle.md
│   │       └── SOLID-005-dependency-inversion-principle.prompt.txt
│   ├── infrastructure/
│   │   ├── INF-001-infrastructure-local-makefile.md
│   │   └── INF-001-infrastructure-local-makefile.sh  # Validation script
│   └── use-case-bundle/
│       ├── UCB-001-use-case-abstract-dto.md
│       ├── UCB-002-use-case-invoke-method.md
│       ├── UCB-003-no-auth-in-use-case.md
│       ├── UCB-004-controller-must-use-response-method.md
│       └── UCB-005-controller-action-method-suffix.md
├── src/                            # Source code
│   ├── Command/                    # Symfony console commands
│   │   ├── RunStandardCommand.php
│   │   └── RunStandardSuiteCommand.php
│   ├── PHPStan/
│   │   └── Rules/
│   │       ├── ControllerActionMethodSuffixRule.php
│   │       ├── UseCaseMustHaveInvokeMethodRule.php
│   │       └── UseCaseParameterMustBeInterfaceRule.php
│   ├── Standard/                   # Standard runner infrastructure
│   │   ├── CheckType.php
│   │   ├── StandardDefinition.php
│   │   ├── StandardRegistry.php
│   │   ├── StandardRunner.php
│   │   └── SuiteRegistry.php
│   └── TmpStandardsBundle.php
├── tests/                          # PHPUnit tests
├── docker/                         # Docker configuration
├── bin/console                     # Symfony console entrypoint
├── composer.json
├── phpstan-extension.neon          # PHPStan extension config
├── phpstan.neon                    # PHPStan config for this package
├── phpunit.xml.dist                # PHPUnit config
└── readme.md

```

Standard Definitions
--------------------

[](#standard-definitions)

### Naming Convention

[](#naming-convention)

Each standard must follow the format: `{PREFIX}-{NUMBER}`, e.g., `UCB-001` (UseCase Bundle). The standard name can be extended with a longer description.

### Prefixes

[](#prefixes)

PrefixCategory`CC`Clean Code - general coding best practices`INF`Infrastructure - local development, CI/CD, tooling`SOLID`Design Patterns - SOLID principles`UCB`UseCase Bundle - rules for UseCase pattern### Requirements

[](#requirements)

Each standard definition should clearly specify:

- What it applies to
- Usage examples (correct implementation)
- Violation examples (what to avoid)
- Rationale for the standard

### Available Standards

[](#available-standards)

CodeTitleCheck Method[CC-001](definitions/clean-code/CC-001-no-persist-in-creational-patterns.md)No Persistence in Creational PatternsAI[INF-001](definitions/infrastructure/INF-001-infrastructure-local-makefile.md)Local Development MakefileSCRIPT[SOLID-001](definitions/design-patterns/solid/SOLID-001-single-responsibility-principle.md)Single Responsibility Principle (SRP)AI[SOLID-002](definitions/design-patterns/solid/SOLID-002-open-closed-principle.md)Open/Closed Principle (OCP)AI[SOLID-003](definitions/design-patterns/solid/SOLID-003-liskov-substitution-principle.md)Liskov Substitution Principle (LSP)AI[SOLID-004](definitions/design-patterns/solid/SOLID-004-interface-segregation-principle.md)Interface Segregation Principle (ISP)AI[SOLID-005](definitions/design-patterns/solid/SOLID-005-dependency-inversion-principle.md)Dependency Inversion Principle (DIP)AI[UCB-001](definitions/use-case-bundle/UCB-001-use-case-abstract-dto.md)UseCase Parameters Must Be InterfacesPHPSTAN[UCB-002](definitions/use-case-bundle/UCB-002-use-case-invoke-method.md)UseCase Must Have Invoke MethodPHPSTAN[UCB-003](definitions/use-case-bundle/UCB-003-no-auth-in-use-case.md)No Authorization in UseCase LayerAI[UCB-004](definitions/use-case-bundle/UCB-004-controller-must-use-response-method.md)Controller Must Use $this-&gt;response()MANUAL[UCB-005](definitions/use-case-bundle/UCB-005-controller-action-method-suffix.md)Controller Action Methods Must Have "Action" SuffixPHPSTANConsole Commands
----------------

[](#console-commands)

The bundle provides Symfony console commands to run standard checks from your project.

### Run a Single Standard

[](#run-a-single-standard)

```
php bin/console tmp:standard {id}
```

Examples:

```
php bin/console tmp:standard test-001    # Run TEST-001 (script-based)
php bin/console tmp:standard ucb-001     # Run UCB-001 (PHPStan-based)
php bin/console tmp:standard cc-001      # Run CC-001 (AI prompt-based)
php bin/console tmp:standard inf-004     # Run INF-004 (manual — skipped with warning)
```

The command exits with code `1` if the check fails.

### Run a Suite

[](#run-a-suite)

```
php bin/console tmp:standard:suite {name}
```

Available suites:

SuiteStandardsDescription`php-sf-app`ARCH, CC, SOLID, INF, TEST, UCBFull check for Symfony applications`php-lib`CC, SOLID, TESTLighter check for PHP libraries`frontend`FEFrontend standards`infra`INFInfrastructure standardsExample:

```
php bin/console tmp:standard:suite php-sf-app
```

The suite prints a summary table at the end and exits with code `1` if any check fails.

### Options

[](#options)

Both commands accept `--project-dir` to specify the project root (defaults to current directory):

```
php bin/console tmp:standard test-001 --project-dir=/path/to/project
```

### Check Types

[](#check-types)

TypeRequiresBehavior**script**bashRuns the `.sh` validation script**prompt**[Claude CLI](https://claude.ai/claude-code)Runs AI review via Claude CLI**phpstan**composer phpstanRuns PHPStan analysis (deduplicated across suite)**manual**humanSkips with warning (does not fail the suite)### Bundle Registration

[](#bundle-registration)

If your project uses Symfony Flex, the bundle registers automatically. Otherwise, add to `config/bundles.php`:

```
TeamMatePro\TmpStandards\TmpStandardsBundle::class => ['all' => true],
```

Validation Scripts
------------------

[](#validation-scripts)

Some standards include validation scripts that can be run to check project compliance.

### INF-001: Makefile Validator

[](#inf-001-makefile-validator)

Validates that your project's Makefile conforms to INF-001 standard.

```
# Run from project root
./vendor/team-mate-pro/tmp-standards/definitions/infrastructure/INF-001-infrastructure-local-makefile.sh

# Or specify a different path
./vendor/team-mate-pro/tmp-standards/definitions/infrastructure/INF-001-infrastructure-local-makefile.sh /path/to/project
```

**What it checks:**

- Required targets: `start`, `stop`, `fast`, `check`
- Recommended targets: `help`, `check_fast`, `fix`, `tests`
- Required variables: `docker-compose`, `main-container-name`, `vendor-dir`
- Optional include syntax (`-include`)
- Self-documenting `###` comments
- Common aliases (`c`, `cf`, `f`, `t`)

**Exit codes:** `0` = passed, `1` = failed

PHPStan
-------

[](#phpstan)

This package provides PHPStan rules that enforce TMP coding standards.

### Installation

[](#installation)

Add the package to your project using Composer:

```
composer require team-mate-pro/tmp-standards --dev
```

For private repository, add to your `composer.json`:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:team-mate-pro/tmp-standards.git"
        }
    ]
}
```

### Configuration

[](#configuration)

The PHPStan rules are auto-discovered via the `phpstan/extension-installer`. If you have it installed, no additional configuration is needed.

If you don't use the extension installer, include the extension manually in your `phpstan.neon`:

```
includes:
    - vendor/team-mate-pro/tmp-standards/phpstan-extension.neon
```

### Available Rules

[](#available-rules)

RuleIdentifierStandard`UseCaseMustHaveInvokeMethodRule``useCase.missingInvoke`[UCB-002](definitions/use-case-bundle/UCB-002-use-case-invoke-method.md)`UseCaseParameterMustBeInterfaceRule``useCase.parameterMustBeInterface`[UCB-001](definitions/use-case-bundle/UCB-001-use-case-abstract-dto.md)`ControllerActionMethodSuffixRule``controller.actionMethodSuffix`[UCB-005](definitions/use-case-bundle/UCB-005-controller-action-method-suffix.md)### Disabling Rules

[](#disabling-rules)

All rules are auto-discovered via `phpstan/extension-installer`. If you need to skip a specific rule in your project, disable it in your `phpstan.neon` using the `ignoreErrors` parameter with the rule identifier:

```
parameters:
    ignoreErrors:
        # Disable a rule entirely
        -
            identifier: controller.actionMethodSuffix

        # Disable a rule for specific paths
        -
            identifier: useCase.missingInvoke
            paths:
                - src/Legacy/*

        # Disable a rule with a message pattern
        -
            identifier: useCase.parameterMustBeInterface
            message: '#UseCase "Legacy.*" parameter#'
```

Available rule identifiers:

IdentifierRule`useCase.missingInvoke``UseCaseMustHaveInvokeMethodRule``useCase.parameterMustBeInterface``UseCaseParameterMustBeInterfaceRule``controller.actionMethodSuffix``ControllerActionMethodSuffixRule`You can also ignore errors inline with PHPStan comments:

```
/** @phpstan-ignore controller.actionMethodSuffix */
public function legacyEndpoint(): JsonResponse
{
    // ...
}
```

### Rule Details

[](#rule-details)

#### UseCaseMustHaveInvokeMethodRule

[](#usecasemusthaveinvokemethodrule)

Every class ending with `UseCase` must have an `__invoke()` method. Abstract classes are exempt.

```
// CORRECT
final readonly class CreateUserUseCase
{
    public function __invoke(CreateUserDtoInterface $dto): Result
    {
        // ...
    }
}

// VIOLATION - missing __invoke()
final readonly class CreateUserUseCase
{
    public function execute(CreateUserDtoInterface $dto): Result
    {
        // ...
    }
}
```

See [UCB-002](definitions/use-case-bundle/UCB-002-use-case-invoke-method.md) for detailed documentation.

#### UseCaseParameterMustBeInterfaceRule

[](#usecaseparametermustbeinterfacerule)

UseCase `__invoke()` method parameters must be **interfaces** or **scalar types**. Concrete classes are not allowed.

```
// CORRECT - interface parameter
public function __invoke(CreateUserDtoInterface $dto): Result

// CORRECT - scalar parameters
public function __invoke(string $userId, int $limit): Result

// VIOLATION - concrete class parameter
public function __invoke(CreateUserRequest $request): Result
```

See [UCB-001](definitions/use-case-bundle/UCB-001-use-case-abstract-dto.md) for detailed documentation.

#### ControllerActionMethodSuffixRule

[](#controlleractionmethodsuffixrule)

Public methods in controllers extending `AbstractRestApiController` must end with the `Action` suffix. Private, protected, static, and magic methods are exempt.

```
// CORRECT - public methods have "Action" suffix
final class ShopController extends AbstractRestApiController
{
    public function getShopAction(): JsonResponse { /* ... */ }
    public function createShopAction(): JsonResponse { /* ... */ }

    private function logPayload(): void { /* ... */ } // exempt
}

// VIOLATION - missing "Action" suffix
final class CustomerController extends AbstractRestApiController
{
    public function importAllExternalCustomers(): JsonResponse { /* ... */ }
}
```

See [UCB-005](definitions/use-case-bundle/UCB-005-controller-action-method-suffix.md) for detailed documentation.

Development
-----------

[](#development)

### Requirements

[](#requirements-1)

- Docker &amp; Docker Compose

### Setup

[](#setup)

```
make start
```

### Running All Checks

[](#running-all-checks)

```
make check
```

This runs PHPCS, PHPStan, and unit tests with 100% coverage enforcement.

### Individual Commands

[](#individual-commands)

```
make phpcs          # Code style
make phpstan        # Static analysis
make tests_unit     # Unit tests with coverage
make fix            # Auto-fix code style
```

License
-------

[](#license)

Proprietary - Team Mate Pro

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

8

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d03da0e36972b87363f18ae2773a03c48142b6ebcebf75eea64698cb6cea0146?d=identicon)[teammatepro](/maintainers/teammatepro)

---

Top Contributors

[![serek-dev](https://avatars.githubusercontent.com/u/6751932?v=4)](https://github.com/serek-dev "serek-dev (24 commits)")[![GIZLO3](https://avatars.githubusercontent.com/u/119735457?v=4)](https://github.com/GIZLO3 "GIZLO3 (8 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/team-mate-pro-tmp-standards/health.svg)

```
[![Health](https://phpackages.com/badges/team-mate-pro-tmp-standards/health.svg)](https://phpackages.com/packages/team-mate-pro-tmp-standards)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
