What is Swagger-PHP?
swagger-php is a library that extracts API metadata from your PHP source code files.
The idea is to add swagger-php attributes next to the relevant PHP code in your application. These will contain the details about your API and swagger-php will convert those into machine-readable OpenAPI documentation.
Keeping your API documentation next to the corresponding source code (same file!) makes it easy to keep up-to-date, as all details can be modified in one place.
Annotating
Annotating your code means adding metadata to the source code for swagger-php. This is done with attributes, classic attributes or docblock annotations.
Requirements
Using swagger-php requires a minimum of PHP 8.2.