forked from nowiko/AliceBundle
-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
104 additions
and
159 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
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,56 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Hautelook\AliceBundle package. | ||
* | ||
* (c) Baldur Rensch <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Hautelook\AliceBundle\Functional; | ||
|
||
use function array_flip; | ||
use function array_key_exists; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Definition; | ||
use Symfony\Component\String\Slugger\SluggerInterface; | ||
|
||
final class MakeServicesPublicCompilerPass implements CompilerPassInterface | ||
{ | ||
private const IGNORED_SERVICE_IDS = [ | ||
'slugger', | ||
SluggerInterface::class, | ||
'test.private_services_locator', | ||
]; | ||
|
||
public function process(ContainerBuilder $container): void | ||
{ | ||
self::setDefinitionsAsPublic( | ||
$container->getDefinitions(), | ||
$container->getAliases(), | ||
); | ||
} | ||
|
||
/** | ||
* @param list<array<string, Definition|mixed>> $sources | ||
*/ | ||
private static function setDefinitionsAsPublic(array $sources): void | ||
{ | ||
$ignoredServiceIdsAsKeys = array_flip(self::IGNORED_SERVICE_IDS); | ||
|
||
foreach ($sources as $source) { | ||
foreach ($source as $id => $definition) { | ||
if ($definition instanceof Definition | ||
&& !array_key_exists($id, $ignoredServiceIdsAsKeys) | ||
) { | ||
$definition->setPublic(true); | ||
} | ||
} | ||
} | ||
} | ||
} |
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,12 +1,5 @@ | ||
doctrine: | ||
dbal: | ||
default_connection: default | ||
connections: | ||
default: | ||
driver: pdo_mysql | ||
dbname: hautelook_alice_bundle | ||
port: 3307 | ||
user: root | ||
password: password | ||
url: 'mysql://root:[email protected]:3307/hautelook_alice_bundle?serverVersion=8.0' | ||
orm: | ||
auto_mapping: true |
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
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.