Skip to content

Commit 6890689

Browse files
committed
fix class name for alias, upgrade phpunit config, force files launching in composer and cs-fixer
1 parent 2123011 commit 6890689

20 files changed

+454
-479
lines changed

.github/workflows/quality.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
run: |
1414
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1515
chmod a+x php-cs-fixer
16-
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
16+
./php-cs-fixer fix src --dry-run
1717
1818
phpstan:
1919
runs-on: ubuntu-latest

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"php-etl/phpspec-extension": "*"
3838
},
3939
"autoload": {
40+
"files": ["src/Compiler/Builder/PropertyPathBuilder.php"],
4041
"psr-4": {
4142
"Kiboko\\Component\\FastMap\\": "src/"
4243
}

composer.lock

+425-438
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
55
backupGlobals="true"
66
colors="false"
77
processIsolation="false"
@@ -21,12 +21,13 @@
2121
<directory>functional/</directory>
2222
</testsuite>
2323
</testsuites>
24-
<coverage>
24+
<coverage/>
25+
<php>
26+
<ini name="allow_url_include" value="1"/>
27+
</php>
28+
<source>
2529
<include>
2630
<directory suffix=".php">src</directory>
2731
</include>
28-
</coverage>
29-
<php>
30-
<ini name="allow_url_include" value="1" />
31-
</php>
32+
</source>
3233
</phpunit>

src/Compiler/Builder/ArrayInitialisationPreconditionBuilder.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
public function __construct(
1414
private PropertyPath $propertyPath,
1515
private Node\Expr $pathNode
16-
) {
17-
}
16+
) {}
1817

1918
public function getNode(): Node
2019
{

src/Compiler/Builder/CompositeInitialisationPreconditionBuilder.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public function __construct(
1616
private TypeMetadataInterface $metadata,
1717
private PropertyPath $propertyPath,
1818
private Node\Expr $pathNode
19-
) {
20-
}
19+
) {}
2120

2221
public function getNode(): Node
2322
{

src/Compiler/Builder/ConstantValueBuilder.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
final readonly class ConstantValueBuilder implements Builder
1111
{
12-
public function __construct(private mixed $value)
13-
{
14-
}
12+
public function __construct(private mixed $value) {}
1513

1614
public function getNode(): Node
1715
{

src/Compiler/Builder/ExpressionLanguageToPhpParserBuilder.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
/**
1616
* @param string[] $variables
1717
*/
18-
public function __construct(private ExpressionLanguage $interpreter, private Expression $expression, private array $variables = [])
19-
{
20-
}
18+
public function __construct(private ExpressionLanguage $interpreter, private Expression $expression, private array $variables = []) {}
2119

2220
public function getNode(): Node\Expr
2321
{

src/Compiler/Builder/ObjectInitialisationPreconditionBuilder.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public function __construct(
1515
private PropertyPath $propertyPath,
1616
private Node\Expr $pathNode,
1717
private ClassTypeMetadata $metadata
18-
) {
19-
}
18+
) {}
2019

2120
public function getNode(): Node
2221
{

src/Compiler/Builder/PropertyPathBuilder.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
namespace Kiboko\Component\FastMap\Compiler\Builder;
66

7-
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
8-
9-
trigger_deprecation('php-etl/fast-map', '0.5.2', 'The "%s" class is deprecated, use "%s" instead.', 'Kiboko\\Component\\FastMap\\Compiler\\Builder\\PropertyPathBuilder', PropertyPathBuilder::class);
7+
trigger_deprecation('php-etl/fast-map', '0.5', 'The "%s" class is deprecated, use "%s" instead.', 'Kiboko\\Component\\FastMap\\Compiler\\Builder\\PropertyPathBuilder', \Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder::class);
108

119
/*
12-
* @deprecated since FastMap 0.5.2, use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder instead.
10+
* @deprecated since FastMap 0.5, use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder instead.
1311
*/
14-
class_alias(PropertyPathBuilder::class, 'Kiboko\\Component\\FastMap\\Compiler\\Builder\\PropertyPathBuilder');
12+
class_alias(\Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder::class, 'Kiboko\\Component\\FastMap\\Compiler\\Builder\\PropertyPathBuilder');

src/Compiler/Builder/RequiredValuePreconditionBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Kiboko\Component\FastMap\Compiler\Builder;
66

7+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
78
use PhpParser\Builder;
89
use PhpParser\Node;
910
use Symfony\Component\PropertyAccess\PropertyPath;
@@ -13,8 +14,7 @@
1314
public function __construct(
1415
private PropertyPath $propertyPath,
1516
private Node\Expr $pathNode
16-
) {
17-
}
17+
) {}
1818

1919
public function getNode(): Node
2020
{

src/Compiler/Builder/ScopedCodeBuilder.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
/**
1313
* @param \PhpParser\Node\Stmt[] $stmts
1414
*/
15-
public function __construct(private Node\Expr $input, private Node\Expr $output, private array $stmts)
16-
{
17-
}
15+
public function __construct(private Node\Expr $input, private Node\Expr $output, private array $stmts) {}
1816

1917
public function getNode(): Node\Expr
2018
{

src/Compiler/StandardCompilationContext.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public function __construct(
1515
private PropertyPathInterface $propertyPath,
1616
private ?string $path = null,
1717
private ?ClassMetadataInterface $class = null
18-
) {
19-
}
18+
) {}
2019

2120
public static function build(PropertyPathInterface $propertyPath, string $cachePath, string $fqcn): self
2221
{

src/Compiler/Strategy/Spaghetti.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Kiboko\Component\FastMap\Compiler\Strategy;
66

7-
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
7+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
88
use Kiboko\Contract\Mapping\CompilableMapperInterface;
99
use Kiboko\Contract\Mapping\CompiledMapperInterface;
1010
use Kiboko\Contract\Mapping\Compiler\Strategy\StrategyInterface;

src/Mapping/Field.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Kiboko\Component\FastMap\Mapping;
66

7-
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
7+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
88
use Kiboko\Contract\Mapping;
99
use PhpParser\Node;
1010
use Symfony\Component\PropertyAccess\PropertyAccess;

src/Mapping/Field/ConcatCopyValuesMapper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Kiboko\Component\FastMap\Mapping\Field;
66

7-
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
87
use Kiboko\Component\FastMap\Compiler\Builder\RequiredValuePreconditionBuilder;
8+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
99
use Kiboko\Contract\Mapping;
1010
use PhpParser\BuilderFactory;
1111
use PhpParser\Node;

src/Mapping/Field/CopyValueMapper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Kiboko\Component\FastMap\Mapping\Field;
66

7-
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
87
use Kiboko\Component\FastMap\Compiler\Builder\RequiredValuePreconditionBuilder;
8+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
99
use Kiboko\Contract\Mapping;
1010
use PhpParser\Node;
1111
use Symfony\Component\PropertyAccess\PropertyAccess;

src/Mapping/ListField.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
namespace Kiboko\Component\FastMap\Mapping;
66

77
use Kiboko\Component\FastMap\Compiler\Builder\ExpressionLanguageToPhpParserBuilder;
8-
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
98
use Kiboko\Component\FastMap\Compiler\Builder\ScopedCodeBuilder;
109
use Kiboko\Component\FastMap\PropertyAccess\EmptyPropertyPath;
10+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
1111
use Kiboko\Contract\Mapping;
1212
use PhpParser\Node;
1313
use Symfony\Component\ExpressionLanguage\Expression;
@@ -24,7 +24,7 @@ public function __construct(
2424
private PropertyPathInterface $outputPath,
2525
private readonly ExpressionLanguage $interpreter,
2626
private readonly Expression $inputExpression,
27-
private readonly Mapping\CompilableMapperInterface&Mapping\ArrayMapperInterface $child
27+
private readonly Mapping\ArrayMapperInterface&Mapping\CompilableMapperInterface $child
2828
) {
2929
$this->accessor = PropertyAccess::createPropertyAccessor();
3030
}

src/Mapping/SingleRelation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Kiboko\Component\FastMap\Mapping;
66

7-
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
87
use Kiboko\Component\FastMap\PropertyAccess\EmptyPropertyPath;
8+
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
99
use Kiboko\Contract\Mapping;
1010
use PhpParser\Node;
1111
use Symfony\Component\ExpressionLanguage\Expression;

src/MappingIteration/PathMappingIterator.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
final readonly class PathMappingIterator implements \Iterator
1111
{
12-
public function __construct(private PropertyPathIteratorInterface $inner, private TypeMetadataInterface $metadata)
13-
{
14-
}
12+
public function __construct(private PropertyPathIteratorInterface $inner, private TypeMetadataInterface $metadata) {}
1513

1614
public function current(): mixed
1715
{

0 commit comments

Comments
 (0)