Follow PSR-12 consistently: ~~~php <?php declare(strict_types=1); namespace App\Service; final class UserService { public function findById(int $id): ?User { return $this->repository->findById($id); } } ~~~ Use four spaces, same-line opening braces, one class per file, and place imports after the namespace. Use PHP CS Fixer with the PSR-12 preset to enforce the style.
Installs into .claude/skills of the current project.
Are you the author of Php Best Practices?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-php-best-practices-agent-skills-standard)
Follow PSR-12 consistently:
~~~php
<?php
declare(strict_types=1);
namespace App\Service;
final class UserService
{
public function findById(int $id): ?User
{
return $this->repository->findById($id);
}
}
~~~
Use four spaces, same-line opening braces, one class per file, and place imports after the namespace. Use PHP CS Fixer with the PSR-12 preset to enforce the style.