File tree Expand file tree Collapse file tree 3 files changed +6
-25
lines changed
Expand file tree Collapse file tree 3 files changed +6
-25
lines changed Original file line number Diff line number Diff line change 2323 - 8.0
2424 - nightly
2525
26- jobs :
27- include :
28- # Test PHP 8.0+ only with composer v2 while ignoring platform reqs
29- # so conflicting dependencies like Symfony polyfills are not installed.
30- - php : 8.0
31- env : COMPOSER_VERSION="2"
32- - php : nightly
33- env : COMPOSER_VERSION="2"
34-
3526matrix :
3627 allow_failures :
3728 - php : nightly
Original file line number Diff line number Diff line change 1616 },
1717 "require-dev" : {
1818 "composer/composer" : " ^2.0" ,
19- "phpunit/phpunit" : " ~5.7" ,
19+ "phpunit/phpunit" : " ~5.7 | ~6.0 | ~7.0 " ,
2020 "symfony/process" : " ^3"
2121 },
2222 "autoload" : {
Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ public function getPackageApplication(PackageInterface $targetPackage)
101101 throw new \RuntimeException ('Cannot Loaded applied patches data file "%s" ' , $ dataFile );
102102 }
103103
104- $ data = json_decode ( file_get_contents ( $ dataFile), true );
104+ $ applicationJson = new JsonFile ( $ dataFile );
105105
106- return $ this ->createPackagePatchApplication ($ targetPackage , $ data );
106+ return $ this ->createPackagePatchApplication ($ targetPackage , $ applicationJson -> read () );
107107 }
108108
109109 /**
@@ -122,19 +122,9 @@ public function savePackageApplication(PackagePatchApplication $packagePatchAppl
122122 throw new \RuntimeException (sprintf ('Package directory is not writable "%s" ' , dirname ($ dataFile )));
123123 }
124124
125- file_put_contents ($ dataFile ,
126- $ this ->encodeData ($ this ->transformPackagePatchApplicationToArray ($ packagePatchApplication ))
127- );
128- }
129-
130- /**
131- * @param array $data
132- * @return string
133- */
134- private function encodeData (array $ data )
135- {
136- return json_encode ($ data ,
137- JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES + JSON_UNESCAPED_UNICODE
125+ $ applicationFile = new JsonFile ($ dataFile );
126+ $ applicationFile ->write (
127+ $ this ->transformPackagePatchApplicationToArray ($ packagePatchApplication )
138128 );
139129 }
140130
You can’t perform that action at this time.
0 commit comments