@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | ini_set('display_errors', 1); |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 13 | +require __DIR__.'/../vendor/autoload.php'; |
|
| 14 | 14 | |
| 15 | 15 | umask(0); |
| 16 | 16 | |
@@ -18,22 +18,22 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $configurator->setDebugMode(false); |
| 20 | 20 | |
| 21 | -$tempDir = sys_get_temp_dir() . '/adminerng/temp'; |
|
| 21 | +$tempDir = sys_get_temp_dir().'/adminerng/temp'; |
|
| 22 | 22 | if (!file_exists($tempDir)) { |
| 23 | 23 | mkdir($tempDir, 0777, true); |
| 24 | 24 | } |
| 25 | 25 | $configurator->setTempDirectory($tempDir); |
| 26 | 26 | |
| 27 | -$configurator->addConfig(__DIR__ . '/config/config.neon'); |
|
| 27 | +$configurator->addConfig(__DIR__.'/config/config.neon'); |
|
| 28 | 28 | $container = $configurator->createContainer(); |
| 29 | 29 | |
| 30 | -Form::extensionMethod('addDatePicker', function (Form $_this, $name, $label, $cols = null, $maxLength = null) { |
|
| 30 | +Form::extensionMethod('addDatePicker', function(Form $_this, $name, $label, $cols = null, $maxLength = null) { |
|
| 31 | 31 | $datePicker = new TbDatePicker($label, $cols, $maxLength); |
| 32 | 32 | $datePicker->setFormat('Y-m-d'); |
| 33 | 33 | return $_this[$name] = $datePicker; |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | -Form::extensionMethod('addDateTimePicker', function (Form $_this, $name, $label, $cols = null, $maxLength = null) { |
|
| 36 | +Form::extensionMethod('addDateTimePicker', function(Form $_this, $name, $label, $cols = null, $maxLength = null) { |
|
| 37 | 37 | $dateTimePicker = new TbDateTimePicker($label, $cols, $maxLength); |
| 38 | 38 | $dateTimePicker->setFormat('Y-m-d H:i:s'); |
| 39 | 39 | return $_this[$name] = $dateTimePicker; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $this->template->driver = $actualDriver; |
| 18 | 18 | $this->driver = $this->driverStorage->getDriver($actualDriver); |
| 19 | 19 | if (!$this->driver) { |
| 20 | - throw new BadRequestException('Driver "' . $actualDriver . '" not found'); |
|
| 20 | + throw new BadRequestException('Driver "'.$actualDriver.'" not found'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $credentials = $this->credentialsStorage->getCredentials($actualDriver); |
@@ -100,10 +100,10 @@ |
||
| 100 | 100 | protected function createComponentFilterForm() |
| 101 | 101 | { |
| 102 | 102 | $form = $this->driver->formManager()->filterForm($this->translator, $this->columns, $this->filter, $this->sorting, $this->onPage); |
| 103 | - $form->doRedirect[] = function ($onPage, $filter, $sorting) { |
|
| 103 | + $form->doRedirect[] = function($onPage, $filter, $sorting) { |
|
| 104 | 104 | $this->redirect('Item:default', $this->driver->type(), $this->database, $this->type, $this->table, 1, $onPage, $filter, $sorting); |
| 105 | 105 | }; |
| 106 | - $form->doReset[] = function () { |
|
| 106 | + $form->doReset[] = function() { |
|
| 107 | 107 | $this->redirect('Item:default', $this->driver->type(), $this->database, $this->type, $this->table); |
| 108 | 108 | }; |
| 109 | 109 | return $form; |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | 'svg' => 'image/svg+xml', |
| 45 | 45 | 'otf' => 'application/x-font-opentype', |
| 46 | 46 | ]; |
| 47 | - $path = __DIR__ . '/../../www/' . $file; |
|
| 47 | + $path = __DIR__.'/../../www/'.$file; |
|
| 48 | 48 | $extension = pathinfo($path, PATHINFO_EXTENSION); |
| 49 | 49 | $contentType = isset($contentTypes[$extension]) ? $contentTypes[$extension] : 'text/plain'; |
| 50 | 50 | $httpResponse->setContentType($contentType); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | foreach ($data as $key => $row) { |
| 14 | 14 | foreach ($row as $column => $value) { |
| 15 | - $col = '__' . $column . '__'; |
|
| 15 | + $col = '__'.$column.'__'; |
|
| 16 | 16 | if (!isset($$col)) { |
| 17 | 17 | $$col = []; |
| 18 | 18 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $args = []; |
| 24 | 24 | foreach ($sorting as $sort) { |
| 25 | 25 | foreach ($sort as $key => $direction) { |
| 26 | - $col = '__' . $key . '__'; |
|
| 26 | + $col = '__'.$key.'__'; |
|
| 27 | 27 | if (!isset($$col)) { |
| 28 | 28 | continue; |
| 29 | 29 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | return $message; |
| 51 | 51 | } |
| 52 | 52 | foreach ($params as $key => $value) { |
| 53 | - $message = str_replace('%' . $key . '%', $value, $message); |
|
| 53 | + $message = str_replace('%'.$key.'%', $value, $message); |
|
| 54 | 54 | } |
| 55 | 55 | return $message; |
| 56 | 56 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function load($lang) |
| 18 | 18 | { |
| 19 | - $files = Finder::findFiles('*.neon')->in($this->localizationDirectory . '/' . $lang); |
|
| 19 | + $files = Finder::findFiles('*.neon')->in($this->localizationDirectory.'/'.$lang); |
|
| 20 | 20 | $translations = []; |
| 21 | 21 | foreach ($files as $file) { |
| 22 | 22 | $translations[pathinfo($file, PATHINFO_FILENAME)] = Neon::decode(file_get_contents($file)); |
@@ -21,28 +21,28 @@ |
||
| 21 | 21 | public function formatSize($number) |
| 22 | 22 | { |
| 23 | 23 | if ($number < 1024) { |
| 24 | - return $this->formatNumber($number) . ' B'; |
|
| 24 | + return $this->formatNumber($number).' B'; |
|
| 25 | 25 | } |
| 26 | 26 | if ($number < 1024 * 1024) { |
| 27 | - return $this->formatNumber($number / 1024, 1) . ' kB'; |
|
| 27 | + return $this->formatNumber($number / 1024, 1).' kB'; |
|
| 28 | 28 | } |
| 29 | 29 | if ($number < 1024 * 1024 * 1024) { |
| 30 | - return $this->formatNumber($number / 1024 / 1024, 1) . ' MB'; |
|
| 30 | + return $this->formatNumber($number / 1024 / 1024, 1).' MB'; |
|
| 31 | 31 | } |
| 32 | 32 | if ($number < 1024 * 1024 * 1024 * 1024) { |
| 33 | - return $this->formatNumber($number / 1024 / 1024 / 1024, 1) . ' GB'; |
|
| 33 | + return $this->formatNumber($number / 1024 / 1024 / 1024, 1).' GB'; |
|
| 34 | 34 | } |
| 35 | - return $this->formatNumber($number / 1024 / 1024 / 1024 / 1024, 1) . ' TB'; |
|
| 35 | + return $this->formatNumber($number / 1024 / 1024 / 1024 / 1024, 1).' TB'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function formatTime($number) |
| 39 | 39 | { |
| 40 | 40 | if ($number < 60) { |
| 41 | - return $number . ' s'; |
|
| 41 | + return $number.' s'; |
|
| 42 | 42 | } |
| 43 | 43 | if ($number < 2600) { |
| 44 | 44 | return date('i:s', $number); |
| 45 | 45 | } |
| 46 | - return ceil($number / 3600) . date('\h i\m s\s', $number); |
|
| 46 | + return ceil($number / 3600).date('\h i\m s\s', $number); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $tableForm->addFieldsToForm($form); |
| 50 | 50 | $form->addSubmit('save', 'Save'); |
| 51 | 51 | $form->onSuccess[] = [$tableForm, 'submit']; |
| 52 | - $form->onSuccess[] = function () { |
|
| 52 | + $form->onSuccess[] = function() { |
|
| 53 | 53 | $this->presenter->redirect('Table:default', $this->driver->type(), $this->database); |
| 54 | 54 | }; |
| 55 | 55 | return $form; |