@@ 57-73 (lines=17) @@ | ||
54 | * |
|
55 | * @SuppressWarnings(PHPMD.StaticAccess) |
|
56 | */ |
|
57 | public function createDataParser(string $rulesClass): JsonApiDataParserInterface |
|
58 | { |
|
59 | $serializedData = FluteSettings::getJsonDataSerializedRules($this->getFluteSettings()); |
|
60 | ||
61 | /** @var FormatterFactoryInterface $formatterFactory */ |
|
62 | $formatterFactory = $this->getContainer()->get(FormatterFactoryInterface::class); |
|
63 | $parser = new DataParser( |
|
64 | $rulesClass, |
|
65 | JsonApiDataRulesSerializer::class, |
|
66 | $serializedData, |
|
67 | new ContextStorage(JsonApiQueryRulesSerializer::readBlocks($serializedData), $this->getContainer()), |
|
68 | new JsonApiErrorCollection($formatterFactory->createFormatter(FluteSettings::VALIDATION_NAMESPACE)), |
|
69 | $this->getContainer()->get(FormatterFactoryInterface::class) |
|
70 | ); |
|
71 | ||
72 | return $parser; |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * @inheritdoc |
|
@@ 80-98 (lines=19) @@ | ||
77 | * |
|
78 | * @SuppressWarnings(PHPMD.StaticAccess) |
|
79 | */ |
|
80 | public function createQueryParser(string $rulesClass): JsonApiQueryParserInterface |
|
81 | { |
|
82 | $serializedData = FluteSettings::getJsonQuerySerializedRules($this->getFluteSettings()); |
|
83 | ||
84 | /** @var FormatterFactoryInterface $formatterFactory */ |
|
85 | $formatterFactory = $this->getContainer()->get(FormatterFactoryInterface::class); |
|
86 | $parser = new QueryParser( |
|
87 | $rulesClass, |
|
88 | JsonApiQueryRulesSerializer::class, |
|
89 | $serializedData, |
|
90 | new ContextStorage(JsonApiQueryRulesSerializer::readBlocks($serializedData), $this->getContainer()), |
|
91 | new CaptureAggregator(), |
|
92 | new ErrorAggregator(), |
|
93 | new JsonApiErrorCollection($formatterFactory->createFormatter(FluteSettings::VALIDATION_NAMESPACE)), |
|
94 | $this->getContainer()->get(FormatterFactoryInterface::class) |
|
95 | ); |
|
96 | ||
97 | return $parser; |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * @return array |