__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
class Alias
{
private const DEFAULT_DEPRECATION_TEMPLATE = 'The "%alias_id%" service alias is deprecated. You should stop using it, as it will be removed in the future.';
private string $id;
private bool $public;
private array $deprecation = [];
public function __construct(string $id, bool $public = false)
{
$this->id = $id;
$this->public = $public;
}
/**
* Checks if this DI Alias should be public or not.
*/
public function isPublic(): bool
{
return $this->public;
}
/**
* Sets if this Alias is public.
*
* @return $this
*/
public function setPublic(bool $boolean): static
{
$this->public = $boolean;
return $this;
}
/**
* Whether this alias is private.
*/
public function isPrivate(): bool
{
return !$this->public;
}
/**
* Whether this alias is deprecated, that means it should not be referenced
* anymore.
*
* @param string $package The name of the composer package that is triggering the deprecation
* @param string $version The version of the package that introduced the deprecation
* @param string $message The deprecation message to use
*
* @return $this
*
* @throws InvalidArgumentException when the message template is invalid
*/
public function setDeprecated(string $package, string $version, string $message): static
{
if ('' !== $message) {
if (preg_match('#[\r\n]|\*/#', $message)) {
throw new InvalidArgumentException('Invalid characters found in deprecation template.');
}
if (!str_contains($message, '%alias_id%')) {
throw new InvalidArgumentException('The deprecation template must contain the "%alias_id%" placeholder.');
}
}
$this->deprecation = ['package' => $package, 'version' => $version, 'message' => $message ?: self::DEFAULT_DEPRECATION_TEMPLATE];
return $this;
}
public function isDeprecated(): bool
{
return (bool) $this->deprecation;
}
/**
* @param string $id Service id relying on this definition
*/
public function getDeprecation(string $id): array
{
return [
'package' => $this->deprecation['package'],
'version' => $this->deprecation['version'],
'message' => str_replace('%alias_id%', $id, $this->deprecation['message']),
];
}
public function __toString(): string
{
return $this->id;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Argument | Folder | 0755 |
|
|
| Attribute | Folder | 0755 |
|
|
| Compiler | Folder | 0755 |
|
|
| Config | Folder | 0755 |
|
|
| Dumper | Folder | 0755 |
|
|
| Exception | Folder | 0755 |
|
|
| Extension | Folder | 0755 |
|
|
| LazyProxy | Folder | 0755 |
|
|
| Loader | Folder | 0755 |
|
|
| ParameterBag | Folder | 0755 |
|
|
| Alias.php | File | 2.9 KB | 0644 |
|
| ChildDefinition.php | File | 2.56 KB | 0644 |
|
| Container.php | File | 13.6 KB | 0644 |
|
| ContainerAwareInterface.php | File | 681 B | 0644 |
|
| ContainerAwareTrait.php | File | 1.06 KB | 0644 |
|
| ContainerBuilder.php | File | 59.07 KB | 0644 |
|
| ContainerInterface.php | File | 2.28 KB | 0644 |
|
| Definition.php | File | 20.17 KB | 0644 |
|
| EnvVarLoaderInterface.php | File | 654 B | 0644 |
|
| EnvVarProcessor.php | File | 13.01 KB | 0644 |
|
| EnvVarProcessorInterface.php | File | 1.24 KB | 0644 |
|
| ExpressionLanguage.php | File | 1.05 KB | 0644 |
|
| ExpressionLanguageProvider.php | File | 2.12 KB | 0644 |
|
| Parameter.php | File | 601 B | 0644 |
|
| Reference.php | File | 945 B | 0644 |
|
| ReverseContainer.php | File | 2.4 KB | 0644 |
|
| ServiceLocator.php | File | 5.3 KB | 0644 |
|
| TaggedContainerInterface.php | File | 688 B | 0644 |
|
| TypedReference.php | File | 1.54 KB | 0644 |
|
| Variable.php | File | 692 B | 0644 |
|
| autoload.php | File | 25.98 KB | 0644 |
|