@@ -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 = []; |
@@ -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'); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if ($this->key) { |
| 32 | 32 | $members = []; |
| 33 | 33 | foreach ($this->connection->zrange($this->key, 0, -1, true) as $member => $score) { |
| 34 | - $members[] = $member . ':' . $score; |
|
| 34 | + $members[] = $member.':'.$score; |
|
| 35 | 35 | } |
| 36 | 36 | $form->setDefaults([ |
| 37 | 37 | 'key' => $this->key, |
@@ -89,42 +89,42 @@ |
||
| 89 | 89 | { |
| 90 | 90 | $columns = []; |
| 91 | 91 | if ($type == RedisDriver::TYPE_KEY || $type == RedisDriver::TYPE_HASH) { |
| 92 | - $columns[] = (new Column('key', 'redis.columns.' . $type . '.key')) |
|
| 92 | + $columns[] = (new Column('key', 'redis.columns.'.$type.'.key')) |
|
| 93 | 93 | ->setSortable(true) |
| 94 | 94 | ->setFilterable(true); |
| 95 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 95 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 96 | 96 | ->setSortable(true) |
| 97 | 97 | ->setFilterable(true); |
| 98 | - $columns[] = (new Column('value', 'redis.columns.' . $type . '.value')) |
|
| 98 | + $columns[] = (new Column('value', 'redis.columns.'.$type.'.value')) |
|
| 99 | 99 | ->setSortable(true) |
| 100 | 100 | ->setFilterable(true); |
| 101 | 101 | } elseif ($type == RedisDriver::TYPE_SET) { |
| 102 | - $columns[] = (new Column('member', 'redis.columns.' . $type . '.member')) |
|
| 102 | + $columns[] = (new Column('member', 'redis.columns.'.$type.'.member')) |
|
| 103 | 103 | ->setSortable(true) |
| 104 | 104 | ->setFilterable(true); |
| 105 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 105 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 106 | 106 | ->setSortable(true) |
| 107 | 107 | ->setFilterable(true); |
| 108 | 108 | } elseif ($type === RedisDriver::TYPE_LIST) { |
| 109 | - $columns[] = (new Column('index', 'redis.columns.' . $type . '.index')) |
|
| 109 | + $columns[] = (new Column('index', 'redis.columns.'.$type.'.index')) |
|
| 110 | 110 | ->setSortable(true) |
| 111 | 111 | ->setFilterable(true); |
| 112 | - $columns[] = (new Column('element', 'redis.columns.' . $type . '.element')) |
|
| 112 | + $columns[] = (new Column('element', 'redis.columns.'.$type.'.element')) |
|
| 113 | 113 | ->setSortable(true) |
| 114 | 114 | ->setFilterable(true); |
| 115 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 115 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 116 | 116 | ->setSortable(true) |
| 117 | 117 | ->setFilterable(true); |
| 118 | 118 | } elseif ($type === RedisDriver::TYPE_SORTED_SET) { |
| 119 | - $columns[] = (new Column('member', 'redis.columns.' . $type . '.member')) |
|
| 119 | + $columns[] = (new Column('member', 'redis.columns.'.$type.'.member')) |
|
| 120 | 120 | ->setSortable(true) |
| 121 | 121 | ->setFilterable(true); |
| 122 | - $columns[] = (new Column('score', 'redis.columns.' . $type . '.score')) |
|
| 122 | + $columns[] = (new Column('score', 'redis.columns.'.$type.'.score')) |
|
| 123 | 123 | ->setSortable(true) |
| 124 | 124 | ->setNumeric(true) |
| 125 | 125 | ->setDecimals(10) |
| 126 | 126 | ->setFilterable(true); |
| 127 | - $columns[] = (new Column('length', 'redis.columns.' . $type . '.length')) |
|
| 127 | + $columns[] = (new Column('length', 'redis.columns.'.$type.'.length')) |
|
| 128 | 128 | ->setSortable(true) |
| 129 | 129 | ->setNumeric(true) |
| 130 | 130 | ->setFilterable(true); |