├── .github └── workflows │ └── continuous-integration.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── composer.json ├── docs ├── 0-requirements.rst ├── 1-setup_custom.rst ├── 1-setup_drupal_8.rst ├── 1-setup_silex.rst ├── 1-setup_symfony_framework.rst ├── 2-configuration.rst └── 3-usage.rst ├── phpunit.xml ├── src ├── EventSubscriber │ ├── RestApiEventSubscriber.php │ └── RestApiEventSubscriberFactory.php ├── Exception │ ├── AbstractException.php │ ├── AbstractValidationException.php │ ├── ErrorField.php │ ├── ExceptionInterface.php │ ├── FieldExceptionInterface.php │ ├── FormValidationException.php │ ├── SerializerException.php │ └── ValidationException.php ├── Model │ ├── AbstractResponseModel.php │ ├── ResponseModel.php │ ├── ResponseModelFactory.php │ └── ResponseModelInterface.php ├── Request │ ├── AbstractRequestMatcher.php │ ├── Format.php │ ├── PathRequestMatcher.php │ ├── RegexRequestMatcher.php │ ├── RequestMatcherInterface.php │ ├── RequestTransformer.php │ └── RequestTransformerInterface.php ├── Response │ ├── AbstractPaginatedResponse.php │ ├── CursorPaginatedResponse.php │ ├── Error.php │ ├── ExtendedResponseInterface.php │ ├── JsonResponse.php │ ├── OffsetPaginatedResponse.php │ ├── PaginatedResponseInterface.php │ ├── Response.php │ ├── ResponseTransformer.php │ └── ResponseTransformerInterface.php ├── Serializer │ ├── ChainSerializer.php │ ├── JMSSerializer.php │ ├── JsonSerializer.php │ ├── MsgpackSerializer.php │ ├── SerializerInterface.php │ └── SerializerTrait.php └── Util │ └── StringUtil.php └── tests ├── EventSubscriber ├── RestApiEventSubscriberFactoryTest.php └── RestApiEventSubscriberTest.php ├── Exception ├── ErrorFieldTest.php ├── FormValidationExceptionTest.php ├── JsonSerializableException.php └── ValidationExceptionTest.php ├── Form └── Type │ └── TestType.php ├── Model ├── ResponseModelFactoryTest.php └── ResponseModelTest.php ├── Request ├── FormatTest.php ├── PathRequestMatcherTest.php ├── RegexRequestMatcherTest.php └── RequestTransformerTest.php ├── Response ├── CursorPaginatedResponseTest.php ├── JsonResponseTest.php ├── OffsetPaginatedResponseTest.php ├── ResponseTest.php └── ResponseTransformerTest.php ├── Serializer ├── ChainSerializerTest.php ├── JMSSerializerTest.php ├── JsonSerializerTest.php └── MsgpackSerializerTest.php ├── Util └── StringUtilTest.php └── bootstrap.php /.github/workflows/continuous-integration.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/.github/workflows/continuous-integration.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /composer.lock 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/Dockerfile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/LICENSE -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/README.md -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/composer.json -------------------------------------------------------------------------------- /docs/0-requirements.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/0-requirements.rst -------------------------------------------------------------------------------- /docs/1-setup_custom.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/1-setup_custom.rst -------------------------------------------------------------------------------- /docs/1-setup_drupal_8.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/1-setup_drupal_8.rst -------------------------------------------------------------------------------- /docs/1-setup_silex.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/1-setup_silex.rst -------------------------------------------------------------------------------- /docs/1-setup_symfony_framework.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/1-setup_symfony_framework.rst -------------------------------------------------------------------------------- /docs/2-configuration.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/2-configuration.rst -------------------------------------------------------------------------------- /docs/3-usage.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/docs/3-usage.rst -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/phpunit.xml -------------------------------------------------------------------------------- /src/EventSubscriber/RestApiEventSubscriber.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/EventSubscriber/RestApiEventSubscriber.php -------------------------------------------------------------------------------- /src/EventSubscriber/RestApiEventSubscriberFactory.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/EventSubscriber/RestApiEventSubscriberFactory.php -------------------------------------------------------------------------------- /src/Exception/AbstractException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/AbstractException.php -------------------------------------------------------------------------------- /src/Exception/AbstractValidationException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/AbstractValidationException.php -------------------------------------------------------------------------------- /src/Exception/ErrorField.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/ErrorField.php -------------------------------------------------------------------------------- /src/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/ExceptionInterface.php -------------------------------------------------------------------------------- /src/Exception/FieldExceptionInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/FieldExceptionInterface.php -------------------------------------------------------------------------------- /src/Exception/FormValidationException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/FormValidationException.php -------------------------------------------------------------------------------- /src/Exception/SerializerException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/SerializerException.php -------------------------------------------------------------------------------- /src/Exception/ValidationException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Exception/ValidationException.php -------------------------------------------------------------------------------- /src/Model/AbstractResponseModel.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Model/AbstractResponseModel.php -------------------------------------------------------------------------------- /src/Model/ResponseModel.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Model/ResponseModel.php -------------------------------------------------------------------------------- /src/Model/ResponseModelFactory.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Model/ResponseModelFactory.php -------------------------------------------------------------------------------- /src/Model/ResponseModelInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Model/ResponseModelInterface.php -------------------------------------------------------------------------------- /src/Request/AbstractRequestMatcher.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/AbstractRequestMatcher.php -------------------------------------------------------------------------------- /src/Request/Format.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/Format.php -------------------------------------------------------------------------------- /src/Request/PathRequestMatcher.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/PathRequestMatcher.php -------------------------------------------------------------------------------- /src/Request/RegexRequestMatcher.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/RegexRequestMatcher.php -------------------------------------------------------------------------------- /src/Request/RequestMatcherInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/RequestMatcherInterface.php -------------------------------------------------------------------------------- /src/Request/RequestTransformer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/RequestTransformer.php -------------------------------------------------------------------------------- /src/Request/RequestTransformerInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Request/RequestTransformerInterface.php -------------------------------------------------------------------------------- /src/Response/AbstractPaginatedResponse.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/AbstractPaginatedResponse.php -------------------------------------------------------------------------------- /src/Response/CursorPaginatedResponse.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/CursorPaginatedResponse.php -------------------------------------------------------------------------------- /src/Response/Error.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/Error.php -------------------------------------------------------------------------------- /src/Response/ExtendedResponseInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/ExtendedResponseInterface.php -------------------------------------------------------------------------------- /src/Response/JsonResponse.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/JsonResponse.php -------------------------------------------------------------------------------- /src/Response/OffsetPaginatedResponse.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/OffsetPaginatedResponse.php -------------------------------------------------------------------------------- /src/Response/PaginatedResponseInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/PaginatedResponseInterface.php -------------------------------------------------------------------------------- /src/Response/Response.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/Response.php -------------------------------------------------------------------------------- /src/Response/ResponseTransformer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/ResponseTransformer.php -------------------------------------------------------------------------------- /src/Response/ResponseTransformerInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Response/ResponseTransformerInterface.php -------------------------------------------------------------------------------- /src/Serializer/ChainSerializer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Serializer/ChainSerializer.php -------------------------------------------------------------------------------- /src/Serializer/JMSSerializer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Serializer/JMSSerializer.php -------------------------------------------------------------------------------- /src/Serializer/JsonSerializer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Serializer/JsonSerializer.php -------------------------------------------------------------------------------- /src/Serializer/MsgpackSerializer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Serializer/MsgpackSerializer.php -------------------------------------------------------------------------------- /src/Serializer/SerializerInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Serializer/SerializerInterface.php -------------------------------------------------------------------------------- /src/Serializer/SerializerTrait.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Serializer/SerializerTrait.php -------------------------------------------------------------------------------- /src/Util/StringUtil.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/src/Util/StringUtil.php -------------------------------------------------------------------------------- /tests/EventSubscriber/RestApiEventSubscriberFactoryTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/EventSubscriber/RestApiEventSubscriberFactoryTest.php -------------------------------------------------------------------------------- /tests/EventSubscriber/RestApiEventSubscriberTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/EventSubscriber/RestApiEventSubscriberTest.php -------------------------------------------------------------------------------- /tests/Exception/ErrorFieldTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Exception/ErrorFieldTest.php -------------------------------------------------------------------------------- /tests/Exception/FormValidationExceptionTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Exception/FormValidationExceptionTest.php -------------------------------------------------------------------------------- /tests/Exception/JsonSerializableException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Exception/JsonSerializableException.php -------------------------------------------------------------------------------- /tests/Exception/ValidationExceptionTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Exception/ValidationExceptionTest.php -------------------------------------------------------------------------------- /tests/Form/Type/TestType.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Form/Type/TestType.php -------------------------------------------------------------------------------- /tests/Model/ResponseModelFactoryTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Model/ResponseModelFactoryTest.php -------------------------------------------------------------------------------- /tests/Model/ResponseModelTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Model/ResponseModelTest.php -------------------------------------------------------------------------------- /tests/Request/FormatTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Request/FormatTest.php -------------------------------------------------------------------------------- /tests/Request/PathRequestMatcherTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Request/PathRequestMatcherTest.php -------------------------------------------------------------------------------- /tests/Request/RegexRequestMatcherTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Request/RegexRequestMatcherTest.php -------------------------------------------------------------------------------- /tests/Request/RequestTransformerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Request/RequestTransformerTest.php -------------------------------------------------------------------------------- /tests/Response/CursorPaginatedResponseTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Response/CursorPaginatedResponseTest.php -------------------------------------------------------------------------------- /tests/Response/JsonResponseTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Response/JsonResponseTest.php -------------------------------------------------------------------------------- /tests/Response/OffsetPaginatedResponseTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Response/OffsetPaginatedResponseTest.php -------------------------------------------------------------------------------- /tests/Response/ResponseTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Response/ResponseTest.php -------------------------------------------------------------------------------- /tests/Response/ResponseTransformerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Response/ResponseTransformerTest.php -------------------------------------------------------------------------------- /tests/Serializer/ChainSerializerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Serializer/ChainSerializerTest.php -------------------------------------------------------------------------------- /tests/Serializer/JMSSerializerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Serializer/JMSSerializerTest.php -------------------------------------------------------------------------------- /tests/Serializer/JsonSerializerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Serializer/JsonSerializerTest.php -------------------------------------------------------------------------------- /tests/Serializer/MsgpackSerializerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Serializer/MsgpackSerializerTest.php -------------------------------------------------------------------------------- /tests/Util/StringUtilTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/Util/StringUtilTest.php -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mediamonks/php-rest-api/HEAD/tests/bootstrap.php --------------------------------------------------------------------------------