File tree 7 files changed +946
-348
lines changed
7 files changed +946
-348
lines changed Original file line number Diff line number Diff line change 5
5
runs-on : ubuntu-latest
6
6
steps :
7
7
- uses : actions/checkout@v3
8
+ - uses : shivammathur/setup-php@v2
9
+ with :
10
+ php-version : ' 8.2'
11
+ tools : composer:v2
12
+ coverage : pcov
8
13
- uses : php-actions/composer@v6
9
14
with :
10
15
args : --prefer-dist
Original file line number Diff line number Diff line change 22
22
"symfony/expression-language" : " ^6.0" ,
23
23
"symfony/cache" : " ^6.0" ,
24
24
"doctrine/inflector" : " ^2.0" ,
25
- "php-etl/metadata" : " ^0.4.0 " ,
26
- "php-etl/mapping-contracts" : " ^ 0.4.0" ,
27
- "php-etl/metadata-contracts" : " ^ 0.2.0" ,
28
- "php-etl/satellite-toolbox" : " ^0.5.0 "
25
+ "php-etl/metadata" : " * " ,
26
+ "php-etl/mapping-contracts" : " 0.4.0" ,
27
+ "php-etl/metadata-contracts" : " 0.2.0" ,
28
+ "php-etl/satellite-toolbox" : " * "
29
29
},
30
30
"require-dev" : {
31
31
"mikey179/vfsstream" : " ^1.6" ,
32
32
"phpunit/phpunit" : " ^10.0" ,
33
33
"phpunit/php-invoker" : " *" ,
34
34
"friendsofphp/php-cs-fixer" : " ^3.0" ,
35
35
"phpstan/phpstan" : " ^1.10" ,
36
- "rector/rector" : " ^0.15"
36
+ "rector/rector" : " ^0.15" ,
37
+ "php-etl/phpspec-extension" : " 0.4.0"
37
38
},
38
39
"autoload" : {
39
40
"psr-4" : {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 13
13
use Kiboko \Contract \Mapping \Compiler \Strategy \StrategyInterface ;
14
14
use Kiboko \Contract \Mapping \MapperInterface ;
15
15
use org \bovigo \vfs \vfsStream ;
16
+ use org \bovigo \vfs \vfsStreamFile ;
16
17
use PhpParser \PrettyPrinter ;
17
18
18
19
class Compiler
@@ -56,13 +57,13 @@ public function compile(
56
57
include_once $ context ->getFilePath ();
57
58
}
58
59
} else {
59
- if (!\in_array ('vfs ' , stream_get_wrappers ())) {
60
- $ fs = vfsStream::setup ();
61
- }
60
+ $ fs = vfsStream::setup ();
62
61
63
- $ filename = 'vfs:// ' .hash ('sha512 ' , random_bytes (512 )).'.php ' ;
64
- file_put_contents ($ filename , $ prettyPrinter ->prettyPrintFile ($ tree ));
65
- include_once $ filename ;
62
+ $ filename = hash ('sha512 ' , random_bytes (512 )).'.php ' ;
63
+ $ file = new vfsStreamFile ($ filename );
64
+ $ file ->setContent ($ prettyPrinter ->prettyPrintFile ($ tree ));
65
+ $ fs ->addChild ($ file );
66
+ include_once vfsStream::url ('root/ ' .$ filename );
66
67
}
67
68
68
69
return new $ fqcn ();
Original file line number Diff line number Diff line change 17
17
18
18
public function __construct (
19
19
private PropertyPathInterface $ path ,
20
- private Mapping \FieldMapperInterface $ child
20
+ private Mapping \CompilableMapperInterface & Mapping \ FieldMapperInterface $ child
21
21
) {
22
22
$ this ->accessor = PropertyAccess::createPropertyAccessor ();
23
23
}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public function __construct(
24
24
private PropertyPathInterface $ outputPath ,
25
25
private readonly ExpressionLanguage $ interpreter ,
26
26
private readonly Expression $ inputExpression ,
27
- private readonly Mapping \ArrayMapperInterface $ child
27
+ private readonly Mapping \CompilableMapperInterface & Mapping \ ArrayMapperInterface $ child
28
28
) {
29
29
$ this ->accessor = PropertyAccess::createPropertyAccessor ();
30
30
}
You can’t perform that action at this time.
0 commit comments