askill
php-language-standards

php-language-standardsSafety 90Repository

Core PHP language standards and modern 8.x features.

144 stars
2.9k downloads
Updated 1/27/2026

Package Files

Loading files...
SKILL.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 readonly for immutable properties.
  • Constructor Promotion: Combine declaration and assignment in __construct.
  • Match Expressions: Prefer match over switch for 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 match for simple value mapping.
  • Global Scope: No Globals: Never define logic in global namespace.

References

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

92/100Analyzed 2/4/2026

A high-quality skill document defining modern PHP 8.x standards with clear triggers, implementation guidelines, and anti-patterns.

90
95
95
85
90

Metadata

Licenseunknown
Version-
Updated1/27/2026
PublisherHoangNguyen0403

Tags

No tags yet.