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

@@ -11,19 +11,38 @@
namespace Carbon\Exceptions;
use Exception;
use Throwable;
class BadComparisonUnitException extends UnitException
{
/**
* The unit.
*
* @var string
*/
protected $unit;
/**
* Constructor.
*
* @param string $unit
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($unit, $code = 0, Exception $previous = null)
public function __construct($unit, $code = 0, Throwable $previous = null)
{
$this->unit = $unit;
parent::__construct("Bad comparison unit: '$unit'", $code, $previous);
}
/**
* Get the unit.
*
* @return string
*/
public function getUnit(): string
{
return $this->unit;
}
}

View File

@@ -12,19 +12,38 @@
namespace Carbon\Exceptions;
use BadMethodCallException as BaseBadMethodCallException;
use Exception;
use Throwable;
class BadFluentConstructorException extends BaseBadMethodCallException implements BadMethodCallException
{
/**
* The method.
*
* @var string
*/
protected $method;
/**
* Constructor.
*
* @param string $method
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($method, $code = 0, Exception $previous = null)
public function __construct($method, $code = 0, Throwable $previous = null)
{
$this->method = $method;
parent::__construct(sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous);
}
/**
* Get the method.
*
* @return string
*/
public function getMethod(): string
{
return $this->method;
}
}

View File

@@ -12,19 +12,38 @@
namespace Carbon\Exceptions;
use BadMethodCallException as BaseBadMethodCallException;
use Exception;
use Throwable;
class BadFluentSetterException extends BaseBadMethodCallException implements BadMethodCallException
{
/**
* The setter.
*
* @var string
*/
protected $setter;
/**
* Constructor.
*
* @param string $method
* @param string $setter
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($method, $code = 0, Exception $previous = null)
public function __construct($setter, $code = 0, Throwable $previous = null)
{
parent::__construct(sprintf("Unknown fluent setter '%s'", $method), $code, $previous);
$this->setter = $setter;
parent::__construct(sprintf("Unknown fluent setter '%s'", $setter), $code, $previous);
}
/**
* Get the setter.
*
* @return string
*/
public function getSetter(): string
{
return $this->setter;
}
}

View File

@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface BadMethodCallException extends Exception
{
//
}

View File

@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface Exception
{
//
}

View File

@@ -11,20 +11,38 @@
namespace Carbon\Exceptions;
use Exception;
use RuntimeException as BaseRuntimeException;
use Throwable;
class ImmutableException extends BaseRuntimeException implements RuntimeException
{
/**
* The value.
*
* @var string
*/
protected $value;
/**
* Constructor.
*
* @param string $value the immutable type/value
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($value, $code = 0, Exception $previous = null)
public function __construct($value, $code = 0, Throwable $previous = null)
{
$this->value = $value;
parent::__construct("$value is immutable.", $code, $previous);
}
/**
* Get the value.
*
* @return string
*/
public function getValue(): string
{
return $this->value;
}
}

View File

@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface InvalidArgumentException extends Exception
{
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidCastException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,8 +11,8 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException
{
@@ -36,9 +36,9 @@ class InvalidDateException extends BaseInvalidArgumentException implements Inval
* @param string $field
* @param mixed $value
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($field, $value, $code = 0, Exception $previous = null)
public function __construct($field, $value, $code = 0, Throwable $previous = null)
{
$this->field = $field;
$this->value = $value;

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidFormatException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidIntervalException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidPeriodDateException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidPeriodParameterException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidTimeZoneException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidTypeException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -12,24 +12,39 @@
namespace Carbon\Exceptions;
use Carbon\CarbonInterface;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* The className.
*
* @var string
*/
protected $className;
/**
* Constructor.
*
* @param string $className
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($className, $code = 0, Exception $previous = null)
public function __construct($className, $code = 0, Throwable $previous = null)
{
parent::__construct(sprintf(
'Given class does not implement %s: %s',
CarbonInterface::class,
$className
), $code, $previous);
$this->className = $className;
parent::__construct(sprintf('Given class does not implement %s: %s', CarbonInterface::class, $className), $code, $previous);
}
/**
* Get the className.
*
* @return string
*/
public function getClassName(): string
{
return $this->className;
}
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class NotAPeriodException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,8 +11,8 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
class NotLocaleAwareException extends BaseInvalidArgumentException implements InvalidArgumentException
{
@@ -21,9 +21,9 @@ class NotLocaleAwareException extends BaseInvalidArgumentException implements In
*
* @param mixed $object
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($object, $code = 0, Exception $previous = null)
public function __construct($object, $code = 0, Throwable $previous = null)
{
$dump = \is_object($object) ? \get_class($object) : \gettype($object);

View File

@@ -11,8 +11,8 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
// This will extends OutOfRangeException instead of InvalidArgumentException since 3.0.0
// use OutOfRangeException as BaseOutOfRangeException;
@@ -55,9 +55,9 @@ class OutOfRangeException extends BaseInvalidArgumentException implements Invali
* @param mixed $max
* @param mixed $value
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($unit, $min, $max, $value, $code = 0, Exception $previous = null)
public function __construct($unit, $min, $max, $value, $code = 0, Throwable $previous = null)
{
$this->unit = $unit;
$this->min = $min;

View File

@@ -11,23 +11,78 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
class ParseErrorException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* The expected.
*
* @var string
*/
protected $expected;
/**
* The actual.
*
* @var string
*/
protected $actual;
/**
* The help message.
*
* @var string
*/
protected $help;
/**
* Constructor.
*
* @param string $expected
* @param string $actual
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($expected, $actual, $help = '', $code = 0, Exception $previous = null)
public function __construct($expected, $actual, $help = '', $code = 0, Throwable $previous = null)
{
$this->expected = $expected;
$this->actual = $actual;
$this->help = $help;
$actual = $actual === '' ? 'data is missing' : "get '$actual'";
parent::__construct(trim("Format expected $expected but $actual\n$help"), $code, $previous);
}
/**
* Get the expected.
*
* @return string
*/
public function getExpected(): string
{
return $this->expected;
}
/**
* Get the actual.
*
* @return string
*/
public function getActual(): string
{
return $this->actual;
}
/**
* Get the help message.
*
* @return string
*/
public function getHelp(): string
{
return $this->help;
}
}

View File

@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface RuntimeException extends Exception
{
//
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class UnitException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}

View File

@@ -11,19 +11,38 @@
namespace Carbon\Exceptions;
use Exception;
use Throwable;
class UnitNotConfiguredException extends UnitException
{
/**
* The unit.
*
* @var string
*/
protected $unit;
/**
* Constructor.
*
* @param string $unit
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($unit, $code = 0, Exception $previous = null)
public function __construct($unit, $code = 0, Throwable $previous = null)
{
$this->unit = $unit;
parent::__construct("Unit $unit have no configuration to get total from other units.", $code, $previous);
}
/**
* Get the unit.
*
* @return string
*/
public function getUnit(): string
{
return $this->unit;
}
}

View File

@@ -11,20 +11,39 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
class UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException
{
/**
* The getter.
*
* @var string
*/
protected $getter;
/**
* Constructor.
*
* @param string $name getter name
* @param string $getter getter name
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($name, $code = 0, Exception $previous = null)
public function __construct($getter, $code = 0, Throwable $previous = null)
{
parent::__construct("Unknown getter '$name'", $code, $previous);
$this->getter = $getter;
parent::__construct("Unknown getter '$getter'", $code, $previous);
}
/**
* Get the getter.
*
* @return string
*/
public function getGetter(): string
{
return $this->getter;
}
}

View File

@@ -12,19 +12,38 @@
namespace Carbon\Exceptions;
use BadMethodCallException as BaseBadMethodCallException;
use Exception;
use Throwable;
class UnknownMethodException extends BaseBadMethodCallException implements BadMethodCallException
{
/**
* The method.
*
* @var string
*/
protected $method;
/**
* Constructor.
*
* @param string $method
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($method, $code = 0, Exception $previous = null)
public function __construct($method, $code = 0, Throwable $previous = null)
{
$this->method = $method;
parent::__construct("Method $method does not exist.", $code, $previous);
}
/**
* Get the method.
*
* @return string
*/
public function getMethod(): string
{
return $this->method;
}
}

View File

@@ -11,20 +11,39 @@
namespace Carbon\Exceptions;
use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
use Throwable;
class UnknownSetterException extends BaseInvalidArgumentException implements BadMethodCallException
{
/**
* The setter.
*
* @var string
*/
protected $setter;
/**
* Constructor.
*
* @param string $name setter name
* @param string $setter setter name
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($name, $code = 0, Exception $previous = null)
public function __construct($setter, $code = 0, Throwable $previous = null)
{
parent::__construct("Unknown setter '$name'", $code, $previous);
$this->setter = $setter;
parent::__construct("Unknown setter '$setter'", $code, $previous);
}
/**
* Get the setter.
*
* @return string
*/
public function getSetter(): string
{
return $this->setter;
}
}

View File

@@ -11,19 +11,38 @@
namespace Carbon\Exceptions;
use Exception;
use Throwable;
class UnknownUnitException extends UnitException
{
/**
* The unit.
*
* @var string
*/
protected $unit;
/**
* Constructor.
*
* @param string $unit
* @param int $code
* @param Exception|null $previous
* @param Throwable|null $previous
*/
public function __construct($unit, $code = 0, Exception $previous = null)
public function __construct($unit, $code = 0, Throwable $previous = null)
{
$this->unit = $unit;
parent::__construct("Unknown unit '$unit'.", $code, $previous);
}
/**
* Get the unit.
*
* @return string
*/
public function getUnit(): string
{
return $this->unit;
}
}

View File

@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
use Exception;
use RuntimeException as BaseRuntimeException;
class UnreachableException extends BaseRuntimeException implements RuntimeException
{
/**
* Constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
*/
public function __construct($message, $code = 0, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
//
}