├── codecov.yml ├── src ├── Metadata │ ├── Exception │ │ ├── UnsupportedMediaTypeHttpException.php │ │ ├── ExceptionInterface.php │ │ ├── OperationNotFoundException.php │ │ ├── StatusAwareExceptionInterface.php │ │ ├── RuntimeException.php │ │ ├── ItemNotFoundException.php │ │ ├── PropertyNotFoundException.php │ │ ├── InvalidArgumentException.php │ │ ├── InvalidIdentifierException.php │ │ ├── InvalidUriVariableException.php │ │ ├── ResourceClassNotFoundException.php │ │ ├── NotExposedHttpException.php │ │ ├── HttpExceptionInterface.php │ │ ├── ErrorCodeSerializableInterface.php │ │ ├── AccessDeniedException.php │ │ └── ProblemExceptionInterface.php │ ├── phpunit.baseline.xml │ ├── Laravel │ │ └── SkipAutoconfigure.php │ ├── HeaderParameterInterface.php │ ├── DeleteOperationInterface.php │ ├── CollectionOperationInterface.php │ ├── GraphQl │ │ ├── Mutation.php │ │ └── DeleteMutation.php │ ├── OperationMutatorInterface.php │ ├── QueryParameterInterface.php │ ├── ResourceMutatorInterface.php │ ├── ParameterProviderFilterInterface.php │ ├── ErrorResourceInterface.php │ ├── QueryParameter.php │ ├── HeaderParameter.php │ ├── JsonSchemaFilterInterface.php │ ├── AsOperationMutator.php │ ├── README.md │ ├── Operation │ │ ├── Factory │ │ │ └── OperationMetadataFactoryInterface.php │ │ └── PathSegmentNameGeneratorInterface.php │ ├── IsApiResource.php │ ├── PropertiesAwareInterface.php │ ├── AsResourceMutator.php │ ├── BackwardCompatibleFilterDescriptionTrait.php │ ├── InflectorInterface.php │ ├── OpenApiParameterFilterInterface.php │ ├── CascadeFromResource.php │ ├── Resource │ │ └── Factory │ │ │ ├── PropertyLinkFactoryInterface.php │ │ │ ├── ResourceNameCollectionFactoryInterface.php │ │ │ └── ResourceMetadataCollectionFactoryInterface.php │ ├── ResourceAccessCheckerInterface.php │ ├── Extractor │ │ ├── PropertyExtractorInterface.php │ │ └── ResourceExtractorInterface.php │ ├── Util │ │ ├── SortTrait.php │ │ └── CloneTrait.php │ ├── Mutator │ │ ├── ResourceMutatorCollectionInterface.php │ │ ├── OperationMutatorCollectionInterface.php │ │ └── ResourceMutatorCollection.php │ └── UriVariableTransformer │ │ └── IntegerUriVariableTransformer.php ├── Laravel │ ├── public │ │ ├── web.png │ │ ├── webby.png │ │ ├── fonts │ │ │ └── open-sans │ │ │ │ └── files │ │ │ │ ├── open-sans-greek-400-normal.woff │ │ │ │ ├── open-sans-greek-700-normal.woff │ │ │ │ ├── open-sans-latin-400-normal.woff │ │ │ │ ├── open-sans-latin-700-normal.woff │ │ │ │ ├── open-sans-math-400-normal.woff │ │ │ │ ├── open-sans-math-400-normal.woff2 │ │ │ │ ├── open-sans-math-700-normal.woff │ │ │ │ ├── open-sans-math-700-normal.woff2 │ │ │ │ ├── open-sans-cyrillic-400-normal.woff │ │ │ │ ├── open-sans-cyrillic-700-normal.woff │ │ │ │ ├── open-sans-greek-400-normal.woff2 │ │ │ │ ├── open-sans-greek-700-normal.woff2 │ │ │ │ ├── open-sans-hebrew-400-normal.woff │ │ │ │ ├── open-sans-hebrew-400-normal.woff2 │ │ │ │ ├── open-sans-hebrew-700-normal.woff │ │ │ │ ├── open-sans-hebrew-700-normal.woff2 │ │ │ │ ├── open-sans-latin-400-normal.woff2 │ │ │ │ ├── open-sans-latin-700-normal.woff2 │ │ │ │ ├── open-sans-symbols-400-normal.woff │ │ │ │ ├── open-sans-symbols-400-normal.woff2 │ │ │ │ ├── open-sans-symbols-700-normal.woff │ │ │ │ ├── open-sans-symbols-700-normal.woff2 │ │ │ │ ├── open-sans-cyrillic-400-normal.woff2 │ │ │ │ ├── open-sans-cyrillic-700-normal.woff2 │ │ │ │ ├── open-sans-greek-ext-400-normal.woff │ │ │ │ ├── open-sans-greek-ext-400-normal.woff2 │ │ │ │ ├── open-sans-greek-ext-700-normal.woff │ │ │ │ ├── open-sans-greek-ext-700-normal.woff2 │ │ │ │ ├── open-sans-latin-ext-400-normal.woff │ │ │ │ ├── open-sans-latin-ext-400-normal.woff2 │ │ │ │ ├── open-sans-latin-ext-700-normal.woff │ │ │ │ ├── open-sans-latin-ext-700-normal.woff2 │ │ │ │ ├── open-sans-vietnamese-400-normal.woff │ │ │ │ ├── open-sans-vietnamese-700-normal.woff │ │ │ │ ├── open-sans-cyrillic-ext-400-normal.woff │ │ │ │ ├── open-sans-cyrillic-ext-400-normal.woff2 │ │ │ │ ├── open-sans-cyrillic-ext-700-normal.woff │ │ │ │ ├── open-sans-cyrillic-ext-700-normal.woff2 │ │ │ │ ├── open-sans-vietnamese-400-normal.woff2 │ │ │ │ └── open-sans-vietnamese-700-normal.woff2 │ │ ├── init-redoc-ui.js │ │ └── init-common-ui.js │ ├── Console │ │ └── Maker │ │ │ ├── Resources │ │ │ └── skeleton │ │ │ │ ├── StateProcessor.php.tpl │ │ │ │ ├── StateProvider.php.tpl │ │ │ │ └── EloquentFilter.php.tpl │ │ │ ├── Utils │ │ │ ├── StateTypeEnum.php │ │ │ └── SuccessMessageTrait.php │ │ │ ├── MakeStateProviderCommand.php │ │ │ └── MakeStateProcessorCommand.php │ ├── README.md │ ├── CONTRIBUTING.md │ ├── Eloquent │ │ ├── Filter │ │ │ ├── QueryPropertyTrait.php │ │ │ ├── FilterInterface.php │ │ │ ├── EqualsFilter.php │ │ │ ├── EndSearchFilter.php │ │ │ ├── StartSearchFilter.php │ │ │ └── PartialSearchFilter.php │ │ ├── State │ │ │ └── RemoveProcessor.php │ │ └── Extension │ │ │ └── QueryExtensionInterface.php │ ├── GraphQl │ │ └── Controller │ │ │ └── GraphiQlController.php │ ├── resources │ │ └── views │ │ │ └── graphiql.blade.php │ ├── Test │ │ └── Constraint │ │ │ └── ArraySubset.php │ └── Security │ │ └── ResourceAccessChecker.php ├── Symfony │ ├── Bundle │ │ ├── Resources │ │ │ ├── public │ │ │ │ ├── web.png │ │ │ │ ├── webby.png │ │ │ │ ├── fonts │ │ │ │ │ └── open-sans │ │ │ │ │ │ └── files │ │ │ │ │ │ ├── open-sans-greek-400-normal.woff │ │ │ │ │ │ ├── open-sans-greek-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-greek-700-normal.woff │ │ │ │ │ │ ├── open-sans-greek-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-hebrew-400-normal.woff │ │ │ │ │ │ ├── open-sans-hebrew-700-normal.woff │ │ │ │ │ │ ├── open-sans-latin-400-normal.woff │ │ │ │ │ │ ├── open-sans-latin-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-latin-700-normal.woff │ │ │ │ │ │ ├── open-sans-latin-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-math-400-normal.woff │ │ │ │ │ │ ├── open-sans-math-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-math-700-normal.woff │ │ │ │ │ │ ├── open-sans-math-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-cyrillic-400-normal.woff │ │ │ │ │ │ ├── open-sans-cyrillic-700-normal.woff │ │ │ │ │ │ ├── open-sans-hebrew-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-hebrew-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-symbols-400-normal.woff │ │ │ │ │ │ ├── open-sans-symbols-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-symbols-700-normal.woff │ │ │ │ │ │ ├── open-sans-symbols-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-cyrillic-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-cyrillic-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-greek-ext-400-normal.woff │ │ │ │ │ │ ├── open-sans-greek-ext-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-greek-ext-700-normal.woff │ │ │ │ │ │ ├── open-sans-greek-ext-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-latin-ext-400-normal.woff │ │ │ │ │ │ ├── open-sans-latin-ext-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-latin-ext-700-normal.woff │ │ │ │ │ │ ├── open-sans-latin-ext-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-vietnamese-400-normal.woff │ │ │ │ │ │ ├── open-sans-vietnamese-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-vietnamese-700-normal.woff │ │ │ │ │ │ ├── open-sans-vietnamese-700-normal.woff2 │ │ │ │ │ │ ├── open-sans-cyrillic-ext-400-normal.woff │ │ │ │ │ │ ├── open-sans-cyrillic-ext-400-normal.woff2 │ │ │ │ │ │ ├── open-sans-cyrillic-ext-700-normal.woff │ │ │ │ │ │ └── open-sans-cyrillic-ext-700-normal.woff2 │ │ │ │ ├── init-redoc-ui.js │ │ │ │ └── init-common-ui.js │ │ │ └── config │ │ │ │ ├── routing │ │ │ │ ├── graphql │ │ │ │ │ ├── graphql.php │ │ │ │ │ └── graphiql.php │ │ │ │ ├── errors.php │ │ │ │ ├── genid.php │ │ │ │ ├── docs.php │ │ │ │ ├── api.php │ │ │ │ └── jsonld.php │ │ │ │ ├── filter.php │ │ │ │ ├── metadata │ │ │ │ ├── php.php │ │ │ │ ├── mutator.php │ │ │ │ ├── php_doc.php │ │ │ │ ├── links.php │ │ │ │ └── xml.php │ │ │ │ ├── openapi │ │ │ │ └── yaml.php │ │ │ │ ├── graphql_mercure.php │ │ │ │ ├── state │ │ │ │ ├── hydra.php │ │ │ │ ├── jsonapi.php │ │ │ │ ├── swagger_ui.php │ │ │ │ ├── mercure.php │ │ │ │ ├── http_cache_purger.php │ │ │ │ ├── parameter_provider.php │ │ │ │ └── security_validator.php │ │ │ │ ├── argument_resolver.php │ │ │ │ ├── symfony │ │ │ │ ├── swagger_ui.php │ │ │ │ └── uid.php │ │ │ │ ├── ramsey_uuid.php │ │ │ │ ├── link_security.php │ │ │ │ └── data_collector.php │ │ ├── Test │ │ │ ├── ClientTrait.php │ │ │ └── Constraint │ │ │ │ └── ArraySubset.php │ │ └── ArgumentResolver │ │ │ └── CompatibleValueResolverInterface.php │ ├── Maker │ │ ├── Resources │ │ │ ├── help │ │ │ │ ├── MakeStateProvider.txt │ │ │ │ ├── MakeStateProcessor.txt │ │ │ │ └── MakeFilter.txt │ │ │ └── skeleton │ │ │ │ ├── StateProcessor.php.tpl │ │ │ │ └── StateProvider.php.tpl │ │ └── Enum │ │ │ └── SupportedFilterTypes.php │ ├── README.md │ ├── Messenger │ │ └── RemoveStamp.php │ ├── Security │ │ ├── ObjectVariableCheckerInterface.php │ │ └── Exception │ │ │ └── AccessDeniedException.php │ ├── Action │ │ ├── NotFoundAction.php │ │ └── PlaceholderAction.php │ ├── Validator │ │ └── ValidationGroupsGeneratorInterface.php │ └── phpunit.baseline.xml ├── State │ ├── OptionsInterface.php │ ├── ResourceList.php │ ├── ParameterNotFound.php │ ├── Exception │ │ └── ProviderNotFoundException.php │ ├── Pagination │ │ ├── HasNextPagePaginatorInterface.php │ │ ├── PartialPaginatorInterface.php │ │ └── PaginatorInterface.php │ ├── README.md │ ├── StopwatchAwareTrait.php │ ├── Util │ │ └── CorsTrait.php │ ├── StopwatchAwareInterface.php │ └── SerializerAwareProviderInterface.php ├── Hal │ ├── phpunit.baseline.xml │ └── README.md ├── Hydra │ ├── phpunit.baseline.xml │ ├── README.md │ ├── IriTemplateMapping.php │ ├── IriTemplate.php │ ├── Collection.php │ └── PartialCollectionView.php ├── JsonApi │ ├── phpunit.baseline.xml │ └── README.md ├── JsonSchema │ ├── phpunit.baseline.xml │ ├── SchemaFactoryAwareInterface.php │ ├── README.md │ ├── SchemaUriPrefixTrait.php │ ├── DefinitionNameFactoryInterface.php │ └── SchemaFactoryInterface.php ├── OpenApi │ ├── phpunit.baseline.xml │ ├── README.md │ ├── Factory │ │ └── OpenApiFactoryInterface.php │ ├── Serializer │ │ └── NormalizeOperationNameTrait.php │ ├── Model │ │ ├── Paths.php │ │ └── ExtensionTrait.php │ └── State │ │ └── OpenApiProvider.php ├── Serializer │ ├── phpunit.baseline.xml │ ├── README.md │ ├── ContextTrait.php │ └── Filter │ │ └── FilterInterface.php ├── Elasticsearch │ ├── phpunit.baseline.xml │ ├── Exception │ │ ├── ExceptionInterface.php │ │ ├── IndexNotFoundException.php │ │ └── NonUniqueIdentifierException.php │ ├── README.md │ ├── Filter │ │ ├── SortFilterInterface.php │ │ ├── ConstantScoreFilterInterface.php │ │ └── FilterInterface.php │ ├── State │ │ └── Options.php │ └── Extension │ │ └── RequestBodySearchCollectionExtensionInterface.php ├── GraphQl │ ├── phpunit.baseline.xml │ ├── Exception │ │ └── InvalidTypeException.php │ ├── README.md │ ├── Type │ │ ├── Definition │ │ │ └── TypeInterface.php │ │ ├── TypesFactoryInterface.php │ │ ├── SchemaBuilderInterface.php │ │ └── TypeNotFoundException.php │ ├── Resolver │ │ ├── MutationResolverInterface.php │ │ ├── QueryItemResolverInterface.php │ │ ├── QueryCollectionResolverInterface.php │ │ └── Factory │ │ │ └── ResolverFactoryInterface.php │ ├── Subscription │ │ ├── SubscriptionIdentifierGeneratorInterface.php │ │ ├── SubscriptionManagerInterface.php │ │ ├── MercureSubscriptionIriGeneratorInterface.php │ │ ├── OperationAwareSubscriptionManagerInterface.php │ │ └── SubscriptionIdentifierGenerator.php │ ├── State │ │ └── Provider │ │ │ └── NoopProvider.php │ ├── Serializer │ │ └── SerializerContextBuilderInterface.php │ ├── Error │ │ ├── ErrorHandler.php │ │ └── ErrorHandlerInterface.php │ └── ExecutorInterface.php ├── Doctrine │ ├── Odm │ │ ├── phpunit.baseline.xml │ │ ├── README.md │ │ ├── Extension │ │ │ ├── AggregationCollectionExtensionInterface.php │ │ │ └── AggregationItemExtensionInterface.php │ │ └── State │ │ │ └── LinksHandlerInterface.php │ ├── Common │ │ ├── README.md │ │ ├── Filter │ │ │ ├── LoggerAwareInterface.php │ │ │ ├── ExistsFilterInterface.php │ │ │ ├── ManagerRegistryAwareInterface.php │ │ │ ├── PropertyPlaceholderOpenApiParameterTrait.php │ │ │ ├── OpenApiFilterTrait.php │ │ │ ├── PropertyAwareFilterInterface.php │ │ │ ├── RangeFilterInterface.php │ │ │ └── LoggerAwareTrait.php │ │ └── ParameterValueExtractorTrait.php │ └── Orm │ │ ├── README.md │ │ ├── QueryAwareInterface.php │ │ ├── Util │ │ └── QueryNameGeneratorInterface.php │ │ └── Extension │ │ └── DoctrinePaginatorFactory.php ├── Documentation │ ├── DocumentationInterface.php │ ├── README.md │ └── Entrypoint.php ├── ApiResource │ └── Error.php ├── Validator │ ├── README.md │ ├── ValidatorInterface.php │ └── Exception │ │ └── ConstraintViolationListAwareExceptionInterface.php ├── RamseyUuid │ └── README.md ├── JsonLd │ ├── README.md │ ├── Serializer │ │ └── HydraPrefixTrait.php │ └── AnonymousContextBuilderInterface.php └── HttpCache │ ├── README.md │ ├── PurgerInterface.php │ ├── SouinPurger.php │ └── VarnishXKeyPurger.php ├── pmu.baseline └── update-hydra-context.php /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "src/**/Tests/" 3 | -------------------------------------------------------------------------------- /src/Metadata/Exception/UnsupportedMediaTypeHttpException.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Laravel/public/web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/web.png -------------------------------------------------------------------------------- /src/Laravel/public/webby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/webby.png -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/web.png -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/webby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/webby.png -------------------------------------------------------------------------------- /pmu.baseline: -------------------------------------------------------------------------------- 1 | Class "ApiPlatform\Serializer\SerializerContextBuilder" uses "ApiPlatform\Doctrine\Orm\State\Options" but it is not declared as dependency. 2 | -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-math-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-math-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-math-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-math-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-math-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-math-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-math-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-math-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Laravel/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-math-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-symbols-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-greek-ext-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-latin-ext-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-vietnamese-700-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-400-normal.woff2 -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/core/HEAD/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-cyrillic-ext-700-normal.woff2 -------------------------------------------------------------------------------- /src/Laravel/public/init-redoc-ui.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | window.onload = () => { 4 | const data = JSON.parse(document.getElementById('swagger-data').innerText); 5 | 6 | Redoc.init(data.spec, {}, document.getElementById('swagger-ui')); 7 | }; 8 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/init-redoc-ui.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | window.onload = () => { 4 | const data = JSON.parse(document.getElementById('swagger-data').innerText); 5 | 6 | Redoc.init(data.spec, {}, document.getElementById('swagger-ui')); 7 | }; 8 | -------------------------------------------------------------------------------- /src/Symfony/Maker/Resources/help/MakeStateProvider.txt: -------------------------------------------------------------------------------- 1 | The %command.name% command generates a new API Platform state provider class. 2 | 3 | php %command.full_name% AwesomeStateProvider 4 | 5 | If the argument is missing, the command will ask for the class name interactively. 6 | -------------------------------------------------------------------------------- /src/Symfony/Maker/Resources/help/MakeStateProcessor.txt: -------------------------------------------------------------------------------- 1 | The %command.name% command generates a new API Platform state processor class. 2 | 3 | php %command.full_name% AwesomeStateProcessor 4 | 5 | If the argument is missing, the command will ask for the class name interactively. 6 | -------------------------------------------------------------------------------- /src/Laravel/public/init-common-ui.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const graphiQlLink = document.querySelector('.graphiql-link'); 4 | if (graphiQlLink) { 5 | graphiQlLink.addEventListener('click', e => { 6 | if (!e.target.hasAttribute('href')) { 7 | alert('GraphQL support is not enabled, see https://api-platform.com/docs/core/graphql/'); 8 | } 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/public/init-common-ui.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const graphiQlLink = document.querySelector('.graphiql-link'); 4 | if (graphiQlLink) { 5 | graphiQlLink.addEventListener('click', e => { 6 | if (!e.target.hasAttribute('href')) { 7 | alert('GraphQL support is not enabled, see https://api-platform.com/docs/core/graphql/'); 8 | } 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /src/State/OptionsInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State; 15 | 16 | interface OptionsInterface 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /src/Hal/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Hydra/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/JsonApi/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/JsonSchema/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/OpenApi/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Serializer/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Elasticsearch/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GraphQl/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Metadata/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Doctrine/Odm/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/State/ResourceList.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State; 15 | 16 | /** 17 | * @internal 18 | */ 19 | class ResourceList extends \ArrayObject 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/GraphQl/Exception/InvalidTypeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Exception; 15 | 16 | final class InvalidTypeException extends \RuntimeException 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/Resources/skeleton/StateProcessor.php.tpl: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Laravel; 15 | 16 | #[\Attribute(\Attribute::TARGET_CLASS)] 17 | class SkipAutoconfigure 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Documentation/DocumentationInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Documentation; 15 | 16 | /** 17 | * An API documentation. 18 | */ 19 | interface DocumentationInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/Resources/skeleton/StateProvider.php.tpl: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * A HTTP header parameter. 18 | */ 19 | interface HeaderParameterInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Symfony/Maker/Resources/help/MakeFilter.txt: -------------------------------------------------------------------------------- 1 | The %command.name% command generates a new API Platform filter class for Doctrine ORM or ODM (MongoDB). 2 | 3 | php %command.full_name% type name 4 | 5 | Important: 6 | - If you omit the argument, the command will prompt you to choose the filter type interactively. 7 | - If you omit the argument, the command will ask you to enter the class name interactively. 8 | 9 | Elasticsearch isn't supported yet. 10 | -------------------------------------------------------------------------------- /src/Metadata/DeleteOperationInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * The Operation deletes content. 18 | */ 19 | interface DeleteOperationInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Symfony/Maker/Resources/skeleton/StateProcessor.php.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | namespace ; 5 | 6 | use ApiPlatform\Metadata\Operation; 7 | use ApiPlatform\State\ProcessorInterface; 8 | 9 | class implements ProcessorInterface 10 | { 11 | public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void 12 | { 13 | // Handle the state 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ApiResource/Error.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\ApiResource; 15 | 16 | use ApiPlatform\State\ApiResource\Error as ApiResourceError; 17 | 18 | class Error extends ApiResourceError 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/Utils/StateTypeEnum.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Console\Maker\Utils; 15 | 16 | enum StateTypeEnum 17 | { 18 | case Provider; 19 | case Processor; 20 | } 21 | -------------------------------------------------------------------------------- /src/Symfony/Maker/Enum/SupportedFilterTypes.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Maker\Enum; 15 | 16 | enum SupportedFilterTypes: string 17 | { 18 | case ORM = 'orm'; 19 | case ODM = 'odm'; 20 | } 21 | -------------------------------------------------------------------------------- /src/Metadata/CollectionOperationInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * The Operation returns a collection. 18 | */ 19 | interface CollectionOperationInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Metadata/GraphQl/Mutation.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\GraphQl; 15 | 16 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] 17 | class Mutation extends Operation 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Metadata/OperationMutatorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface OperationMutatorInterface 17 | { 18 | public function __invoke(Operation $operation): Operation; 19 | } 20 | -------------------------------------------------------------------------------- /src/Metadata/QueryParameterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * A parameter in the HTTP request query string. 18 | */ 19 | interface QueryParameterInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Metadata/ResourceMutatorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface ResourceMutatorInterface 17 | { 18 | public function __invoke(ApiResource $resource): ApiResource; 19 | } 20 | -------------------------------------------------------------------------------- /src/Symfony/Maker/Resources/skeleton/StateProvider.php.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | namespace ; 5 | 6 | use ApiPlatform\Metadata\Operation; 7 | use ApiPlatform\State\ProviderInterface; 8 | 9 | class implements ProviderInterface 10 | { 11 | public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null 12 | { 13 | // Retrieve the state from somewhere 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Metadata/ParameterProviderFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface ParameterProviderFilterInterface 17 | { 18 | public static function getParameterProvider(): string; 19 | } 20 | -------------------------------------------------------------------------------- /src/Validator/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Validator 2 | 3 | The Validator component of the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/admin/validation/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Documentation/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Documentation 2 | 3 | The API documentation component of the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/State/ParameterNotFound.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State; 15 | 16 | /** 17 | * Represents a query or header parameter that was not present during this request. 18 | */ 19 | final class ParameterNotFound 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/GraphQl/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - GraphQL 2 | 3 | The [GraphQL](https://graphql.org/) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/graphql/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/JsonSchema/SchemaFactoryAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\JsonSchema; 15 | 16 | interface SchemaFactoryAwareInterface 17 | { 18 | public function setSchemaFactory(SchemaFactoryInterface $schemaFactory): void; 19 | } 20 | -------------------------------------------------------------------------------- /src/Symfony/README.md: -------------------------------------------------------------------------------- 1 | # API Platform for Symfony 2 | 3 | Integration of [Symfony](https://symfony.com) with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/symfony/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Metadata/ErrorResourceInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface ErrorResourceInterface 17 | { 18 | public static function createFromException(\Exception|\Throwable $exception, int $status): self; 19 | } 20 | -------------------------------------------------------------------------------- /src/Metadata/QueryParameter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] 17 | class QueryParameter extends Parameter implements QueryParameterInterface 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Metadata/HeaderParameter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] 17 | class HeaderParameter extends Parameter implements HeaderParameterInterface 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/State/Exception/ProviderNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State\Exception; 15 | 16 | use ApiPlatform\Metadata\Exception\RuntimeException; 17 | 18 | final class ProviderNotFoundException extends RuntimeException 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /src/GraphQl/Type/Definition/TypeInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Type\Definition; 15 | 16 | /** 17 | * @author Alan Poulain 18 | */ 19 | interface TypeInterface 20 | { 21 | public function getName(): string; 22 | } 23 | -------------------------------------------------------------------------------- /src/RamseyUuid/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - `ramsey/uuid 2 | 3 | Integration for [`ramsey/uuid`](https://uuid.ramsey.dev) with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/identifiers/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Laravel/README.md: -------------------------------------------------------------------------------- 1 | # API Platform for Laravel 2 | 3 | Integration of [Laravel](https://laravel.com) and the Illuminate components with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/laravel/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Metadata/JsonSchemaFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface JsonSchemaFilterInterface 17 | { 18 | /** 19 | * @return array 20 | */ 21 | public function getSchema(Parameter $parameter): array; 22 | } 23 | -------------------------------------------------------------------------------- /src/Metadata/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Base exception interface. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | interface ExceptionInterface extends \Throwable 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Metadata/Exception/OperationNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Operation not found exception. 18 | */ 19 | class OperationNotFoundException extends \InvalidArgumentException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Doctrine/Common/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Doctrine Common Support 2 | 3 | Integration for [Doctrine](https://www.doctrine-project.org) with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/getting-started/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Elasticsearch/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Exception; 15 | 16 | /** 17 | * Base exception interface. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | interface ExceptionInterface extends \Throwable 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Metadata/Exception/StatusAwareExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | interface StatusAwareExceptionInterface 17 | { 18 | /** 19 | * Sets the status code. 20 | */ 21 | public function setStatus(int $status): void; 22 | } 23 | -------------------------------------------------------------------------------- /src/Elasticsearch/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Elasticsearch Support 2 | 3 | Integration for [Elasticsearch](https://www.elastic.co/elasticsearch) with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/elasticsearch/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/State/Pagination/HasNextPagePaginatorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State\Pagination; 15 | 16 | interface HasNextPagePaginatorInterface 17 | { 18 | /** 19 | * Does this collection offer a next page. 20 | */ 21 | public function hasNextPage(): bool; 22 | } 23 | -------------------------------------------------------------------------------- /src/GraphQl/Type/TypesFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Type; 15 | 16 | /** 17 | * Get the GraphQL types. 18 | * 19 | * @author Alan Poulain 20 | */ 21 | interface TypesFactoryInterface 22 | { 23 | public function getTypes(): array; 24 | } 25 | -------------------------------------------------------------------------------- /src/Hal/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - HAL 2 | 3 | The [HAL (Hypertext Application Language)](https://stateless.group/hal_specification.html) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/content-negotiation/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Metadata/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Runtime exception. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | class RuntimeException extends \RuntimeException implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Metadata/Exception/ItemNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Item not found exception. 18 | * 19 | * @author Amrouche Hamza 20 | */ 21 | class ItemNotFoundException extends InvalidArgumentException 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/JsonSchema/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - JSON Schema 2 | 3 | The [JSON Schema](https://json-schema.org/) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Generates JSON Schema from PHP classes. 6 | 7 | [Documentation](https://api-platform.com/docs/core/json-schema/) 8 | 9 | > [!CAUTION] 10 | > 11 | > This is a read-only sub split of `api-platform/core`, please 12 | > [report issues](https://github.com/api-platform/core/issues) and 13 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 14 | > in the [core API Platform repository](https://github.com/api-platform/core). 15 | -------------------------------------------------------------------------------- /src/Metadata/AsOperationMutator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] 17 | class AsOperationMutator 18 | { 19 | public function __construct( 20 | public readonly string $operationName, 21 | ) { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Hydra/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Hydra 2 | 3 | The [Hydra](https://www.hydra-cg.com/) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Hydra simplifies the development of interoperable, hypermedia-driven Web APIs. 6 | 7 | [Documentation](https://api-platform.com/docs/core/) 8 | 9 | > [!CAUTION] 10 | > 11 | > This is a read-only sub split of `api-platform/core`, please 12 | > [report issues](https://github.com/api-platform/core/issues) and 13 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 14 | > in the [core API Platform repository](https://github.com/api-platform/core). 15 | -------------------------------------------------------------------------------- /src/Metadata/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Metadata 2 | 3 | The Metadata component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Generates abstract representation of web APIs. It's the core of the API Platform Core library. 6 | 7 | [Documentation](https://api-platform.com/docs/core/) 8 | 9 | > [!CAUTION] 10 | > 11 | > This is a read-only sub split of `api-platform/core`, please 12 | > [report issues](https://github.com/api-platform/core/issues) and 13 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 14 | > in the [core API Platform repository](https://github.com/api-platform/core). 15 | -------------------------------------------------------------------------------- /src/Metadata/Exception/PropertyNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Property not found exception. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | class PropertyNotFoundException extends \Exception implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Metadata/GraphQl/DeleteMutation.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\GraphQl; 15 | 16 | use ApiPlatform\Metadata\DeleteOperationInterface; 17 | 18 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] 19 | class DeleteMutation extends Mutation implements DeleteOperationInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/graphql/graphql.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_graphql_entrypoint', '/graphql') 18 | ->controller('api_platform.graphql.action.entrypoint'); 19 | }; 20 | -------------------------------------------------------------------------------- /src/JsonApi/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - JSON:API 2 | 3 | The [JSON:API](https://jsonapi.org/) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | JSON:API is a popular specification for building APIs in JSON. 6 | 7 | [Documentation](https://api-platform.com/docs/core/content-negotiation/) 8 | 9 | > [!CAUTION] 10 | > 11 | > This is a read-only sub split of `api-platform/core`, please 12 | > [report issues](https://github.com/api-platform/core/issues) and 13 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 14 | > in the [core API Platform repository](https://github.com/api-platform/core). 15 | -------------------------------------------------------------------------------- /src/Metadata/Operation/Factory/OperationMetadataFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Operation\Factory; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | 18 | interface OperationMetadataFactoryInterface 19 | { 20 | public function create(string $uriTemplate, array $context = []): ?Operation; 21 | } 22 | -------------------------------------------------------------------------------- /src/Doctrine/Orm/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Doctrine ORM Support 2 | 3 | Integration for [Doctrine ORM](https://www.doctrine-project.org/projects/doctrine-orm/en/current/index.html) with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/getting-started/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Metadata/Exception/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Invalid argument exception. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/GraphQl/Type/SchemaBuilderInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Type; 15 | 16 | use GraphQL\Type\Schema; 17 | 18 | /** 19 | * Builds a GraphQL schema. 20 | * 21 | * @author Alan Poulain 22 | */ 23 | interface SchemaBuilderInterface 24 | { 25 | public function getSchema(): Schema; 26 | } 27 | -------------------------------------------------------------------------------- /src/Metadata/Exception/InvalidIdentifierException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Identifier is not valid exception. 18 | * 19 | * @author Antoine Bluchet 20 | */ 21 | final class InvalidIdentifierException extends \Exception implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Metadata/Exception/InvalidUriVariableException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Identifier is not valid exception. 18 | * 19 | * @author Antoine Bluchet 20 | */ 21 | final class InvalidUriVariableException extends \Exception implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Metadata/Exception/ResourceClassNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Resource class not found exception. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | class ResourceClassNotFoundException extends \Exception implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/OpenApi/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - OpenAPI 2 | 3 | The [OpenAPI](https://www.openapis.org) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Builds and serializes OpenAPI specifications. OpenAPI was formerly known as Swagger. 6 | 7 | [Documentation](https://api-platform.com/docs/core/openapi/) 8 | 9 | > [!CAUTION] 10 | > 11 | > This is a read-only sub split of `api-platform/core`, please 12 | > [report issues](https://github.com/api-platform/core/issues) and 13 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 14 | > in the [core API Platform repository](https://github.com/api-platform/core). 15 | -------------------------------------------------------------------------------- /src/Elasticsearch/Filter/SortFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Filter; 15 | 16 | /** 17 | * Elasticsearch filter interface for sorting. 18 | * 19 | * @experimental 20 | * 21 | * @author Baptiste Meyer 22 | */ 23 | interface SortFilterInterface extends FilterInterface 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/Metadata/Exception/NotExposedHttpException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 17 | 18 | /** 19 | * @author Vincent Chalamon 20 | */ 21 | class NotExposedHttpException extends NotFoundHttpException 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Serializer/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Serializer 2 | 3 | The Serializer component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Serializes PHP objects in various API formats. 6 | Built on top of the Symfony Serializer component. 7 | 8 | [Documentation](https://api-platform.com/docs/core/serialization/) 9 | 10 | > [!CAUTION] 11 | > 12 | > This is a read-only sub split of `api-platform/core`, please 13 | > [report issues](https://github.com/api-platform/core/issues) and 14 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 15 | > in the [core API Platform repository](https://github.com/api-platform/core). 16 | -------------------------------------------------------------------------------- /src/Doctrine/Odm/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Doctrine MongoDB ODM Support 2 | 3 | Integration for [Doctrine MongoDB ODM](https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/current/index.html) with the [API Platform](https://api-platform.com) framework. 4 | 5 | [Documentation](https://api-platform.com/docs/core/mongodb/) 6 | 7 | > [!CAUTION] 8 | > 9 | > This is a read-only sub split of `api-platform/core`, please 10 | > [report issues](https://github.com/api-platform/core/issues) and 11 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 12 | > in the [core API Platform repository](https://github.com/api-platform/core). 13 | -------------------------------------------------------------------------------- /src/Metadata/IsApiResource.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * @author Kévin Dunglas 18 | * 19 | * @phpstan-ignore trait.unused 20 | */ 21 | trait IsApiResource 22 | { 23 | public static function apiResource(): ApiResource 24 | { 25 | return new ApiResource(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/JsonLd/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - JSON-LD 2 | 3 | The [JSON-LD](https://json-ld.org/) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Data is messy and disconnected. JSON-LD organizes and connects it, creating a better Web. 6 | 7 | [Documentation](https://api-platform.com/docs/core/extending-jsonld-context/) 8 | 9 | > [!CAUTION] 10 | > 11 | > This is a read-only sub split of `api-platform/core`, please 12 | > [report issues](https://github.com/api-platform/core/issues) and 13 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 14 | > in the [core API Platform repository](https://github.com/api-platform/core). 15 | -------------------------------------------------------------------------------- /src/Metadata/PropertiesAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * This interface makes a Parameter aware of the properties it can filter on. 18 | * It can be set on a Filter or a Parameter, properties are available in 19 | * extraProperties['_properties']. 20 | */ 21 | interface PropertiesAwareInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/GraphQl/Resolver/MutationResolverInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Resolver; 15 | 16 | /** 17 | * A function resolving a GraphQL mutation. 18 | * 19 | * @author Raoul Clais 20 | */ 21 | interface MutationResolverInterface 22 | { 23 | public function __invoke(?object $item, array $context): ?object; 24 | } 25 | -------------------------------------------------------------------------------- /src/GraphQl/Resolver/QueryItemResolverInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Resolver; 15 | 16 | /** 17 | * A function resolving a GraphQL query of an item. 18 | * 19 | * @author Lukas Lücke 20 | */ 21 | interface QueryItemResolverInterface 22 | { 23 | public function __invoke(?object $item, array $context): object; 24 | } 25 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/errors.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_validation_errors', '/validation_errors/{id}') 18 | ->controller('api_platform.action.not_exposed') 19 | ->methods(['GET', 'HEAD']); 20 | }; 21 | -------------------------------------------------------------------------------- /src/Elasticsearch/Exception/IndexNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Exception; 15 | 16 | /** 17 | * Index not found exception. 18 | * 19 | * @experimental 20 | * 21 | * @author Baptiste Meyer 22 | */ 23 | final class IndexNotFoundException extends \Exception implements ExceptionInterface 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/graphql/graphiql.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_graphql_graphiql', '/graphql/graphiql') 18 | ->controller('api_platform.graphql.action.graphiql') 19 | ->methods(['GET', 'HEAD']); 20 | }; 21 | -------------------------------------------------------------------------------- /src/Symfony/Messenger/RemoveStamp.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Messenger; 15 | 16 | use Symfony\Component\Messenger\Stamp\StampInterface; 17 | 18 | /** 19 | * Hints that the resource in the envelope must be removed. 20 | * 21 | * @author Kévin Dunglas 22 | */ 23 | final class RemoveStamp implements StampInterface 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/LoggerAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | use Psr\Log\LoggerInterface; 17 | 18 | interface LoggerAwareInterface 19 | { 20 | public function hasLogger(): bool; 21 | 22 | public function getLogger(): LoggerInterface; 23 | 24 | public function setLogger(LoggerInterface $logger): void; 25 | } 26 | -------------------------------------------------------------------------------- /src/Elasticsearch/Filter/ConstantScoreFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Filter; 15 | 16 | /** 17 | * Elasticsearch filter interface for a constant score query. 18 | * 19 | * @experimental 20 | * 21 | * @author Baptiste Meyer 22 | */ 23 | interface ConstantScoreFilterInterface extends FilterInterface 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/State/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - Serializer 2 | 3 | The State component of the [API Platform](https://api-platform.com) framework. 4 | 5 | Provides and processes API states. 6 | 7 | Documentation: 8 | 9 | * [State providers](https://api-platform.com/docs/core/state-providers/) 10 | * [State processors](https://api-platform.com/docs/core/state-processors/) 11 | 12 | > [!CAUTION] 13 | > 14 | > This is a read-only sub split of `api-platform/core`, please 15 | > [report issues](https://github.com/api-platform/core/issues) and 16 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 17 | > in the [core API Platform repository](https://github.com/api-platform/core). 18 | -------------------------------------------------------------------------------- /src/Elasticsearch/Exception/NonUniqueIdentifierException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Exception; 15 | 16 | /** 17 | * Non unique identifier exception. 18 | * 19 | * @experimental 20 | * 21 | * @author Baptiste Meyer 22 | */ 23 | final class NonUniqueIdentifierException extends \Exception implements ExceptionInterface 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/Metadata/AsResourceMutator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] 17 | class AsResourceMutator 18 | { 19 | /** 20 | * @param class-string $resourceClass 21 | */ 22 | public function __construct( 23 | public readonly string $resourceClass, 24 | ) { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Metadata/Exception/HttpExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | interface HttpExceptionInterface 17 | { 18 | /** 19 | * Returns the status code. 20 | */ 21 | public function getStatusCode(): int; 22 | 23 | /** 24 | * Returns response headers. 25 | */ 26 | public function getHeaders(): array; 27 | } 28 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Test/ClientTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Bundle\Test; 15 | 16 | trait ClientTrait 17 | { 18 | public function withOptions(array $options): static 19 | { 20 | $clone = clone $this; 21 | $clone->defaultOptions = self::mergeDefaultOptions($options, $this->defaultOptions); 22 | 23 | return $clone; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/OpenApi/Factory/OpenApiFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\OpenApi\Factory; 15 | 16 | use ApiPlatform\OpenApi\OpenApi; 17 | 18 | interface OpenApiFactoryInterface 19 | { 20 | /** 21 | * Creates an OpenApi class. 22 | * 23 | * @param array $context 24 | */ 25 | public function __invoke(array $context = []): OpenApi; 26 | } 27 | -------------------------------------------------------------------------------- /src/Metadata/BackwardCompatibleFilterDescriptionTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * @author Vincent Amstoutz 18 | * 19 | * @internal 20 | */ 21 | trait BackwardCompatibleFilterDescriptionTrait 22 | { 23 | public function getDescription(string $resourceClass): array 24 | { 25 | return []; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/State/StopwatchAwareTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State; 15 | 16 | use Symfony\Component\Stopwatch\Stopwatch; 17 | 18 | /** 19 | * @internal 20 | */ 21 | trait StopwatchAwareTrait 22 | { 23 | private ?Stopwatch $stopwatch = null; 24 | 25 | public function setStopwatch(Stopwatch $stopwatch): void 26 | { 27 | $this->stopwatch = $stopwatch; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/Resources/skeleton/EloquentFilter.php.tpl: -------------------------------------------------------------------------------- 1 | $builder 15 | * @param array $context 16 | */ 17 | public function apply(Builder $builder, mixed $values, Parameter $parameter, array $context = []): Builder 18 | { 19 | // TODO: make your awesome query using the $builder 20 | // return $builder-> 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Laravel/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to the Laravel Integration of API Platform 2 | 3 | Pull requests should be made at https://github.com/api-plaform/core 4 | 5 | ## Tests 6 | 7 | cd src/Laravel 8 | composer global require soyuka/pmu 9 | composer global link ../../ 10 | vendor/bin/testbench workbench:build 11 | vendor/bin/testbench api-platform:install 12 | vendor/bin/testbench package:test 13 | # or 14 | vendor/bin/phpunit 15 | 16 | A command is available to remove the database: 17 | 18 | vendor/bin/testbench workbench:drop-sqlite-db 19 | 20 | ## Starting the Test App 21 | 22 | The test server is also available through: 23 | 24 | vendor/bin/testbench serve 25 | -------------------------------------------------------------------------------- /src/Metadata/Exception/ErrorCodeSerializableInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * An exception which has a serializable application-specific error code. 18 | */ 19 | interface ErrorCodeSerializableInterface 20 | { 21 | /** 22 | * Gets the application-specific error code. 23 | */ 24 | public static function getErrorCode(): string; 25 | } 26 | -------------------------------------------------------------------------------- /src/Metadata/InflectorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface InflectorInterface 17 | { 18 | /** 19 | * Returns a snake case transformed string. 20 | */ 21 | public function tableize(string $input): string; 22 | 23 | /** 24 | * Returns the plural forms of a string. 25 | */ 26 | public function pluralize(string $singular): string; 27 | } 28 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/filter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.filter_locator', 'Symfony\Component\DependencyInjection\ServiceLocator') 20 | ->tag('container.service_locator'); 21 | }; 22 | -------------------------------------------------------------------------------- /src/Metadata/OpenApiParameterFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter; 17 | 18 | interface OpenApiParameterFilterInterface 19 | { 20 | /** 21 | * @return OpenApiParameter|OpenApiParameter[]|null 22 | */ 23 | public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null; 24 | } 25 | -------------------------------------------------------------------------------- /src/GraphQl/Subscription/SubscriptionIdentifierGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Subscription; 15 | 16 | /** 17 | * Generates an identifier used to identify a subscription. 18 | * 19 | * @author Alan Poulain 20 | */ 21 | interface SubscriptionIdentifierGeneratorInterface 22 | { 23 | public function generateSubscriptionIdentifier(array $fields): string; 24 | } 25 | -------------------------------------------------------------------------------- /src/Symfony/Security/ObjectVariableCheckerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Security; 15 | 16 | interface ObjectVariableCheckerInterface 17 | { 18 | /** 19 | * @param string $expression a Expression Language string 20 | * @param array $variables 21 | */ 22 | public function usesObjectVariable(string $expression, array $variables = []): bool; 23 | } 24 | -------------------------------------------------------------------------------- /src/JsonSchema/SchemaUriPrefixTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\JsonSchema; 15 | 16 | /** 17 | * @internal 18 | */ 19 | trait SchemaUriPrefixTrait 20 | { 21 | public function getSchemaUriPrefix(string $version): string 22 | { 23 | return match ($version) { 24 | Schema::VERSION_OPENAPI => '#/components/schemas/', 25 | default => '#/definitions/', 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/genid.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_genid', '/.well-known/genid/{id}') 18 | ->controller('api_platform.action.not_exposed') 19 | ->methods(['GET', 'HEAD']) 20 | ->defaults([ 21 | '_api_respond' => true, 22 | ]); 23 | }; 24 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/ExistsFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | /** 17 | * Interface for filtering the collection by whether a property value exists or not. 18 | * 19 | * @author Teoh Han Hui 20 | * @author Alan Poulain 21 | */ 22 | interface ExistsFilterInterface 23 | { 24 | public const QUERY_PARAMETER_KEY = 'exists'; 25 | } 26 | -------------------------------------------------------------------------------- /src/Doctrine/Orm/QueryAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Orm; 15 | 16 | use Doctrine\ORM\Query; 17 | 18 | interface QueryAwareInterface 19 | { 20 | /** 21 | * Gets the Query object that will actually be executed. 22 | * 23 | * This should allow configuring options which could only be set on the Query 24 | * object itself. 25 | */ 26 | public function getQuery(): Query; 27 | } 28 | -------------------------------------------------------------------------------- /src/HttpCache/README.md: -------------------------------------------------------------------------------- 1 | # API Platform - HTTP Cache 2 | 3 | The [HTTP Cache](https://httpwg.org/specs/rfc7234.html) component of the [API Platform](https://api-platform.com) framework. 4 | 5 | This component also provides integrations with [Varnish](https://varnish-cache.org/), [Souin](https://souin.io/) 6 | and other HTTP cache servers and services. 7 | 8 | [Documentation](https://api-platform.com/docs/core/performance/) 9 | 10 | > [!CAUTION] 11 | > 12 | > This is a read-only sub split of `api-platform/core`, please 13 | > [report issues](https://github.com/api-platform/core/issues) and 14 | > [send Pull Requests](https://github.com/api-platform/core/pulls) 15 | > in the [core API Platform repository](https://github.com/api-platform/core). 16 | -------------------------------------------------------------------------------- /src/Symfony/Action/NotFoundAction.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Action; 15 | 16 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 17 | 18 | /** 19 | * An action which always returns HTTP 404 Not Found. Useful for disabling an operation. 20 | */ 21 | final class NotFoundAction 22 | { 23 | public function __invoke(): void 24 | { 25 | throw new NotFoundHttpException(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Filter/QueryPropertyTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | 18 | /** 19 | * @internal 20 | */ 21 | trait QueryPropertyTrait 22 | { 23 | private function getQueryProperty(Parameter $parameter): ?string 24 | { 25 | return $parameter->getExtraProperties()['_query_property'] ?? $parameter->getProperty() ?? null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/ManagerRegistryAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | use Doctrine\Persistence\ManagerRegistry; 17 | 18 | interface ManagerRegistryAwareInterface 19 | { 20 | public function hasManagerRegistry(): bool; 21 | 22 | public function getManagerRegistry(): ManagerRegistry; 23 | 24 | public function setManagerRegistry(ManagerRegistry $managerRegistry): void; 25 | } 26 | -------------------------------------------------------------------------------- /src/Metadata/CascadeFromResource.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | /** 17 | * @internal 18 | * 19 | * @phpstan-require-extends Operation 20 | */ 21 | trait CascadeFromResource 22 | { 23 | use WithResourceTrait; 24 | 25 | public function cascadeFromResource(ApiResource $apiResource, array $ignoredOptions = []): static 26 | { 27 | return $this->copyFrom($apiResource, $ignoredOptions); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/docs.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_doc', '/docs.{_format}') 18 | ->controller('api_platform.action.documentation') 19 | ->methods(['GET', 'HEAD']) 20 | ->defaults([ 21 | '_format' => null, 22 | '_api_respond' => true, 23 | ]); 24 | }; 25 | -------------------------------------------------------------------------------- /src/Symfony/Action/PlaceholderAction.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Action; 15 | 16 | /** 17 | * Placeholder returning the data passed in parameter. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | final class PlaceholderAction 22 | { 23 | /** 24 | * @param object $data 25 | * 26 | * @return object 27 | */ 28 | public function __invoke($data) 29 | { 30 | return $data; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/JsonLd/Serializer/HydraPrefixTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\JsonLd\Serializer; 15 | 16 | use ApiPlatform\JsonLd\ContextBuilder; 17 | 18 | trait HydraPrefixTrait 19 | { 20 | /** 21 | * @param array $context 22 | */ 23 | private function getHydraPrefix(array $context): string 24 | { 25 | return ($context[ContextBuilder::HYDRA_CONTEXT_HAS_PREFIX] ?? true) ? ContextBuilder::HYDRA_PREFIX : ''; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Metadata/Resource/Factory/PropertyLinkFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Resource\Factory; 15 | 16 | use ApiPlatform\Metadata\Link; 17 | use ApiPlatform\Metadata\Metadata; 18 | 19 | /** 20 | * @internal 21 | */ 22 | interface PropertyLinkFactoryInterface 23 | { 24 | /** 25 | * Create a link for a given property. 26 | */ 27 | public function createLinkFromProperty(Metadata $operation, string $property): Link; 28 | } 29 | -------------------------------------------------------------------------------- /src/GraphQl/Subscription/SubscriptionManagerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Subscription; 15 | 16 | /** 17 | * Manages all the queried subscriptions and creates their ID. 18 | * 19 | * @author Alan Poulain 20 | */ 21 | interface SubscriptionManagerInterface 22 | { 23 | public function retrieveSubscriptionId(array $context, ?array $result): ?string; 24 | 25 | public function getPushPayloads(object $object): array; 26 | } 27 | -------------------------------------------------------------------------------- /src/State/Util/CorsTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State\Util; 15 | 16 | use Symfony\Component\HttpFoundation\Request; 17 | 18 | /** 19 | * CORS utils. 20 | * 21 | * @internal 22 | * 23 | * @author Kévin Dunglas 24 | */ 25 | trait CorsTrait 26 | { 27 | public function isPreflightRequest(Request $request): bool 28 | { 29 | return $request->isMethod('OPTIONS') && $request->headers->has('Access-Control-Request-Method'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Validator/ValidatorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Validator; 15 | 16 | use ApiPlatform\Validator\Exception\ValidationException; 17 | 18 | /** 19 | * Validates an item. 20 | * 21 | * @author Kévin Dunglas 22 | */ 23 | interface ValidatorInterface 24 | { 25 | /** 26 | * Validates an item. 27 | * 28 | * @throws ValidationException 29 | */ 30 | public function validate(object $data, array $context = []): void; 31 | } 32 | -------------------------------------------------------------------------------- /src/GraphQl/State/Provider/NoopProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\State\Provider; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use ApiPlatform\State\ProviderInterface; 18 | 19 | /** 20 | * No-op Provider for GraphQl. 21 | */ 22 | final class NoopProvider implements ProviderInterface 23 | { 24 | public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null 25 | { 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/metadata/php.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.metadata.resource_extractor.php_file', 'ApiPlatform\Metadata\Extractor\PhpFileResourceExtractor') 20 | ->args([ 21 | [], 22 | service('service_container'), 23 | ]); 24 | }; 25 | -------------------------------------------------------------------------------- /src/Metadata/Exception/AccessDeniedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; 17 | 18 | final class AccessDeniedException extends AccessDeniedHttpException implements HttpExceptionInterface 19 | { 20 | public function getStatusCode(): int 21 | { 22 | return 403; 23 | } 24 | 25 | public function getHeaders(): array 26 | { 27 | return []; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Doctrine/Common/ParameterValueExtractorTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | 18 | trait ParameterValueExtractorTrait 19 | { 20 | /** 21 | * @return array 22 | */ 23 | private function extractParameterValue(Parameter $parameter, mixed $value): array 24 | { 25 | $key = $parameter->getProperty() ?? $parameter->getKey(); 26 | 27 | return [$key => $value]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/GraphQl/Serializer/SerializerContextBuilderInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Serializer; 15 | 16 | use ApiPlatform\Metadata\GraphQl\Operation; 17 | 18 | /** 19 | * Builds the context used by the Symfony Serializer. 20 | * 21 | * @author Alan Poulain 22 | */ 23 | interface SerializerContextBuilderInterface 24 | { 25 | public function create(string $resourceClass, Operation $operation, array $resolverContext, bool $normalization): array; 26 | } 27 | -------------------------------------------------------------------------------- /src/State/StopwatchAwareInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State; 15 | 16 | use Symfony\Component\Stopwatch\Stopwatch; 17 | 18 | /** 19 | * Interface for classes that can be injected with a Stopwatch instance. 20 | * 21 | * @internal 22 | * 23 | * @author Kévin Dunglas 24 | */ 25 | interface StopwatchAwareInterface 26 | { 27 | /** 28 | * Sets the Stopwatch instance. 29 | */ 30 | public function setStopwatch(Stopwatch $stopwatch): void; 31 | } 32 | -------------------------------------------------------------------------------- /src/Laravel/GraphQl/Controller/GraphiQlController.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\GraphQl\Controller; 15 | 16 | use Illuminate\Http\Response; 17 | 18 | readonly class GraphiQlController 19 | { 20 | public function __construct(private readonly string $prefix) 21 | { 22 | } 23 | 24 | public function __invoke(): Response 25 | { 26 | return new Response(view('api-platform::graphiql', ['graphiql_data' => ['entrypoint' => $this->prefix.'/graphql']]), 200); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Metadata/ResourceAccessCheckerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata; 15 | 16 | interface ResourceAccessCheckerInterface 17 | { 18 | /** 19 | * Checks if the given item can be accessed by the current user. 20 | * 21 | * @param array{object?: mixed, previous_object?: mixed, request?: \Symfony\Component\HttpFoundation\Request} $extraVariables 22 | */ 23 | public function isGranted(string $resourceClass, string $expression, array $extraVariables = []): bool; 24 | } 25 | -------------------------------------------------------------------------------- /src/GraphQl/Subscription/MercureSubscriptionIriGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Subscription; 15 | 16 | /** 17 | * Generates Mercure-related IRIs from a subscription ID. 18 | * 19 | * @author Alan Poulain 20 | */ 21 | interface MercureSubscriptionIriGeneratorInterface 22 | { 23 | public function generateTopicIri(string $subscriptionId): string; 24 | 25 | public function generateMercureUrl(string $subscriptionId, ?string $hub = null): string; 26 | } 27 | -------------------------------------------------------------------------------- /src/GraphQl/Resolver/QueryCollectionResolverInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Resolver; 15 | 16 | /** 17 | * A function resolving a GraphQL query of a collection. 18 | * 19 | * @author Alan Poulain 20 | */ 21 | interface QueryCollectionResolverInterface 22 | { 23 | /** 24 | * @param iterable $collection 25 | * 26 | * @return iterable 27 | */ 28 | public function __invoke(iterable $collection, array $context): iterable; 29 | } 30 | -------------------------------------------------------------------------------- /src/OpenApi/Serializer/NormalizeOperationNameTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\OpenApi\Serializer; 15 | 16 | /** 17 | * Transforms the operation name to a readable operation id. 18 | * 19 | * @author soyuka 20 | */ 21 | trait NormalizeOperationNameTrait 22 | { 23 | private function normalizeOperationName(string $operationName): string 24 | { 25 | return preg_replace('/^_/', '', str_replace(['/', '{._format}', '{', '}'], ['', '', '_', ''], $operationName)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Symfony/Validator/ValidationGroupsGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Validator; 15 | 16 | use Symfony\Component\Validator\Constraints\GroupSequence; 17 | 18 | /** 19 | * Generates validation groups for an object. 20 | * 21 | * @author Tomas Norkūnas 22 | */ 23 | interface ValidationGroupsGeneratorInterface 24 | { 25 | /** 26 | * @return GroupSequence|string[] 27 | */ 28 | public function __invoke(object $object): array|GroupSequence; 29 | } 30 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/MakeStateProviderCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Console\Maker; 15 | 16 | use ApiPlatform\Laravel\Console\Maker\Utils\StateTypeEnum; 17 | 18 | final class MakeStateProviderCommand extends AbstractMakeStateCommand 19 | { 20 | protected $signature = 'make:state-provider'; 21 | protected $description = 'Creates an API Platform state provider'; 22 | 23 | protected function getStateType(): StateTypeEnum 24 | { 25 | return StateTypeEnum::Provider; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/openapi/yaml.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.yamlopenapi.encoder', 'ApiPlatform\Serializer\YamlEncoder') 20 | ->args([ 21 | 'yamlopenapi', 22 | service('serializer.encoder.yaml')->nullOnInvalid(), 23 | ]) 24 | ->tag('serializer.encoder'); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/MakeStateProcessorCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Console\Maker; 15 | 16 | use ApiPlatform\Laravel\Console\Maker\Utils\StateTypeEnum; 17 | 18 | final class MakeStateProcessorCommand extends AbstractMakeStateCommand 19 | { 20 | protected $signature = 'make:state-processor'; 21 | protected $description = 'Creates an API Platform state processor'; 22 | 23 | protected function getStateType(): StateTypeEnum 24 | { 25 | return StateTypeEnum::Processor; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Metadata/Resource/Factory/ResourceNameCollectionFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Resource\Factory; 15 | 16 | use ApiPlatform\Metadata\Resource\ResourceNameCollection; 17 | 18 | /** 19 | * Creates a resource name collection value object. 20 | * 21 | * @author Kévin Dunglas 22 | */ 23 | interface ResourceNameCollectionFactoryInterface 24 | { 25 | /** 26 | * Creates the resource name collection. 27 | */ 28 | public function create(): ResourceNameCollection; 29 | } 30 | -------------------------------------------------------------------------------- /src/OpenApi/Model/Paths.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\OpenApi\Model; 15 | 16 | final class Paths 17 | { 18 | private array $paths = []; 19 | 20 | public function addPath(string $path, PathItem $pathItem): void 21 | { 22 | $this->paths[$path] = $pathItem; 23 | } 24 | 25 | public function getPath(string $path): ?PathItem 26 | { 27 | return $this->paths[$path] ?? null; 28 | } 29 | 30 | public function getPaths(): array 31 | { 32 | return $this->paths; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/metadata/mutator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.metadata.mutator_collection.resource', 'ApiPlatform\Metadata\Mutator\ResourceMutatorCollection'); 20 | 21 | $services->set('api_platform.metadata.mutator_collection.operation', 'ApiPlatform\Metadata\Mutator\OperationMutatorCollection'); 22 | }; 23 | -------------------------------------------------------------------------------- /src/GraphQl/Error/ErrorHandler.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Error; 15 | 16 | /** 17 | * Handles the errors thrown by the GraphQL library by applying the formatter to them (default behavior). 18 | * 19 | * @author Ollie Harridge 20 | */ 21 | final class ErrorHandler implements ErrorHandlerInterface 22 | { 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function __invoke(array $errors, callable $formatter): array 27 | { 28 | return array_map($formatter, $errors); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Doctrine/Orm/Util/QueryNameGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Orm\Util; 15 | 16 | /** 17 | * @author Amrouche Hamza 18 | */ 19 | interface QueryNameGeneratorInterface 20 | { 21 | /** 22 | * Generates a cacheable alias for DQL join. 23 | */ 24 | public function generateJoinAlias(string $association): string; 25 | 26 | /** 27 | * Generates a cacheable parameter name for DQL query. 28 | */ 29 | public function generateParameterName(string $name): string; 30 | } 31 | -------------------------------------------------------------------------------- /src/GraphQl/Error/ErrorHandlerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Error; 15 | 16 | use GraphQL\Error\Error; 17 | 18 | /** 19 | * Handles the errors thrown by the GraphQL library. 20 | * It is responsible for applying the formatter to the errors and can be used for filtering or logging them. 21 | * 22 | * @author Ollie Harridge 23 | */ 24 | interface ErrorHandlerInterface 25 | { 26 | /** 27 | * @param Error[] $errors 28 | */ 29 | public function __invoke(array $errors, callable $formatter): array; 30 | } 31 | -------------------------------------------------------------------------------- /src/GraphQl/Subscription/OperationAwareSubscriptionManagerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Subscription; 15 | 16 | use ApiPlatform\Metadata\GraphQl\Operation; 17 | 18 | /** 19 | * Manages all the queried subscriptions and creates their ID. 20 | * 21 | * @author Alan Poulain 22 | */ 23 | interface OperationAwareSubscriptionManagerInterface extends SubscriptionManagerInterface 24 | { 25 | public function retrieveSubscriptionId(array $context, ?array $result, ?Operation $operation = null): ?string; 26 | } 27 | -------------------------------------------------------------------------------- /src/Hydra/IriTemplateMapping.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Hydra; 15 | 16 | use Symfony\Component\JsonStreamer\Attribute\StreamedName; 17 | use Symfony\Component\Serializer\Attribute\SerializedName; 18 | 19 | class IriTemplateMapping 20 | { 21 | #[StreamedName('@type')] 22 | #[SerializedName('@type')] 23 | public string $type = 'IriTemplateMapping'; 24 | 25 | public function __construct( 26 | public string $variable, 27 | public ?string $property, 28 | public bool $required = false, 29 | ) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/graphql_mercure.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.graphql.subscription.mercure_iri_generator', 'ApiPlatform\GraphQl\Subscription\MercureSubscriptionIriGenerator') 20 | ->args([ 21 | service('router.request_context'), 22 | service('Symfony\Component\Mercure\HubRegistry'), 23 | ]); 24 | }; 25 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/PropertyPlaceholderOpenApiParameterTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter; 18 | 19 | trait PropertyPlaceholderOpenApiParameterTrait 20 | { 21 | /** 22 | * @return array|null 23 | */ 24 | public function getOpenApiParameters(Parameter $parameter): ?array 25 | { 26 | return [new OpenApiParameter(name: $parameter->getKey(), in: 'query')]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Serializer/ContextTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Serializer; 15 | 16 | /** 17 | * Creates and manipulates the Serializer context. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | trait ContextTrait 22 | { 23 | /** 24 | * Initializes the context. 25 | */ 26 | private function initContext(string $resourceClass, array $context): array 27 | { 28 | return array_merge($context, [ 29 | 'api_sub_level' => true, 30 | 'resource_class' => $resourceClass, 31 | ]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Elasticsearch/Filter/FilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Filter; 15 | 16 | use ApiPlatform\Metadata\FilterInterface as BaseFilterInterface; 17 | use ApiPlatform\Metadata\Operation; 18 | 19 | /** 20 | * Elasticsearch filter interface. 21 | * 22 | * @experimental 23 | * 24 | * @author Baptiste Meyer 25 | */ 26 | interface FilterInterface extends BaseFilterInterface 27 | { 28 | public function apply(array $clauseBody, string $resourceClass, ?Operation $operation = null, array $context = []): array; 29 | } 30 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Filter/FilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use Illuminate\Database\Eloquent\Builder; 18 | use Illuminate\Database\Eloquent\Model; 19 | 20 | interface FilterInterface 21 | { 22 | /** 23 | * @param Builder $builder 24 | * @param array $context 25 | * 26 | * @return Builder 27 | */ 28 | public function apply(Builder $builder, mixed $values, Parameter $parameter, array $context = []): Builder; 29 | } 30 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/State/RemoveProcessor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\State; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use ApiPlatform\State\ProcessorInterface; 18 | 19 | /** 20 | * @implements ProcessorInterface<\Illuminate\Database\Eloquent\Model, null> 21 | */ 22 | final class RemoveProcessor implements ProcessorInterface 23 | { 24 | public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []) 25 | { 26 | $data->delete(); 27 | 28 | return null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Laravel/resources/views/graphiql.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ config('api-platform.title') }} - API Platform 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/State/SerializerAwareProviderInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State; 15 | 16 | use Psr\Container\ContainerInterface; 17 | 18 | /** 19 | * Injects serializer in providers. 20 | * 21 | * @author Vincent Chalamon 22 | * 23 | * @deprecated in 4.2, to be removed in 5.0 because it violates the dependency injection principle. 24 | */ 25 | interface SerializerAwareProviderInterface 26 | { 27 | /** 28 | * @return void 29 | */ 30 | public function setSerializerLocator(ContainerInterface $serializerLocator); 31 | } 32 | -------------------------------------------------------------------------------- /src/Doctrine/Orm/Extension/DoctrinePaginatorFactory.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Orm\Extension; 15 | 16 | use Doctrine\ORM\Query; 17 | use Doctrine\ORM\QueryBuilder; 18 | use Doctrine\ORM\Tools\Pagination\Paginator; 19 | 20 | class DoctrinePaginatorFactory 21 | { 22 | /** 23 | * @param Query|QueryBuilder $query 24 | * @param bool $fetchJoinCollection 25 | */ 26 | public function getPaginator($query, $fetchJoinCollection): Paginator 27 | { 28 | return new Paginator($query, $fetchJoinCollection); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/api.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_entrypoint', '/{index}.{_format}') 18 | ->controller('api_platform.action.entrypoint') 19 | ->methods(['GET', 'HEAD']) 20 | ->defaults([ 21 | '_format' => null, 22 | '_api_respond' => true, 23 | 'index' => 'index', 24 | ]) 25 | ->requirements([ 26 | 'index' => 'index', 27 | ]); 28 | }; 29 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/hydra.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.hydra.processor.link', 'ApiPlatform\Hydra\State\HydraLinkProcessor') 20 | ->decorate('api_platform.state_processor.respond', null, 410) 21 | ->args([ 22 | service('api_platform.hydra.processor.link.inner'), 23 | service('api_platform.router'), 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/OpenApiFilterTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter; 18 | 19 | /** 20 | * @author Vincent Amstoutz 21 | */ 22 | trait OpenApiFilterTrait 23 | { 24 | public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null 25 | { 26 | return new OpenApiParameter(name: $parameter->getKey().'[]', in: 'query', style: 'deepObject', explode: true); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Laravel/Test/Constraint/ArraySubset.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Test\Constraint; 15 | 16 | use PHPUnit\Framework\Constraint\Constraint; 17 | 18 | /** 19 | * Is used for phpunit >= 9. 20 | * 21 | * @internal 22 | */ 23 | final class ArraySubset extends Constraint 24 | { 25 | use ArraySubsetTrait; 26 | 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function evaluate(mixed $other, string $description = '', bool $returnResult = false): ?bool 31 | { 32 | return $this->_evaluate($other, $description, $returnResult); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Metadata/Extractor/PropertyExtractorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Extractor; 15 | 16 | use ApiPlatform\Metadata\Exception\InvalidArgumentException; 17 | 18 | /** 19 | * Extracts an array of metadata from a file or a list of files. 20 | * 21 | * @author Vincent Chalamon 22 | */ 23 | interface PropertyExtractorInterface 24 | { 25 | /** 26 | * Parses all metadata files and convert them in an array. 27 | * 28 | * @throws InvalidArgumentException 29 | */ 30 | public function getProperties(): array; 31 | } 32 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Test/Constraint/ArraySubset.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Bundle\Test\Constraint; 15 | 16 | use PHPUnit\Framework\Constraint\Constraint; 17 | 18 | /** 19 | * Is used for phpunit >= 9. 20 | * 21 | * @internal 22 | */ 23 | final class ArraySubset extends Constraint 24 | { 25 | use ArraySubsetTrait; 26 | 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function evaluate($other, string $description = '', bool $returnResult = false): ?bool 31 | { 32 | return $this->_evaluate($other, $description, $returnResult); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Documentation/Entrypoint.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Documentation; 15 | 16 | use ApiPlatform\Metadata\Resource\ResourceNameCollection; 17 | 18 | /** 19 | * The first path you will see in the API. 20 | * 21 | * @author Amrouche Hamza 22 | */ 23 | final class Entrypoint 24 | { 25 | public function __construct(private readonly ResourceNameCollection $resourceNameCollection) 26 | { 27 | } 28 | 29 | public function getResourceNameCollection(): ResourceNameCollection 30 | { 31 | return $this->resourceNameCollection; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Elasticsearch/State/Options.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\State; 15 | 16 | use ApiPlatform\State\OptionsInterface; 17 | 18 | class Options implements OptionsInterface 19 | { 20 | public function __construct( 21 | protected ?string $index = null, 22 | ) { 23 | } 24 | 25 | public function getIndex(): ?string 26 | { 27 | return $this->index; 28 | } 29 | 30 | public function withIndex(?string $index): self 31 | { 32 | $self = clone $this; 33 | $self->index = $index; 34 | 35 | return $self; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/jsonapi.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.jsonapi.state_provider', 'ApiPlatform\JsonApi\State\JsonApiProvider') 20 | ->decorate('api_platform.state_provider.read', null, 0) 21 | ->args([ 22 | service('api_platform.jsonapi.state_provider.inner'), 23 | '%api_platform.collection.order_parameter_name%', 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/swagger_ui.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.swagger_ui.provider', 'ApiPlatform\Symfony\Bundle\SwaggerUi\SwaggerUiProvider') 20 | ->decorate('api_platform.state_provider.read', null, 0) 21 | ->args([ 22 | service('api_platform.swagger_ui.provider.inner'), 23 | service('api_platform.openapi.factory'), 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/GraphQl/Resolver/Factory/ResolverFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Resolver\Factory; 15 | 16 | use ApiPlatform\Metadata\GraphQl\Operation; 17 | use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface; 18 | 19 | /** 20 | * Builds a GraphQL resolver. 21 | * 22 | * @author Kévin Dunglas 23 | */ 24 | interface ResolverFactoryInterface 25 | { 26 | public function __invoke(?string $resourceClass = null, ?string $rootClass = null, ?Operation $operation = null, ?PropertyMetadataFactoryInterface $propertyMetadataFactory = null): callable; 27 | } 28 | -------------------------------------------------------------------------------- /src/Hydra/IriTemplate.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Hydra; 15 | 16 | use Symfony\Component\JsonStreamer\Attribute\StreamedName; 17 | use Symfony\Component\Serializer\Attribute\SerializedName; 18 | 19 | final class IriTemplate 20 | { 21 | #[StreamedName('@type')] 22 | #[SerializedName('@type')] 23 | public string $type = 'IriTemplate'; 24 | 25 | public function __construct( 26 | public string $variableRepresentation, 27 | /** @var list */ 28 | public array $mapping = [], 29 | public ?string $template = null, 30 | ) { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Metadata/Util/SortTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Util; 15 | 16 | /** 17 | * Sort helper methods. 18 | * 19 | * @internal 20 | * 21 | * @author Alan Poulain 22 | */ 23 | trait SortTrait 24 | { 25 | private function arrayRecursiveSort(array &$array, callable $sortFunction): void 26 | { 27 | foreach ($array as &$value) { 28 | if (\is_array($value)) { 29 | $this->arrayRecursiveSort($value, $sortFunction); 30 | } 31 | } 32 | unset($value); 33 | $sortFunction($array); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/routing/jsonld.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\Routing\Loader\Configurator; 15 | 16 | return function (RoutingConfigurator $routes) { 17 | $routes->add('api_jsonld_context', '/contexts/{shortName}.{_format}') 18 | ->controller('api_platform.jsonld.action.context') 19 | ->methods(['GET', 'HEAD']) 20 | ->defaults([ 21 | '_format' => 'jsonld', 22 | '_api_respond' => true, 23 | ]) 24 | ->requirements([ 25 | 'shortName' => '[^.]+', 26 | '_format' => 'jsonld', 27 | ]); 28 | }; 29 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/PropertyAwareFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | /** 17 | * TODO: 5.x uncomment method. 18 | * 19 | * @author Antoine Bluchet 20 | * 21 | * @method ?array getProperties() 22 | * 23 | * @experimental 24 | */ 25 | interface PropertyAwareFilterInterface 26 | { 27 | /** 28 | * @param string[] $properties 29 | */ 30 | public function setProperties(array $properties): void; 31 | 32 | // /** 33 | // * @return string[] 34 | // */ 35 | // public function getProperties(): ?array; 36 | } 37 | -------------------------------------------------------------------------------- /src/Doctrine/Odm/Extension/AggregationCollectionExtensionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Odm\Extension; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use Doctrine\ODM\MongoDB\Aggregation\Builder; 18 | 19 | /** 20 | * Interface of Doctrine MongoDB ODM aggregation extensions for collection aggregations. 21 | * 22 | * @author Alan Poulain 23 | */ 24 | interface AggregationCollectionExtensionInterface 25 | { 26 | public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void; 27 | } 28 | -------------------------------------------------------------------------------- /src/Doctrine/Odm/Extension/AggregationItemExtensionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Odm\Extension; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use Doctrine\ODM\MongoDB\Aggregation\Builder; 18 | 19 | /** 20 | * Interface of Doctrine MongoDB ODM aggregation extensions for item aggregations. 21 | * 22 | * @author Alan Poulain 23 | */ 24 | interface AggregationItemExtensionInterface 25 | { 26 | public function applyToItem(Builder $aggregationBuilder, string $resourceClass, array $identifiers, ?Operation $operation = null, array &$context = []): void; 27 | } 28 | -------------------------------------------------------------------------------- /src/GraphQl/Subscription/SubscriptionIdentifierGenerator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Subscription; 15 | 16 | /** 17 | * Generates an identifier used to identify a subscription. 18 | * 19 | * @author Alan Poulain 20 | */ 21 | final class SubscriptionIdentifierGenerator implements SubscriptionIdentifierGeneratorInterface 22 | { 23 | public function generateSubscriptionIdentifier(array $fields): string 24 | { 25 | unset($fields['mercureUrl'], $fields['clientSubscriptionId']); 26 | 27 | return hash('sha256', print_r($fields, true)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Metadata/Mutator/ResourceMutatorCollectionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Mutator; 15 | 16 | use ApiPlatform\Metadata\ResourceMutatorInterface; 17 | use Psr\Container\ContainerInterface; 18 | 19 | /** 20 | * Collection of Resource mutators to mutate ApiResource metadata. 21 | */ 22 | interface ResourceMutatorCollectionInterface extends ContainerInterface 23 | { 24 | /** 25 | * @return list 26 | */ 27 | public function get(string $id): array; 28 | 29 | public function add(string $resourceClass, ResourceMutatorInterface $mutator): void; 30 | } 31 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/RangeFilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | /** 17 | * Interface for filtering the collection by range. 18 | * 19 | * @author Lee Siong Chan 20 | * @author Alan Poulain 21 | */ 22 | interface RangeFilterInterface 23 | { 24 | public const PARAMETER_BETWEEN = 'between'; 25 | public const PARAMETER_GREATER_THAN = 'gt'; 26 | public const PARAMETER_GREATER_THAN_OR_EQUAL = 'gte'; 27 | public const PARAMETER_LESS_THAN = 'lt'; 28 | public const PARAMETER_LESS_THAN_OR_EQUAL = 'lte'; 29 | } 30 | -------------------------------------------------------------------------------- /src/Metadata/Mutator/OperationMutatorCollectionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Mutator; 15 | 16 | use ApiPlatform\Metadata\OperationMutatorInterface; 17 | use Psr\Container\ContainerInterface; 18 | 19 | /** 20 | * Collection of Operation mutators to mutate Operation metadata. 21 | */ 22 | interface OperationMutatorCollectionInterface extends ContainerInterface 23 | { 24 | /** 25 | * @return list 26 | */ 27 | public function get(string $id): mixed; 28 | 29 | public function add(string $operationName, OperationMutatorInterface $mutator): void; 30 | } 31 | -------------------------------------------------------------------------------- /src/Validator/Exception/ConstraintViolationListAwareExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Validator\Exception; 15 | 16 | use ApiPlatform\Metadata\Exception\ExceptionInterface; 17 | use Symfony\Component\Validator\ConstraintViolationListInterface; 18 | 19 | /** 20 | * An exception which has a constraint violation list. 21 | */ 22 | interface ConstraintViolationListAwareExceptionInterface extends ExceptionInterface 23 | { 24 | /** 25 | * Gets constraint violations related to this exception. 26 | */ 27 | public function getConstraintViolationList(): ConstraintViolationListInterface; 28 | } 29 | -------------------------------------------------------------------------------- /src/Metadata/Util/CloneTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Util; 15 | 16 | /** 17 | * Clones given data if cloneable. 18 | * 19 | * @internal 20 | * 21 | * @author Quentin Barloy 22 | */ 23 | trait CloneTrait 24 | { 25 | public function clone(mixed $data): mixed 26 | { 27 | if (!\is_object($data)) { 28 | return $data; 29 | } 30 | 31 | try { 32 | return (new \ReflectionClass($data))->isCloneable() ? clone $data : null; 33 | } catch (\ReflectionException) { 34 | return null; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Serializer/Filter/FilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Serializer\Filter; 15 | 16 | use ApiPlatform\Metadata\FilterInterface as BaseFilterInterface; 17 | use Symfony\Component\HttpFoundation\Request; 18 | 19 | /** 20 | * Symfony serializer context builder filter interface. 21 | * 22 | * @author Baptiste Meyer 23 | */ 24 | interface FilterInterface extends BaseFilterInterface 25 | { 26 | /** 27 | * Apply a filter to the serializer context. 28 | */ 29 | public function apply(Request $request, bool $normalization, array $attributes, array &$context): void; 30 | } 31 | -------------------------------------------------------------------------------- /src/State/Pagination/PartialPaginatorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State\Pagination; 15 | 16 | /** 17 | * Partial Paginator Interface. 18 | * 19 | * @author Baptiste Meyer 20 | * 21 | * @template T of object 22 | * 23 | * @extends \Traversable 24 | */ 25 | interface PartialPaginatorInterface extends \Traversable, \Countable 26 | { 27 | /** 28 | * Gets the current page number. 29 | */ 30 | public function getCurrentPage(): float; 31 | 32 | /** 33 | * Gets the number of items by page. 34 | */ 35 | public function getItemsPerPage(): float; 36 | } 37 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/metadata/php_doc.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.metadata.resource.metadata_collection_factory.php_doc', 'ApiPlatform\Metadata\Resource\Factory\PhpDocResourceMetadataCollectionFactory') 20 | ->decorate('api_platform.metadata.resource.metadata_collection_factory', null, 200) 21 | ->args([service('api_platform.metadata.resource.metadata_collection_factory.php_doc.inner')]); 22 | }; 23 | -------------------------------------------------------------------------------- /src/Metadata/Extractor/ResourceExtractorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Extractor; 15 | 16 | use ApiPlatform\Metadata\Exception\InvalidArgumentException; 17 | 18 | /** 19 | * Extracts an array of metadata from a file or a list of files. 20 | * 21 | * @author Kévin Dunglas 22 | * @author Vincent Chalamon 23 | */ 24 | interface ResourceExtractorInterface 25 | { 26 | /** 27 | * Parses all metadata files and convert them in an array. 28 | * 29 | * @throws InvalidArgumentException 30 | */ 31 | public function getResources(): array; 32 | } 33 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/metadata/links.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.metadata.resource.link_factory', 'ApiPlatform\Metadata\Resource\Factory\LinkFactory') 20 | ->args([ 21 | service('api_platform.metadata.property.name_collection_factory'), 22 | service('api_platform.metadata.property.metadata_factory'), 23 | service('api_platform.resource_class_resolver'), 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/HttpCache/PurgerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\HttpCache; 15 | 16 | /** 17 | * Purges resources from the cache. 18 | * 19 | * @author Kévin Dunglas 20 | */ 21 | interface PurgerInterface 22 | { 23 | /** 24 | * Purges all responses containing the given resources from the cache. 25 | * 26 | * @param string[] $iris 27 | */ 28 | public function purge(array $iris): void; 29 | 30 | /** 31 | * Get the response header containing purged tags. 32 | * 33 | * @param string[] $iris 34 | */ 35 | public function getResponseHeaders(array $iris): array; 36 | } 37 | -------------------------------------------------------------------------------- /src/OpenApi/Model/ExtensionTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\OpenApi\Model; 15 | 16 | trait ExtensionTrait 17 | { 18 | private array $extensionProperties = []; 19 | 20 | public function withExtensionProperty(string $key, mixed $value): mixed 21 | { 22 | if (!str_starts_with($key, 'x-')) { 23 | $key = 'x-'.$key; 24 | } 25 | 26 | $clone = clone $this; 27 | $clone->extensionProperties[$key] = $value; 28 | 29 | return $clone; 30 | } 31 | 32 | public function getExtensionProperties(): array 33 | { 34 | return $this->extensionProperties; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/argument_resolver.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.argument_resolver.payload', 'ApiPlatform\Symfony\Bundle\ArgumentResolver\PayloadArgumentResolver') 20 | ->args([ 21 | service('api_platform.metadata.resource.metadata_collection_factory'), 22 | service('api_platform.serializer.context_builder'), 23 | ]) 24 | ->tag('controller.argument_value_resolver'); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/ArgumentResolver/CompatibleValueResolverInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Bundle\ArgumentResolver; 15 | 16 | use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; 17 | use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; 18 | 19 | if (interface_exists(ValueResolverInterface::class)) { 20 | /** @internal */ 21 | interface CompatibleValueResolverInterface extends ValueResolverInterface 22 | { 23 | } 24 | } else { 25 | /** @internal */ 26 | interface CompatibleValueResolverInterface extends ArgumentValueResolverInterface 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/symfony/swagger_ui.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.swagger_ui.documentation.provider', 'ApiPlatform\Symfony\Bundle\SwaggerUi\SwaggerUiProvider') 20 | ->decorate('api_platform.state_provider.documentation.read', null, 0) 21 | ->args([ 22 | service('api_platform.swagger_ui.documentation.provider.inner'), 23 | service('api_platform.openapi.factory'), 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Extension/QueryExtensionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Extension; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use Illuminate\Database\Eloquent\Builder; 18 | use Illuminate\Database\Eloquent\Model; 19 | 20 | interface QueryExtensionInterface 21 | { 22 | /** 23 | * @param Builder $builder 24 | * @param array $uriVariables 25 | * @param array $context 26 | * 27 | * @return Builder 28 | */ 29 | public function apply(Builder $builder, array $uriVariables, Operation $operation, $context = []): Builder; 30 | } 31 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/mercure.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.mercure.processor.add_link_header', 'ApiPlatform\Symfony\State\MercureLinkProcessor') 20 | ->decorate('api_platform.state_processor.respond', null, 400) 21 | ->args([ 22 | service('api_platform.mercure.processor.add_link_header.inner'), 23 | service('Symfony\Component\Mercure\Discovery')->ignoreOnInvalid(), 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/ramsey_uuid.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.serializer.uuid_denormalizer', 'ApiPlatform\RamseyUuid\Serializer\UuidDenormalizer') 20 | ->tag('serializer.normalizer'); 21 | 22 | $services->set('api_platform.ramsey_uuid.uri_variables.transformer.uuid', 'ApiPlatform\RamseyUuid\UriVariableTransformer\UuidUriVariableTransformer') 23 | ->tag('api_platform.uri_variables.transformer', ['priority' => -100]); 24 | }; 25 | -------------------------------------------------------------------------------- /src/Doctrine/Common/Filter/LoggerAwareTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Common\Filter; 15 | 16 | use Psr\Log\LoggerInterface; 17 | use Psr\Log\NullLogger; 18 | 19 | trait LoggerAwareTrait 20 | { 21 | private ?LoggerInterface $logger = null; 22 | 23 | public function hasLogger(): bool 24 | { 25 | return $this->logger instanceof LoggerInterface; 26 | } 27 | 28 | public function getLogger(): LoggerInterface 29 | { 30 | return $this->logger ??= new NullLogger(); 31 | } 32 | 33 | public function setLogger(LoggerInterface $logger): void 34 | { 35 | $this->logger = $logger; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Symfony/Security/Exception/AccessDeniedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Symfony\Security\Exception; 15 | 16 | use ApiPlatform\Metadata\Exception\HttpExceptionInterface; 17 | use Symfony\Component\Security\Core\Exception\AccessDeniedException as ExceptionAccessDeniedException; 18 | 19 | /** 20 | * TODO: deprecate in favor of Metadata. 21 | */ 22 | final class AccessDeniedException extends ExceptionAccessDeniedException implements HttpExceptionInterface 23 | { 24 | public function getStatusCode(): int 25 | { 26 | return 403; 27 | } 28 | 29 | public function getHeaders(): array 30 | { 31 | return []; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/symfony/uid.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.symfony.uri_variables.transformer.ulid', 'ApiPlatform\Symfony\UriVariableTransformer\UlidUriVariableTransformer') 20 | ->tag('api_platform.uri_variables.transformer'); 21 | 22 | $services->set('api_platform.symfony.uri_variables.transformer.uuid', 'ApiPlatform\Symfony\UriVariableTransformer\UuidUriVariableTransformer') 23 | ->tag('api_platform.uri_variables.transformer'); 24 | }; 25 | -------------------------------------------------------------------------------- /src/Doctrine/Odm/State/LinksHandlerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Doctrine\Odm\State; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use Doctrine\ODM\MongoDB\Aggregation\Builder; 18 | 19 | interface LinksHandlerInterface 20 | { 21 | /** 22 | * Handle Doctrine ORM links. 23 | * 24 | * @see LinksHandlerTrait 25 | * 26 | * @param array $uriVariables 27 | * @param array{documentClass: string, operation: Operation}&array $context 28 | */ 29 | public function handleLinks(Builder $aggregationBuilder, array $uriVariables, array $context): void; 30 | } 31 | -------------------------------------------------------------------------------- /src/Symfony/phpunit.baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/JsonLd/AnonymousContextBuilderInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\JsonLd; 15 | 16 | use ApiPlatform\Metadata\UrlGeneratorInterface; 17 | 18 | /** 19 | * JSON-LD context builder with Input Output DTO support interface. 20 | * 21 | * @author Antoine Bluchet 22 | */ 23 | interface AnonymousContextBuilderInterface extends ContextBuilderInterface 24 | { 25 | /** 26 | * Creates a JSON-LD context based on the given object. 27 | * Usually this is used with an Input or Output DTO object. 28 | */ 29 | public function getAnonymousResourceContext(object $object, array $context = [], int $referenceType = UrlGeneratorInterface::ABS_PATH): array; 30 | } 31 | -------------------------------------------------------------------------------- /src/State/Pagination/PaginatorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\State\Pagination; 15 | 16 | /** 17 | * The \Countable implementation should return the number of items on the 18 | * current page, as an integer. 19 | * 20 | * @author Kévin Dunglas 21 | * 22 | * @template T of object 23 | * 24 | * @extends PartialPaginatorInterface 25 | */ 26 | interface PaginatorInterface extends PartialPaginatorInterface 27 | { 28 | /** 29 | * Gets last page. 30 | */ 31 | public function getLastPage(): float; 32 | 33 | /** 34 | * Gets the number of items in the whole collection. 35 | */ 36 | public function getTotalItems(): float; 37 | } 38 | -------------------------------------------------------------------------------- /src/Laravel/Security/ResourceAccessChecker.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Security; 15 | 16 | use ApiPlatform\Laravel\Eloquent\Paginator; 17 | use ApiPlatform\Metadata\ResourceAccessCheckerInterface; 18 | use Illuminate\Support\Facades\Gate; 19 | 20 | class ResourceAccessChecker implements ResourceAccessCheckerInterface 21 | { 22 | public function isGranted(string $resourceClass, string $expression, array $extraVariables = []): bool 23 | { 24 | return Gate::allows( 25 | $expression, 26 | $extraVariables['object'] instanceof Paginator ? 27 | $resourceClass : 28 | $extraVariables['object'] 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/OpenApi/State/OpenApiProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\OpenApi\State; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | use ApiPlatform\OpenApi\Factory\OpenApiFactoryInterface; 18 | use ApiPlatform\OpenApi\OpenApi; 19 | use ApiPlatform\State\ProviderInterface; 20 | 21 | /** 22 | * @internal 23 | */ 24 | final class OpenApiProvider implements ProviderInterface 25 | { 26 | public function __construct(private readonly OpenApiFactoryInterface $openApiFactory) 27 | { 28 | } 29 | 30 | public function provide(Operation $operation, array $uriVariables = [], array $context = []): OpenApi 31 | { 32 | return $this->openApiFactory->__invoke($context); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /update-hydra-context.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | $opts = [ 15 | 'http' => [ 16 | 'method' => 'GET', 17 | 'header' => "User-Agent: Mozilla/5.0\r\n", 18 | ], 19 | ]; 20 | 21 | $context = stream_context_create($opts); 22 | $hydraContext = json_decode(file_get_contents('http://www.w3.org/ns/hydra/context.jsonld', false, $context), true); 23 | file_put_contents('src/JsonLd/HydraContext.php', ' 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Elasticsearch\Extension; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | 18 | /** 19 | * Interface of Elasticsearch request body search extensions for collection queries. 20 | * 21 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html 22 | * 23 | * @experimental 24 | * 25 | * @author Baptiste Meyer 26 | */ 27 | interface RequestBodySearchCollectionExtensionInterface 28 | { 29 | public function applyToCollection(array $requestBody, string $resourceClass, ?Operation $operation = null, array $context = []): array; 30 | } 31 | -------------------------------------------------------------------------------- /src/Hydra/Collection.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Hydra; 15 | 16 | use Symfony\Component\JsonStreamer\Attribute\StreamedName; 17 | 18 | /** 19 | * @template T 20 | * 21 | * @internal 22 | */ 23 | class Collection 24 | { 25 | #[StreamedName('@context')] 26 | public string $context = 'VIRTUAL'; 27 | 28 | #[StreamedName('@id')] 29 | public string $id = 'VIRTUAL'; 30 | 31 | #[StreamedName('@type')] 32 | public string $type = 'Collection'; 33 | 34 | public float $totalItems; 35 | 36 | public ?IriTemplate $search = null; 37 | public ?PartialCollectionView $view = null; 38 | 39 | /** 40 | * @var list 41 | */ 42 | public iterable $member; 43 | } 44 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/http_cache_purger.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.http_cache_purger.processor.add_tags', 'ApiPlatform\HttpCache\State\AddTagsProcessor') 20 | ->decorate('api_platform.state_processor.respond', null, 0) 21 | ->args([ 22 | service('api_platform.http_cache_purger.processor.add_tags.inner'), 23 | service('api_platform.iri_converter'), 24 | service('api_platform.http_cache.purger')->nullOnInvalid(), 25 | ]); 26 | }; 27 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/parameter_provider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.state_provider.parameter.iri_converter', 'ApiPlatform\State\ParameterProvider\IriConverterParameterProvider') 20 | ->args([ 21 | service('api_platform.iri_converter'), 22 | service('logger')->ignoreOnInvalid(), 23 | ]) 24 | ->tag('api_platform.parameter_provider', ['key' => 'ApiPlatform\State\ParameterProvider\IriConverterParameterProvider', 'priority' => -895]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Metadata/UriVariableTransformer/IntegerUriVariableTransformer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\UriVariableTransformer; 15 | 16 | use ApiPlatform\Metadata\UriVariableTransformerInterface; 17 | use Symfony\Component\TypeInfo\TypeIdentifier; 18 | 19 | final class IntegerUriVariableTransformer implements UriVariableTransformerInterface 20 | { 21 | public function transform(mixed $value, array $types, array $context = []): int 22 | { 23 | return (int) $value; 24 | } 25 | 26 | public function supportsTransformation(mixed $value, array $types, array $context = []): bool 27 | { 28 | return TypeIdentifier::INT->value === $types[0] && \is_string($value); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/link_security.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.state_provider.read_link', 'ApiPlatform\State\ParameterProvider\ReadLinkParameterProvider') 20 | ->args([ 21 | service('api_platform.state_provider.locator'), 22 | service('api_platform.metadata.resource.metadata_collection_factory'), 23 | ]) 24 | ->tag('api_platform.parameter_provider', ['key' => 'ApiPlatform\State\ParameterProvider\ReadLinkParameterProvider', 'priority' => -890]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/state/security_validator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.state_provider.access_checker.post_validate', 'ApiPlatform\Symfony\Security\State\AccessCheckerProvider') 20 | ->decorate('api_platform.state_provider.validate', null, 0) 21 | ->args([ 22 | service('api_platform.state_provider.access_checker.post_validate.inner'), 23 | service('api_platform.security.resource_access_checker'), 24 | 'post_validate', 25 | ]); 26 | }; 27 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Filter/EqualsFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use Illuminate\Database\Eloquent\Builder; 18 | use Illuminate\Database\Eloquent\Model; 19 | 20 | final class EqualsFilter implements FilterInterface 21 | { 22 | use QueryPropertyTrait; 23 | 24 | /** 25 | * @param Builder $builder 26 | * @param array $context 27 | */ 28 | public function apply(Builder $builder, mixed $values, Parameter $parameter, array $context = []): Builder 29 | { 30 | return $builder->{$context['whereClause'] ?? 'where'}($this->getQueryProperty($parameter), $values); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Metadata/Operation/PathSegmentNameGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Operation; 15 | 16 | /** 17 | * Generates a path name according to a string and whether it's a collection or not. 18 | * 19 | * @author Antoine Bluchet 20 | */ 21 | interface PathSegmentNameGeneratorInterface 22 | { 23 | /** 24 | * Transforms a given string to a valid path name which can be pluralized (eg. for collections). 25 | * 26 | * @param string $name Usually a ResourceMetadata shortname 27 | * 28 | * @return string A string that is a part of the route name 29 | */ 30 | public function getSegmentName(string $name, bool $collection = true): string; 31 | } 32 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/metadata/xml.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.metadata.resource_extractor.xml', 'ApiPlatform\Metadata\Extractor\XmlResourceExtractor') 20 | ->args([ 21 | [], 22 | service('service_container'), 23 | ]); 24 | 25 | $services->set('api_platform.metadata.property_extractor.xml', 'ApiPlatform\Metadata\Extractor\XmlPropertyExtractor') 26 | ->args([ 27 | [], 28 | service('service_container'), 29 | ]); 30 | }; 31 | -------------------------------------------------------------------------------- /src/Symfony/Bundle/Resources/config/data_collector.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; 15 | 16 | return function (ContainerConfigurator $container) { 17 | $services = $container->services(); 18 | 19 | $services->set('api_platform.data_collector.request', 'ApiPlatform\Symfony\Bundle\DataCollector\RequestDataCollector') 20 | ->args([ 21 | service('api_platform.metadata.resource.metadata_collection_factory'), 22 | service('api_platform.filter_locator'), 23 | ]) 24 | ->tag('data_collector', ['template' => '@ApiPlatform/DataCollector/request.html.twig', 'id' => 'api_platform.data_collector.request', 'priority' => 334]); 25 | }; 26 | -------------------------------------------------------------------------------- /src/Metadata/Exception/ProblemExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Exception; 15 | 16 | /** 17 | * Implements the Problem Error specification. 18 | */ 19 | interface ProblemExceptionInterface 20 | { 21 | public function getType(): string; 22 | 23 | /** 24 | * Note from RFC rfc7807: "title" (string) - A short, human-readable summary of the problem type. 25 | * It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. 26 | */ 27 | public function getTitle(): ?string; 28 | 29 | public function getStatus(): ?int; 30 | 31 | public function getDetail(): ?string; 32 | 33 | public function getInstance(): ?string; 34 | } 35 | -------------------------------------------------------------------------------- /src/GraphQl/ExecutorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl; 15 | 16 | use GraphQL\Executor\ExecutionResult; 17 | use GraphQL\Type\Schema; 18 | 19 | /** 20 | * Wrapper for the GraphQL facade. 21 | * 22 | * @author Alan Poulain 23 | */ 24 | interface ExecutorInterface 25 | { 26 | /** 27 | * @see http://webonyx.github.io/graphql-php/executing-queries/#using-facade-method 28 | * 29 | * @param mixed $source 30 | */ 31 | public function executeQuery(Schema $schema, $source, mixed $rootValue = null, mixed $context = null, ?array $variableValues = null, ?string $operationName = null, ?callable $fieldResolver = null, ?array $validationRules = null): ExecutionResult; 32 | } 33 | -------------------------------------------------------------------------------- /src/Hydra/PartialCollectionView.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Hydra; 15 | 16 | use Symfony\Component\JsonStreamer\Attribute\StreamedName; 17 | 18 | class PartialCollectionView 19 | { 20 | #[StreamedName('@type')] 21 | public string $type = 'PartialCollectionView'; 22 | 23 | public function __construct( 24 | #[StreamedName('@id')] 25 | public string $id, 26 | #[StreamedName('first')] 27 | public ?string $first = null, 28 | #[StreamedName('last')] 29 | public ?string $last = null, 30 | #[StreamedName('previous')] 31 | public ?string $previous = null, 32 | #[StreamedName('next')] 33 | public ?string $next = null, 34 | ) { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/JsonSchema/DefinitionNameFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\JsonSchema; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | 18 | /** 19 | * Factory for creating definition names for resources in a JSON Schema document. 20 | * 21 | * @author Gwendolen Lynch 22 | */ 23 | interface DefinitionNameFactoryInterface 24 | { 25 | /** 26 | * Creates a resource definition name. 27 | * 28 | * @param class-string $className 29 | * 30 | * @return string the definition name 31 | */ 32 | public function create(string $className, string $format = 'json', ?string $inputOrOutputClass = null, ?Operation $operation = null, array $serializerContext = []): string; 33 | } 34 | -------------------------------------------------------------------------------- /src/Laravel/Console/Maker/Utils/SuccessMessageTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Console\Maker\Utils; 15 | 16 | trait SuccessMessageTrait 17 | { 18 | private function writeSuccessMessage(string $filePath, string $customText): void 19 | { 20 | $this->newLine(); 21 | $this->line(' '); 22 | $this->line(' Success! '); 23 | $this->line(' '); 24 | $this->newLine(); 25 | $this->line('created: '.$filePath.''); 26 | $this->newLine(); 27 | $this->line("Next: Open your new $customText class and start customizing it."); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Filter/EndSearchFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use Illuminate\Database\Eloquent\Builder; 18 | use Illuminate\Database\Eloquent\Model; 19 | 20 | final class EndSearchFilter implements FilterInterface 21 | { 22 | use QueryPropertyTrait; 23 | 24 | /** 25 | * @param Builder $builder 26 | * @param array $context 27 | */ 28 | public function apply(Builder $builder, mixed $values, Parameter $parameter, array $context = []): Builder 29 | { 30 | return $builder->{$context['whereClause'] ?? 'where'}($this->getQueryProperty($parameter), 'like', '%'.$values); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Filter/StartSearchFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use Illuminate\Database\Eloquent\Builder; 18 | use Illuminate\Database\Eloquent\Model; 19 | 20 | final class StartSearchFilter implements FilterInterface 21 | { 22 | use QueryPropertyTrait; 23 | 24 | /** 25 | * @param Builder $builder 26 | * @param array $context 27 | */ 28 | public function apply(Builder $builder, mixed $values, Parameter $parameter, array $context = []): Builder 29 | { 30 | return $builder->{$context['whereClause'] ?? 'where'}($this->getQueryProperty($parameter), 'like', $values.'%'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Laravel/Eloquent/Filter/PartialSearchFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Laravel\Eloquent\Filter; 15 | 16 | use ApiPlatform\Metadata\Parameter; 17 | use Illuminate\Database\Eloquent\Builder; 18 | use Illuminate\Database\Eloquent\Model; 19 | 20 | final class PartialSearchFilter implements FilterInterface 21 | { 22 | use QueryPropertyTrait; 23 | 24 | /** 25 | * @param Builder $builder 26 | * @param array $context 27 | */ 28 | public function apply(Builder $builder, mixed $values, Parameter $parameter, array $context = []): Builder 29 | { 30 | return $builder->{$context['whereClause'] ?? 'where'}($this->getQueryProperty($parameter), 'like', '%'.$values.'%'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Metadata/Resource/Factory/ResourceMetadataCollectionFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Resource\Factory; 15 | 16 | use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException; 17 | use ApiPlatform\Metadata\Resource\ResourceMetadataCollection; 18 | 19 | /** 20 | * Creates a resource metadata value object. 21 | * 22 | * @author Antoine Bluchet 23 | */ 24 | interface ResourceMetadataCollectionFactoryInterface 25 | { 26 | /** 27 | * Creates a resource metadata. 28 | * 29 | * @param string|class-string $resourceClass 30 | * 31 | * @throws ResourceClassNotFoundException 32 | */ 33 | public function create(string $resourceClass): ResourceMetadataCollection; 34 | } 35 | -------------------------------------------------------------------------------- /src/HttpCache/SouinPurger.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\HttpCache; 15 | 16 | use Symfony\Contracts\HttpClient\HttpClientInterface; 17 | 18 | /** 19 | * Purges Souin. 20 | * 21 | * @author Sylvain Combraque 22 | */ 23 | class SouinPurger extends SurrogateKeysPurger 24 | { 25 | private const MAX_HEADER_SIZE_PER_BATCH = 1500; 26 | private const SEPARATOR = ', '; 27 | private const HEADER = 'Surrogate-Key'; 28 | 29 | /** 30 | * @param HttpClientInterface[] $clients 31 | */ 32 | public function __construct(iterable $clients, int $maxHeaderLength = self::MAX_HEADER_SIZE_PER_BATCH) 33 | { 34 | parent::__construct($clients, $maxHeaderLength, self::HEADER, self::SEPARATOR); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/HttpCache/VarnishXKeyPurger.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\HttpCache; 15 | 16 | use Symfony\Contracts\HttpClient\HttpClientInterface; 17 | 18 | /** 19 | * Purges Varnish XKey. 20 | * 21 | * @author Kévin Dunglas 22 | */ 23 | final class VarnishXKeyPurger extends SurrogateKeysPurger 24 | { 25 | private const VARNISH_MAX_HEADER_LENGTH = 8000; 26 | private const VARNISH_SEPARATOR = ' '; 27 | 28 | /** 29 | * @param HttpClientInterface[] $clients 30 | */ 31 | public function __construct(iterable $clients, int $maxHeaderLength = self::VARNISH_MAX_HEADER_LENGTH, string $xkeyGlue = self::VARNISH_SEPARATOR) 32 | { 33 | parent::__construct($clients, $maxHeaderLength, 'xkey', $xkeyGlue); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Metadata/Mutator/ResourceMutatorCollection.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\Metadata\Mutator; 15 | 16 | use ApiPlatform\Metadata\ResourceMutatorInterface; 17 | 18 | /** 19 | * @internal 20 | */ 21 | final class ResourceMutatorCollection implements ResourceMutatorCollectionInterface 22 | { 23 | private array $mutators = []; 24 | 25 | public function add(string $resourceClass, ResourceMutatorInterface $mutator): void 26 | { 27 | $this->mutators[$resourceClass][] = $mutator; 28 | } 29 | 30 | public function get(string $id): array 31 | { 32 | return $this->mutators[$id] ?? []; 33 | } 34 | 35 | public function has(string $id): bool 36 | { 37 | return isset($this->mutators[$id]); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/GraphQl/Type/TypeNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\GraphQl\Type; 15 | 16 | use Psr\Container\NotFoundExceptionInterface; 17 | 18 | /** 19 | * Exception thrown when a type has not been found in the types container. 20 | * 21 | * @author Alan Poulain 22 | */ 23 | final class TypeNotFoundException extends \InvalidArgumentException implements NotFoundExceptionInterface 24 | { 25 | public function __construct(string $message, private readonly string $typeId) 26 | { 27 | parent::__construct($message); 28 | } 29 | 30 | /** 31 | * Returns the type identifier causing this exception. 32 | */ 33 | public function getTypeId(): string 34 | { 35 | return $this->typeId; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/JsonSchema/SchemaFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace ApiPlatform\JsonSchema; 15 | 16 | use ApiPlatform\Metadata\Operation; 17 | 18 | /** 19 | * Factory for creating the JSON Schema document corresponding to a PHP class. 20 | * 21 | * @author Kévin Dunglas 22 | */ 23 | interface SchemaFactoryInterface 24 | { 25 | public const FORCE_SUBSCHEMA = '_api_subschema_force_readable_link'; 26 | 27 | /** 28 | * Builds the JSON Schema document corresponding to the given PHP class. 29 | */ 30 | public function buildSchema(string $className, string $format = 'json', string $type = Schema::TYPE_OUTPUT, ?Operation $operation = null, ?Schema $schema = null, ?array $serializerContext = null, bool $forceCollection = false): Schema; 31 | } 32 | --------------------------------------------------------------------------------