@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | { |
59 | 59 | $dataTable//->add("id", TextColumn::class) |
60 | 60 | ->add('name', TextColumn::class, ['label' => 'name.label', |
61 | - 'render' => function ($value, Part $context) { |
|
61 | + 'render' => function($value, Part $context) { |
|
62 | 62 | return $this->urlGenerator->infoHTML($context); |
63 | - }, ]) |
|
63 | + },]) |
|
64 | 64 | ->add('description', TextColumn::class, ['label' => 'description.label']) |
65 | 65 | ->add('category', TextColumn::class, ['field' => 'category.name', 'label' => 'category.label']) |
66 | 66 | ->add('instock', TextColumn::class, ['label' => 'instock.label_short']) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ->createAdapter(ORMAdapter::class, [ |
71 | 71 | 'entity' => Part::class, |
72 | 72 | 'criteria' => [ |
73 | - function (QueryBuilder $builder) use ($options) { |
|
73 | + function(QueryBuilder $builder) use ($options) { |
|
74 | 74 | if (isset($options['cid'])) { |
75 | 75 | $builder->andWhere('part.category = :cid') |
76 | 76 | ->setParameter('cid', $options['cid']); |
@@ -179,7 +179,7 @@ |
||
179 | 179 | */ |
180 | 180 | public function listOperationsForPermission(string $permission): array |
181 | 181 | { |
182 | - if(!$this->isValidPermission($permission)) { |
|
182 | + if (!$this->isValidPermission($permission)) { |
|
183 | 183 | throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission)); |
184 | 184 | } |
185 | 185 | $operations = $this->permission_structure['perms'][$permission]['operations']; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | //Ensure that we always serialize an array. This makes it easier to import the data again. |
100 | - if(is_array($entity)) { |
|
100 | + if (is_array($entity)) { |
|
101 | 101 | $entity_array = $entity; |
102 | 102 | } else { |
103 | 103 | $entity_array = [$entity]; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | |
133 | - $filename = "export_" . $entity_name . "_" . $level . "." . $format; |
|
133 | + $filename = "export_".$entity_name."_".$level.".".$format; |
|
134 | 134 | |
135 | 135 | // Create the disposition of the file |
136 | 136 | $disposition = $response->headers->makeDisposition( |
@@ -137,11 +137,11 @@ |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | //The [] behind class_name denotes that we expect an array. |
140 | - $entities = $this->serializer->deserialize($content, $class_name . '[]', $options['format'], |
|
140 | + $entities = $this->serializer->deserialize($content, $class_name.'[]', $options['format'], |
|
141 | 141 | ['groups' => $groups, 'csv_delimiter' => $options['csv_separator']]); |
142 | 142 | |
143 | 143 | //Ensure we have an array of entitity elements. |
144 | - if(!is_array($entities)) { |
|
144 | + if (!is_array($entities)) { |
|
145 | 145 | $entities = [$entities]; |
146 | 146 | } |
147 | 147 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $em->remove($element); |
96 | 96 | }); |
97 | 97 | |
98 | - if($flush) { |
|
98 | + if ($flush) { |
|
99 | 99 | $em->flush(); |
100 | 100 | } |
101 | 101 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | public function getTests() |
69 | 69 | { |
70 | 70 | return [ |
71 | - new TwigTest('instanceof', function ($var, $instance) { |
|
71 | + new TwigTest('instanceof', function($var, $instance) { |
|
72 | 72 | return $var instanceof $instance; |
73 | 73 | } ) |
74 | 74 | ]; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $skip_this_version = false; |
33 | 33 | try { |
34 | 34 | //Check if we can use this migration method: |
35 | - $version = (int)$this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
35 | + $version = (int) $this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
36 | 36 | |
37 | 37 | $this->abortIf($version !== 26, "This database migration can only be used if the database version is 26! Install Part-DB 0.5.6 and update database there!"); |
38 | 38 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $skip_this_version = false; |
27 | 27 | try { |
28 | 28 | //Check if we can use this migration method: |
29 | - $version = (int)$this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
29 | + $version = (int) $this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
30 | 30 | |
31 | 31 | $this->skipIf(true, "Old Part-DB Database detected! Continue with upgrade..."); |
32 | 32 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $this->addSql('ALTER TABLE `users` ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES `groups` (id)'); |
74 | 74 | |
75 | 75 | //Create table for user logs: |
76 | - $sql = $updateSteps[] = "CREATE TABLE `log` ". |
|
76 | + $sql = $updateSteps[] = "CREATE TABLE `log` ". |
|
77 | 77 | "( `id` INT NOT NULL AUTO_INCREMENT , `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ,". |
78 | 78 | " `id_user` INT NOT NULL ,". |
79 | 79 | " `level` TINYINT NOT NULL ,". |
@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | public function getIDString(): string |
80 | 80 | { |
81 | - return 'MU' . $this->getID(); |
|
81 | + return 'MU'.$this->getID(); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |