Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1992,9 +1992,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
}

/**
* Returns the base path for the XSD files.
*
* @return string The XSD base path
* {@inheritdoc}
*/
public function getXsdValidationBasePath()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,7 @@ public function addUserProviderFactory(UserProviderFactoryInterface $factory)
}

/**
* Returns the base path for the XSD files.
*
* @return string The XSD base path
* {@inheritdoc}
*/
public function getXsdValidationBasePath()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ private function normalizeBundleName(string $name)
}

/**
* Returns the base path for the XSD files.
*
* @return string The XSD base path
* {@inheritdoc}
*/
public function getXsdValidationBasePath()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function load(array $configs, ContainerBuilder $container)
}

/**
* Returns the base path for the XSD files.
*
* @return string The XSD base path
* {@inheritdoc}
*/
public function getXsdValidationBasePath()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Definition/ArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function setNormalizeKeys($normalizeKeys)
*
* @param mixed $value
*
* @return array The value with normalized keys
* @return mixed The value with normalized keys
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if $value is not an array, it is returned immediately.

*/
protected function preNormalize($value)
{
Expand Down
23 changes: 21 additions & 2 deletions src/Symfony/Component/Config/Definition/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,37 @@ public static function resetPlaceholders(): void
self::$placeholders = [];
}

/**
* @param string $key
*/
public function setAttribute($key, $value)
{
$this->attributes[$key] = $value;
}

/**
* @param string $key
*
* @return mixed
*/
public function getAttribute($key, $default = null)
{
return isset($this->attributes[$key]) ? $this->attributes[$key] : $default;
}

/**
* @param string $key
*
* @return bool
*/
public function hasAttribute($key)
{
return isset($this->attributes[$key]);
}

/**
* @return array
*/
public function getAttributes()
{
return $this->attributes;
Expand All @@ -122,6 +138,9 @@ public function setAttributes(array $attributes)
$this->attributes = $attributes;
}

/**
* @param string $key
*/
public function removeAttribute($key)
{
unset($this->attributes[$key]);
Expand All @@ -140,7 +159,7 @@ public function setInfo($info)
/**
* Returns info message.
*
* @return string The info text
* @return string|null The info text
*/
public function getInfo()
{
Expand All @@ -160,7 +179,7 @@ public function setExample($example)
/**
* Retrieves the example configuration for this node.
*
* @return string|array The example
* @return string|array|null The example
*/
public function getExample()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function setKeyAttribute($attribute, $remove = true)
/**
* Retrieves the name of the attribute which value should be used as key.
*
* @return string The name of the attribute
* @return string|null The name of the attribute
*/
public function getKeyAttribute()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Util/XmlUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static function loadFile($file, $schemaOrCallable = null)
* @param \DOMElement $element A \DOMElement instance
* @param bool $checkPrefix Check prefix in an element or an attribute name
*
* @return array A PHP array
* @return mixed
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can return virtually any non-object type and we have tests covering this. That is a bit surprising, given that the method name ends with ToArray.

*/
public static function convertDomElementToArray(\DOMElement $element, $checkPrefix = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/DependencyInjection/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ public function setConfigurator($configurator)
/**
* Gets the configurator to call after the service is fully initialized.
*
* @return callable|null The PHP callable to call
* @return callable|array|null
*/
public function getConfigurator()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getNamespace();
/**
* Returns the base path for the XSD files.
*
* @return string The XSD base path
* @return string|false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's fix that with a deprecation, same as the guard method

*/
public function getXsdValidationBasePath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ private function loadFromExtensions(\DOMDocument $xml)
*
* @param \DOMElement $element A \DOMElement instance
*
* @return array A PHP array
* @return mixed
*/
public static function convertDomElementToArray(\DOMElement $element)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function resolveValue($value, array $resolving = [])
* @param string $value The string to resolve
* @param array $resolving An array of keys that are being resolved (used internally to detect circular references)
*
* @return string The resolved string
* @return mixed The resolved string
*
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
* @throws ParameterCircularReferenceException if a circular reference if detected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function load(array $configs, ContainerBuilder $configuration)
return $configuration;
}

public function getXsdValidationBasePath(): string
public function getXsdValidationBasePath()
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ProjectWithXsdExtension extends ProjectExtension
{
public function getXsdValidationBasePath(): string
public function getXsdValidationBasePath()
{
return __DIR__.'/schema';
}
Expand Down