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.
Completed
Push — master ( b9ff6f...04622d )
by Brett
05:24
created
src/panels/CurlPanel.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 
9 9
 use Yii;
10 10
 use bedezign\yii2\audit\components\panels\DataStoragePanel;
11
-use yii\grid\GridViewAsset;
12 11
 use yii\data\ArrayDataProvider;
12
+use yii\grid\GridViewAsset;
13 13
 
14 14
 /**
15 15
  * Class CurlPanel
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function getLabel()
63 63
     {
64
-        return $this->getName() . ' <small>(' . count($this->data) . ')</small>';
64
+        return $this->getName().' <small>('.count($this->data).')</small>';
65 65
     }
66 66
 
67 67
     /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         }
138 138
 
139 139
         if ($this->content)
140
-            $this->data[$id]['content']= curl_multi_getcontent($handle);
140
+            $this->data[$id]['content'] = curl_multi_getcontent($handle);
141 141
 
142 142
         // Cleanup empty things
143 143
         $this->data[$id] = array_filter($this->data[$id]);
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         if (!is_resource($resource))
209 209
             return false;
210 210
 
211
-        $parts = explode('#', (string)$resource);
211
+        $parts = explode('#', (string) $resource);
212 212
         return array_pop($parts);
213 213
     }
214 214
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -96,19 +96,22 @@  discard block
 block discarded – undo
96 96
             curl_setopt($handle, CURLOPT_URL, $url);
97 97
         }
98 98
 
99
-        if ($postData)
100
-            $this->data[$id]['post'] = $postData;
99
+        if ($postData) {
100
+                    $this->data[$id]['post'] = $postData;
101
+        }
101 102
 
102
-        if ($this->headers)
103
-            curl_setopt($handle, CURLOPT_HEADERFUNCTION, [$this, 'captureHeader']);
103
+        if ($this->headers) {
104
+                    curl_setopt($handle, CURLOPT_HEADERFUNCTION, [$this, 'captureHeader']);
105
+        }
104 106
 
105 107
         if ($this->log) {
106 108
             curl_setopt($handle, CURLOPT_VERBOSE, true);
107 109
             curl_setopt($handle, CURLOPT_STDERR, $this->_logHandles[$id] = fopen('php://temp', 'rw+'));
108 110
         }
109 111
 
110
-        if ($this->content)
111
-            curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
112
+        if ($this->content) {
113
+                    curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
114
+        }
112 115
 
113 116
         return true;
114 117
     }
@@ -136,8 +139,9 @@  discard block
 block discarded – undo
136 139
             unset($this->_logHandles[$id]);
137 140
         }
138 141
 
139
-        if ($this->content)
140
-            $this->data[$id]['content']= curl_multi_getcontent($handle);
142
+        if ($this->content) {
143
+                    $this->data[$id]['content']= curl_multi_getcontent($handle);
144
+        }
141 145
 
142 146
         // Cleanup empty things
143 147
         $this->data[$id] = array_filter($this->data[$id]);
@@ -192,8 +196,9 @@  discard block
 block discarded – undo
192 196
     public function captureHeader($handle, $header)
193 197
     {
194 198
         $id = $this->id($handle);
195
-        if (!isset($this->data[$id]['headers']))
196
-            $this->data[$id]['headers'] = [];
199
+        if (!isset($this->data[$id]['headers'])) {
200
+                    $this->data[$id]['headers'] = [];
201
+        }
197 202
 
198 203
         $this->data[$id]['headers'][] = $header;
199 204
         return strlen($header);
@@ -205,8 +210,9 @@  discard block
 block discarded – undo
205 210
      */
206 211
     protected function id($resource)
207 212
     {
208
-        if (!is_resource($resource))
209
-            return false;
213
+        if (!is_resource($resource)) {
214
+                    return false;
215
+        }
210 216
 
211 217
         $parts = explode('#', (string)$resource);
212 218
         return array_pop($parts);
Please login to merge, or discard this patch.
src/panels/MailPanel.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
     /**
38 38
      * @param Event $event
39
-     * @return null|static
39
+     * @return AuditMail|null
40 40
      */
41 41
     public function record($event)
42 42
     {
Please login to merge, or discard this patch.
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@
 block discarded – undo
2 2
 
3 3
 namespace bedezign\yii2\audit\panels;
4 4
 
5
-use bedezign\yii2\audit\Audit;
6
-use bedezign\yii2\audit\components\panels\Panel;
7
-use bedezign\yii2\audit\models\AuditMail;
8
-use bedezign\yii2\audit\models\AuditMailSearch;
9 5
 use Swift_Message;
10 6
 use Swift_Mime_Attachment;
11 7
 use Swift_Mime_MimePart;
12 8
 use Yii;
9
+use bedezign\yii2\audit\Audit;
10
+use bedezign\yii2\audit\components\panels\Panel;
11
+use bedezign\yii2\audit\models\AuditMail;
12
+use bedezign\yii2\audit\models\AuditMailSearch;
13 13
 use yii\base\Event;
14 14
 use yii\grid\GridViewAsset;
15 15
 use yii\mail\BaseMailer;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public function init()
30 30
     {
31 31
         parent::init();
32
-        Event::on(BaseMailer::className(), BaseMailer::EVENT_AFTER_SEND, function ($event) {
32
+        Event::on(BaseMailer::className(), BaseMailer::EVENT_AFTER_SEND, function($event) {
33 33
             $this->record($event);
34 34
         });
35 35
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function getLabel()
117 117
     {
118
-        return $this->getName() . ' <small>(' . count($this->_model->mails) . ')</small>';
118
+        return $this->getName().' <small>('.count($this->_model->mails).')</small>';
119 119
     }
120 120
 
121 121
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,8 +87,9 @@
 block discarded – undo
87 87
     public function cleanup($maxAge = null)
88 88
     {
89 89
         $maxAge = $maxAge !== null ? $maxAge : $this->maxAge;
90
-        if ($maxAge === null)
91
-            return false;
90
+        if ($maxAge === null) {
91
+                    return false;
92
+        }
92 93
         return AuditTrail::deleteAll([
93 94
             '<=', 'created', date('Y-m-d 23:59:59', strtotime("-$maxAge days"))
94 95
         ]);
Please login to merge, or discard this patch.
src/panels/ProfilingPanel.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace bedezign\yii2\audit\panels;
4 4
 
5
-use bedezign\yii2\audit\components\panels\DataStoragePanelTrait;
6 5
 use Yii;
6
+use bedezign\yii2\audit\components\panels\DataStoragePanelTrait;
7 7
 use yii\debug\models\search\Profile;
8 8
 use yii\grid\GridViewAsset;
9 9
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
     public function getLabel()
22 22
     {
23 23
         $memory = sprintf('%.1f MB', $this->data['memory'] / 1048576);
24
-        $time = number_format($this->data['time'] * 1000) . ' ms';
25
-        return $this->getName() . ' <small>(' . $memory . ' / ' . $time . ')</small>';
24
+        $time = number_format($this->data['time'] * 1000).' ms';
25
+        return $this->getName().' <small>('.$memory.' / '.$time.')</small>';
26 26
     }
27 27
 
28 28
     /**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             'dataProvider' => $dataProvider,
39 39
             'searchModel' => $searchModel,
40 40
             'memory' => sprintf('%.1f MB', $this->data['memory'] / 1048576),
41
-            'time' => number_format($this->data['time'] * 1000) . ' ms',
41
+            'time' => number_format($this->data['time'] * 1000).' ms',
42 42
         ]);
43 43
     }
44 44
 
Please login to merge, or discard this patch.
src/panels/SoapPanel.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 namespace bedezign\yii2\audit\panels;
3 3
 
4 4
 use Yii;
5
-use bedezign\yii2\audit\models\AuditError;
6 5
 use bedezign\yii2\audit\components\panels\DataStoragePanel;
7 6
 use yii\data\ArrayDataProvider;
8 7
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function getLabel()
24 24
     {
25
-        return $this->getName() . ' <small>(' . count($this->data) . ')</small>';
25
+        return $this->getName().' <small>('.count($this->data).')</small>';
26 26
     }
27 27
 
28 28
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@
 block discarded – undo
35 35
     {
36 36
         $this->module->registerPanel($this);
37 37
 
38
-        if (!is_array($this->data))
39
-            $this->data = [];
38
+        if (!is_array($this->data)) {
39
+                    $this->data = [];
40
+        }
40 41
 
41 42
         if (isset($data['error'])) {
42 43
             $error = $this->module->exception($data['error']);
Please login to merge, or discard this patch.
src/views/entry/panels/soap/detail.php 3 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* @var $panel bedezign\yii2\audit\panels\SoapPanel */
3 3
 
4
-use yii\bootstrap\Tabs;
5
-use yii\helpers\Html;
6 4
 use bedezign\yii2\audit\components\Helper;
5
+use yii\bootstrap\Tabs;
7 6
 use yii\helpers\ArrayHelper;
7
+use yii\helpers\Html;
8 8
 use yii\helpers\VarDumper;
9 9
 
10 10
 $preformatted = ['class' => 'well', 'style' => 'overflow: auto; white-space: pre'];
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,6 +38,6 @@
 block discarded – undo
38 38
     unset($request['result']);
39 39
 }
40 40
 
41
-$tabs[] = [ 'label' => \Yii::t('audit', 'Info'), 'content' => $this->render('info_table', ['request' => $request]), 'active' => true ];
41
+$tabs[] = ['label' => \Yii::t('audit', 'Info'), 'content' => $this->render('info_table', ['request' => $request]), 'active' => true];
42 42
 
43 43
 echo Html::tag('h2', \Yii::t('audit', 'Request #{id}', ['id' => $index])), Tabs::widget(['items' => array_reverse($tabs)]);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,11 +24,12 @@
 block discarded – undo
24 24
 
25 25
 if (isset($request['result'])) {
26 26
     $xml = Helper::formatAsXML($request['result']);
27
-    if ($xml)
28
-        $tabs[] = [
27
+    if ($xml) {
28
+            $tabs[] = [
29 29
             'label' => \Yii::t('audit', 'Result - XML'),
30 30
             'content' => Html::tag('div', $xml, $preformatted)
31 31
         ];
32
+    }
32 33
 
33 34
     $tabs[] = [
34 35
         'label' => \Yii::t('audit', 'Result'),
Please login to merge, or discard this patch.
src/views/entry/panels/soap/info_table.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 use yii\helpers\Html;
4 4
 use yii\helpers\VarDumper;
5
-use yii\helpers\Url;
6 5
 
7 6
 
8 7
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 if (isset($request['error']) && isset($request['error'][1])) {
12 12
     $error = \bedezign\yii2\audit\models\AuditError::findOne($request['error'][1]);
13
-    $request['error'] = Html::a('[' . $request['error'][0] . '] ' . $error->message, ['error/view', 'id' => $error->id]);
13
+    $request['error'] = Html::a('['.$request['error'][0].'] '.$error->message, ['error/view', 'id' => $error->id]);
14 14
 }
15 15
 
16 16
 ?>
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     if (is_array($value) || is_object($value))
32 32
         $value = \yii\helpers\ArrayHelper::toArray($value);
33 33
     elseif ($name == 'duration')
34
-        $value = number_format($value, 2) . 's';
34
+        $value = number_format($value, 2).'s';
35 35
     echo $name == 'error' ? $value : $formatter->asText(is_scalar($value) ? $value : VarDumper::dumpAsString($value));
36 36
 ?>
37 37
                 </td>
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,11 @@
 block discarded – undo
28 28
                 <th><?= Html::encode(\yii\helpers\Inflector::humanize($name)) ?></th>
29 29
                 <td>
30 30
 <?php
31
-    if (is_array($value) || is_object($value))
32
-        $value = \yii\helpers\ArrayHelper::toArray($value);
33
-    elseif ($name == 'duration')
34
-        $value = number_format($value, 2) . 's';
31
+    if (is_array($value) || is_object($value)) {
32
+            $value = \yii\helpers\ArrayHelper::toArray($value);
33
+    } elseif ($name == 'duration') {
34
+            $value = number_format($value, 2) . 's';
35
+    }
35 36
     echo $name == 'error' ? $value : $formatter->asText(is_scalar($value) ? $value : VarDumper::dumpAsString($value));
36 37
 ?>
37 38
                 </td>
Please login to merge, or discard this patch.
src/Audit.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -373,12 +373,12 @@
 block discarded – undo
373 373
 
374 374
         // We now need one more iteration to add core classes to the panels added via the merge, if needed
375 375
         array_walk($this->panels, function(&$value, $key) {
376
-           if (!isset($value['class'])) {
377
-               if (isset($this->_corePanels[$key]))
378
-                   $value = ArrayHelper::merge($value, $this->_corePanels[$key]);
379
-               else
380
-                   throw new InvalidConfigException("Invalid configuration for '$key'. No 'class' specified.");
381
-           }
376
+            if (!isset($value['class'])) {
377
+                if (isset($this->_corePanels[$key]))
378
+                    $value = ArrayHelper::merge($value, $this->_corePanels[$key]);
379
+                else
380
+                    throw new InvalidConfigException("Invalid configuration for '$key'. No 'class' specified.");
381
+            }
382 382
         });
383 383
     }
384 384
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,9 +135,9 @@
 block discarded – undo
135 135
         // 'audit/config',
136 136
 
137 137
         // These provide special functionality and get loaded to activate it
138
-        'audit/error',      // Links the extra error reporting functions (`exception()` and `errorMessage()`)
139
-        'audit/extra',      // Links the data functions (`data()`)
140
-        'audit/curl',       // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`)
138
+        'audit/error', // Links the extra error reporting functions (`exception()` and `errorMessage()`)
139
+        'audit/extra', // Links the data functions (`data()`)
140
+        'audit/curl', // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`)
141 141
     ];
142 142
 
143 143
     /**
Please login to merge, or discard this patch.
Braces   +44 added lines, -33 removed lines patch added patch discarded remove patch
@@ -239,8 +239,9 @@  discard block
 block discarded – undo
239 239
      */
240 240
     public function registerFunction($name, $callback)
241 241
     {
242
-        if (isset($this->_panelFunctions[$name]))
243
-            throw new InvalidParamException("The '$name'-function has already been defined.");
242
+        if (isset($this->_panelFunctions[$name])) {
243
+                    throw new InvalidParamException("The '$name'-function has already been defined.");
244
+        }
244 245
 
245 246
         $this->_panelFunctions[$name] = $callback;
246 247
     }
@@ -260,8 +261,9 @@  discard block
 block discarded – undo
260 261
      */
261 262
     public function __call($name, $params)
262 263
     {
263
-        if (!isset($this->_panelFunctions[$name]))
264
-            throw new \yii\base\InvalidCallException("Unknown panel function '$name'");
264
+        if (!isset($this->_panelFunctions[$name])) {
265
+                    throw new \yii\base\InvalidCallException("Unknown panel function '$name'");
266
+        }
265 267
 
266 268
         return call_user_func_array($this->_panelFunctions[$name], $params);
267 269
     }
@@ -333,13 +335,15 @@  discard block
 block discarded – undo
333 335
     public function getPanel($identifier)
334 336
     {
335 337
         $config = null;
336
-        if (isset($this->panels[$identifier]))
337
-            $config = $this->panels[$identifier];
338
-        elseif (isset($this->_corePanels[$identifier]))
339
-            $config = $this->_corePanels[$identifier];
338
+        if (isset($this->panels[$identifier])) {
339
+                    $config = $this->panels[$identifier];
340
+        } elseif (isset($this->_corePanels[$identifier])) {
341
+                    $config = $this->_corePanels[$identifier];
342
+        }
340 343
 
341
-        if (!$config)
342
-            throw new InvalidConfigException("'$identifier' is not a valid panel identifier");
344
+        if (!$config) {
345
+                    throw new InvalidConfigException("'$identifier' is not a valid panel identifier");
346
+        }
343 347
 
344 348
         if (is_array($config)) {
345 349
             $config['module'] = $this;
@@ -360,11 +364,11 @@  discard block
 block discarded – undo
360 364
         foreach ($this->panels as $key => $value) {
361 365
             if (is_numeric($key)) {
362 366
                 // The $value contains the identifier of a core panel
363
-                if (!isset($this->_corePanels[$value]))
364
-                    throw new InvalidConfigException("'$value' is not a valid panel identifier");
367
+                if (!isset($this->_corePanels[$value])) {
368
+                                    throw new InvalidConfigException("'$value' is not a valid panel identifier");
369
+                }
365 370
                 $panels[$value] = $this->_corePanels[$value];
366
-            }
367
-            else {
371
+            } else {
368 372
                 // The key contains the identifier and the value is either a class name or a full array
369 373
                 $panels[$key] = is_string($value) ? ['class' => $value] : $value;
370 374
             }
@@ -374,10 +378,11 @@  discard block
 block discarded – undo
374 378
         // We now need one more iteration to add core classes to the panels added via the merge, if needed
375 379
         array_walk($this->panels, function(&$value, $key) {
376 380
            if (!isset($value['class'])) {
377
-               if (isset($this->_corePanels[$key]))
378
-                   $value = ArrayHelper::merge($value, $this->_corePanels[$key]);
379
-               else
380
-                   throw new InvalidConfigException("Invalid configuration for '$key'. No 'class' specified.");
381
+               if (isset($this->_corePanels[$key])) {
382
+                                  $value = ArrayHelper::merge($value, $this->_corePanels[$key]);
383
+               } else {
384
+                                  throw new InvalidConfigException("Invalid configuration for '$key'. No 'class' specified.");
385
+               }
381 386
            }
382 387
         });
383 388
     }
@@ -389,18 +394,21 @@  discard block
 block discarded – undo
389 394
     {
390 395
         foreach (Yii::$app->modules as $name => $module) {
391 396
             $class = null;
392
-            if (is_string($module))
393
-                $class = $module;
394
-            elseif (is_array($module)) {
395
-                if (isset($module['class']))
396
-                    $class = $module['class'];
397
-            } else
398
-                /** @var Module $module */
397
+            if (is_string($module)) {
398
+                            $class = $module;
399
+            } elseif (is_array($module)) {
400
+                if (isset($module['class'])) {
401
+                                    $class = $module['class'];
402
+                }
403
+            } else {
404
+                            /** @var Module $module */
399 405
                 $class = $module::className();
406
+            }
400 407
 
401 408
             $parts = explode('\\', $class);
402
-            if ($class && strtolower(end($parts)) == 'audit')
403
-                return $name;
409
+            if ($class && strtolower(end($parts)) == 'audit') {
410
+                            return $name;
411
+            }
404 412
         }
405 413
         return null;
406 414
     }
@@ -436,18 +444,21 @@  discard block
 block discarded – undo
436 444
             $len = strlen($compare);
437 445
             if ($compare[$len - 1] == '*') {
438 446
                 $compare = rtrim($compare, '*');
439
-                if (substr($route, 0, $len - 1) === $compare)
440
-                    return true;
447
+                if (substr($route, 0, $len - 1) === $compare) {
448
+                                    return true;
449
+                }
441 450
             }
442 451
 
443 452
             if ($compare[0] == '*') {
444 453
                 $compare = ltrim($compare, '*');
445
-                if (substr($route, - ($len - 1)) === $compare)
446
-                    return true;
454
+                if (substr($route, - ($len - 1)) === $compare) {
455
+                                    return true;
456
+                }
447 457
             }
448 458
 
449
-            if ($route === $compare)
450
-                return true;
459
+            if ($route === $compare) {
460
+                            return true;
461
+            }
451 462
         }
452 463
         return false;
453 464
     }
Please login to merge, or discard this patch.
src/LogTarget.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,13 +36,15 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function export()
38 38
     {
39
-        if (!\Yii::$app)
40
-            // Things like this can happen in tests etc, but it is too late for us to do anything about that.
39
+        if (!\Yii::$app) {
40
+                    // Things like this can happen in tests etc, but it is too late for us to do anything about that.
41 41
             return;
42
+        }
42 43
 
43 44
         $module = $this->module;
44
-        if (!$module->entry || empty($module->panels))
45
-            return;
45
+        if (!$module->entry || empty($module->panels)) {
46
+                    return;
47
+        }
46 48
 
47 49
         $entry = $module->entry;
48 50
 
@@ -53,11 +55,12 @@  discard block
 block discarded – undo
53 55
         $records = array_filter($records);
54 56
 
55 57
         if (!empty($records)) {
56
-            if ($module->batchSave)
57
-                $entry->addBatchData($records, false);
58
-            else {
59
-                foreach ($records as $type => $record)
60
-                    $entry->addData($type, $record, false);
58
+            if ($module->batchSave) {
59
+                            $entry->addBatchData($records, false);
60
+            } else {
61
+                foreach ($records as $type => $record) {
62
+                                    $entry->addData($type, $record, false);
63
+                }
61 64
             }
62 65
         }
63 66
         $this->messages = [];
Please login to merge, or discard this patch.
src/commands/AuditController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 
96 96
         // heading
97 97
         $n = count($panels);
98
-        $this->stdout("Total $n " . ($n === 1 ? 'cleanup' : 'cleanups') . " to be applied:\n", Console::FG_YELLOW);
99
-        $this->stdout("\t" . 'DATA                      CLEANUP TO DATETIME' . "\n");
100
-        $this->stdout("\t" . '---------------------------------------------' . "\n");
98
+        $this->stdout("Total $n ".($n === 1 ? 'cleanup' : 'cleanups')." to be applied:\n", Console::FG_YELLOW);
99
+        $this->stdout("\t".'DATA                      CLEANUP TO DATETIME'."\n");
100
+        $this->stdout("\t".'---------------------------------------------'."\n");
101 101
 
102 102
         // audit panels
103 103
         foreach ($panels as $id) {
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
             $dots = str_repeat('.', 24 - strlen($id));
108 108
             if ($age !== null) {
109 109
                 $date = date('Y-m-d 23:59:59', strtotime("-$age days"));
110
-                $this->stdout("\t" . $id . ' ' . $dots . ' ' . $date . "\n");
110
+                $this->stdout("\t".$id.' '.$dots.' '.$date."\n");
111 111
             } else {
112
-                $this->stdout("\t" . $id . ' ' . $dots . ' no maxAge, skipping' . "\n");
112
+                $this->stdout("\t".$id.' '.$dots.' no maxAge, skipping'."\n");
113 113
             }
114 114
         }
115 115
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         if ($entry) {
118 118
             $maxAge = $maxAge !== null ? $maxAge : $audit->maxAge;
119 119
             $date = $maxAge !== null ? date('Y-m-d 23:59:59', strtotime("-$maxAge days")) : 'no maxAge, skipping';
120
-            $this->stdout("\t" . 'AuditEntry .............. ' . $date . "\n");
120
+            $this->stdout("\t".'AuditEntry .............. '.$date."\n");
121 121
         }
122 122
 
123 123
         $this->stdout("\n");
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
         $count = AuditEntry::deleteAll(['<=', 'created', $date]);
143 143
         if ($count !== false) {
144 144
             $time = microtime(true) - $start;
145
-            $this->stdout("\n*** cleaned AuditEntry (records: " . $count . ",time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_GREEN);
145
+            $this->stdout("\n*** cleaned AuditEntry (records: ".$count.",time: ".sprintf("%.3f", $time)."s)\n", Console::FG_GREEN);
146 146
             return true;
147 147
         }
148 148
         $time = microtime(true) - $start;
149
-        $this->stdout("\n*** failed to clean AuditEntry (time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_RED);
149
+        $this->stdout("\n*** failed to clean AuditEntry (time: ".sprintf("%.3f", $time)."s)\n", Console::FG_RED);
150 150
         return false;
151 151
     }
152 152
 
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
         $count = $panel->cleanup($maxAge);
172 172
         if ($count !== false) {
173 173
             $time = microtime(true) - $start;
174
-            $this->stdout("\n*** cleaned $id (records: " . $count . ", time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_GREEN);
174
+            $this->stdout("\n*** cleaned $id (records: ".$count.", time: ".sprintf("%.3f", $time)."s)\n", Console::FG_GREEN);
175 175
             return true;
176 176
         }
177 177
         $time = microtime(true) - $start;
178
-        $this->stdout("\n*** failed to clean $id (time: " . sprintf("%.3f", $time) . "s)\n", Console::FG_RED);
178
+        $this->stdout("\n*** failed to clean $id (time: ".sprintf("%.3f", $time)."s)\n", Console::FG_RED);
179 179
         return false;
180 180
     }
181 181
 
@@ -207,13 +207,13 @@  discard block
 block discarded – undo
207 207
                 ];
208 208
                 $message = [
209 209
                     'subject' => Yii::t('audit', 'Audit Error in Audit Entry #{entry_id}', $params),
210
-                    'text' => Yii::t('audit', '{message}' . "\n" . 'in {file} on line {line}.' . "\n" . '-- {url}', $params),
210
+                    'text' => Yii::t('audit', '{message}'."\n".'in {file} on line {line}.'."\n".'-- {url}', $params),
211 211
                     'html' => Yii::t('audit', '<b>{message}</b><br />in <i>{file}</i> on line <i>{line}</i>.<br/>-- {link}', $params),
212 212
                 ];
213 213
 
214 214
                 // send email
215 215
                 Yii::$app->mailer->compose()
216
-                    ->setFrom([$email => 'Audit :: ' . Yii::$app->name])
216
+                    ->setFrom([$email => 'Audit :: '.Yii::$app->name])
217 217
                     ->setTo($email)
218 218
                     ->setSubject($message['subject'])
219 219
                     ->setTextBody($message['text'])
Please login to merge, or discard this patch.