@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80'; |
|
| 104 | + $connectionString = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80'; |
|
| 105 | 105 | parent::__construct($connectionString, $level, $bubble); |
| 106 | 106 | |
| 107 | 107 | $this->token = $token; |
@@ -136,8 +136,7 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $dataArray = array( |
| 138 | 138 | 'notify' => $this->version == self::API_V1 ? |
| 139 | - ($this->notify ? 1 : 0) : |
|
| 140 | - ($this->notify ? 'true' : 'false'), |
|
| 139 | + ($this->notify ? 1 : 0) : ($this->notify ? 'true' : 'false'), |
|
| 141 | 140 | 'message' => $record['formatted'], |
| 142 | 141 | 'message_format' => $this->format, |
| 143 | 142 | 'color' => $this->getAlertColor($record['level']), |
@@ -145,9 +144,9 @@ discard block |
||
| 145 | 144 | |
| 146 | 145 | if (!$this->validateStringLength($dataArray['message'], static::MAXIMUM_MESSAGE_LENGTH)) { |
| 147 | 146 | if (function_exists('mb_substr')) { |
| 148 | - $dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; |
|
| 147 | + $dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH) . ' [truncated]'; |
|
| 149 | 148 | } else { |
| 150 | - $dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; |
|
| 149 | + $dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH) . ' [truncated]'; |
|
| 151 | 150 | } |
| 152 | 151 | } |
| 153 | 152 | |
@@ -57,9 +57,9 @@ |
||
| 57 | 57 | $this->client = $client; |
| 58 | 58 | $this->options = array_merge( |
| 59 | 59 | array( |
| 60 | - 'index' => 'monolog', // Elastic index name |
|
| 61 | - 'type' => 'record', // Elastic document type |
|
| 62 | - 'ignore_error' => false, // Suppress Elastica exceptions |
|
| 60 | + 'index' => 'monolog', // Elastic index name |
|
| 61 | + 'type' => 'record', // Elastic document type |
|
| 62 | + 'ignore_error' => false, // Suppress Elastica exceptions |
|
| 63 | 63 | ), |
| 64 | 64 | $options |
| 65 | 65 | ); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $level = $this->level; |
| 67 | 67 | |
| 68 | - $records = array_filter($records, function ($record) use ($level) { |
|
| 68 | + $records = array_filter($records, function($record) use ($level) { |
|
| 69 | 69 | return ($record['level'] >= $level); |
| 70 | 70 | }); |
| 71 | 71 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $headers = array('Content-Type: application/json'); |
| 82 | 82 | |
| 83 | 83 | if (!empty($this->tag)) { |
| 84 | - $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); |
|
| 84 | + $headers[] = 'X-LOGGLY-TAG: ' . implode(',', $this->tag); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $ch = curl_init(); |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | if (array_key_exists(strtolower($facility), $this->facilities)) { |
| 86 | 86 | $facility = $this->facilities[strtolower($facility)]; |
| 87 | 87 | } elseif (!in_array($facility, array_values($this->facilities), true)) { |
| 88 | - throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); |
|
| 88 | + throw new \UnexpectedValueException('Unknown facility value "' . $facility . '" given'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $this->facility = $facility; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | restore_error_handler(); |
| 105 | 105 | if (!is_resource($this->stream)) { |
| 106 | 106 | $this->stream = null; |
| 107 | - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url)); |
|
| 107 | + throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: ' . $this->errorMessage, $this->url)); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $status = mkdir($dir, 0777, true); |
| 169 | 169 | restore_error_handler(); |
| 170 | 170 | if (false === $status) { |
| 171 | - throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir)); |
|
| 171 | + throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: ' . $this->errorMessage, $dir)); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | $this->dirCreated = true; |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | protected function write(array $record) |
| 61 | 61 | { |
| 62 | 62 | if (!openlog($this->ident, $this->logopts, $this->facility)) { |
| 63 | - throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"'); |
|
| 63 | + throw new \LogicException('Can\'t open syslog for ident "' . $this->ident . '" and facility "' . $this->facility . '"'); |
|
| 64 | 64 | } |
| 65 | 65 | syslog($this->logLevels[$record['level']], (string) $record['formatted']); |
| 66 | 66 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $level = $this->level; |
| 75 | 75 | |
| 76 | 76 | // filter records based on their level |
| 77 | - $records = array_filter($records, function ($record) use ($level) { |
|
| 77 | + $records = array_filter($records, function($record) use ($level) { |
|
| 78 | 78 | return $record['level'] >= $level; |
| 79 | 79 | }); |
| 80 | 80 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // the record with the highest severity is the "main" one |
| 86 | - $record = array_reduce($records, function ($highest, $record) { |
|
| 86 | + $record = array_reduce($records, function($highest, $record) { |
|
| 87 | 87 | if ($record['level'] > $highest['level']) { |
| 88 | 88 | return $record; |
| 89 | 89 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | parent::__construct($handler, 0, Logger::DEBUG, $bubble, false); |
| 68 | 68 | |
| 69 | - $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore; |
|
| 69 | + $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) . '.log' : $deduplicationStore; |
|
| 70 | 70 | $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel); |
| 71 | 71 | $this->time = $time; |
| 72 | 72 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | return false; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
| 110 | + $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
|
| 111 | 111 | if (!is_array($store)) { |
| 112 | 112 | return false; |
| 113 | 113 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->setAcceptedLevels($minLevelOrList, $maxLevel); |
| 58 | 58 | |
| 59 | 59 | if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { |
| 60 | - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); |
|
| 60 | + throw new \RuntimeException("The given handler (" . json_encode($this->handler) . ") is not a callable nor a Monolog\Handler\HandlerInterface object"); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } else { |
| 81 | 81 | $minLevelOrList = Logger::toMonologLevel($minLevelOrList); |
| 82 | 82 | $maxLevel = Logger::toMonologLevel($maxLevel); |
| 83 | - $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) { |
|
| 83 | + $acceptedLevels = array_values(array_filter(Logger::getLevels(), function($level) use ($minLevelOrList, $maxLevel) { |
|
| 84 | 84 | return $level >= $minLevelOrList && $level <= $maxLevel; |
| 85 | 85 | })); |
| 86 | 86 | } |