-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #509 from lcobucci/7.0.x-merge-up-into-7.1.x_RgT4Fg7p
Merge release 7.0.1 into 7.1.x
- Loading branch information
Showing
11 changed files
with
142 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
{ | ||
"name": "lcobucci/di-builder", | ||
"type": "library", | ||
"description": "Dependency Injection Builder for PHP applications", | ||
"keywords": [ | ||
"dependency-injection" | ||
], | ||
"homepage": "https://github.com/lcobucci/di-builder", | ||
"license": [ | ||
"BSD-3-Clause" | ||
], | ||
"type": "library", | ||
"keywords": [ | ||
"dependency-injection" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Luís Cobucci", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"homepage": "https://github.com/lcobucci/di-builder", | ||
"require": { | ||
"php": "^8.0", | ||
"symfony/config": "^5.3", | ||
"symfony/dependency-injection": "^5.3", | ||
"symfony/expression-language": "^5.3" | ||
}, | ||
"replace": { | ||
"symfony/polyfill-php71": "*", | ||
"symfony/polyfill-php72": "*", | ||
"symfony/polyfill-php73": "*", | ||
"symfony/polyfill-php74": "*", | ||
"symfony/polyfill-php80": "*" | ||
}, | ||
"require-dev": { | ||
"infection/infection": "^0.25", | ||
"lcobucci/coding-standard": "^8.0", | ||
|
@@ -42,13 +35,16 @@ | |
"symfony/proxy-manager-bridge": "^5.3", | ||
"symfony/yaml": "^5.3" | ||
}, | ||
"replace": { | ||
"symfony/polyfill-php71": "*", | ||
"symfony/polyfill-php72": "*", | ||
"symfony/polyfill-php73": "*", | ||
"symfony/polyfill-php74": "*", | ||
"symfony/polyfill-php80": "*" | ||
}, | ||
"suggest": { | ||
"symfony/proxy-manager-bridge": "Allows the creation of lazy services" | ||
}, | ||
"config": { | ||
"preferred-install": "dist", | ||
"sort-packages": true | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Lcobucci\\DependencyInjection\\": "src" | ||
|
@@ -58,5 +54,15 @@ | |
"psr-4": { | ||
"Lcobucci\\DependencyInjection\\": "test" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true, | ||
"infection/extension-installer": true, | ||
"phpstan/extension-installer": true, | ||
"ocramius/package-versions": true | ||
}, | ||
"preferred-install": "dist", | ||
"sort-packages": true | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Lcobucci\DependencyInjection; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @covers \Lcobucci\DependencyInjection\ContainerBuilder | ||
* @covers \Lcobucci\DependencyInjection\Compiler | ||
* @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag | ||
* @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration | ||
* @covers \Lcobucci\DependencyInjection\Generator | ||
* @covers \Lcobucci\DependencyInjection\Generators\Xml | ||
* @covers \Lcobucci\DependencyInjection\Testing\MakeServicesPublic | ||
*/ | ||
final class CompilationWithBaseClassTest extends TestCase | ||
{ | ||
use GeneratesDumpDirectory; | ||
|
||
private const DI_NAMESPACE = 'Lcobucci\\DiTests\\BaseClass'; | ||
|
||
/** @test */ | ||
public function containerCanHaveACustomBaseClass(): void | ||
{ | ||
$container = ContainerBuilder::xml(__FILE__, self::DI_NAMESPACE) | ||
->setBaseClass(ContainerForTests::class) | ||
->setDumpDir($this->dumpDirectory) | ||
->getContainer(); | ||
|
||
self::assertInstanceOf(ContainerForTests::class, $container); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Lcobucci\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\Container; | ||
|
||
abstract class ContainerForTests extends Container | ||
{ | ||
} |
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,35 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Lcobucci\DependencyInjection; | ||
|
||
use function assert; | ||
use function exec; | ||
use function is_string; | ||
use function mkdir; | ||
use function tempnam; | ||
use function unlink; | ||
|
||
trait GeneratesDumpDirectory | ||
{ | ||
private string $dumpDirectory; | ||
|
||
/** @before */ | ||
public function createDumpDir(): void | ||
{ | ||
mkdir(__DIR__ . '/../tmp'); | ||
|
||
$tempName = tempnam(__DIR__ . '/../tmp', 'lcobucci-di-builder'); | ||
assert(is_string($tempName)); | ||
|
||
$this->dumpDirectory = $tempName; | ||
unlink($this->dumpDirectory); | ||
mkdir($this->dumpDirectory); | ||
} | ||
|
||
/** @after */ | ||
public function removeDumpDir(): void | ||
{ | ||
exec('rm -rf ' . __DIR__ . '/../tmp'); | ||
} | ||
} |
Oops, something went wrong.