@@ -161,20 +205,20 @@ protected function parseDefinition($id, $service, $filename) {
if(isset($service['tags'])){
if(!is_array($service['tags'])){
thrownew\InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.',$id,$filename));
thrownewInvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.',$id,$file));
}
foreach($service['tags']as$tag){
if(!isset($tag['name'])){
thrownew\InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.',$id,$filename));
thrownewInvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.',$id,$file));
}
$name=$tag['name'];
unset($tag['name']);
foreach($tagas$value){
if(!is_scalar($value)){
thrownew\InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s.',$id,$name,$filename));
foreach($tagas$attribute=>$value){
if(!is_scalar($value)&&null!==$value){
thrownewInvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in %s.',$id,$name,$attribute,$file));
}
}
@@ -188,39 +232,45 @@ protected function parseDefinition($id, $service, $filename) {
thrownew\InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s. Services have to be added under "services" and Parameters under "parameters".',$filename,$invalid_keys));
thrownewInvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s. Services have to be added under "services" and Parameters under "parameters".',$file,$invalid_keys));
}
return$content;
@@ -229,40 +279,41 @@ protected function validate($content, $filename) {
/**
* Resolves services.
*
* Copied from \Symfony\Component\DependencyInjection\Loader\YamlFileLoader::parseDefinition().
*
* @param mixed $value
* If a string, then it is either a plain string (for example a class
* name) or a reference to a service. If it's an array then it's a list of