Analyzer::Php::ApiPlatform
Inherits Analyzer::Php::PhpEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object
API Platform builds its HTTP API from class-level resource metadata instead of controller routes:
#[ApiResource(operations: [new Get(), new Post(uriTemplate: '/books/new')])]
#[GetCollection(uriTemplate: '/authors/{authorId}/books')]
class Book { … }
An operation without its own uriTemplate inherits the resource's, and
without either one it gets the generated /{short_names} (collection,
POST) or /{short_names}/{id} (item) path. routePrefix and the
type: api_platform route import's prefix (/api in the Symfony
recipe, route_prefix in Laravel's config/api-platform.php) sit in front.
Constants
HttpOperation is not an attribute class, so it only counts inside
operations: lists.
API Platform 4's defaults; 3.x also added Put.
scan is ASCII, so byte offsets are char offsets; skipping PCRE2's
per-call UTF validation keeps the attribute walk linear.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.