/**
  * @param IntegrationInterface $integration
  */
 public function registerCodecMatcher(IntegrationInterface $integration)
 {
     // register factory
     $factory = $this->createFactory();
     $integration->setInContainer(FactoryInterface::class, $factory);
     // register config
     $config = $integration->getConfig();
     $integration->setInContainer(C::class, $config);
     // register schemas
     $schemaContainer = $this->createSchemaContainer($config, $factory);
     $integration->setInContainer(ContainerInterface::class, $schemaContainer);
     // register codec matcher
     $codecMatcher = $this->createCodecMatcher($config, $factory, $schemaContainer);
     $integration->setInContainer(CodecMatcherInterface::class, $codecMatcher);
 }
Example #2
0
 /**
  * Init integrations with JSON API implementation.
  *
  * @param IntegrationInterface $integration
  *
  * @return void
  */
 private function initJsonApiSupport(IntegrationInterface $integration)
 {
     $this->integration = $integration;
     /** @var FactoryInterface $factory */
     $factory = $this->getIntegration()->getFromContainer(FactoryInterface::class);
     $this->codecMatcher = $integration->getFromContainer(CodecMatcherInterface::class);
     $this->exceptionThrower = $integration->getFromContainer(ExceptionThrowerInterface::class);
     $this->parametersParser = $factory->createParametersParser();
     $this->supportedExtensions = $factory->createSupportedExtensions($this->extensions);
     $this->parametersChecker = $factory->createParametersChecker($this->exceptionThrower, $this->codecMatcher, $this->allowUnrecognizedParams, $this->allowedIncludePaths, $this->allowedFieldSetTypes, $this->allowedSortFields, $this->allowedPagingParameters, $this->allowedFilteringParameters);
     // information about extensions supported by the current controller might be used in exception handler
     $integration->setInContainer(SupportedExtensionsInterface::class, $this->supportedExtensions);
 }