@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface ComponentFactoryInterface |
6 | 6 | { |
7 | - public function create(?array $ops = null); |
|
7 | + public function create (?array $ops = null); |
|
8 | 8 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param ObjectManager $manager |
31 | 31 | * @param ValidatorInterface $validator |
32 | 32 | */ |
33 | - public function __construct( |
|
33 | + public function __construct ( |
|
34 | 34 | ObjectManager $manager, |
35 | 35 | ValidatorInterface $validator |
36 | 36 | ) { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @param array|null $ops |
44 | 44 | * @throws \Silverback\ApiComponentBundle\Exception\InvalidFactoryOptionException |
45 | 45 | */ |
46 | - protected function init($component, ?array $ops = null): void |
|
46 | + protected function init ($component, ?array $ops = null): void |
|
47 | 47 | { |
48 | 48 | $this->setOptions($ops); |
49 | 49 | $component->setClassName($this->ops['className']); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param array|null $ops |
55 | 55 | * @throws \Silverback\ApiComponentBundle\Exception\InvalidFactoryOptionException |
56 | 56 | */ |
57 | - protected function setOptions(?array $ops): void |
|
57 | + protected function setOptions (?array $ops): void |
|
58 | 58 | { |
59 | 59 | if (!$ops) { |
60 | 60 | $ops = []; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return bool |
79 | 79 | * @throws \Silverback\ApiComponentBundle\Exception\InvalidEntityException |
80 | 80 | */ |
81 | - protected function validate(AbstractComponent $component): bool |
|
81 | + protected function validate (AbstractComponent $component): bool |
|
82 | 82 | { |
83 | 83 | $errors = $this->validator->validate($component); |
84 | 84 | if (\count($errors)) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * @return array |
92 | 92 | */ |
93 | - protected static function defaultOps(): array |
|
93 | + protected static function defaultOps (): array |
|
94 | 94 | { |
95 | 95 | return [ |
96 | 96 | 'className' => null |
@@ -100,5 +100,5 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * @param array|null $ops |
102 | 102 | */ |
103 | - abstract public function create(?array $ops = null); |
|
103 | + abstract public function create (?array $ops = null); |
|
104 | 104 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | private $client; |
22 | 22 | |
23 | - public function __construct( |
|
23 | + public function __construct ( |
|
24 | 24 | ObjectManager $manager, |
25 | 25 | ValidatorInterface $validator, |
26 | 26 | Client $client |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @return array |
34 | 34 | */ |
35 | - private static function getGuzzleOps(): array |
|
35 | + private static function getGuzzleOps (): array |
|
36 | 36 | { |
37 | 37 | return [ |
38 | 38 | 'connect_timeout' => 3, |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @return string |
46 | 46 | */ |
47 | - private function getLipsumContent(): string |
|
47 | + private function getLipsumContent (): string |
|
48 | 48 | { |
49 | 49 | $url = 'http://loripsum.net/api/' . implode('/', $this->ops['lipsum']); |
50 | 50 | try { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | /** |
70 | 70 | * @inheritdoc |
71 | 71 | */ |
72 | - public function create(?array $ops = null): Content |
|
72 | + public function create (?array $ops = null): Content |
|
73 | 73 | { |
74 | 74 | $component = new Content(); |
75 | 75 | $this->init($component, $ops); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * @inheritdoc |
89 | 89 | */ |
90 | - public static function defaultOps(): array |
|
90 | + public static function defaultOps (): array |
|
91 | 91 | { |
92 | 92 | return array_merge( |
93 | 93 | parent::defaultOps(), |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @inheritdoc |
16 | 16 | */ |
17 | - public function create(?array $ops = null): Hero |
|
17 | + public function create (?array $ops = null): Hero |
|
18 | 18 | { |
19 | 19 | $component = new Hero(); |
20 | 20 | $this->init($component, $ops); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * @inheritdoc |
30 | 30 | */ |
31 | - public static function defaultOps(): array |
|
31 | + public static function defaultOps (): array |
|
32 | 32 | { |
33 | 33 | return array_merge( |
34 | 34 | parent::defaultOps(), |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @inheritdoc |
16 | 16 | */ |
17 | - public function create(?array $ops = null): Article |
|
17 | + public function create (?array $ops = null): Article |
|
18 | 18 | { |
19 | 19 | $component = new Article(); |
20 | 20 | $this->init($component, $ops); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @inheritdoc |
31 | 31 | */ |
32 | - protected static function defaultOps(): array |
|
32 | + protected static function defaultOps (): array |
|
33 | 33 | { |
34 | 34 | return array_merge( |
35 | 35 | parent::defaultOps(), |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | private $handlers; |
24 | 24 | |
25 | - public function __construct( |
|
25 | + public function __construct ( |
|
26 | 26 | EntityManagerInterface $entityManager, |
27 | 27 | SerializerInterface $serializer, |
28 | 28 | FormFactory $formFactory, |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @throws \ReflectionException |
58 | 58 | * @throws \LogicException |
59 | 59 | */ |
60 | - public function __invoke(Request $request, Form $data, string $_format) |
|
60 | + public function __invoke (Request $request, Form $data, string $_format) |
|
61 | 61 | { |
62 | 62 | $form = $this->formFactory->create($data); |
63 | 63 | $formData = $this->deserializeFormData($form, $request->getContent()); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param SerializerInterface $serializer |
35 | 35 | * @param FormFactory $formFactory |
36 | 36 | */ |
37 | - public function __construct( |
|
37 | + public function __construct ( |
|
38 | 38 | EntityManagerInterface $entityManager, |
39 | 39 | SerializerInterface $serializer, |
40 | 40 | FormFactory $formFactory |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @throws \InvalidArgumentException |
54 | 54 | * @throws \UnexpectedValueException |
55 | 55 | */ |
56 | - protected function getResponse($data, $_format, $valid, Response $response = null): Response |
|
56 | + protected function getResponse ($data, $_format, $valid, Response $response = null): Response |
|
57 | 57 | { |
58 | 58 | if (!$response) { |
59 | 59 | $response = new Response(); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @param FormView $formView |
68 | 68 | * @return mixed |
69 | 69 | */ |
70 | - protected function getFormValid(FormView $formView) |
|
70 | + protected function getFormValid (FormView $formView) |
|
71 | 71 | { |
72 | 72 | return $formView->getVars()['valid']; |
73 | 73 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return array |
79 | 79 | * @throws BadRequestHttpException |
80 | 80 | */ |
81 | - public function deserializeFormData(FormInterface $form, $content): array |
|
81 | + public function deserializeFormData (FormInterface $form, $content): array |
|
82 | 82 | { |
83 | 83 | $content = \GuzzleHttp\json_decode($content, true); |
84 | 84 | if (!isset($content[$form->getName()])) { |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @param string $_format |
29 | 29 | * @return Response |
30 | 30 | */ |
31 | - public function __invoke(Request $request, Form $data, string $_format) |
|
31 | + public function __invoke (Request $request, Form $data, string $_format) |
|
32 | 32 | { |
33 | 33 | $form = $this->formFactory->create($data); |
34 | 34 | $formData = $this->deserializeFormData($form, $request->getContent()); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @param LifecycleEventArgs $eventArgs |
21 | 21 | * @throws \Doctrine\ORM\ORMInvalidArgumentException |
22 | 22 | */ |
23 | - public function preRemove(AbstractComponent $component, LifecycleEventArgs $eventArgs): void |
|
23 | + public function preRemove (AbstractComponent $component, LifecycleEventArgs $eventArgs): void |
|
24 | 24 | { |
25 | 25 | $this->em = $eventArgs->getEntityManager(); |
26 | 26 | if ($component->onDeleteCascade()) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | /** |
32 | 32 | * @param AbstractComponent $component |
33 | 33 | */ |
34 | - private function deleteSubComponents(AbstractComponent $component): void |
|
34 | + private function deleteSubComponents (AbstractComponent $component): void |
|
35 | 35 | { |
36 | 36 | foreach ($component->getComponentGroups() as $componentGroup) { |
37 | 37 | $this->em->remove($componentGroup); |