symfony-ports-adapters — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited symfony-ports-adapters (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are an expert in the Ports & Adapters pattern within Symfony hexagonal architecture.
| Feature | Requires | Fallback |
|---|---|---|
alias: in services.yaml | all versions | - |
when@test: / when@dev: blocks | Symfony 5.3 | services_test.yaml |
#[AsAlias(PortInterface::class)] on the adapter | Symfony 6.3 | YAML alias |
#[AsAlias(..., when: 'test')] | Symfony 7.3 | when@test: YAML block |
#[AsDecorator(decorates: ...)] | Symfony 6.1 | decorates: in YAML |
Repeatable #[AsDecorator] | Symfony 7.4 | one decorator per class |
Default to YAML aliases: they work on every version and keep all bindings visible in one file.
Ports are interfaces that define contracts for external dependencies. They live in Domain/{Module}/Port/ (shared ones in Domain/Shared/Port/).
UserRepositoryInterface, not DoctrineUserRepositoryRequest, Collection, UploadedFile, Uuid, ...)| Port Type | Example |
|---|---|
| Repository (write) | UserRepositoryInterface |
| Read repository | UserReadRepositoryInterface |
| External Service | PaymentGatewayInterface |
| Notification | NotificationServiceInterface |
| File Storage | FileStorageInterface |
| Identity | IdGeneratorInterface |
| Security | PasswordHasherInterface |
namespace App\Domain\{Module}\Port;
use App\Domain\{Module}\Entity\{Entity};
use App\Domain\{Module}\ValueObject\{Entity}Id;
interface {Entity}RepositoryInterface
{
public function save({Entity} $entity): void;
public function findById({Entity}Id $id): ?{Entity};
}Adapters implement ports using specific technologies. They live in Infrastructure/{Module}/.
Doctrine{Entity}Repository, Stripe{Payment}Gatewayfinal readonly class when possiblenamespace App\Infrastructure\{Module}\Persistence;
use App\Domain\{Module}\Port\{Entity}RepositoryInterface;
use Doctrine\ORM\EntityManagerInterface;
final readonly class Doctrine{Entity}Repository implements {Entity}RepositoryInterface
{
public function __construct(
private EntityManagerInterface $entityManager,
) {
}
// implement all port methods
}# config/services.yaml
services:
# Bind ports to adapters
App\Domain\User\Port\UserRepositoryInterface:
alias: App\Infrastructure\User\Persistence\DoctrineUserRepository
App\Domain\Payment\Port\PaymentGatewayInterface:
alias: App\Infrastructure\Payment\ExternalService\StripePaymentGateway
App\Domain\Notification\Port\NotificationServiceInterface:
alias: App\Infrastructure\Notification\ExternalService\SymfonyMailerAdapterAttribute alternative (Symfony 6.3+), on the adapter:
use Symfony\Component\DependencyInjection\Attribute\AsAlias;
#[AsAlias(UserRepositoryInterface::class)]
final readonly class DoctrineUserRepository implements UserRepositoryInterface { /* ... */ }See references/ for detailed guides:
port-adapter-examples.md - Full examples for various port typesdi-configuration.md - Advanced DI configuration patterns~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.