updated-packages

This commit is contained in:
RafficMohammed
2023-01-08 00:13:22 +05:30
parent 3ff7df7487
commit da241bacb6
12659 changed files with 563377 additions and 510538 deletions

View File

@@ -5,13 +5,15 @@ namespace Doctrine\DBAL;
use Doctrine\Common\Cache\Cache;
use Doctrine\DBAL\Logging\SQLLogger;
use Doctrine\DBAL\Schema\AbstractAsset;
use Doctrine\Deprecations\Deprecation;
use function preg_match;
/**
* Configuration container for the Doctrine DBAL.
*
* @internal When adding a new configuration option just write a getter/setter
* pair and add the option to the _attributes array with a proper default value.
* Internal note: When adding a new configuration option just write a getter/setter
* pair and add the option to the _attributes array with a proper default value.
*/
class Configuration
{
@@ -72,15 +74,22 @@ class Configuration
*
* @deprecated Use Configuration::setSchemaAssetsFilter() instead
*
* @param string $filterExpression
* @param string|null $filterExpression
*
* @return void
*/
public function setFilterSchemaAssetsExpression($filterExpression)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/3316',
'Configuration::setFilterSchemaAssetsExpression() is deprecated, use setSchemaAssetsFilter() instead.'
);
$this->_attributes['filterSchemaAssetsExpression'] = $filterExpression;
if ($filterExpression) {
$this->_attributes['filterSchemaAssetsExpressionCallable'] = $this->buildSchemaAssetsFilterFromExpression($filterExpression);
$this->_attributes['filterSchemaAssetsExpressionCallable']
= $this->buildSchemaAssetsFilterFromExpression($filterExpression);
} else {
$this->_attributes['filterSchemaAssetsExpressionCallable'] = null;
}
@@ -95,18 +104,27 @@ class Configuration
*/
public function getFilterSchemaAssetsExpression()
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/3316',
'Configuration::getFilterSchemaAssetsExpression() is deprecated, use getSchemaAssetsFilter() instead.'
);
return $this->_attributes['filterSchemaAssetsExpression'] ?? null;
}
/**
* @param string $filterExpression
*
* @return callable(string|AbstractAsset)
*/
private function buildSchemaAssetsFilterFromExpression($filterExpression) : callable
private function buildSchemaAssetsFilterFromExpression($filterExpression): callable
{
return static function ($assetName) use ($filterExpression) {
if ($assetName instanceof AbstractAsset) {
$assetName = $assetName->getName();
}
return preg_match($filterExpression, $assetName);
};
}
@@ -114,16 +132,17 @@ class Configuration
/**
* Sets the callable to use to filter schema assets.
*/
public function setSchemaAssetsFilter(?callable $callable = null) : ?callable
public function setSchemaAssetsFilter(?callable $callable = null): ?callable
{
$this->_attributes['filterSchemaAssetsExpression'] = null;
$this->_attributes['filterSchemaAssetsExpression'] = null;
return $this->_attributes['filterSchemaAssetsExpressionCallable'] = $callable;
}
/**
* Returns the callable to use to filter schema assets.
*/
public function getSchemaAssetsFilter() : ?callable
public function getSchemaAssetsFilter(): ?callable
{
return $this->_attributes['filterSchemaAssetsExpressionCallable'] ?? null;
}
@@ -138,6 +157,8 @@ class Configuration
* @see getAutoCommit
*
* @param bool $autoCommit True to enable auto-commit mode; false to disable it.
*
* @return void
*/
public function setAutoCommit($autoCommit)
{