GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#191)
by Herbert
17:37 queued 09:28
created
src/views/error/view.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $this->title = Yii::t('audit', 'Error #{id}', ['id' => $model->id]);
12 12
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']];
13 13
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Errors'), 'url' => ['index']];
14
-$this->params['breadcrumbs'][] = '#' . $model->id;
14
+$this->params['breadcrumbs'][] = '#'.$model->id;
15 15
 
16 16
 echo Html::tag('h1', $this->title);
17 17
 
@@ -44,16 +44,15 @@  discard block
 block discarded – undo
44 44
         'line',
45 45
         [
46 46
             'header' => Yii::t('audit', 'Called'),
47
-            'value' => function ($data) {
47
+            'value' => function($data) {
48 48
                 return
49 49
                     isset($data['type']) ?
50
-                        (( isset($data['class']) ? $data['class'] : '[unknown]') . $data['type'] . $data['function']) :
51
-                        $data['function'];
50
+                        ((isset($data['class']) ? $data['class'] : '[unknown]').$data['type'].$data['function']) : $data['function'];
52 51
             }
53 52
         ],
54 53
         [
55 54
             'header' => Yii::t('audit', 'Args'),
56
-            'value' => function ($data) {
55
+            'value' => function($data) {
57 56
                 $out = '<a class="args-toggle glyphicon glyphicon-plus" href="javascript:void(0);"></a>';
58 57
                 $out .= '<pre style="display:none;">';
59 58
                 $out .= VarDumper::dumpAsString($data['args']);
Please login to merge, or discard this patch.
src/views/javascript/view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 $this->title = Yii::t('audit', 'Javascript #{id}', ['id' => $model->id]);
10 10
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']];
11 11
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Javascripts'), 'url' => ['index']];
12
-$this->params['breadcrumbs'][] = '#' . $model->id;
12
+$this->params['breadcrumbs'][] = '#'.$model->id;
13 13
 
14 14
 echo Html::tag('h1', $this->title);
15 15
 
Please login to merge, or discard this patch.
src/views/trail/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             [
28 28
                 'attribute' => 'entry_id',
29 29
                 'class' => 'yii\grid\DataColumn',
30
-                'value' => function ($data) {
30
+                'value' => function($data) {
31 31
                     return $data->entry_id ? Html::a($data->entry_id, ['entry/view', 'id' => $data->entry_id]) : '';
32 32
                 },
33 33
                 'format' => 'raw',
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 'attribute' => 'user_id',
37 37
                 'label' => Yii::t('audit', 'User ID'),
38 38
                 'class' => 'yii\grid\DataColumn',
39
-                'value' => function ($data) {
39
+                'value' => function($data) {
40 40
                     return Audit::getInstance()->getUserIdentifier($data->user_id);
41 41
                 },
42 42
                 'format' => 'raw',
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             'field',
51 51
             [
52 52
                 'label' => Yii::t('audit', 'Diff'),
53
-                'value' => function ($model) {
53
+                'value' => function($model) {
54 54
                     return $model->getDiffHtml();
55 55
                 },
56 56
                 'format' => 'raw',
Please login to merge, or discard this patch.
src/views/trail/view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 $this->title = Yii::t('audit', 'Trail #{id}', ['id' => $model->id]);
11 11
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']];
12 12
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Trails'), 'url' => ['trail/index']];
13
-$this->params['breadcrumbs'][] = '#' . $model->id;
13
+$this->params['breadcrumbs'][] = '#'.$model->id;
14 14
 
15 15
 echo Html::tag('h1', $this->title);
16 16
 
Please login to merge, or discard this patch.
src/views/mail/view.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 $this->title = Yii::t('audit', 'Mail #{id}', ['id' => $model->id]);
14 14
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']];
15 15
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Mails'), 'url' => ['index']];
16
-$this->params['breadcrumbs'][] = '#' . $model->id;
16
+$this->params['breadcrumbs'][] = '#'.$model->id;
17 17
 
18 18
 echo Html::tag('h1', $this->title);
19 19
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 echo Html::tag('h2', Yii::t('audit', 'HTML'));
51 51
 echo '<div class="well">';
52
-echo '<iframe src="' . Url::to(['mail/view-html', 'id' => $model->id]) . '" style="width:100%;" onload="this.style.height = this.contentWindow.document.body.scrollHeight + \'px\';" frameborder="0"></iframe>';
52
+echo '<iframe src="'.Url::to(['mail/view-html', 'id' => $model->id]).'" style="width:100%;" onload="this.style.height = this.contentWindow.document.body.scrollHeight + \'px\';" frameborder="0"></iframe>';
53 53
 //echo Yii::$app->formatter->asHtml($model->html);
54 54
 echo '</div>';
55 55
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 /** @var View $this */
4 4
 /** @var AuditMail $model */
5 5
 
6
-use bedezign\yii2\audit\components\Helper;
7 6
 use bedezign\yii2\audit\models\AuditMail;
8 7
 use yii\helpers\Html;
9 8
 use yii\helpers\Url;
Please login to merge, or discard this patch.
src/views/mail/view-html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 $this->title = Yii::t('audit', 'Mail #{id}', ['id' => $model->id]);
10 10
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']];
11 11
 $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Mails'), 'url' => ['index']];
12
-$this->params['breadcrumbs'][] = '#' . $model->id;
12
+$this->params['breadcrumbs'][] = '#'.$model->id;
13 13
 
14 14
 
15 15
 echo Yii::$app->formatter->asHtml($model->html);
16 16
\ No newline at end of file
Please login to merge, or discard this patch.
src/AuditTrailBehavior.php 5 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -218,8 +218,8 @@
 block discarded – undo
218 218
         $query = new Query;
219 219
 
220 220
         $query->select($queryParams['returnField'])
221
-              ->from($queryParams['tableName'])
222
-              ->where([$queryParams['searchField'] => $searchFieldValue]);
221
+                ->from($queryParams['tableName'])
222
+                ->where([$queryParams['searchField'] => $searchFieldValue]);
223 223
 
224 224
         $rows = $query->all();
225 225
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     /**
118
-     * @param $action
118
+     * @param string $action
119 119
      * @throws \yii\db\Exception
120 120
      */
121 121
     public function audit($action)
@@ -261,14 +261,14 @@  discard block
 block discarded – undo
261 261
     /**
262 262
      * Save the audit trails for a create or update action
263 263
      *
264
-     * @param $action
264
+     * @param string $action
265 265
      * @param $newAttributes
266 266
      * @param $oldAttributes
267 267
      * @param $entry_id
268 268
      * @param $user_id
269
-     * @param $model
269
+     * @param string $model
270 270
      * @param $model_id
271
-     * @param $created
271
+     * @param string $created
272 272
      * @throws \yii\db\Exception
273 273
      */
274 274
     protected function saveAuditTrail($action, $newAttributes, $oldAttributes, $entry_id, $user_id, $model, $model_id, $created)
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 namespace bedezign\yii2\audit;
3 3
 
4 4
 use Yii;
5
+use bedezign\yii2\audit\models\AuditTrail;
5 6
 use yii\base\Behavior;
6 7
 use yii\db\ActiveRecord;
7
-use bedezign\yii2\audit\models\AuditTrail;
8 8
 use yii\db\Query;
9 9
 
10 10
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     protected function cleanAttributesIgnored($attributes)
179 179
     {
180
-        if($this->ignore_timestamps)
180
+        if ($this->ignore_timestamps)
181 181
             $this->ignored = array_merge($this->ignored, [
182 182
                 'created', 'updated', 'created_at', 'updated_at', 'timestamp']);
183 183
 
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
      */
200 200
     protected function cleanAttributesOverride($attributes)
201 201
     {
202
-        if (sizeof($this->override) > 0 && sizeof($attributes) >0) {
202
+        if (sizeof($this->override) > 0 && sizeof($attributes) > 0) {
203 203
             foreach ($this->override as $field => $queryParams) {
204 204
                 $newOverrideValues = $this->getNewOverrideValues($attributes[$field], $queryParams);
205 205
                 $saveField = \yii\helpers\ArrayHelper::getValue($queryParams, 'saveField', $field);
206 206
 
207
-                if (count($newOverrideValues) >1) {
207
+                if (count($newOverrideValues) > 1) {
208 208
                     $attributes[$saveField] = implode(', ',
209 209
                                         \yii\helpers\ArrayHelper::map($newOverrideValues, $queryParams['returnField'], $queryParams['returnField'])
210 210
                     );
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,9 +177,10 @@
 block discarded – undo
177 177
      */
178 178
     protected function cleanAttributesIgnored($attributes)
179 179
     {
180
-        if($this->ignore_timestamps)
181
-            $this->ignored = array_merge($this->ignored, [
180
+        if($this->ignore_timestamps) {
181
+                    $this->ignored = array_merge($this->ignored, [
182 182
                 'created', 'updated', 'created_at', 'updated_at', 'timestamp']);
183
+        }
183 184
 
184 185
         if (sizeof($this->ignored) > 0) {
185 186
             foreach ($attributes as $f => $v) {
Please login to merge, or discard this patch.
src/commands/AuditController.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * Cleans the AuditEntry data
134 134
      *
135
-     * @param $maxAge
135
+     * @param integer|null $maxAge
136 136
      * @return bool
137 137
      */
138 138
     protected function cleanupEntry($maxAge)
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * Cleans the Panel data
161 161
      *
162 162
      * @param $id
163
-     * @param $maxAge
163
+     * @param integer|null $maxAge
164 164
      * @return bool
165 165
      */
166 166
     protected function cleanupPanel($id, $maxAge)
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 namespace bedezign\yii2\audit\commands;
4 4
 
5
+use Yii;
5 6
 use bedezign\yii2\audit\Audit;
6 7
 use bedezign\yii2\audit\components\panels\Panel;
7 8
 use bedezign\yii2\audit\models\AuditEntry;
8 9
 use bedezign\yii2\audit\models\AuditError;
9
-use Yii;
10 10
 use yii\base\Exception;
11 11
 use yii\console\Controller;
12 12
 use yii\helpers\Console;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 
114 114
         // heading
115 115
         $n = count($panels);
116
-        $this->stdout("Total $n " . ($n === 1 ? 'cleanup' : 'cleanups') . " to be applied:\n", Console::FG_YELLOW);
117
-        $this->stdout("\t" . 'DATA                      CLEANUP TO DATETIME' . "\n");
118
-        $this->stdout("\t" . '---------------------------------------------' . "\n");
116
+        $this->stdout("Total $n ".($n === 1 ? 'cleanup' : 'cleanups')." to be applied:\n", Console::FG_YELLOW);
117
+        $this->stdout("\t".'DATA                      CLEANUP TO DATETIME'."\n");
118
+        $this->stdout("\t".'---------------------------------------------'."\n");
119 119
 
120 120
         // audit panels
121 121
         foreach ($panels as $id) {
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
             $dots = str_repeat('.', 24 - strlen($id));
126 126
             if ($age !== null) {
127 127
                 $date = date('Y-m-d 23:59:59', strtotime("-$age days"));
128
-                $this->stdout("\t" . $id . ' ' . $dots . ' ' . $date . "\n");
128
+                $this->stdout("\t".$id.' '.$dots.' '.$date."\n");
129 129
             } else {
130
-                $this->stdout("\t" . $id . ' ' . $dots . ' no maxAge, skipping' . "\n");
130
+                $this->stdout("\t".$id.' '.$dots.' no maxAge, skipping'."\n");
131 131
             }
132 132
         }
133 133
 
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
         if ($entry) {
136 136
             $maxAge = $maxAge !== null ? $maxAge : $audit->maxAge;
137 137
             $date = $maxAge !== null ? date('Y-m-d 23:59:59', strtotime("-$maxAge days")) : 'no maxAge, skipping';
138
-            $this->stdout("\t" . 'AuditEntry .............. ' . $date . "\n");
138
+            $this->stdout("\t".'AuditEntry .............. '.$date."\n");
139 139
         }
140 140
 
141 141
         // audit entry solo
142 142
         if ($entrySolo) {
143
-            $this->stdout("\t" . 'AuditEntry solo ......... ' . date('Y-m-d 23:59:59') . "\n");
143
+            $this->stdout("\t".'AuditEntry solo ......... '.date('Y-m-d 23:59:59')."\n");
144 144
         }
145 145
 
146 146
         $this->stdout("\n");
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
         $count = AuditEntry::deleteAll(['<=', 'created', $date]);
166 166
         if ($count !== false) {
167 167
             $time = microtime(true) - $start;
168
-            $this->stdout("\n*** cleaned AuditEntry (records: " . $count . ",time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_GREEN);
168
+            $this->stdout("\n*** cleaned AuditEntry (records: ".$count.",time: ".sprintf("%.3f", $time)."s)\n", Console::FG_GREEN);
169 169
             return true;
170 170
         }
171 171
         $time = microtime(true) - $start;
172
-        $this->stdout("\n*** failed to clean AuditEntry (time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_RED);
172
+        $this->stdout("\n*** failed to clean AuditEntry (time: ".sprintf("%.3f", $time)."s)\n", Console::FG_RED);
173 173
         return false;
174 174
     }
175 175
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             }
205 205
         }
206 206
         $time = microtime(true) - $start;
207
-        $this->stdout("\n*** cleaned AuditEntry (records: " . $count . ",time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_GREEN);
207
+        $this->stdout("\n*** cleaned AuditEntry (records: ".$count.",time: ".sprintf("%.3f", $time)."s)\n", Console::FG_GREEN);
208 208
         return true;
209 209
     }
210 210
 
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
         $count = $panel->cleanup($maxAge);
230 230
         if ($count !== false) {
231 231
             $time = microtime(true) - $start;
232
-            $this->stdout("\n*** cleaned $id (records: " . $count . ", time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_GREEN);
232
+            $this->stdout("\n*** cleaned $id (records: ".$count.", time: ".sprintf("%.3f", $time)."s)\n", Console::FG_GREEN);
233 233
             return true;
234 234
         }
235 235
         $time = microtime(true) - $start;
236
-        $this->stdout("\n*** failed to clean $id (time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_RED);
236
+        $this->stdout("\n*** failed to clean $id (time: ".sprintf("%.3f", $time)."s)\n", Console::FG_RED);
237 237
         return false;
238 238
     }
239 239
 
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
                 ];
266 266
                 $message = [
267 267
                     'subject' => Yii::t('audit', 'Audit Error in Audit Entry #{entry_id}', $params),
268
-                    'text' => Yii::t('audit', '{message}' . "\n" . 'in {file} on line {line}.' . "\n" . '-- {url}', $params),
268
+                    'text' => Yii::t('audit', '{message}'."\n".'in {file} on line {line}.'."\n".'-- {url}', $params),
269 269
                     'html' => Yii::t('audit', '<b>{message}</b><br />in <i>{file}</i> on line <i>{line}</i>.<br/>-- {link}', $params),
270 270
                 ];
271 271
 
272 272
                 // send email
273 273
                 Yii::$app->mailer->compose()
274
-                    ->setFrom([$email => 'Audit :: ' . Yii::$app->name])
274
+                    ->setFrom([$email => 'Audit :: '.Yii::$app->name])
275 275
                     ->setTo($email)
276 276
                     ->setSubject($message['subject'])
277 277
                     ->setTextBody($message['text'])
Please login to merge, or discard this patch.
src/views/mail/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             [
32 32
                 'attribute' => 'entry_id',
33 33
                 'class' => 'yii\grid\DataColumn',
34
-                'value' => function ($data) {
34
+                'value' => function($data) {
35 35
                     return $data->entry_id ? Html::a($data->entry_id, ['entry/view', 'id' => $data->entry_id]) : '';
36 36
                 },
37 37
                 'format' => 'raw',
Please login to merge, or discard this patch.