Augmentation vers version 3.3.0

This commit is contained in:
Gauvain Boiché
2020-03-31 15:31:03 +02:00
parent d926806907
commit a1864c0414
2618 changed files with 406015 additions and 31377 deletions

View File

@@ -17,6 +17,8 @@ use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;
* EnvParametersResource represents resources stored in prefixed environment variables.
*
* @author Chris Wilkinson <chriswilkinson84@gmail.com>
*
* @deprecated since version 3.4, to be removed in 4.0
*/
class EnvParametersResource implements SelfCheckingResourceInterface, \Serializable
{
@@ -48,11 +50,11 @@ class EnvParametersResource implements SelfCheckingResourceInterface, \Serializa
}
/**
* {@inheritdoc}
* @return array An array with two keys: 'prefix' for the prefix used and 'variables' containing all the variables watched by this resource
*/
public function getResource()
{
return array('prefix' => $this->prefix, 'variables' => $this->variables);
return ['prefix' => $this->prefix, 'variables' => $this->variables];
}
/**
@@ -63,14 +65,24 @@ class EnvParametersResource implements SelfCheckingResourceInterface, \Serializa
return $this->findVariables() === $this->variables;
}
/**
* @internal
*/
public function serialize()
{
return serialize(array('prefix' => $this->prefix, 'variables' => $this->variables));
return serialize(['prefix' => $this->prefix, 'variables' => $this->variables]);
}
/**
* @internal
*/
public function unserialize($serialized)
{
$unserialized = unserialize($serialized);
if (\PHP_VERSION_ID >= 70000) {
$unserialized = unserialize($serialized, ['allowed_classes' => false]);
} else {
$unserialized = unserialize($serialized);
}
$this->prefix = $unserialized['prefix'];
$this->variables = $unserialized['variables'];
@@ -78,7 +90,7 @@ class EnvParametersResource implements SelfCheckingResourceInterface, \Serializa
private function findVariables()
{
$variables = array();
$variables = [];
foreach ($_SERVER as $key => $value) {
if (0 === strpos($key, $this->prefix)) {

View File

@@ -29,7 +29,7 @@ class FileLocator extends BaseFileLocator
* @param string|null $path The path the global resource directory
* @param array $paths An array of paths where to look for resources
*/
public function __construct(KernelInterface $kernel, $path = null, array $paths = array())
public function __construct(KernelInterface $kernel, $path = null, array $paths = [])
{
$this->kernel = $kernel;
if (null !== $path) {