mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +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:
@@ -49,11 +49,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child array node.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
*
|
||||
* @return ArrayNodeDefinition The child node
|
||||
* @return ArrayNodeDefinition
|
||||
*/
|
||||
public function arrayNode($name)
|
||||
public function arrayNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'array');
|
||||
}
|
||||
@@ -61,11 +59,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child scalar node.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
*
|
||||
* @return ScalarNodeDefinition The child node
|
||||
* @return ScalarNodeDefinition
|
||||
*/
|
||||
public function scalarNode($name)
|
||||
public function scalarNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'scalar');
|
||||
}
|
||||
@@ -73,11 +69,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child Boolean node.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
*
|
||||
* @return BooleanNodeDefinition The child node
|
||||
* @return BooleanNodeDefinition
|
||||
*/
|
||||
public function booleanNode($name)
|
||||
public function booleanNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'boolean');
|
||||
}
|
||||
@@ -85,11 +79,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child integer node.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
*
|
||||
* @return IntegerNodeDefinition The child node
|
||||
* @return IntegerNodeDefinition
|
||||
*/
|
||||
public function integerNode($name)
|
||||
public function integerNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'integer');
|
||||
}
|
||||
@@ -97,11 +89,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child float node.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
*
|
||||
* @return FloatNodeDefinition The child node
|
||||
* @return FloatNodeDefinition
|
||||
*/
|
||||
public function floatNode($name)
|
||||
public function floatNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'float');
|
||||
}
|
||||
@@ -109,11 +99,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child EnumNode.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return EnumNodeDefinition
|
||||
*/
|
||||
public function enumNode($name)
|
||||
public function enumNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'enum');
|
||||
}
|
||||
@@ -121,11 +109,9 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child variable node.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
*
|
||||
* @return VariableNodeDefinition The builder of the child node
|
||||
* @return VariableNodeDefinition
|
||||
*/
|
||||
public function variableNode($name)
|
||||
public function variableNode(string $name)
|
||||
{
|
||||
return $this->node($name, 'variable');
|
||||
}
|
||||
@@ -133,7 +119,7 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Returns the parent node.
|
||||
*
|
||||
* @return NodeDefinition&ParentNodeDefinitionInterface The parent node
|
||||
* @return NodeDefinition&ParentNodeDefinitionInterface
|
||||
*/
|
||||
public function end()
|
||||
{
|
||||
@@ -143,15 +129,12 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Creates a child node.
|
||||
*
|
||||
* @param string|null $name The name of the node
|
||||
* @param string $type The type of the node
|
||||
*
|
||||
* @return NodeDefinition The child node
|
||||
* @return NodeDefinition
|
||||
*
|
||||
* @throws \RuntimeException When the node type is not registered
|
||||
* @throws \RuntimeException When the node class is not found
|
||||
*/
|
||||
public function node($name, $type)
|
||||
public function node(?string $name, string $type)
|
||||
{
|
||||
$class = $this->getNodeClass($type);
|
||||
|
||||
@@ -179,7 +162,7 @@ class NodeBuilder implements NodeParentInterface
|
||||
*/
|
||||
public function append(NodeDefinition $node)
|
||||
{
|
||||
if ($node instanceof ParentNodeDefinitionInterface) {
|
||||
if ($node instanceof BuilderAwareInterface) {
|
||||
$builder = clone $this;
|
||||
$builder->setParent(null);
|
||||
$node->setBuilder($builder);
|
||||
@@ -202,7 +185,7 @@ class NodeBuilder implements NodeParentInterface
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNodeClass($type, $class)
|
||||
public function setNodeClass(string $type, string $class)
|
||||
{
|
||||
$this->nodeMapping[strtolower($type)] = $class;
|
||||
|
||||
@@ -212,14 +195,12 @@ class NodeBuilder implements NodeParentInterface
|
||||
/**
|
||||
* Returns the class name of the node definition.
|
||||
*
|
||||
* @param string $type The node type
|
||||
*
|
||||
* @return string The node definition class name
|
||||
* @return string
|
||||
*
|
||||
* @throws \RuntimeException When the node type is not registered
|
||||
* @throws \RuntimeException When the node class is not found
|
||||
*/
|
||||
protected function getNodeClass($type)
|
||||
protected function getNodeClass(string $type)
|
||||
{
|
||||
$type = strtolower($type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user