diff --git a/src/Chronos.php b/src/Chronos.php index 436abe2..cf0c497 100644 --- a/src/Chronos.php +++ b/src/Chronos.php @@ -936,7 +936,7 @@ public function modify(string $modifier): static { $new = parent::modify($modifier); if ($new === false) { - throw new InvalidArgumentException('Unable to modify date using: ' . $modifier); + throw new InvalidArgumentException(sprintf('Unable to modify date using `%s`', $modifier)); } return $new; @@ -2665,7 +2665,7 @@ public function __get(string $name): string|float|int|bool|DateTimeZone return $this->getTimezone()->getName(); default: - throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); + throw new InvalidArgumentException(sprintf('Unknown getter `%s`', $name)); } } @@ -2673,7 +2673,7 @@ public function __get(string $name): string|float|int|bool|DateTimeZone * Check if an attribute exists on the object * * @param string $name The property name to check. - * @return bool Whether or not the property exists. + * @return bool Whether the property exists. */ public function __isset(string $name): bool { diff --git a/src/ChronosDate.php b/src/ChronosDate.php index db84023..a60fc54 100644 --- a/src/ChronosDate.php +++ b/src/ChronosDate.php @@ -356,7 +356,7 @@ public function modify(string $modifier): static $new = clone $this; $new->native = $new->native->modify($modifier); if ($new->native === false) { - throw new InvalidArgumentException('Unable to modify date using: ' . $modifier); + throw new InvalidArgumentException(sprintf('Unable to modify date using `%s`', $modifier)); } if ($new->format('H:i:s') !== '00:00:00') { @@ -1647,7 +1647,7 @@ public function __get(string $name): string|float|int|bool return $this->month <= 6 ? 1 : 2; default: - throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); + throw new InvalidArgumentException(sprintf('Unknown getter `%s`', $name)); } } @@ -1655,7 +1655,7 @@ public function __get(string $name): string|float|int|bool * Check if an attribute exists on the object * * @param string $name The property name to check. - * @return bool Whether or not the property exists. + * @return bool Whether the property exists. */ public function __isset(string $name): bool { diff --git a/src/ChronosTime.php b/src/ChronosTime.php index cc7751f..88f52d2 100644 --- a/src/ChronosTime.php +++ b/src/ChronosTime.php @@ -120,7 +120,7 @@ protected static function parseString(string $time): int { if (!preg_match('/^\s*(\d{1,2})[:.](\d{1,2})(?|[:.](\d{1,2})[.](\d+)|[:.](\d{1,2}))?\s*$/', $time, $matches)) { throw new InvalidArgumentException( - 'Time string is not in expected format: "HH[:.]mm" or "HH[:.]mm[:.]ss.u".' + sprintf('Time string `%s` is not in expected format `HH[:.]mm` or `HH[:.]mm[:.]ss.u`.', $time) ); } @@ -130,7 +130,7 @@ protected static function parseString(string $time): int $microseconds = (int)substr($matches[4] ?? '', 0, 6); if ($hours > 24 || $minutes > 59 || $seconds > 59 || $microseconds > 999_999) { - throw new InvalidArgumentException('Time string contains invalid values.'); + throw new InvalidArgumentException(sprintf('Time string `%s` contains invalid values.', $time)); } $ticks = $hours * self::TICKS_PER_HOUR; diff --git a/src/Translator.php b/src/Translator.php index 5ffee67..37568ae 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -50,7 +50,7 @@ class Translator * Check if a translation key exists. * * @param string $key The key to check. - * @return bool Whether or not the key exists. + * @return bool Whether the key exists. */ public function exists(string $key): bool {