Skip to content

Commit a532ff6

Browse files
committed
Set minimum PHP version to ^7.4 - Close #53
1 parent 9eba9cf commit a532ff6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+156
-157
lines changed

.github/workflows/integration.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ jobs:
77
fail-fast: false
88
matrix:
99
php-version:
10-
- "7.3"
1110
- "7.4"
1211
os: [ubuntu-latest]
1312
experimental: [false]

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"require": {
28-
"php": "^7.3 || ^8.0",
28+
"php": "^7.4 || ^8.0",
2929
"nikic/php-parser": "^4.2",
3030
"ext-json": "*"
3131
},
@@ -35,8 +35,8 @@
3535
"phpspec/prophecy-phpunit": "^2.0",
3636
"phpstan/phpstan": "^0.12.33",
3737
"phpstan/phpstan-strict-rules": "^0.12.4",
38-
"phpunit/phpunit": "^9.2.6",
39-
"prooph/php-cs-fixer-config": "^0.3",
38+
"phpunit/phpunit": "^9.5.0",
39+
"prooph/php-cs-fixer-config": "^v0.3.1",
4040
"roave/security-advisories": "dev-master"
4141
},
4242
"minimum-stability": "dev",

src/Builder/ClassBuilder.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,43 @@
2626
final class ClassBuilder implements File
2727
{
2828
/** @var string|null */
29-
private $namespace;
29+
private ?string $namespace = null;
3030

3131
/** @var string|null */
32-
private $name;
32+
private ?string $name = null;
3333

3434
/** @var bool */
35-
private $strict = false;
35+
private bool $strict = false;
3636

3737
/** @var bool */
38-
private $typed = false;
38+
private bool $typed = false;
3939

4040
/** @var bool */
41-
private $final = false;
41+
private bool $final = false;
4242

4343
/** @var bool */
44-
private $abstract = false;
44+
private bool $abstract = false;
4545

4646
/** @var string|null */
47-
private $extends;
47+
private ?string $extends = null;
4848

4949
/** @var string[] */
50-
private $implements = [];
50+
private array $implements = [];
5151

5252
/** @var string[] */
53-
private $namespaceImports = [];
53+
private array $namespaceImports = [];
5454

5555
/** @var string[] */
56-
private $traits = [];
56+
private array $traits = [];
5757

5858
/** @var ClassConstBuilder[] */
59-
private $constants = [];
59+
private array $constants = [];
6060

6161
/** @var ClassPropertyBuilder[] */
62-
private $properties = [];
62+
private array $properties = [];
6363

6464
/** @var ClassMethodBuilder[] */
65-
private $methods = [];
65+
private array $methods = [];
6666

6767
private function __construct()
6868
{

src/Builder/ClassBuilderCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ClassBuilderCollection implements Iterator, Countable
2121
/**
2222
* @var array<string, ClassBuilder>
2323
*/
24-
private $items;
24+
private array $items;
2525

2626
public static function fromItems(ClassBuilder ...$classBuilders): self
2727
{

src/Builder/ClassConstBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
final class ClassConstBuilder
2020
{
2121
/** @var string */
22-
private $name;
22+
private string $name;
2323

2424
/** @var mixed */
2525
private $value;
2626

2727
/**
2828
* @var int
2929
*/
30-
private $visibility;
30+
private int $visibility;
3131

3232
private function __construct()
3333
{

src/Builder/ClassMethodBuilder.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,48 +27,48 @@
2727
final class ClassMethodBuilder
2828
{
2929
/** @var string */
30-
private $name;
30+
private string $name;
3131

3232
/** @var ParameterBuilder[] */
33-
private $parameters = [];
33+
private array $parameters = [];
3434

3535
/** @var string */
36-
private $body = '';
36+
private string $body = '';
3737

3838
/** @var string|null */
39-
private $returnType;
39+
private ?string $returnType = null;
4040

4141
/**
4242
* @var int
4343
*/
44-
private $visibility;
44+
private int $visibility;
4545

4646
/** @var bool */
47-
private $typed = false;
47+
private bool $typed = false;
4848

4949
/**
5050
* @var string|null
5151
*/
52-
private $docBlockComment;
52+
private ?string $docBlockComment = null;
5353

5454
/**
5555
* @var string|null
5656
*/
57-
private $returnTypeDocBlockHint;
57+
private ?string $returnTypeDocBlockHint = null;
5858

5959
/**
6060
* @var DocBlock|null
6161
*/
62-
private $docBlock;
62+
private ?DocBlock $docBlock = null;
6363

6464
/** @var bool */
65-
private $final = false;
65+
private bool $final = false;
6666

6767
/** @var bool */
68-
private $abstract = false;
68+
private bool $abstract = false;
6969

7070
/** @var bool */
71-
private $isStatic = false;
71+
private bool $isStatic = false;
7272

7373
private function __construct()
7474
{

src/Builder/ClassPropertyBuilder.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,36 @@
2222
final class ClassPropertyBuilder
2323
{
2424
/** @var string */
25-
private $name;
25+
private string $name;
2626

27-
/** @var string */
28-
private $type;
27+
/** @var string|null */
28+
private ?string $type;
2929

3030
/** @var mixed */
3131
private $defaultValue;
3232

3333
/**
3434
* @var int
3535
*/
36-
private $visibility;
36+
private int $visibility;
3737

3838
/** @var bool */
39-
private $typed = false;
39+
private bool $typed = false;
4040

4141
/**
4242
* @var string|null
4343
*/
44-
private $docBlockComment;
44+
private ?string $docBlockComment = null;
4545

4646
/**
4747
* @var string|null
4848
*/
49-
private $typeDocBlockHint;
49+
private ?string $typeDocBlockHint = null;
5050

5151
/**
5252
* @var DocBlock|null
5353
*/
54-
private $docBlock;
54+
private ?DocBlock $docBlock = null;
5555

5656
private function __construct()
5757
{
@@ -114,7 +114,7 @@ public function getName(): string
114114
return $this->name;
115115
}
116116

117-
public function getType(): string
117+
public function getType(): ?string
118118
{
119119
return $this->type;
120120
}

src/Builder/FileCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class FileCollection implements Iterator, Countable
1818
/**
1919
* @var array<string, File>
2020
*/
21-
private $items;
21+
private array $items;
2222

2323
public static function fromItems(File ...$files): self
2424
{

src/Builder/InterfaceBuilder.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@
2424
final class InterfaceBuilder implements File
2525
{
2626
/** @var string|null */
27-
private $namespace;
27+
private ?string $namespace = null;
2828

2929
/** @var string|null */
30-
private $name;
30+
private ?string $name = null;
3131

3232
/** @var bool */
33-
private $strict = false;
33+
private bool $strict = false;
3434

3535
/** @var bool */
36-
private $typed = false;
36+
private bool $typed = false;
3737

3838
/** @var string[] */
39-
private $extends = [];
39+
private array $extends = [];
4040

4141
/** @var string[] */
42-
private $namespaceImports = [];
42+
private array $namespaceImports = [];
4343

4444
/** @var ClassConstBuilder[] */
45-
private $constants = [];
45+
private array $constants = [];
4646

4747
/** @var ClassMethodBuilder[] */
48-
private $methods = [];
48+
private array $methods = [];
4949

5050
private function __construct()
5151
{

src/Builder/ParameterBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
final class ParameterBuilder
1717
{
1818
/** @var string */
19-
private $name;
19+
private string $name;
2020

2121
/** @var string|null */
22-
private $type;
22+
private ?string $type = null;
2323

2424
/**
2525
* @var mixed
@@ -29,17 +29,17 @@ final class ParameterBuilder
2929
/**
3030
* @var bool
3131
*/
32-
private $passedByReference = false;
32+
private bool $passedByReference = false;
3333

3434
/**
3535
* @var bool
3636
*/
37-
private $variadic = false;
37+
private bool $variadic = false;
3838

3939
/**
4040
* @var string|null
4141
*/
42-
private $typeDocBlockHint;
42+
private ?string $typeDocBlockHint = null;
4343

4444
private function __construct()
4545
{

src/Code/AbstractMemberGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ abstract class AbstractMemberGenerator implements StatementGenerator
4444
/**
4545
* @var string
4646
*/
47-
protected $name;
47+
protected string $name;
4848

4949
/**
5050
* @var int
5151
*/
52-
protected $flags = self::FLAG_PUBLIC;
52+
protected int $flags = self::FLAG_PUBLIC;
5353

5454
/**
5555
* @param int|array $flags

src/Code/BodyGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ final class BodyGenerator implements StatementGenerator
1717
/**
1818
* @var Parser
1919
**/
20-
private $parser;
20+
private Parser $parser;
2121

2222
/**
2323
* @var string
2424
*/
25-
private $code;
25+
private string $code;
2626

2727
public function __construct(Parser $parser, string $code)
2828
{

src/Code/ClassConstGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class ClassConstGenerator extends AbstractMemberGenerator
1717
/**
1818
* @var ValueGenerator
1919
*/
20-
private $value;
20+
private ValueGenerator $value;
2121

2222
/**
2323
* @param string $name

src/Code/ClassGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ final class ClassGenerator implements StatementGenerator
2828
/**
2929
* @var string
3030
*/
31-
private $name;
31+
private string $name;
3232

3333
/**
3434
* @var int
3535
*/
36-
private $flags = 0;
36+
private int $flags = 0;
3737

3838
/**
3939
* @param string|null $name

src/Code/DocBlock/DocBlock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ final class DocBlock
1717
/**
1818
* @var string
1919
*/
20-
protected $comment;
20+
protected ?string $comment = null;
2121

2222
/**
2323
* @var Tag[]
2424
*/
25-
protected $tags;
25+
protected array $tags;
2626

2727
public function __construct(?string $comment, Tag ...$tags)
2828
{

src/Code/DocBlock/Tag/AbstractTypeableTag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ abstract class AbstractTypeableTag implements Tag
2929
/**
3030
* @var string
3131
*/
32-
protected $description;
32+
protected ?string $description = null;
3333

3434
/**
3535
* @var array
3636
*/
37-
protected $types = [];
37+
protected array $types = [];
3838

3939
/**
4040
* @param string|string[] $types

0 commit comments

Comments
 (0)