smithery.ai

backend-php-standards

PSR standards, coding conventions, and best practices for modern PHP development.

First seen Mar 30, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,429 B
  • docs SUMMARY.md 110 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Backend PHP Standards

When to use this skill

  • Starting new PHP projects
  • Code reviews
  • Establishing team standards
  • Refactoring legacy code

Workflow

  • Follow PSR-12 coding style
  • Use PSR-4 autoloading
  • Enable strict types
  • Type hint all parameters and returns
  • Use meaningful variable names

Instructions

PSR-12 Coding Style

<?php

declare(strict_types=1);

namespace App\Controllers;

use App\Services\UserService;

class UserController extends BaseController
{
    public function __construct(
        private readonly UserService $userService
    ) {}

    public function index(): string
    {
        $users = $this->userService->getAllUsers();
        return view('users/index', ['users' => $users]);
    }
}

Strict Types

<?php

declare(strict_types=1);

function calculateTotal(int $quantity, float $price): float
{
    return $quantity * $price;
}

Naming Conventions

  • Classes: PascalCase (UserController, OrderService)
  • Methods: camelCase (getUser(), createOrder())
  • Constants: UPPERSNAKECASE (MAXRETRIES, APIVERSION)
  • Properties: camelCase ($userName, $isActive)

Resources

  • PSR-1: Basic coding standard
  • PSR-12: Extended coding style
  • PSR-4: Autoloading standard