@@ -87,8 +87,9 @@ |
||
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 AuditJavascript::deleteAll([ |
93 | 94 | '<=', 'created', date('Y-m-d 23:59:59', strtotime("-$maxAge days")) |
94 | 95 | ]); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getLabel() |
32 | 32 | { |
33 | - return $this->getName() . ' <small>(' . $this->_model->getJavascripts()->count() . ')</small>'; |
|
33 | + return $this->getName().' <small>('.$this->_model->getJavascripts()->count().')</small>'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function getLabel() |
22 | 22 | { |
23 | 23 | $messageCount = isset($this->data['messages']) ? count($this->data['messages']) : 0; |
24 | - return $this->getName() . ($messageCount ? ' <small>(' . $messageCount . ')</small>' : ''); |
|
24 | + return $this->getName().($messageCount ? ' <small>('.$messageCount.')</small>' : ''); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -167,8 +167,9 @@ |
||
167 | 167 | public function cleanup($maxAge = null) |
168 | 168 | { |
169 | 169 | $maxAge = $maxAge !== null ? $maxAge : $this->maxAge; |
170 | - if ($maxAge === null) |
|
171 | - return false; |
|
170 | + if ($maxAge === null) { |
|
171 | + return false; |
|
172 | + } |
|
172 | 173 | return AuditMail::deleteAll([ |
173 | 174 | '<=', 'created', date('Y-m-d 23:59:59', strtotime("-$maxAge days")) |
174 | 175 | ]); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function init() |
39 | 39 | { |
40 | 40 | parent::init(); |
41 | - Event::on(BaseMailer::className(), BaseMailer::EVENT_AFTER_SEND, function ($event) { |
|
41 | + Event::on(BaseMailer::className(), BaseMailer::EVENT_AFTER_SEND, function($event) { |
|
42 | 42 | $this->record($event); |
43 | 43 | }); |
44 | 44 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getLabel() |
129 | 129 | { |
130 | - return $this->getName() . ' <small>(' . $this->_model->getMails()->count() . ')</small>'; |
|
130 | + return $this->getName().' <small>('.$this->_model->getMails()->count().')</small>'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -63,9 +63,9 @@ |
||
63 | 63 | { |
64 | 64 | if (Yii::$app->requestedAction) { |
65 | 65 | if (Yii::$app->requestedAction instanceof InlineAction) { |
66 | - return get_class(Yii::$app->requestedAction->controller) . '::' . Yii::$app->requestedAction->actionMethod . '()'; |
|
66 | + return get_class(Yii::$app->requestedAction->controller).'::'.Yii::$app->requestedAction->actionMethod.'()'; |
|
67 | 67 | } |
68 | - return get_class(Yii::$app->requestedAction) . '::run()'; |
|
68 | + return get_class(Yii::$app->requestedAction).'::run()'; |
|
69 | 69 | } |
70 | 70 | return null; |
71 | 71 | } |
@@ -35,8 +35,9 @@ |
||
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']); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function getLabel() |
38 | 38 | { |
39 | - return $this->getName() . ' <small>(' . count($this->data) . ')</small>'; |
|
39 | + return $this->getName().' <small>('.count($this->data).')</small>'; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -87,8 +87,9 @@ |
||
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 | ]); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function getLabel() |
40 | 40 | { |
41 | - return $this->getName() . ' <small>(' . $this->_model->getTrails()->count() . ')</small>'; |
|
41 | + return $this->getName().' <small>('.$this->_model->getTrails()->count().')</small>'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -12,8 +12,8 @@ |
||
12 | 12 | $style = YII_DEBUG ? '' : 'color:transparent;'; |
13 | 13 | } |
14 | 14 | if (Access::checkAccess()) { |
15 | - echo Html::a('audit-' . $auditEntry->id, ['/audit/entry/view', 'id' => $auditEntry->id], ['style' => $style]); |
|
15 | + echo Html::a('audit-'.$auditEntry->id, ['/audit/entry/view', 'id' => $auditEntry->id], ['style' => $style]); |
|
16 | 16 | } else { |
17 | - echo Html::tag('span', 'audit-' . $auditEntry->id, ['style' => $style]); |
|
17 | + echo Html::tag('span', 'audit-'.$auditEntry->id, ['style' => $style]); |
|
18 | 18 | } |
19 | 19 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if (empty($columns) || in_array('user_id', $columns)) { |
38 | 38 | $_columns[] = [ |
39 | 39 | 'attribute' => 'user_id', |
40 | - 'value' => function ($data) { |
|
40 | + 'value' => function($data) { |
|
41 | 41 | return Audit::getInstance()->getUserIdentifier($data->user_id); |
42 | 42 | }, |
43 | 43 | 'format' => 'raw', |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | if (empty($columns) || in_array('entry_id', $columns)) { |
47 | 47 | $_columns[] = [ |
48 | 48 | 'attribute' => 'entry_id', |
49 | - 'value' => function ($model) { |
|
49 | + 'value' => function($model) { |
|
50 | 50 | /** @var AuditTrail $model */ |
51 | 51 | if (Access::checkAccess()) { |
52 | 52 | return Html::a($model->entry_id, ['/audit/entry/view', 'id' => $model->entry_id]); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (empty($columns) || in_array('diff', $columns)) { |
78 | 78 | $_columns[] = [ |
79 | 79 | 'label' => Yii::t('audit', 'Diff'), |
80 | - 'value' => function ($model) { |
|
80 | + 'value' => function($model) { |
|
81 | 81 | /** @var AuditTrail $model */ |
82 | 82 | return $model->getDiffHtml(); |
83 | 83 | }, |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | 'linkSelector' => '#pjax-AuditTrails ul.pagination a, th a', |
95 | 95 | ]); |
96 | 96 | |
97 | -echo '<div class="table-responsive">' . GridView::widget([ |
|
97 | +echo '<div class="table-responsive">'.GridView::widget([ |
|
98 | 98 | 'layout' => '{summary}{pager}<br/>{items}{pager}', |
99 | 99 | 'dataProvider' => $auditTrailDataProvider, |
100 | 100 | 'filterModel' => $filter ? $auditTrailSearch : null, |
101 | 101 | 'columns' => $_columns, |
102 | - ]) . '</div>'; |
|
102 | + ]).'</div>'; |
|
103 | 103 | |
104 | 104 | Pjax::end(); |
105 | 105 |
@@ -38,11 +38,12 @@ discard block |
||
38 | 38 | ); |
39 | 39 | } |
40 | 40 | |
41 | -if ($headers) |
|
41 | +if ($headers) { |
|
42 | 42 | $tabs[] = [ |
43 | 43 | 'label' => \Yii::t('audit', 'Headers'), |
44 | 44 | 'content' => Html::tag('div', $formatter->asNtext(implode('', $headers)), ['class' => 'well']) |
45 | 45 | ]; |
46 | +} |
|
46 | 47 | |
47 | 48 | if ($content) { |
48 | 49 | $tabs[] = [ |
@@ -56,11 +57,12 @@ discard block |
||
56 | 57 | ); |
57 | 58 | } |
58 | 59 | |
59 | -if ($log) |
|
60 | +if ($log) { |
|
60 | 61 | $tabs[] = [ |
61 | 62 | 'label' => \Yii::t('audit', 'Log'), |
62 | 63 | 'content' => Html::tag('div', $formatter->asText($log), $preformatted) |
63 | 64 | ]; |
65 | +} |
|
64 | 66 | |
65 | 67 | |
66 | 68 | echo Html::tag('h2', \Yii::t('audit', 'Request #{id}', ['id' => $index])), |