mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
migration symfony 5 4 (#300)
* symfony 5.4 (diff dev) * symfony 5.4 (working) * symfony 5.4 (update autoload) * symfony 5.4 (remove swiftmailer mailer implementation) * symfony 5.4 (php doc and split Global accessor class) ### Impacted packages: composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
This commit is contained in:
@@ -23,7 +23,6 @@ class Compiler
|
||||
{
|
||||
private $passConfig;
|
||||
private $log = [];
|
||||
private $loggingFormatter;
|
||||
private $serviceReferenceGraph;
|
||||
|
||||
public function __construct()
|
||||
@@ -33,9 +32,7 @@ class Compiler
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the PassConfig.
|
||||
*
|
||||
* @return PassConfig The PassConfig instance
|
||||
* @return PassConfig
|
||||
*/
|
||||
public function getPassConfig()
|
||||
{
|
||||
@@ -43,77 +40,24 @@ class Compiler
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ServiceReferenceGraph.
|
||||
*
|
||||
* @return ServiceReferenceGraph The ServiceReferenceGraph instance
|
||||
* @return ServiceReferenceGraph
|
||||
*/
|
||||
public function getServiceReferenceGraph()
|
||||
{
|
||||
return $this->serviceReferenceGraph;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the logging formatter which can be used by compilation passes.
|
||||
*
|
||||
* @return LoggingFormatter
|
||||
*
|
||||
* @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.
|
||||
*/
|
||||
public function getLoggingFormatter()
|
||||
public function addPass(CompilerPassInterface $pass, string $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
|
||||
{
|
||||
if (null === $this->loggingFormatter) {
|
||||
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), \E_USER_DEPRECATED);
|
||||
|
||||
$this->loggingFormatter = new LoggingFormatter();
|
||||
}
|
||||
|
||||
return $this->loggingFormatter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a pass to the PassConfig.
|
||||
*
|
||||
* @param CompilerPassInterface $pass A compiler pass
|
||||
* @param string $type The type of the pass
|
||||
*/
|
||||
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
{
|
||||
if (\func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
} else {
|
||||
if (__CLASS__ !== static::class) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since Symfony 3.2.', __METHOD__), \E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
$priority = 0;
|
||||
}
|
||||
|
||||
$this->passConfig->addPass($pass, $type, $priority);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a log message.
|
||||
*
|
||||
* @param string $string The log message
|
||||
*
|
||||
* @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.
|
||||
*/
|
||||
public function addLogMessage($string)
|
||||
{
|
||||
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), \E_USER_DEPRECATED);
|
||||
|
||||
$this->log[] = $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
public function log(CompilerPassInterface $pass, $message)
|
||||
public function log(CompilerPassInterface $pass, string $message)
|
||||
{
|
||||
if (false !== strpos($message, "\n")) {
|
||||
if (str_contains($message, "\n")) {
|
||||
$message = str_replace("\n", "\n".\get_class($pass).': ', trim($message));
|
||||
}
|
||||
|
||||
@@ -121,9 +65,7 @@ class Compiler
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the log.
|
||||
*
|
||||
* @return array Log array
|
||||
* @return array
|
||||
*/
|
||||
public function getLog()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user