@@ -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 = []; |
@@ -65,30 +65,30 @@ |
||
| 65 | 65 | { |
| 66 | 66 | $columns = []; |
| 67 | 67 | if ($type == RedisDriver::TYPE_KEY || $type == RedisDriver::TYPE_HASH) { |
| 68 | - $columns[] = (new Column('key', 'redis.columns.' . $type . '.key')) |
|
| 68 | + $columns[] = (new Column('key', 'redis.columns.'.$type.'.key')) |
|
| 69 | 69 | ->setSortable(true) |
| 70 | 70 | ->setFilterable(true); |
| 71 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 71 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 72 | 72 | ->setSortable(true) |
| 73 | 73 | ->setFilterable(true); |
| 74 | - $columns[] = (new Column('value', 'redis.columns.' . $type . '.value')) |
|
| 74 | + $columns[] = (new Column('value', 'redis.columns.'.$type.'.value')) |
|
| 75 | 75 | ->setSortable(true) |
| 76 | 76 | ->setFilterable(true); |
| 77 | 77 | } elseif ($type == RedisDriver::TYPE_SET) { |
| 78 | - $columns[] = (new Column('member', 'redis.columns.' . $type . '.member')) |
|
| 78 | + $columns[] = (new Column('member', 'redis.columns.'.$type.'.member')) |
|
| 79 | 79 | ->setSortable(true) |
| 80 | 80 | ->setFilterable(true); |
| 81 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 81 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 82 | 82 | ->setSortable(true) |
| 83 | 83 | ->setFilterable(true); |
| 84 | 84 | } elseif ($type === RedisDriver::TYPE_LIST) { |
| 85 | - $columns[] = (new Column('index', 'redis.columns.' . $type . '.index')) |
|
| 85 | + $columns[] = (new Column('index', 'redis.columns.'.$type.'.index')) |
|
| 86 | 86 | ->setSortable(true) |
| 87 | 87 | ->setFilterable(true); |
| 88 | - $columns[] = (new Column('element', 'redis.columns.' . $type . '.element')) |
|
| 88 | + $columns[] = (new Column('element', 'redis.columns.'.$type.'.element')) |
|
| 89 | 89 | ->setSortable(true) |
| 90 | 90 | ->setFilterable(true); |
| 91 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 91 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 92 | 92 | ->setSortable(true) |
| 93 | 93 | ->setFilterable(true); |
| 94 | 94 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->template->filter = $this->filter; |
| 47 | 47 | $this->template->sorting = $this->sorting; |
| 48 | 48 | $this->template->limit = $this->onPage !== self::DEFAULT_ON_PAGE; |
| 49 | - $this->template->setFile(__DIR__ . '/filter_form.latte'); |
|
| 49 | + $this->template->setFile(__DIR__.'/filter_form.latte'); |
|
| 50 | 50 | $this->template->render(); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | $filterItems[$column->getKey()] = $column->getTitle(); |
| 140 | 140 | foreach ($column->getFilters() as $filter) { |
| 141 | - $operators[$filter] = 'core.filter.' . $filter; |
|
| 141 | + $operators[$filter] = 'core.filter.'.$filter; |
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | public function __construct(string $host = 'localhost', string $port = '15672', string $user = 'guest', string $password = 'guest') |
| 12 | 12 | { |
| 13 | - $this->baseUrl = 'http://' . $user . ':' . $password . '@' . $host . ':' . $port; |
|
| 13 | + $this->baseUrl = 'http://'.$user.':'.$password.'@'.$host.':'.$port; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function overview(): array |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $vhosts[] = $item; |
| 28 | 28 | continue; |
| 29 | 29 | } |
| 30 | - $permissions = $this->call('/api/vhosts/' . urlencode($item['name']) . '/permissions'); |
|
| 30 | + $permissions = $this->call('/api/vhosts/'.urlencode($item['name']).'/permissions'); |
|
| 31 | 31 | foreach ($permissions as $permission) { |
| 32 | 32 | if ($permission['user'] === $user) { |
| 33 | 33 | $vhosts[] = $item; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $endpoint = '/api/queues'; |
| 44 | 44 | if ($vhost) { |
| 45 | - $endpoint .= '/' . urlencode($vhost); |
|
| 45 | + $endpoint .= '/'.urlencode($vhost); |
|
| 46 | 46 | } |
| 47 | 47 | $queues = $this->call($endpoint); |
| 48 | 48 | return $queues; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return []; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $endpoint = '/api/queues/' . urlencode($vhost) . '/' . urlencode($queue) . '/get'; |
|
| 64 | + $endpoint = '/api/queues/'.urlencode($vhost).'/'.urlencode($queue).'/get'; |
|
| 65 | 65 | $params = [ |
| 66 | 66 | 'count' => $count, |
| 67 | 67 | 'requeue' => true, |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | private function call(string $endpoint, string $method = 'GET', ?array $params = null): array |
| 75 | 75 | { |
| 76 | - $ch = curl_init($this->baseUrl . $endpoint); |
|
| 76 | + $ch = curl_init($this->baseUrl.$endpoint); |
|
| 77 | 77 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 78 | 78 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
| 79 | 79 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if (!$response) { |
| 87 | 87 | return []; |
| 88 | 88 | } |
| 89 | - $result = json_decode((string)$response, true); |
|
| 89 | + $result = json_decode((string) $response, true); |
|
| 90 | 90 | if (isset($result['error'])) { |
| 91 | 91 | throw new ConnectException($result['reason']); |
| 92 | 92 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $itemForm->addFieldsToForm($form); |
| 53 | 53 | $form->addSubmit('save', 'Save'); |
| 54 | 54 | $form->onSuccess[] = [$itemForm, 'submit']; |
| 55 | - $form->onSuccess[] = function () { |
|
| 55 | + $form->onSuccess[] = function() { |
|
| 56 | 56 | $this->item |
| 57 | 57 | ? $this->presenter->flashMessage('Item was successfully updated', 'success') |
| 58 | 58 | : $this->presenter->flashMessage('Item was successfully created', 'success'); |