Skip to content

Commit 9304fd0

Browse files
Merge pull request #19 from php-strictus/phpstan
PHPStan Integration
2 parents aaac675 + f3970bc commit 9304fd0

13 files changed

+87
-60
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ jobs:
2929
- name: Code Style 👨‍🏭
3030
run: composer test:lint
3131

32+
- name: Static Analysis 🔍
33+
run: composer test:stan
34+
3235
- name: Pest Tests 🧫
3336
run: composer test:unit

composer.json

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,71 @@
11
{
2-
"name": "strictus/strictus",
3-
"description": "Strict Typing for local variables in PHP",
4-
"type": "library",
5-
"keywords": ["php", "type", "typing", "strict", "strict types", "strict typing"],
6-
"license": "MIT",
7-
"authors": [
8-
{
9-
"name": "Christopher Miller",
10-
"email": "[email protected]",
11-
"role": "Developer"
12-
},
13-
{
14-
"name": "Wendell Adriel",
15-
"email": "[email protected]",
16-
"role": "Developer"
17-
}
18-
],
19-
"autoload": {
20-
"psr-4": {
21-
"Strictus\\": "src"
22-
}
23-
},
24-
"autoload-dev": {
25-
"psr-4": {
26-
"Strictus\\Tests\\": "tests"
27-
}
28-
},
29-
"require": {
30-
"php": "^8.1"
31-
},
32-
"scripts": {
33-
"lint": ["pint"],
34-
"test:lint": ["pint --test"],
35-
"test:unit": ["pest --order-by random"],
36-
"test": [
37-
"@test:lint",
38-
"@test:unit"
39-
]
40-
},
41-
"require-dev": {
42-
"laravel/pint": "^1.10.1",
43-
"pestphp/pest": "^1.23.0"
2+
"name": "strictus/strictus",
3+
"description": "Strict Typing for local variables in PHP",
4+
"type": "library",
5+
"keywords": [
6+
"php",
7+
"type",
8+
"typing",
9+
"strict",
10+
"strict types",
11+
"strict typing"
12+
],
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Christopher Miller",
17+
"email": "[email protected]",
18+
"role": "Developer"
4419
},
45-
"config": {
46-
"sort-packages": true,
47-
"allow-plugins": {
48-
"pestphp/pest-plugin": true
49-
}
50-
},
51-
"minimum-stability": "dev",
52-
"prefer-stable": true
20+
{
21+
"name": "Wendell Adriel",
22+
"email": "[email protected]",
23+
"role": "Developer"
24+
}
25+
],
26+
"autoload": {
27+
"psr-4": {
28+
"Strictus\\": "src"
29+
}
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"Strictus\\Tests\\": "tests"
34+
}
35+
},
36+
"require": {
37+
"php": "^8.1"
38+
},
39+
"scripts": {
40+
"lint": [
41+
"pint"
42+
],
43+
"test:lint": [
44+
"pint --test"
45+
],
46+
"test:stan": [
47+
"phpstan analyse"
48+
],
49+
"test:unit": [
50+
"pest --order-by random"
51+
],
52+
"test": [
53+
"@test:lint",
54+
"@test:stan",
55+
"@test:unit"
56+
]
57+
},
58+
"require-dev": {
59+
"laravel/pint": "^1.10.1",
60+
"pestphp/pest": "^1.23.0",
61+
"phpstan/phpstan": "^1.10"
62+
},
63+
"config": {
64+
"sort-packages": true,
65+
"allow-plugins": {
66+
"pestphp/pest-plugin": true
67+
}
68+
},
69+
"minimum-stability": "dev",
70+
"prefer-stable": true
5371
}

phpstan.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
3+
level: 9
4+
5+
paths:
6+
- src/

src/Traits/Immutable.php renamed to src/Concerns/Immutable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Strictus\Traits;
5+
namespace Strictus\Concerns;
66

77
/**
88
* @internal

src/Traits/StrictusTyping.php renamed to src/Concerns/StrictusTyping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Strictus\Traits;
5+
namespace Strictus\Concerns;
66

77
use Strictus\Exceptions\ImmutableStrictusException;
88
use Strictus\Exceptions\StrictusTypeException;

src/Types/StrictusArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Interfaces\StrictusTypeInterface;
8-
use Strictus\Traits\StrictusTyping;
99

1010
/**
1111
* @internal

src/Types/StrictusBoolean.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Interfaces\StrictusTypeInterface;
8-
use Strictus\Traits\StrictusTyping;
99

1010
/**
1111
* @internal

src/Types/StrictusEnum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Exceptions\StrictusTypeException;
89
use Strictus\Interfaces\StrictusTypeInterface;
9-
use Strictus\Traits\StrictusTyping;
1010

1111
/**
1212
* @internal

src/Types/StrictusFloat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Interfaces\StrictusTypeInterface;
8-
use Strictus\Traits\StrictusTyping;
99

1010
/**
1111
* @internal

src/Types/StrictusInstance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Exceptions\StrictusTypeException;
89
use Strictus\Interfaces\StrictusTypeInterface;
9-
use Strictus\Traits\StrictusTyping;
1010

1111
/**
1212
* @internal

src/Types/StrictusInteger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Interfaces\StrictusTypeInterface;
8-
use Strictus\Traits\StrictusTyping;
99

1010
/**
1111
* @internal

src/Types/StrictusObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Interfaces\StrictusTypeInterface;
8-
use Strictus\Traits\StrictusTyping;
99

1010
/**
1111
* @internal

src/Types/StrictusString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Strictus\Types;
66

7+
use Strictus\Concerns\StrictusTyping;
78
use Strictus\Interfaces\StrictusTypeInterface;
8-
use Strictus\Traits\StrictusTyping;
99

1010
/**
1111
* @internal

0 commit comments

Comments
 (0)