Skip to content

Commit

Permalink
Prepare release v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed Nov 6, 2019
1 parent 64086ba commit 07a81f1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 11 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.



## [1.0.2] - 2019-11-06

### Added
- Support `monolog/monolog:^2.0`

### Changed
- Change coding style from PSR-2 to PSR-12

### Fixed
- Logs wasn't send to Logz.io




## [1.0.1] - 2019-11-06

### Fixed
Expand Down Expand Up @@ -87,7 +101,8 @@ First release



[Unreleased]: https://github.com/oanhnn/laravel-logzio/compare/v1.0.1...develop
[Unreleased]: https://github.com/oanhnn/laravel-logzio/compare/v1.0.2...develop
[1.0.2]: https://github.com/oanhnn/laravel-logzio/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/oanhnn/laravel-logzio/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/oanhnn/laravel-logzio/compare/v0.2.0...v1.0.0
[0.2.0]: https://github.com/oanhnn/laravel-logzio/compare/v0.1.2...v0.2.0
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Before submitting a pull request:

If the project maintainer has any additional requirements, you will find them listed here.

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
- **[PSR-12 Extended Coding Style](https://www.php-fig.org/psr/psr-12)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ return [
'driver' => 'logzio',
'name' => 'channel-name',
'token' => 'logz-access-token',
'type' => 'https-bulk',
'type' => 'http-bulk',
'ssl' => true,
'level' => 'info',
'bubble' => true,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"require": {
"php": "^7.1.3",
"guzzlehttp/guzzle": "^6.4",
"monolog/monolog": "~1.12",
"monolog/monolog": "^1.12|^2.0",
"psr/log": "^1.1"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<arg value="p"/>
<arg name="colors"/>

<rule ref="PSR2"/>
<rule ref="PSR12"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>

Expand Down
2 changes: 1 addition & 1 deletion src/Log/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Formatter extends JsonFormatter
* Datetime format for Logz.io
* @see https://support.logz.io/hc/en-us/articles/210206885
*/
const DATETIME_FORMAT = 'c';
protected const DATETIME_FORMAT = 'c';

/**
* @param int $batchMode
Expand Down
6 changes: 3 additions & 3 deletions src/Log/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct($level = Logger::DEBUG, bool $bubble = true, array $
/**
* {@inheritdoc}
*/
public function handleBatch(array $records)
public function handleBatch(array $records): void
{
$processed = [];

Expand Down Expand Up @@ -134,7 +134,7 @@ protected function send($data)
$headers = ['Content-Type: application/json'];
$request = new Request('POST', $this->endpoint, $headers, $data);

$this->client->sendAsync($request);
$this->client->send($request);
}

/**
Expand All @@ -157,7 +157,7 @@ protected function validRegion(string $region): bool
/**
* {@inheritdoc}
*/
protected function write(array $record)
protected function write(array $record): void
{
$this->send($record['formatted']);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/LogzioHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testItShouldProvidersDefaultFormatter()
public function testItShouldHandleARecord()
{
$client = $this->createMock(Client::class);
$client->expects($this->once())->method('sendAsync');
$client->expects($this->once())->method('send');

$handler = new Handler('debug', false, ['token' => 'abc', 'http_client' => $client]);
$handler->handle($this->logRecord());
Expand All @@ -84,7 +84,7 @@ public function testItShouldHandleARecord()
public function testItShouldHandleBatch()
{
$client = $this->createMock(Client::class);
$client->expects($this->once())->method('sendAsync');
$client->expects($this->once())->method('send');

$handler = new Handler('notice', false, ['token' => 'abc', 'http_client' => $client]);
$handler->handleBatch([
Expand Down

0 comments on commit 07a81f1

Please sign in to comment.