> php-language
Core PHP language standards and modern 8.x features. Use when working with PHP 8.x features like enums, fibers, readonly properties, or named arguments. (triggers: **/*.php, declare, readonly, match, constructor, promotion, types)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/php-language?format=md"PHP Language Standards
Priority: P0 (CRITICAL)
Structure
src/
└── {Namespace}/
└── {Class}.php
Implementation Guidelines
- Strict Typing: Declare
declare(strict_types=1);at file top. - Type Hinting: Apply scalar hints and return types to all members.
- Modern Types: Use Union (
string|int) and Intersection types. - Read-only: Use
readonlyfor immutable properties. - Constructor Promotion: Combine declaration and assignment in
__construct. - Match Expressions: Prefer
matchoverswitchfor value returns. - Named Arguments: Use for readability in optional parameters.
Anti-Patterns
- No Type Context: Avoid functions without return or parameter types.
- Sloppy Comparison: No ==: Use
===for strict comparison. - Legacy Syntax: No switch: Use
matchfor simple value mapping. - Global Scope: No Globals: Never define logic in global namespace.
References
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)