Skip to content

Commit dd79474

Browse files
authored
Merge pull request #23 from SaliBhdr/v2
feature: add support to php 7.2 and higher
2 parents 0d32186 + 2c6cc27 commit dd79474

12 files changed

+117
-115
lines changed

Diff for: .github/workflows/testing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
99
strategy:
1010
matrix:
11-
php-versions: [7.0, 7.1]
11+
php-versions: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2]
1212
dependency-version: [prefer-lowest, prefer-stable]
1313

1414
steps:

Diff for: .php-cs-fixer.dist

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ return (new PhpCsFixer\Config())
2222
'trailing_comma_in_multiline' => true,
2323
'phpdoc_scalar' => true,
2424
'unary_operator_spaces' => true,
25-
'binary_operator_spaces' => [
26-
'align_double_arrow' => true,
27-
'align_equals' => true
28-
],
2925
'blank_line_before_statement' => [
3026
'statements' => [
3127
'break',
@@ -41,6 +37,7 @@ return (new PhpCsFixer\Config())
4137
'on_multiline' => 'ensure_fully_multiline',
4238
'keep_multiple_spaces_after_comma' => true,
4339
],
40+
'void_return' => true,
4441
'single_trait_insert_per_statement' => true,
4542
'blank_line_after_namespace' => true,
4643
'braces' => true,
@@ -52,14 +49,14 @@ return (new PhpCsFixer\Config())
5249
'function_declaration' => true,
5350
'indentation_type' => true,
5451
'line_ending' => true,
55-
'lowercase_constants' => true,
52+
'constant_case' => ['case' => 'lower'],
5653
'lowercase_keywords' => true,
5754
'no_blank_lines_after_class_opening' => true,
5855
'no_blank_lines_after_phpdoc' => true,
5956
'no_closing_tag' => true,
6057
'no_empty_phpdoc' => true,
6158
'no_empty_statement' => true,
62-
'no_extra_consecutive_blank_lines' => true,
59+
'no_extra_blank_lines' => true,
6360
'no_leading_namespace_whitespace' => true,
6461
'no_singleline_whitespace_before_semicolons' => true,
6562
'no_spaces_after_function_name' => true,

Diff for: README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
[![Total Downloads][ico-downloads]][link-downloads]
77
[![Today Downloads][ico-today-downloads]][link-downloads]
88
[![Required PHP Version][ico-php]][link-packagist]
9-
![build](https://github.com/salibhdr/php-dump-logger/actions/workflows/testing.yml/badge.svg?branch=v1)
10-
[![codecov](https://codecov.io/gh/SaliBhdr/php-dump-logger/branch/v1/graph/badge.svg?token=ZG9NV6JRRP)](https://codecov.io/gh/SaliBhdr/php-dump-logger)
9+
![build](https://github.com/salibhdr/php-dump-logger/actions/workflows/testing.yml/badge.svg?branch=v2)
10+
[![codecov](https://codecov.io/gh/SaliBhdr/php-dump-logger/branch/v2/graph/badge.svg?token=ZG9NV6JRRP)](https://codecov.io/gh/SaliBhdr/php-dump-logger)
1111
[![Latest Versions][ico-version]][link-packagist]
1212
[![Unstable Version][ico-unstable]][link-packagist]
1313

@@ -78,9 +78,14 @@ Install via composer:
7878

7979
## Version Compatibility
8080

81-
| PHP | PHP Dump Logger |
82-
|:-------------|:----------------|
83-
| ^7.0 && ^7.1 | 1.x |
81+
| PHP | PHP Dump Logger |
82+
|:-----------|:----------------|
83+
| ^7 && ^7.1 | 1.x |
84+
| ^7.2 | 2.x |
85+
| ^7.3 | 2.x |
86+
| ^7.4 | 2.x |
87+
| ^8.1 | 2.x |
88+
| ^8.2 | 2.x |
8489

8590
## Basic Usage
8691

@@ -482,7 +487,7 @@ composer testfix
482487
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
483488

484489

485-
[ico-php]: https://img.shields.io/badge/php-7.0|7.1-8892bf?style=flat-square&logo=php
490+
[ico-php]: https://img.shields.io/badge/php-7.*|8.*-8892bf?style=flat-square&logo=php
486491
[ico-downloads]: https://poser.pugx.org/salibhdr/php-dump-logger/downloads
487492
[ico-today-downloads]: https://img.shields.io/packagist/dd/salibhdr/php-dump-logger.svg?style=flat-square
488493
[ico-unstable]: https://poser.pugx.org/salibhdr/php-dump-logger/v/unstable

Diff for: composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
}
2828
],
2929
"require": {
30-
"php": "^7.0 | ^7.1",
31-
"symfony/var-dumper": "^3"
30+
"php": "^7.2 | ^7.3 | ^7.4 | ^8.0 | ^8.1 | ^8.2",
31+
"symfony/var-dumper": "^5 | ^6"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^6",
34+
"phpunit/phpunit": "^6 | ^7 | ^8 | ^9",
3535
"mockery/mockery": "^1",
36-
"friendsofphp/php-cs-fixer": "^2"
36+
"friendsofphp/php-cs-fixer": "^2 | ^3"
3737
},
3838
"autoload": {
3939
"psr-4": {
@@ -46,7 +46,7 @@
4646
}
4747
},
4848
"scripts": {
49-
"csfix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist",
49+
"csfix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist --allow-risky=yes",
5050
"test": "vendor/bin/phpunit --testdox",
5151
"testfix": [
5252
"@csfix",

Diff for: src/Loggers/RawLogger.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function log($data, string $level = 'log'): bool
215215
* @throws InvalidArgumentException
216216
* @throws RuntimeException
217217
*/
218-
protected function save($data, string $level = 'log', bool $makeDir = true)
218+
protected function save($data, string $level = 'log', bool $makeDir = true): void
219219
{
220220
if (empty($this->dumper) || empty($this->extension)) {
221221
throw new InvalidArgumentException('Please specify a dumper and file extension with dumper() method.');
@@ -249,7 +249,7 @@ protected function save($data, string $level = 'log', bool $makeDir = true)
249249
/**
250250
* @param string $path
251251
*/
252-
protected function makeDirIfNotExists(string $path)
252+
protected function makeDirIfNotExists(string $path): void
253253
{
254254
if (!is_dir($path)) {
255255
$oldMask = umask(0);

Diff for: tests/TestCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function removeDir(string $dir): bool
2929
return rmdir($dir);
3030
}
3131

32-
public function assertFileContains(string $path, string $phrase)
32+
public function assertFileContains(string $path, string $phrase): void
3333
{
3434
$content = @file_get_contents($path);
3535

@@ -53,7 +53,7 @@ protected function strRandom(int $chars = 10): string
5353
return $randomString;
5454
}
5555

56-
protected function assertFilePermission(string $path, string $expected)
56+
protected function assertFilePermission(string $path, string $expected): void
5757
{
5858
$actual = $this->getFilePermission($path);
5959

Diff for: tests/Unit/Factory/DumperFactoryTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,35 @@
99

1010
class DumperFactoryTest extends TestCase
1111
{
12-
public function testCanMakeCliDumper()
12+
public function testCanMakeCliDumper(): void
1313
{
1414
$dumper = Dumper::make('cli');
1515

1616
$this->assertInstanceOf(CliDumper::class, $dumper);
1717
}
1818

19-
public function testCanMakeHtmlDumper()
19+
public function testCanMakeHtmlDumper(): void
2020
{
2121
$dumper = Dumper::make('html');
2222

2323
$this->assertInstanceOf(HtmlDumper::class, $dumper);
2424
}
2525

26-
public function testTheDefaultDumperIsCliDumper()
26+
public function testTheDefaultDumperIsCliDumper(): void
2727
{
2828
$dumper = Dumper::make();
2929

3030
$this->assertInstanceOf(CliDumper::class, $dumper);
3131
}
3232

33-
public function testCliMethodWillReturnCliDumper()
33+
public function testCliMethodWillReturnCliDumper(): void
3434
{
3535
$dumper = Dumper::cli();
3636

3737
$this->assertInstanceOf(CliDumper::class, $dumper);
3838
}
3939

40-
public function testHtmlMethodWillReturnHtmlDumper()
40+
public function testHtmlMethodWillReturnHtmlDumper(): void
4141
{
4242
$dumper = Dumper::html();
4343

Diff for: tests/Unit/Factory/LoggerFactoryTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,35 @@
99

1010
class LoggerFactoryTest extends TestCase
1111
{
12-
public function testCanMakePrettyLogger()
12+
public function testCanMakePrettyLogger(): void
1313
{
1414
$dumper = Logger::make('pretty');
1515

1616
$this->assertInstanceOf(PrettyLogger::class, $dumper);
1717
}
1818

19-
public function testCanMakeHtmlLogger()
19+
public function testCanMakeHtmlLogger(): void
2020
{
2121
$dumper = Logger::make('html');
2222

2323
$this->assertInstanceOf(HtmlLogger::class, $dumper);
2424
}
2525

26-
public function testTheDefaultLoggerIsPrettyLogger()
26+
public function testTheDefaultLoggerIsPrettyLogger(): void
2727
{
2828
$dumper = Logger::make();
2929

3030
$this->assertInstanceOf(PrettyLogger::class, $dumper);
3131
}
3232

33-
public function testPrettyMethodWillReturnPrettyLogger()
33+
public function testPrettyMethodWillReturnPrettyLogger(): void
3434
{
3535
$dumper = Logger::html();
3636

3737
$this->assertInstanceOf(HtmlLogger::class, $dumper);
3838
}
3939

40-
public function testHtmlMethodWillReturnHtmlLogger()
40+
public function testHtmlMethodWillReturnHtmlLogger(): void
4141
{
4242
$dumper = Logger::pretty();
4343

0 commit comments

Comments
 (0)