@@ -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 | ]; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $em->flush(); |
97 | 97 | //$this->addFlash('success', $translator->trans('part.created_flash')); |
98 | 98 | |
99 | - return $this->redirectToRoute($this->route_base . '_edit', ['id' => $new_entity->getID()]); |
|
99 | + return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | //Import form |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | foreach ($errors as $name => $error) { |
117 | 117 | /** @var $error ConstraintViolationList */ |
118 | - $this->addFlash('error', $name . ":" . $error); |
|
118 | + $this->addFlash('error', $name.":".$error); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->addFlash('success', 'attachment_type.deleted'); |
156 | 156 | } |
157 | 157 | |
158 | - return $this->redirectToRoute($this->route_base . '_new'); |
|
158 | + return $this->redirectToRoute($this->route_base.'_new'); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | protected function _exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request) |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $entities = $em->getRepository($this->entity_class)->findAll(); |
168 | 168 | |
169 | - return $exporter->exportEntityFromRequest($entities,$request); |
|
169 | + return $exporter->exportEntityFromRequest($entities, $request); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | protected function _exportEntity(NamedDBElement $entity, EntityExporter $exporter, Request $request) |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | $tree_node = new TreeViewNode($element->__toString(), $href, $children_nodes); |
90 | 90 | |
91 | - if($children_nodes != null) { |
|
91 | + if ($children_nodes != null) { |
|
92 | 92 | $tree_node->addTag((string) count($children_nodes)); |
93 | 93 | } |
94 | 94 |
@@ -145,7 +145,7 @@ |
||
145 | 145 | return $this->urlGenerator->generate("footprint_edit", ['id' => $entity->getID()]); |
146 | 146 | } |
147 | 147 | |
148 | - if($entity instanceof User) { |
|
148 | + if ($entity instanceof User) { |
|
149 | 149 | return $this->urlGenerator->generate('user_edit', ['id' => $entity->getID()]); |
150 | 150 | } |
151 | 151 |
@@ -110,7 +110,6 @@ |
||
110 | 110 | * in the database, you have to pass the "price_related_quantity" count as $multiplier. |
111 | 111 | * |
112 | 112 | * @return float the price as a float number |
113 | - |
|
114 | 113 | */ |
115 | 114 | public function getPricePerUnit(int $multiplier = 1) : float |
116 | 115 | { |
@@ -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 ,". |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($fs->isAbsolutePath($tmp_base_path)) { |
55 | 55 | $this->base_path = $tmp_base_path; |
56 | 56 | } else { |
57 | - $this->base_path = realpath($kernel->getProjectDir() . $tmp_base_path); |
|
57 | + $this->base_path = realpath($kernel->getProjectDir().$tmp_base_path); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | $sz = 'BKMGTP'; |
126 | 126 | $factor = (int) floor((strlen($bytes) - 1) / 3); |
127 | - return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor]; |
|
127 | + return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor]; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | } |
131 | 131 | \ No newline at end of file |
@@ -221,7 +221,7 @@ |
||
221 | 221 | if ($only_http) { //Check if scheme is HTTPS or HTTP |
222 | 222 | $scheme = parse_url($string, PHP_URL_SCHEME); |
223 | 223 | if ($scheme !== 'http' && $scheme !== 'https') { |
224 | - return false; //All other schemes are not valid. |
|
224 | + return false; //All other schemes are not valid. |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | if ($path_required) { |