| @@ -82,7 +82,7 @@ | ||
| 82 | 82 | * @param $id | 
| 83 | 83 | * @param $attribute | 
| 84 | 84 | * @param $version | 
| 85 | - * @return null|integer|float|string | |
| 85 | + * @return string|null | |
| 86 | 86 | */ | 
| 87 | 87 | public static function findAttribute($class, $id, $attribute, $version) | 
| 88 | 88 |      { | 
| @@ -36,7 +36,7 @@ | ||
| 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 |      { | 
| @@ -29,7 +29,7 @@ discard block | ||
| 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 | ||
| 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 | /** | 
| @@ -135,9 +135,9 @@ | ||
| 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 | /** | 
| @@ -95,9 +95,9 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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']) | 
| @@ -91,7 +91,7 @@ discard block | ||
| 91 | 91 |      { | 
| 92 | 92 | $data = ArrayHelper::toArray($data); | 
| 93 | 93 | if ($simplify) | 
| 94 | -            array_walk($data, function (&$value) { | |
| 94 | +            array_walk($data, function(&$value) { | |
| 95 | 95 | if (is_array($value) && count($value) == 1) $value = reset($value); | 
| 96 | 96 | }); | 
| 97 | 97 | |
| @@ -167,7 +167,7 @@ discard block | ||
| 167 | 167 |              if (is_object($value)) { | 
| 168 | 168 | $class = get_class($value); | 
| 169 | 169 | // By default we just mention the object type | 
| 170 | -                $args[$name] = 'Object(' . $class . ')'; | |
| 170 | +                $args[$name] = 'Object('.$class.')'; | |
| 171 | 171 | |
| 172 | 172 |                  if ($recurseDepth > 0) { | 
| 173 | 173 | // Make sure to limit the toArray to non recursive, it's much to easy to get stuck in an infinite loop | 
| @@ -198,7 +198,7 @@ discard block | ||
| 198 | 198 |          $hash = bcadd(sprintf('%u', crc32($data)), 0x100000000); | 
| 199 | 199 | $str = ''; | 
| 200 | 200 |          do { | 
| 201 | - $str = $map[bcmod($hash, 62)] . $str; | |
| 201 | + $str = $map[bcmod($hash, 62)].$str; | |
| 202 | 202 | $hash = bcdiv($hash, 62); | 
| 203 | 203 | } while ($hash >= 1); | 
| 204 | 204 | return $str; | 
| @@ -80,7 +80,7 @@ | ||
| 80 | 80 | return $this->_data['result'] = parent::__doRequest($request, $location, $action, $version, $one_way); | 
| 81 | 81 | } | 
| 82 | 82 | |
| 83 | - public function __setCookie ($name, $value = null) | |
| 83 | + public function __setCookie($name, $value = null) | |
| 84 | 84 |      { | 
| 85 | 85 | if (!isset($this->_data['cookies'])) | 
| 86 | 86 | $this->_data['cookies'] = []; | 
| @@ -36,7 +36,7 @@ discard block | ||
| 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 | /** | 
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 | */ | 
| 81 | 81 | public function getUrl() | 
| 82 | 82 |      { | 
| 83 | - return Url::toRoute(['/' . $this->module->id . '/entry/view', | |
| 83 | + return Url::toRoute(['/'.$this->module->id.'/entry/view', | |
| 84 | 84 | 'panel' => $this->id, | 
| 85 | 85 | 'id' => $this->tag, | 
| 86 | 86 | ]); | 
| @@ -44,13 +44,13 @@ | ||
| 44 | 44 | 'message' => 'message', | 
| 45 | 45 | 'type' => 'type', | 
| 46 | 46 | 'file' => 'origin', | 
| 47 | -            'line'       => function ($value) use ($javascript) { | |
| 48 | - $javascript->origin .= ':' . $value; | |
| 47 | +            'line'       => function($value) use ($javascript) { | |
| 48 | + $javascript->origin .= ':'.$value; | |
| 49 | 49 | }, | 
| 50 | -            'col'        => function ($value) use ($javascript) { | |
| 51 | - $javascript->origin .= ':' . $value; | |
| 50 | +            'col'        => function($value) use ($javascript) { | |
| 51 | + $javascript->origin .= ':'.$value; | |
| 52 | 52 | }, | 
| 53 | -            'data'       => function ($value) use ($javascript) { | |
| 53 | +            'data'       => function($value) use ($javascript) { | |
| 54 | 54 | if (count($value)) $javascript->data = $value; | 
| 55 | 55 | }, | 
| 56 | 56 | ]; | 
| @@ -58,6 +58,6 @@ | ||
| 58 | 58 |          if (!$model) { | 
| 59 | 59 |              throw new NotFoundHttpException('The requested mail does not exist.'); | 
| 60 | 60 | } | 
| 61 | - Yii::$app->response->sendContentAsFile(Helper::uncompress($model->data), $model->id . '.eml'); | |
| 61 | + Yii::$app->response->sendContentAsFile(Helper::uncompress($model->data), $model->id.'.eml'); | |
| 62 | 62 | } | 
| 63 | 63 | } |