File tree 11 files changed +51
-14
lines changed
11 files changed +51
-14
lines changed Original file line number Diff line number Diff line change 1
- /vendor /
2
- /. * /
3
- /composer.lock
1
+ /vendor /
2
+ /. * /
3
+ /composer.lock
4
+ /* .log
Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ cache:
23
23
- vendor
24
24
25
25
install :
26
- - alias composer=composer\ -n && composer selfupdate
27
26
- composer validate
28
- - composer update $DEPENDENCIES
27
+ - composer --no-interaction update $DEPENDENCIES
29
28
30
29
script :
31
- - composer test -- --coverage-clover=build/logs/clover.xml
30
+ - composer test -- --coverage-clover=build/logs/clover.xml --coverage-xml=build/coverage/coverage-xml
31
+ --log-junit=build/coverage/phpunit.junit.xml
32
+ - vendor/bin/infection --min-msi=95 --threads=$(nproc) --coverage=build/coverage
32
33
33
34
after_success :
34
35
- bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Porter <img src="https://github.com/ScriptFUSION/Porter/wiki/images/porter%20222
4
4
[ ![ Latest version] [ Version image ]] [ Releases ]
5
5
[ ![ Total downloads] [ Downloads image ]] [ Downloads ]
6
6
[ ![ Build status] [ Build image ]] [ Build ]
7
+ [ ![ Mutation score] [ MSI image ]] [ Build ]
7
8
[ ![ Test coverage] [ Coverage image ]] [ Coverage ]
8
9
[ ![ Code style] [ Style image ]] [ Style ]
9
10
@@ -580,6 +581,7 @@ Porter is published under the open source GNU Lesser General Public License v3.0
580
581
[ Downloads image ] : https://poser.pugx.org/scriptfusion/porter/downloads " Total downloads "
581
582
[ Build ] : http://travis-ci.org/ScriptFUSION/Porter
582
583
[ Build image ] : https://travis-ci.org/ScriptFUSION/Porter.svg?branch=master " Build status "
584
+ [ MSI image ] : https://badge.stryker-mutator.io/github.com/ScriptFUSION/Porter/master
583
585
[ Coverage ] : https://codecov.io/gh/ScriptFUSION/Porter
584
586
[ Coverage image ] : https://codecov.io/gh/ScriptFUSION/Porter/branch/master/graphs/badge.svg " Test coverage "
585
587
[ Style ] : https://styleci.io/repos/49824895
Original file line number Diff line number Diff line change 19
19
},
20
20
"require-dev" : {
21
21
"amphp/phpunit-util" : " ^1.1" ,
22
- "phpunit/phpunit" : " ^7.1.3" ,
23
- "mockery/mockery" : " ^1.1"
22
+ "infection/infection" : " ^0.13" ,
23
+ "mockery/mockery" : " ^1.1" ,
24
+ "phpunit/phpunit" : " ^7.1.3"
24
25
},
25
26
"suggest" : {
26
27
"connectors/http" : " Provides an HTTP connector for Porter providers." ,
38
39
},
39
40
"scripts" : {
40
41
"test" : " phpunit -c test"
42
+ },
43
+ "config" : {
44
+ "sort-packages" : true
41
45
}
42
46
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "timeout" : 10 ,
3
+ "source" : {
4
+ "directories" : [
5
+ " src"
6
+ ]
7
+ },
8
+ "phpUnit" : {
9
+ "configDir" : " test"
10
+ },
11
+ "logs" : {
12
+ "text" : " infection.log" ,
13
+ "badge" : {
14
+ "branch" : " 5.0"
15
+ }
16
+ },
17
+ "mutators" : {
18
+ "@default" : true
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public function importOne(ImportSpecification $specification): ?array
104
104
private function fetch (ImportSpecification $ specification ): \Iterator
105
105
{
106
106
$ resource = $ specification ->getResource ();
107
- $ provider = $ this ->getProvider ($ specification ->getProviderName () ?: $ resource ->getProviderClassName ());
107
+ $ provider = $ this ->getProvider ($ specification ->getProviderName () ?? $ resource ->getProviderClassName ());
108
108
109
109
if ($ resource ->getProviderClassName () !== \get_class ($ provider )) {
110
110
throw new ForeignResourceException (sprintf (
@@ -175,7 +175,7 @@ public function importOneAsync(AsyncImportSpecification $specification): Promise
175
175
private function fetchAsync (AsyncImportSpecification $ specification ): Iterator
176
176
{
177
177
$ resource = $ specification ->getAsyncResource ();
178
- $ provider = $ this ->getProvider ($ specification ->getProviderName () ?: $ resource ->getProviderClassName ());
178
+ $ provider = $ this ->getProvider ($ specification ->getProviderName () ?? $ resource ->getProviderClassName ());
179
179
180
180
if (!$ provider instanceof AsyncProvider) {
181
181
// TODO: Specific exception type.
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ final public function getTransformers(): array
102
102
*
103
103
* @return $this
104
104
*/
105
- public function addTransformer (AnysyncTransformer $ transformer ): self
105
+ protected function addTransformer (AnysyncTransformer $ transformer ): self
106
106
{
107
107
if ($ this ->hasTransformer ($ transformer )) {
108
108
throw new DuplicateTransformerException ('Transformer already added. ' );
Original file line number Diff line number Diff line change 5
5
6
6
use ScriptFUSION \Porter \Collection \AsyncRecordCollection ;
7
7
8
+ /**
9
+ * Provides a method to asynchronously transform imported data.
10
+ */
8
11
interface AsyncTransformer extends AnysyncTransformer
9
12
{
13
+ /**
14
+ * Transforms the specified asynchronous record collection, decorated with the specified context data.
15
+ *
16
+ * @param AsyncRecordCollection $records Asynchronous Record collection.
17
+ * @param mixed $context Context data.
18
+ */
10
19
public function transformAsync (AsyncRecordCollection $ records , $ context ): AsyncRecordCollection ;
11
20
}
Original file line number Diff line number Diff line change 11
11
interface Transformer extends AnysyncTransformer
12
12
{
13
13
/**
14
- * Transforms the specified record collection decorated with the specified context data.
14
+ * Transforms the specified record collection, decorated with the specified context data.
15
15
*
16
16
* @param RecordCollection $records Record collection.
17
17
* @param mixed $context Context data.
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ protected function setUp(): void
66
66
67
67
protected function registerProvider (Provider $ provider , string $ name = null ): void
68
68
{
69
- $ name = $ name ?: \get_class ($ provider );
69
+ $ name = $ name ?? \get_class ($ provider );
70
70
71
71
$ this ->container
72
72
->shouldReceive ('has ' )->with ($ name )->andReturn (true )
Original file line number Diff line number Diff line change 1
1
<phpunit
2
2
beStrictAboutOutputDuringTests =" true"
3
3
>
4
- <testsuite >
4
+ <testsuite name = " all " >
5
5
<directory >.</directory >
6
6
</testsuite >
7
7
<filter >
You can’t perform that action at this time.
0 commit comments