Completed
Push — master ( 5c2acc...fb58ff )
by Michal
02:06
created
app/Drivers/RabbitMQ/RabbitMQManagementApiClient.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -61,6 +61,10 @@  discard block
 block discarded – undo
61 61
         return $queues;
62 62
     }
63 63
 
64
+    /**
65
+     * @param string $vhost
66
+     * @param string $queue
67
+     */
64 68
     public function getMessages($vhost, $queue)
65 69
     {
66 70
         $count = 0;
@@ -84,6 +88,10 @@  discard block
 block discarded – undo
84 88
         return $result;
85 89
     }
86 90
 
91
+    /**
92
+     * @param string $endpoint
93
+     * @param string $params
94
+     */
87 95
     private function call($endpoint, $method = 'GET', $params = null)
88 96
     {
89 97
         $ch = curl_init($this->baseUrl . $endpoint);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
     public function __construct($host = 'localhost', $port = '15672', $user = 'guest', $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
     /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 $vhosts[] = $item;
36 36
                 continue;
37 37
             }
38
-            $permissions = $this->call('/api/vhosts/' . urlencode($item['name']) . '/permissions');
38
+            $permissions = $this->call('/api/vhosts/'.urlencode($item['name']).'/permissions');
39 39
             foreach ($permissions as $permission) {
40 40
                 if ($permission['user'] == $user) {
41 41
                     $vhosts[] = $item;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     {
56 56
         $endpoint = '/api/queues';
57 57
         if ($vhost) {
58
-            $endpoint .= '/' . urlencode($vhost);
58
+            $endpoint .= '/'.urlencode($vhost);
59 59
         }
60 60
         $queues = $this->call($endpoint);
61 61
         return $queues;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             return [];
75 75
         }
76 76
 
77
-        $endpoint = '/api/queues/' . urlencode($vhost) . '/' . urlencode($queue) . '/get';
77
+        $endpoint = '/api/queues/'.urlencode($vhost).'/'.urlencode($queue).'/get';
78 78
         $params = [
79 79
             'count' => $count,
80 80
             'requeue' => true,
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
     private function call($endpoint, $method = 'GET', $params = null)
88 88
     {
89
-        $ch = curl_init($this->baseUrl . $endpoint);
89
+        $ch = curl_init($this->baseUrl.$endpoint);
90 90
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
91 91
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
92 92
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         if (!$response) {
100 100
             return [];
101 101
         }
102
-        $result = json_decode((string)$response, true);
102
+        $result = json_decode((string) $response, true);
103 103
         if (isset($result['error'])) {
104 104
             throw new ConnectException($result['reason']);
105 105
         }
Please login to merge, or discard this patch.
app/presenters/BasePresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/presenters/ItemPresenter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,10 +100,10 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
app/presenters/DefaultPresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Core/Translator/Translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Core/Forms/DatabaseForm/DatabaseForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $databaseForm->addFieldsToForm($form);
44 44
         $form->addSubmit('save', 'Save');
45 45
         $form->onSuccess[] = [$databaseForm, 'submit'];
46
-        $form->onSuccess[] = function () {
46
+        $form->onSuccess[] = function() {
47 47
             $this->presenter->redirect('Database:default', $this->driver->type());
48 48
         };
49 49
         return $form;
Please login to merge, or discard this patch.
app/Core/Forms/FilterForm/FilterForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $this->template->filter = $this->filter;
48 48
         $this->template->sorting = $this->sorting;
49 49
         $this->template->limit = $this->onPage != self::DEFAULT_ON_PAGE;
50
-        $this->template->setFile(__DIR__ . '/filter_form.latte');
50
+        $this->template->setFile(__DIR__.'/filter_form.latte');
51 51
         $this->template->render();
52 52
     }
53 53
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             }
140 140
             $filterItems[$column->getKey()] = $column->getTitle();
141 141
             foreach ($column->getFilters() as $filter) {
142
-                $operators[$filter] = 'core.filter.' . $filter;
142
+                $operators[$filter] = 'core.filter.'.$filter;
143 143
             }
144 144
         }
145 145
 
Please login to merge, or discard this patch.
app/Core/Forms/ItemForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
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->presenter->redirect('Item:default', $this->driver->type(), $this->database, $this->type, $this->table);
57 57
         };
58 58
         return $form;
Please login to merge, or discard this patch.
app/Core/Forms/TableForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.