Core and composer updates

This commit is contained in:
Rob Davies 2017-07-03 16:47:07 +01:00
parent a82634bb98
commit 62cac30480
1118 changed files with 21770 additions and 6306 deletions
web/vendor/symfony/dependency-injection

View file

@ -116,7 +116,8 @@ class AutowirePass implements CompilerPassInterface
}
if (isset($this->autowired[$typeHint->name])) {
return $this->autowired[$typeHint->name] ? new Reference($this->autowired[$typeHint->name]) : null;
$arguments[$index] = $this->autowired[$typeHint->name] ? new Reference($this->autowired[$typeHint->name]) : null;
continue;
}
if (null === $this->types) {
@ -303,9 +304,28 @@ class AutowirePass implements CompilerPassInterface
$class = $this->container->getParameterBag()->resolveValue($class);
if ($deprecated = $definition->isDeprecated()) {
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
return (E_USER_DEPRECATED === $level || !$prevErrorHandler) ? false : $prevErrorHandler($level, $message, $file, $line);
});
}
$e = null;
try {
$reflector = new \ReflectionClass($class);
} catch (\ReflectionException $e) {
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
if ($deprecated) {
restore_error_handler();
}
if (null !== $e) {
if (!$e instanceof \ReflectionException) {
throw $e;
}
$reflector = false;
}

View file

@ -29,7 +29,7 @@ class Definition
private $factoryService;
private $shared = true;
private $deprecated = false;
private $deprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
private $deprecationTemplate;
private $scope = ContainerInterface::SCOPE_CONTAINER;
private $properties = array();
private $calls = array();
@ -44,6 +44,8 @@ class Definition
private $autowired = false;
private $autowiringTypes = array();
private static $defaultDeprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
protected $arguments;
/**
@ -379,7 +381,7 @@ class Definition
public function addMethodCall($method, array $arguments = array())
{
if (empty($method)) {
throw new InvalidArgumentException(sprintf('Method name cannot be empty.'));
throw new InvalidArgumentException('Method name cannot be empty.');
}
$this->calls[] = array($method, $arguments);
@ -796,7 +798,7 @@ class Definition
*/
public function getDeprecationMessage($id)
{
return str_replace('%service_id%', $id, $this->deprecationTemplate);
return str_replace('%service_id%', $id, $this->deprecationTemplate ?: self::$defaultDeprecationTemplate);
}
/**

View file

@ -847,7 +847,7 @@ EOF;
private function startClass($class, $baseClass, $namespace)
{
$bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;';
$namespaceLine = $namespace ? "namespace $namespace;\n" : '';
$namespaceLine = $namespace ? "\nnamespace $namespace;\n" : '';
return <<<EOF
<?php
@ -1351,9 +1351,12 @@ EOF;
if (null !== $this->definitionVariables && $this->definitionVariables->contains($value)) {
return $this->dumpValue($this->definitionVariables->offsetGet($value), $interpolate);
}
if (count($value->getMethodCalls()) > 0) {
if ($value->getMethodCalls()) {
throw new RuntimeException('Cannot dump definitions which have method calls.');
}
if ($value->getProperties()) {
throw new RuntimeException('Cannot dump definitions which have properties.');
}
if (null !== $value->getConfigurator()) {
throw new RuntimeException('Cannot dump definitions which have a configurator.');
}

View file

@ -215,6 +215,10 @@ class XmlDumper extends Dumper
$service->appendChild($autowiringType);
}
if ($definition->isAbstract()) {
$service->setAttribute('abstract', 'true');
}
if ($callable = $definition->getConfigurator()) {
$configurator = $this->document->createElement('configurator');

View file

@ -93,11 +93,11 @@ class YamlDumper extends Dumper
}
if ($definition->isSynthetic()) {
$code .= sprintf(" synthetic: true\n");
$code .= " synthetic: true\n";
}
if ($definition->isSynchronized(false)) {
$code .= sprintf(" synchronized: true\n");
$code .= " synchronized: true\n";
}
if ($definition->isDeprecated()) {
@ -121,7 +121,7 @@ class YamlDumper extends Dumper
}
if ($definition->isLazy()) {
$code .= sprintf(" lazy: true\n");
$code .= " lazy: true\n";
}
if ($definition->getFactoryMethod(false)) {

View file

@ -145,8 +145,8 @@
</xsd:complexType>
<xsd:complexType name="property" mixed="true">
<xsd:choice minOccurs="0" maxOccurs="1">
<xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
<xsd:choice minOccurs="0">
<xsd:element name="property" type="property" maxOccurs="unbounded" />
<xsd:element name="service" type="service" />
</xsd:choice>
<xsd:attribute name="type" type="argument_type" />
@ -158,8 +158,8 @@
</xsd:complexType>
<xsd:complexType name="argument" mixed="true">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
<xsd:choice minOccurs="0">
<xsd:element name="argument" type="argument" maxOccurs="unbounded" />
<xsd:element name="service" type="service" />
</xsd:choice>
<xsd:attribute name="type" type="argument_type" />
@ -170,10 +170,9 @@
<xsd:attribute name="strict" type="boolean" />
</xsd:complexType>
<xsd:complexType name="call" mixed="true">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="service" type="service" />
<xsd:complexType name="call">
<xsd:choice minOccurs="0">
<xsd:element name="argument" type="argument" maxOccurs="unbounded" />
</xsd:choice>
<xsd:attribute name="method" type="xsd:string" />
</xsd:complexType>

View file

@ -5,6 +5,8 @@
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
>
<php>
<ini name="error_reporting" value="-1" />