@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $query = <<<'SQL' |
41 | 41 | SELECT uuid FROM company |
42 | 42 | WHERE name = :name |
43 | -SQL; |
|
43 | +sql; |
|
44 | 44 | $statement = $this->connection->executeQuery($query, ['name' => $name])->fetchOne(); |
45 | 45 | |
46 | 46 | return !(false === $statement); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | company.slug as slug |
113 | 113 | FROM company |
114 | 114 | WHERE uuid = :uuid |
115 | -SQL; |
|
115 | +sql; |
|
116 | 116 | $result = $this->connection->executeQuery($query, ['uuid' => $uuid])->fetchAssociative(); |
117 | 117 | |
118 | 118 | return Company::create( |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | $query = <<<'SQL' |
140 | 140 | SELECT uuid FROM company |
141 | -SQL; |
|
141 | +sql; |
|
142 | 142 | $statement = $this->connection->executeQuery($query)->fetchOne(); |
143 | 143 | |
144 | 144 | return !(false === $statement); |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | { |
26 | 26 | foreach ($familyLogs as $key => $familyLog) { |
27 | 27 | if ('1' === $familyLog['level']) { |
28 | - ${'parent' . $key} = FamilyLog::create( |
|
28 | + ${'parent'.$key} = FamilyLog::create( |
|
29 | 29 | FamilyLogUuid::fromString($familyLog['uuid']), |
30 | 30 | NameField::fromString($familyLog['label']), |
31 | 31 | (int) $familyLog['level'] |
32 | 32 | ); |
33 | - $parent = ${'parent' . $key}; |
|
33 | + $parent = ${'parent'.$key}; |
|
34 | 34 | } else { |
35 | - ${'parent' . $key} = FamilyLog::create( |
|
35 | + ${'parent'.$key} = FamilyLog::create( |
|
36 | 36 | FamilyLogUuid::fromString($familyLog['uuid']), |
37 | 37 | NameField::fromString($familyLog['label']), |
38 | 38 | (int) $familyLog['level'], |
39 | - ${'parent' . ($key - 1)} |
|
39 | + ${'parent'.($key - 1)} |
|
40 | 40 | ); |
41 | - unset(${'parent' . ($key - 1)}); |
|
42 | - $parent = ${'parent' . $key}; |
|
41 | + unset(${'parent'.($key - 1)}); |
|
42 | + $parent = ${'parent'.$key}; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | ); |
60 | 60 | } |
61 | 61 | |
62 | - \usort($data, static function ($a, $b) { |
|
62 | + \usort($data, static function($a, $b) { |
|
63 | 63 | return \strcmp($a['level'], $b['level']); |
64 | 64 | }); |
65 | 65 | |
66 | 66 | foreach ($data as $datum) { |
67 | - \array_map(static function (FamilyLog $familyLog) use ($datum, $familyLogs): void { |
|
67 | + \array_map(static function(FamilyLog $familyLog) use ($datum, $familyLogs): void { |
|
68 | 68 | if (null !== $datum['parent_id'] && ($datum['uuid'] === $familyLog->uuid())) { |
69 | 69 | $familyLog->attributeParent($familyLogs[$datum['parent_id']]); |
70 | 70 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | return new FamilyLogs( |
75 | - ...\array_map(function (FamilyLog $familyLog) { |
|
75 | + ...\array_map(function(FamilyLog $familyLog) { |
|
76 | 76 | return $this->createReadModelFromDomain($familyLog); |
77 | 77 | }, \array_values($familyLogs)) |
78 | 78 | ); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $query = <<<'SQL' |
43 | 43 | SELECT uuid FROM supplier |
44 | 44 | WHERE name = :name |
45 | -SQL; |
|
45 | +sql; |
|
46 | 46 | $statement = $this->connection->executeQuery($query, ['name' => $name])->fetchOne(); |
47 | 47 | |
48 | 48 | return !(false === $statement); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | FROM supplier |
109 | 109 | JOIN family_log on family_log.uuid = supplier.family_log_id |
110 | 110 | WHERE supplier.uuid = :uuid |
111 | -SQL; |
|
111 | +sql; |
|
112 | 112 | $result = $this->connection->executeQuery($query, ['uuid' => $uuid])->fetchAssociative(); |
113 | 113 | if (null === $result) { |
114 | 114 | throw new SupplierNotFound(); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | ) |
67 | 67 | SELECT DISTINCT uuid, parent_id, label, level, path, slug FROM cte |
68 | 68 | ORDER BY level DESC |
69 | -SQL; |
|
69 | +sql; |
|
70 | 70 | |
71 | 71 | $results = $this->connection->executeQuery($query)->fetchAllAssociative(); |
72 | 72 |
@@ -118,7 +118,7 @@ |
||
118 | 118 | $results = $this->connection->executeQuery($query)->fetchAllAssociative(); |
119 | 119 | |
120 | 120 | return new Suppliers( |
121 | - ...\array_map(static function (array $supplier) { |
|
121 | + ...\array_map(static function(array $supplier) { |
|
122 | 122 | $familyLog = FamilyLog::create( |
123 | 123 | FamilyLogUuid::fromString($supplier['familyLogId']), |
124 | 124 | NameField::fromString($supplier['label']), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | supplier.slug as slug |
58 | 58 | FROM supplier |
59 | 59 | WHERE uuid = :uuid |
60 | -SQL; |
|
60 | +sql; |
|
61 | 61 | $result = $this->connection->executeQuery($query, ['uuid' => $uuid])->fetchAssociative(); |
62 | 62 | |
63 | 63 | if (null === $result) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | FROM supplier |
115 | 115 | INNER JOIN family_log ON supplier.family_log_id = family_log.uuid |
116 | 116 | WHERE active = 1 |
117 | -SQL; |
|
117 | +sql; |
|
118 | 118 | $results = $this->connection->executeQuery($query)->fetchAllAssociative(); |
119 | 119 | |
120 | 120 | return new Suppliers( |
@@ -65,7 +65,7 @@ |
||
65 | 65 | ) |
66 | 66 | SELECT DISTINCT uuid, parent_id, label, slug, level, path FROM cte |
67 | 67 | ORDER BY level |
68 | -SQL; |
|
68 | +sql; |
|
69 | 69 | |
70 | 70 | // Get parents |
71 | 71 | $result = $this->connection->executeQuery($query, ['uuid' => $uuid])->fetchAllAssociative(); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function childrenArrayLabels(self $familyLog): ?array |
88 | 88 | { |
89 | 89 | if (null !== $familyLog->children) { |
90 | - return \array_map(static function (self $child) { |
|
90 | + return \array_map(static function(self $child) { |
|
91 | 91 | return $child->label; |
92 | 92 | }, $familyLog->children); |
93 | 93 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $this->level = 1; |
137 | 137 | if (null !== $parent) { |
138 | 138 | $this->parent->addChild($this); |
139 | - $this->path = $parent->path() . '/' . $this->slug(); |
|
139 | + $this->path = $parent->path().'/'.$this->slug(); |
|
140 | 140 | $this->level = $parent->level + 1; |
141 | 141 | } |
142 | 142 | if ($this->hasChildren()) { |