Skip to content

Commit 82848be

Browse files
Narrow types
1 parent 59365e9 commit 82848be

18 files changed

Lines changed: 198 additions & 4 deletions

src/Framework/Attributes/After.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#[Attribute(Attribute::TARGET_METHOD)]
2020
final readonly class After
2121
{
22+
/**
23+
* @var non-negative-int
24+
*/
2225
private int $priority;
2326

27+
/**
28+
* @param non-negative-int $priority
29+
*/
2430
public function __construct(int $priority = 0)
2531
{
2632
$this->priority = $priority;
2733
}
2834

35+
/**
36+
* @return non-negative-int
37+
*/
2938
public function priority(): int
3039
{
3140
return $this->priority;

src/Framework/Attributes/AfterClass.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#[Attribute(Attribute::TARGET_METHOD)]
2020
final readonly class AfterClass
2121
{
22+
/**
23+
* @var non-negative-int
24+
*/
2225
private int $priority;
2326

27+
/**
28+
* @param non-negative-int $priority
29+
*/
2430
public function __construct(int $priority = 0)
2531
{
2632
$this->priority = $priority;
2733
}
2834

35+
/**
36+
* @return non-negative-int
37+
*/
2938
public function priority(): int
3039
{
3140
return $this->priority;

src/Framework/Attributes/Before.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#[Attribute(Attribute::TARGET_METHOD)]
2020
final readonly class Before
2121
{
22+
/**
23+
* @var non-negative-int
24+
*/
2225
private int $priority;
2326

27+
/**
28+
* @param non-negative-int $priority
29+
*/
2430
public function __construct(int $priority = 0)
2531
{
2632
$this->priority = $priority;
2733
}
2834

35+
/**
36+
* @return non-negative-int
37+
*/
2938
public function priority(): int
3039
{
3140
return $this->priority;

src/Framework/Attributes/BeforeClass.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#[Attribute(Attribute::TARGET_METHOD)]
2020
final readonly class BeforeClass
2121
{
22+
/**
23+
* @var non-negative-int
24+
*/
2225
private int $priority;
2326

27+
/**
28+
* @param non-negative-int $priority
29+
*/
2430
public function __construct(int $priority = 0)
2531
{
2632
$this->priority = $priority;
2733
}
2834

35+
/**
36+
* @return non-negative-int
37+
*/
2938
public function priority(): int
3039
{
3140
return $this->priority;

src/Framework/Attributes/PostCondition.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#[Attribute(Attribute::TARGET_METHOD)]
2020
final readonly class PostCondition
2121
{
22+
/**
23+
* @var non-negative-int
24+
*/
2225
private int $priority;
2326

27+
/**
28+
* @param non-negative-int $priority
29+
*/
2430
public function __construct(int $priority = 0)
2531
{
2632
$this->priority = $priority;
2733
}
2834

35+
/**
36+
* @return non-negative-int
37+
*/
2938
public function priority(): int
3039
{
3140
return $this->priority;

src/Framework/Attributes/PreCondition.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#[Attribute(Attribute::TARGET_METHOD)]
2020
final readonly class PreCondition
2121
{
22+
/**
23+
* @var non-negative-int
24+
*/
2225
private int $priority;
2326

27+
/**
28+
* @param non-negative-int $priority
29+
*/
2430
public function __construct(int $priority = 0)
2531
{
2632
$this->priority = $priority;
2733
}
2834

35+
/**
36+
* @return non-negative-int
37+
*/
2938
public function priority(): int
3039
{
3140
return $this->priority;

src/Framework/Attributes/RequiresEnvironmentVariable.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,37 @@
1919
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
2020
final readonly class RequiresEnvironmentVariable
2121
{
22+
/**
23+
* @var non-empty-string
24+
*/
2225
private string $environmentVariableName;
26+
27+
/**
28+
* @var ?non-empty-string
29+
*/
2330
private null|string $value;
2431

32+
/**
33+
* @param non-empty-string $environmentVariableName
34+
* @param ?non-empty-string $value
35+
*/
2536
public function __construct(string $environmentVariableName, null|string $value = null)
2637
{
2738
$this->environmentVariableName = $environmentVariableName;
2839
$this->value = $value;
2940
}
3041

42+
/**
43+
* @return non-empty-string
44+
*/
3145
public function environmentVariableName(): string
3246
{
3347
return $this->environmentVariableName;
3448
}
3549

50+
/**
51+
* @return ?non-empty-string
52+
*/
3653
public function value(): null|string
3754
{
3855
return $this->value;

src/Framework/Attributes/WithEnvironmentVariable.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@
2323
* @var non-empty-string
2424
*/
2525
private string $environmentVariableName;
26+
27+
/**
28+
* @var ?non-empty-string
29+
*/
2630
private null|string $value;
2731

2832
/**
29-
* @param non-empty-string $environmentVariableName
33+
* @param non-empty-string $environmentVariableName
34+
* @param ?non-empty-string $value
3035
*/
3136
public function __construct(string $environmentVariableName, null|string $value = null)
3237
{
@@ -42,6 +47,9 @@ public function environmentVariableName(): string
4247
return $this->environmentVariableName;
4348
}
4449

50+
/**
51+
* @return ?non-empty-string
52+
*/
4553
public function value(): null|string
4654
{
4755
return $this->value;

src/Metadata/After.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616
*/
1717
final readonly class After extends Metadata
1818
{
19+
/**
20+
* @var non-negative-int
21+
*/
1922
private int $priority;
2023

24+
/**
25+
* @param non-negative-int $priority
26+
*/
2127
protected function __construct(Level $level, int $priority)
2228
{
2329
parent::__construct($level);
@@ -30,6 +36,9 @@ public function isAfter(): true
3036
return true;
3137
}
3238

39+
/**
40+
* @return non-negative-int
41+
*/
3342
public function priority(): int
3443
{
3544
return $this->priority;

src/Metadata/AfterClass.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616
*/
1717
final readonly class AfterClass extends Metadata
1818
{
19+
/**
20+
* @var non-negative-int
21+
*/
1922
private int $priority;
2023

24+
/**
25+
* @param non-negative-int $priority
26+
*/
2127
protected function __construct(Level $level, int $priority)
2228
{
2329
parent::__construct($level);
@@ -30,6 +36,9 @@ public function isAfterClass(): true
3036
return true;
3137
}
3238

39+
/**
40+
* @return non-negative-int
41+
*/
3342
public function priority(): int
3443
{
3544
return $this->priority;

0 commit comments

Comments
 (0)