@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | use RadekDostal\NetteComponents\DateTimePicker\TbDatePicker; |
| 6 | 6 | use RadekDostal\NetteComponents\DateTimePicker\TbDateTimePicker; |
| 7 | 7 | |
| 8 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 8 | +require __DIR__.'/../vendor/autoload.php'; |
|
| 9 | 9 | |
| 10 | 10 | umask(0); |
| 11 | 11 | |
@@ -13,23 +13,23 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | $configurator->setDebugMode(false); |
| 15 | 15 | |
| 16 | -$tempDir = sys_get_temp_dir() . '/uniman/temp'; |
|
| 16 | +$tempDir = sys_get_temp_dir().'/uniman/temp'; |
|
| 17 | 17 | if (!file_exists($tempDir)) { |
| 18 | 18 | mkdir($tempDir, 0777, true); |
| 19 | 19 | } |
| 20 | 20 | $configurator->setTempDirectory($tempDir); |
| 21 | 21 | |
| 22 | -$configurator->addConfig(__DIR__ . '/config/config.neon'); |
|
| 22 | +$configurator->addConfig(__DIR__.'/config/config.neon'); |
|
| 23 | 23 | $container = $configurator->createContainer(); |
| 24 | 24 | |
| 25 | -Form::extensionMethod('addDatePicker', function (Form $form, $name, $label, $maxLength = null) { |
|
| 25 | +Form::extensionMethod('addDatePicker', function(Form $form, $name, $label, $maxLength = null) { |
|
| 26 | 26 | $datePicker = new TbDatePicker($label, $maxLength); |
| 27 | 27 | $datePicker->setFormat('Y-m-d'); |
| 28 | 28 | $datePicker->setAttribute('class', 'datepicker'); |
| 29 | 29 | return $form[$name] = $datePicker; |
| 30 | 30 | }); |
| 31 | 31 | |
| 32 | -Form::extensionMethod('addDateTimePicker', function (Form $form, $name, $label, $maxLength = null) { |
|
| 32 | +Form::extensionMethod('addDateTimePicker', function(Form $form, $name, $label, $maxLength = null) { |
|
| 33 | 33 | $dateTimePicker = new TbDateTimePicker($label, $maxLength); |
| 34 | 34 | $dateTimePicker->setFormat('Y-m-d H:i:s'); |
| 35 | 35 | $dateTimePicker->setAttribute('class', 'datetimepicker'); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | public function itemsCount($type, $table, array $filter = []) |
| 105 | 105 | { |
| 106 | - $query = sprintf('SELECT count(*) FROM `%s`', $table) . $this->createWhere($filter); |
|
| 106 | + $query = sprintf('SELECT count(*) FROM `%s`', $table).$this->createWhere($filter); |
|
| 107 | 107 | return $this->connection->query($query)->fetch(PDO::FETCH_COLUMN); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $query = sprintf('SELECT * FROM `%s`', $table); |
| 114 | 114 | $query .= $this->createWhere($filter); |
| 115 | 115 | $query .= $this->createOrderBy($sorting); |
| 116 | - $query .= ' LIMIT ' . (($page - 1) * $onPage) . ', ' . $onPage; |
|
| 116 | + $query .= ' LIMIT '.(($page - 1) * $onPage).', '.$onPage; |
|
| 117 | 117 | $items = []; |
| 118 | 118 | foreach ($this->connection->query($query)->fetchAll(PDO::FETCH_ASSOC) as $item) { |
| 119 | 119 | $pk = []; |
@@ -154,14 +154,14 @@ discard block |
||
| 154 | 154 | foreach ($filterPart as $key => $filterSettings) { |
| 155 | 155 | foreach ($filterSettings as $operator => $value) { |
| 156 | 156 | if (!isset($operatorsMap[$operator])) { |
| 157 | - throw new OperatorNotSupportedException('Operator "' . $operator . '" is not supported.'); |
|
| 157 | + throw new OperatorNotSupportedException('Operator "'.$operator.'" is not supported.'); |
|
| 158 | 158 | } |
| 159 | 159 | if ($operator === Filter::OPERATOR_IS_IN || $operator === Filter::OPERATOR_IS_NOT_IN) { |
| 160 | - $value = implode(', ', array_map(function ($item) { |
|
| 161 | - return '"' . $item . '"'; |
|
| 160 | + $value = implode(', ', array_map(function($item) { |
|
| 161 | + return '"'.$item.'"'; |
|
| 162 | 162 | }, explode(',', $value))); |
| 163 | 163 | } |
| 164 | - $whereParts[] = "`$key` " . sprintf($operatorsMap[$operator], $value); |
|
| 164 | + $whereParts[] = "`$key` ".sprintf($operatorsMap[$operator], $value); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | } elseif ($type === MySqlDriver::TYPE_VIEW) { |
| 208 | 208 | $query = sprintf('DROP VIEW `%s`', $table); |
| 209 | 209 | } else { |
| 210 | - throw new InvalidArgumentException('Type "' . $type . '" is not supported'); |
|
| 210 | + throw new InvalidArgumentException('Type "'.$type.'" is not supported'); |
|
| 211 | 211 | } |
| 212 | 212 | return $this->connection->query($query); |
| 213 | 213 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | public function execute($commands) |
| 262 | 262 | { |
| 263 | - $queries = array_filter(array_map('trim', explode(';', $commands)), function ($query) { |
|
| 263 | + $queries = array_filter(array_map('trim', explode(';', $commands)), function($query) { |
|
| 264 | 264 | return $query; |
| 265 | 265 | }); |
| 266 | 266 | $results = []; |