Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -46,8 +46,8 @@ abstract class AbstractRepository implements RepositoryInterface
*/
public function get($name)
{
if (!is_string($name)) {
throw new InvalidArgumentException('Expected name to be a string.');
if (!is_string($name) || '' === $name) {
throw new InvalidArgumentException('Expected name to be a non-empty string.');
}
return $this->getInternal($name);
@@ -56,7 +56,7 @@ abstract class AbstractRepository implements RepositoryInterface
/**
* Get an environment variable.
*
* @param string $name
* @param non-empty-string $name
*
* @return string|null
*/
@@ -74,8 +74,8 @@ abstract class AbstractRepository implements RepositoryInterface
*/
public function set($name, $value = null)
{
if (!is_string($name)) {
throw new InvalidArgumentException('Expected name to be a string.');
if (!is_string($name) || '' === $name) {
throw new InvalidArgumentException('Expected name to be a non-empty string.');
}
// Don't overwrite existing environment variables if we're immutable
@@ -91,8 +91,8 @@ abstract class AbstractRepository implements RepositoryInterface
/**
* Set an environment variable.
*
* @param string $name
* @param string|null $value
* @param non-empty-string $name
* @param string|null $value
*
* @return void
*/
@@ -109,8 +109,8 @@ abstract class AbstractRepository implements RepositoryInterface
*/
public function clear($name)
{
if (!is_string($name)) {
throw new InvalidArgumentException('Expected name to be a string.');
if (!is_string($name) || '' === $name) {
throw new InvalidArgumentException('Expected name to be a non-empty string.');
}
// Don't clear anything if we're immutable.
@@ -124,7 +124,7 @@ abstract class AbstractRepository implements RepositoryInterface
/**
* Clear an environment variable.
*
* @param string $name
* @param non-empty-string $name
*
* @return void
*/
@@ -139,7 +139,7 @@ abstract class AbstractRepository implements RepositoryInterface
*/
public function has($name)
{
return is_string($name) && $this->get($name) !== null;
return is_string($name) && $name !== '' && $this->get($name) !== null;
}
/**