-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into feat/parallel-proce…
…ssing
- Loading branch information
Showing
10 changed files
with
164 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the box project. | ||
* | ||
* (c) Kevin Herrera <[email protected]> | ||
* Théo Fidry <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace KevinGH\Box\PhpScoper; | ||
|
||
use Humbug\PhpScoper\Configuration\Configuration as PhpScoperConfiguration; | ||
use Humbug\PhpScoper\Container; | ||
use InvalidArgumentException; | ||
use KevinGH\Box\NotInstantiable; | ||
use Throwable; | ||
use function sprintf; | ||
|
||
final class ConfigurationFactory | ||
{ | ||
use NotInstantiable; | ||
|
||
public static function create(?string $filePath): PhpScoperConfiguration | ||
{ | ||
$configFactory = (new Container())->getConfigurationFactory(); | ||
|
||
try { | ||
return $configFactory->create($filePath); | ||
} catch (Throwable $throwable) { | ||
throw new InvalidArgumentException( | ||
sprintf( | ||
'Could not create a PHP-Scoper config from the file "%s": %s', | ||
$filePath, | ||
$throwable->getMessage(), | ||
), | ||
$throwable->getCode(), | ||
$throwable, | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the box project. | ||
* | ||
* (c) Kevin Herrera <[email protected]> | ||
* Théo Fidry <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace KevinGH\Box\Compactor; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use function serialize; | ||
use function unserialize; | ||
|
||
abstract class CompactorTestCase extends TestCase | ||
{ | ||
/** | ||
* @dataProvider compactorProvider | ||
*/ | ||
public function test_it_is_serializable(Compactor $compactor): void | ||
{ | ||
$unserializedCompactor = unserialize(serialize($compactor)); | ||
|
||
self::assertEquals( | ||
$compactor, | ||
$unserializedCompactor, | ||
); | ||
} | ||
|
||
abstract public static function compactorProvider(): iterable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.