Skip to content

Commit

Permalink
build: minimal php version is 8.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed Mar 26, 2022
1 parent 9e85037 commit 0e317b8
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 71 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ jobs:
fail-fast: false
matrix:
include:
- operating-system: 'ubuntu-latest'
php-version: '7.3'
job-description: 'Ubuntu; PHP 7.3; latest-deps'

- operating-system: 'ubuntu-latest'
php-version: '7.3'
composer-flags: '--prefer-lowest'
job-description: 'Ubuntu; PHP 7.3; lowest-deps'

- operating-system: 'ubuntu-latest'
php-version: '7.4'
job-description: 'Ubuntu; PHP 7.4; latest-deps'

- operating-system: 'ubuntu-latest'
php-version: '7.4'
composer-flags: '--prefer-lowest'
job-description: 'Ubuntu; PHP 7.4; lowest-deps'

- operating-system: 'ubuntu-latest'
php-version: '8.0'
job-description: 'Ubuntu; PHP 8.0; latest-deps'
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@PHP73Migration' => true,
'@PHP80Migration' => true,

'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
}
],
"require": {
"php": ">=7.3",
"symfony/config": "^4.4||^5.0||^6.0",
"symfony/yaml": "^4.4||^5.0||^6.0"
"php": ">=8.0.2",
"symfony/config": "^5.4||^6.0",
"symfony/yaml": "^5.4||^6.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5.16",
"friendsofphp/php-cs-fixer": "^3.0"
},
"autoload": {
Expand Down
7 changes: 2 additions & 5 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class Config
{
private $parameters;
private array $parameters;

private function __construct(array $data)
{
Expand All @@ -17,10 +17,7 @@ private function __construct(array $data)
);
}

/**
* @return static
*/
public static function createFromYaml(string $configPath): self
public static function createFromYaml(string $configPath): static
{
return new static(Yaml::parseFile($configPath));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/ParserException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

class ParserException extends \Exception
{
private $errorLogLine;
private $pattern;
private ?string $errorLogLine = null;
private ?string $pattern = null;

public function getErrorLogLine(): ?string
{
Expand Down
35 changes: 8 additions & 27 deletions src/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,22 @@

class Iterator implements \Iterator
{
/**
* @var Parser
*/
private $parser;
private Parser $parser;

/**
* @var string
*/
private $logFile;
private string $logFile;

/**
* @var resource
*/
private $fileHandler;

/**
* @var string|null
*/
private $currentLine;
private ?string $currentLine = null;

/**
* @var bool
*/
private $skipEmptyLines;
/**
* @var int
*/
private $seek;
/**
* @var string
*/
private $name;
private bool $skipEmptyLines;

private ?int $seek = null;

private string $name = '';

public function __construct(string $logFile, Parser $parser, bool $skipEmptyLines = true)
{
Expand All @@ -46,9 +30,6 @@ public function __construct(string $logFile, Parser $parser, bool $skipEmptyLine
$this->skipEmptyLines = $skipEmptyLines;
}

/**
* Destructor.
*/
public function __destruct()
{
@\fclose($this->fileHandler);
Expand Down
2 changes: 1 addition & 1 deletion src/Logio.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Logio
/**
* @var Parser[]
*/
private $parsers = [];
private array $parsers = [];

public function __construct(Config $config)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

class Parser
{
protected $name;
protected $parameters;
protected string $name;
protected array $parameters;

public function __construct(string $name, array $parameters)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class ConfigTest extends TestCase
{
private $fixturesDir = __DIR__.'/fixtures';
private string $fixturesDir = __DIR__.'/fixtures';

public function testConfigSuccess(): void
{
Expand Down
7 changes: 2 additions & 5 deletions tests/LogioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@

class LogioTest extends TestCase
{
private $fixturesDir = __DIR__.'/fixtures';
/**
* @var Config
*/
private $config;
private string $fixturesDir = __DIR__.'/fixtures';
private Config $config;

protected function setUp(): void
{
Expand Down
7 changes: 2 additions & 5 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@

class ParserTest extends TestCase
{
private $fixturesDir = __DIR__.'/fixtures';
/**
* @var Config
*/
private $config;
private string $fixturesDir = __DIR__.'/fixtures';
private Config $config;

protected function setUp(): void
{
Expand Down

0 comments on commit 0e317b8

Please sign in to comment.