init
This commit is contained in:
29
backend/vendor/doctrine/doctrine-bundle/src/Dbal/BlacklistSchemaAssetFilter.php
vendored
Normal file
29
backend/vendor/doctrine/doctrine-bundle/src/Dbal/BlacklistSchemaAssetFilter.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Bundle\DoctrineBundle\Dbal;
|
||||
|
||||
use Doctrine\DBAL\Schema\AbstractAsset;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/** @deprecated Implement your own include/exclude mechanism */
|
||||
class BlacklistSchemaAssetFilter
|
||||
{
|
||||
/** @param string[] $blacklist */
|
||||
public function __construct(
|
||||
private readonly array $blacklist,
|
||||
) {
|
||||
}
|
||||
|
||||
/** @param string|AbstractAsset $assetName */
|
||||
public function __invoke($assetName): bool
|
||||
{
|
||||
if ($assetName instanceof AbstractAsset) {
|
||||
$assetName = $assetName->getName();
|
||||
}
|
||||
|
||||
return ! in_array($assetName, $this->blacklist, true);
|
||||
}
|
||||
}
|
||||
27
backend/vendor/doctrine/doctrine-bundle/src/Dbal/ManagerRegistryAwareConnectionProvider.php
vendored
Normal file
27
backend/vendor/doctrine/doctrine-bundle/src/Dbal/ManagerRegistryAwareConnectionProvider.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Bundle\DoctrineBundle\Dbal;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Tools\Console\ConnectionProvider;
|
||||
use Doctrine\Persistence\AbstractManagerRegistry;
|
||||
|
||||
class ManagerRegistryAwareConnectionProvider implements ConnectionProvider
|
||||
{
|
||||
public function __construct(
|
||||
private readonly AbstractManagerRegistry $managerRegistry,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getDefaultConnection(): Connection
|
||||
{
|
||||
return $this->managerRegistry->getConnection();
|
||||
}
|
||||
|
||||
public function getConnection(string $name): Connection
|
||||
{
|
||||
return $this->managerRegistry->getConnection($name);
|
||||
}
|
||||
}
|
||||
26
backend/vendor/doctrine/doctrine-bundle/src/Dbal/RegexSchemaAssetFilter.php
vendored
Normal file
26
backend/vendor/doctrine/doctrine-bundle/src/Dbal/RegexSchemaAssetFilter.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Bundle\DoctrineBundle\Dbal;
|
||||
|
||||
use Doctrine\DBAL\Schema\AbstractAsset;
|
||||
|
||||
use function preg_match;
|
||||
|
||||
class RegexSchemaAssetFilter
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $filterExpression,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(string|AbstractAsset $assetName): bool
|
||||
{
|
||||
if ($assetName instanceof AbstractAsset) {
|
||||
$assetName = $assetName->getName();
|
||||
}
|
||||
|
||||
return (bool) preg_match($this->filterExpression, $assetName);
|
||||
}
|
||||
}
|
||||
31
backend/vendor/doctrine/doctrine-bundle/src/Dbal/SchemaAssetsFilterManager.php
vendored
Normal file
31
backend/vendor/doctrine/doctrine-bundle/src/Dbal/SchemaAssetsFilterManager.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Bundle\DoctrineBundle\Dbal;
|
||||
|
||||
use Doctrine\DBAL\Schema\AbstractAsset;
|
||||
|
||||
/**
|
||||
* Manages schema filters passed to Connection::setSchemaAssetsFilter()
|
||||
*/
|
||||
class SchemaAssetsFilterManager
|
||||
{
|
||||
/** @param callable[] $schemaAssetFilters */
|
||||
public function __construct(
|
||||
private readonly array $schemaAssetFilters,
|
||||
) {
|
||||
}
|
||||
|
||||
/** @param string|AbstractAsset $assetName */
|
||||
public function __invoke($assetName): bool
|
||||
{
|
||||
foreach ($this->schemaAssetFilters as $schemaAssetFilter) {
|
||||
if ($schemaAssetFilter($assetName) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user