File tree Expand file tree Collapse file tree 11 files changed +51
-14
lines changed Expand file tree Collapse file tree 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:
2323 - vendor
2424
2525install :
26- - alias composer=composer\ -n && composer selfupdate
2726 - composer validate
28- - composer update $DEPENDENCIES
27+ - composer --no-interaction update $DEPENDENCIES
2928
3029script :
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
3233
3334after_success :
3435 - 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
44[ ![ Latest version] [ Version image ]] [ Releases ]
55[ ![ Total downloads] [ Downloads image ]] [ Downloads ]
66[ ![ Build status] [ Build image ]] [ Build ]
7+ [ ![ Mutation score] [ MSI image ]] [ Build ]
78[ ![ Test coverage] [ Coverage image ]] [ Coverage ]
89[ ![ Code style] [ Style image ]] [ Style ]
910
@@ -580,6 +581,7 @@ Porter is published under the open source GNU Lesser General Public License v3.0
580581 [ Downloads image ] : https://poser.pugx.org/scriptfusion/porter/downloads " Total downloads "
581582 [ Build ] : http://travis-ci.org/ScriptFUSION/Porter
582583 [ 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
583585 [ Coverage ] : https://codecov.io/gh/ScriptFUSION/Porter
584586 [ Coverage image ] : https://codecov.io/gh/ScriptFUSION/Porter/branch/master/graphs/badge.svg " Test coverage "
585587 [ Style ] : https://styleci.io/repos/49824895
Original file line number Diff line number Diff line change 1919 },
2020 "require-dev" : {
2121 "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"
2425 },
2526 "suggest" : {
2627 "connectors/http" : " Provides an HTTP connector for Porter providers." ,
3839 },
3940 "scripts" : {
4041 "test" : " phpunit -c test"
42+ },
43+ "config" : {
44+ "sort-packages" : true
4145 }
4246}
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
104104 private function fetch (ImportSpecification $ specification ): \Iterator
105105 {
106106 $ resource = $ specification ->getResource ();
107- $ provider = $ this ->getProvider ($ specification ->getProviderName () ?: $ resource ->getProviderClassName ());
107+ $ provider = $ this ->getProvider ($ specification ->getProviderName () ?? $ resource ->getProviderClassName ());
108108
109109 if ($ resource ->getProviderClassName () !== \get_class ($ provider )) {
110110 throw new ForeignResourceException (sprintf (
@@ -175,7 +175,7 @@ public function importOneAsync(AsyncImportSpecification $specification): Promise
175175 private function fetchAsync (AsyncImportSpecification $ specification ): Iterator
176176 {
177177 $ resource = $ specification ->getAsyncResource ();
178- $ provider = $ this ->getProvider ($ specification ->getProviderName () ?: $ resource ->getProviderClassName ());
178+ $ provider = $ this ->getProvider ($ specification ->getProviderName () ?? $ resource ->getProviderClassName ());
179179
180180 if (!$ provider instanceof AsyncProvider) {
181181 // TODO: Specific exception type.
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ final public function getTransformers(): array
102102 *
103103 * @return $this
104104 */
105- public function addTransformer (AnysyncTransformer $ transformer ): self
105+ protected function addTransformer (AnysyncTransformer $ transformer ): self
106106 {
107107 if ($ this ->hasTransformer ($ transformer )) {
108108 throw new DuplicateTransformerException ('Transformer already added. ' );
Original file line number Diff line number Diff line change 55
66use ScriptFUSION \Porter \Collection \AsyncRecordCollection ;
77
8+ /**
9+ * Provides a method to asynchronously transform imported data.
10+ */
811interface AsyncTransformer extends AnysyncTransformer
912{
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+ */
1019 public function transformAsync (AsyncRecordCollection $ records , $ context ): AsyncRecordCollection ;
1120}
Original file line number Diff line number Diff line change 1111interface Transformer extends AnysyncTransformer
1212{
1313 /**
14- * Transforms the specified record collection decorated with the specified context data.
14+ * Transforms the specified record collection, decorated with the specified context data.
1515 *
1616 * @param RecordCollection $records Record collection.
1717 * @param mixed $context Context data.
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ protected function setUp(): void
6666
6767 protected function registerProvider (Provider $ provider , string $ name = null ): void
6868 {
69- $ name = $ name ?: \get_class ($ provider );
69+ $ name = $ name ?? \get_class ($ provider );
7070
7171 $ this ->container
7272 ->shouldReceive ('has ' )->with ($ name )->andReturn (true )
You can’t perform that action at this time.
0 commit comments