Skip to content

Commit d1547a2

Browse files
committed
Prepare to monorepo
1 parent f03a262 commit d1547a2

15 files changed

Lines changed: 130 additions & 238 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ vendor/
1212
# php-cs-fixer
1313
.php-cs-fixer.cache
1414
.php-cs-fixer.php
15+
16+
# phpunit
17+
.phpunit.result.cache

.php-cs-fixer.dist.php

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,54 @@
1010
*/
1111

1212
$finder = PhpCsFixer\Finder::create()
13-
->name('*.php')
14-
->ignoreDotFiles(TRUE)
15-
->ignoreVCS(TRUE);
13+
->in(__DIR__ . '/packages')
14+
->append([__FILE__])
15+
->name('*.php')
16+
->ignoreDotFiles(true)
17+
->ignoreVCS(true);
1618

1719
$config = new PhpCsFixer\Config();
1820
$config->setFinder($finder)
19-
->setRules([
20-
'@PSR12' => TRUE,
21-
'array_syntax' => ['syntax' => 'short'],
22-
'ordered_imports' => ['sort_algorithm' => 'alpha'],
23-
'no_unused_imports' => TRUE,
24-
'not_operator_with_successor_space' => TRUE,
25-
'trailing_comma_in_multiline' => TRUE,
26-
'phpdoc_scalar' => TRUE,
27-
'unary_operator_spaces' => TRUE,
28-
'binary_operator_spaces' => TRUE,
29-
'blank_line_before_statement' => [
30-
'statements' => [
31-
'break',
32-
'continue',
33-
'declare',
34-
'return',
35-
'throw',
36-
'try',
37-
],
38-
],
39-
'phpdoc_single_line_var_spacing' => TRUE,
40-
'phpdoc_var_without_name' => TRUE,
41-
'class_attributes_separation' => [
42-
'elements' => [
43-
'method' => 'one',
44-
],
45-
],
46-
'braces' => [
47-
'allow_single_line_closure' => TRUE,
48-
'position_after_anonymous_constructs' => 'same',
49-
'position_after_functions_and_oop_constructs' => 'next',
50-
'position_after_control_structures' => 'same',
51-
],
52-
'method_argument_space' => [
53-
'on_multiline' => 'ensure_fully_multiline',
54-
'keep_multiple_spaces_after_comma' => TRUE,
55-
],
56-
'single_trait_insert_per_statement' => TRUE,
57-
]);
21+
->setRules(
22+
[
23+
'@PSR12' => true,
24+
'array_syntax' => ['syntax' => 'short'],
25+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
26+
'no_unused_imports' => true,
27+
'not_operator_with_successor_space' => true,
28+
'trailing_comma_in_multiline' => true,
29+
'phpdoc_scalar' => true,
30+
'unary_operator_spaces' => true,
31+
'binary_operator_spaces' => true,
32+
'blank_line_before_statement' => [
33+
'statements' => [
34+
'break',
35+
'continue',
36+
'declare',
37+
'return',
38+
'throw',
39+
'try',
40+
],
41+
],
42+
'phpdoc_single_line_var_spacing' => true,
43+
'phpdoc_var_without_name' => true,
44+
'class_attributes_separation' => [
45+
'elements' => [
46+
'method' => 'one',
47+
],
48+
],
49+
'braces' => [
50+
'allow_single_line_closure' => true,
51+
'position_after_anonymous_constructs' => 'same',
52+
'position_after_functions_and_oop_constructs' => 'next',
53+
'position_after_control_structures' => 'same',
54+
],
55+
'method_argument_space' => [
56+
'on_multiline' => 'ensure_fully_multiline',
57+
'keep_multiple_spaces_after_comma' => true,
58+
],
59+
'single_trait_insert_per_statement' => true,
60+
]
61+
);
5862

5963
return $config;

app/bootstrap.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

composer.json

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
11
{
2-
"name": "aether/aether",
3-
"license": "MIT",
4-
"type": "project",
5-
"support": {
6-
"issues": "https://github.com/sxbrsky/aether/issues",
7-
"source": "https://github.com/sxbrsky/aether"
8-
},
9-
"require": {
10-
"php": ">=8.2",
11-
"symfony/http-foundation": "^7.1"
12-
},
13-
"require-dev": {
14-
"friendsofphp/php-cs-fixer": "^3.64",
15-
"phpstan/phpstan": "^1.12",
16-
"phpunit/phpunit": "^11.3"
17-
},
18-
"minimum-stability": "dev",
19-
"prefer-stable": true,
20-
"autoload": {
21-
"psr-4": {
22-
"Aether\\Framework\\": "system/Framework/"
23-
}
24-
},
25-
"autoload-dev": {
26-
"psr-4": {
27-
"Aether\\Tests\\PHPStan\\": "dev/phpstan/",
28-
"Aether\\Tests\\Unit\\": "dev/tests/unit/"
29-
}
30-
},
31-
"config": {
32-
"platform": {
33-
"php": "8.3.0"
2+
"name": "aether/aether",
3+
"description": "The component framework.",
4+
"license": "MIT",
5+
"type": "library",
6+
"support": {
7+
"issues": "https://github.com/sxbrsky/aether/issues",
8+
"source": "https://github.com/sxbrsky/aether"
9+
},
10+
"require": {
11+
"php": "^8.2",
12+
"psr/clock": "^1.0"
13+
},
14+
"require-dev": {
15+
"friendsofphp/php-cs-fixer": "^3.64",
16+
"phpstan/phpstan": "^1.12",
17+
"phpstan/phpstan-strict-rules": "^1.6",
18+
"phpunit/phpunit": "^11.3",
19+
"symplify/monorepo-builder": "^11.2"
20+
},
21+
"replace": {
22+
"aether/clock": "self.version"
3423
},
35-
"preferred-install": "dist",
36-
"sort-packages": true
37-
}
24+
"provide": {
25+
"psr/clock-implementation": "*"
26+
},
27+
"minimum-stability": "dev",
28+
"prefer-stable": true,
29+
"autoload": {
30+
"psr-4": {
31+
"Aether\\Clock\\": "packages/Clock/src/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"Aether\\Tests\\Clock\\": "packages/Clock/tests/"
37+
}
38+
},
39+
"config": {
40+
"platform": {
41+
"php": "8.3.0"
42+
},
43+
"preferred-install": "dist",
44+
"sort-packages": true
45+
}
3846
}

dev/phpstan/phpstan.neon.dist

Lines changed: 0 additions & 13 deletions
This file was deleted.

dev/tests/bootstrap.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

dev/tests/unit/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

monorepo-builder.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symplify\MonorepoBuilder\Config\MBConfig;
6+
7+
return static function (MBConfig $mbConfig): void {
8+
$mbConfig->packageDirectories([__DIR__ . '/packages']);
9+
$mbConfig->packageAliasFormat('<major>.<minor>.x-dev');
10+
};

phpstan-baseline.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
ignoreErrors:

phpstan.neon

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
includes:
2+
- vendor/phpstan/phpstan-strict-rules/rules.neon
3+
- phpstan-baseline.neon
4+
5+
parameters:
6+
level: 9
7+
8+
paths:
9+
- packages/
10+
11+
excludePaths:
12+
- */vendor/
13+
14+
checkImplicitMixed: true
15+
checkBenevolentUnionTypes: true
16+
treatPhpDocTypesAsCertain: false

0 commit comments

Comments
 (0)