بنقرة واحدة
php-conventions
PHP coding standards including strict typing, OOP patterns, error handling, and documentation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
PHP coding standards including strict typing, OOP patterns, error handling, and documentation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
RESTful API design patterns, HTTP standards, versioning, error handling, and documentation
Joomla 4/5 component development with MVC, services, plugins, and language handling
Joomla 3.x legacy patterns with JFactory, non-namespaced MVC, JDatabase, and plugin structure
Laravel best practices for Eloquent, controllers, validation, services, and testing
Performance optimization for PHP, JavaScript, databases, and caching strategies
Deep dive into SOLID principles with PHP/TypeScript examples, refactoring patterns, and violation detection
| name | php-conventions |
| description | PHP coding standards including strict typing, OOP patterns, error handling, and documentation |
| license | MIT |
| compatibility | opencode |
| metadata | {"language":"php","version":"8.1+"} |
declare(strict_types=1); at top of filesint, float, string, bool, arrayvoidmixed only when necessary - document whyfinal for classes not designed for extensionreadonly for immutable properties (PHP 8.1+)\Exception unless re-throwing@)@param, @return, @throws<?php
declare(strict_types=1);
namespace App\Service;
use App\Repository\UserRepositoryInterface;
use App\Exception\UserNotFoundException;
final class UserService
{
public function __construct(
private readonly UserRepositoryInterface $user_repository
) {}
/**
* Find user by ID or throw exception.
*
* @throws UserNotFoundException
*/
public function findOrFail(int $user_id): User
{
$user = $this->user_repository->find($user_id);
if ($user === null) {
throw new UserNotFoundException("User {$user_id} not found");
}
return $user;
}
}
composer audit)