Skip to content

Commit

Permalink
Fix PHPStan exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Dec 5, 2021
1 parent b6e0b24 commit cb20bc3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ parameters:
- '#Call to an undefined method DateTimeInterface::setTimezone\(\)\.#'
- '#should return (\S*)static\(Carbon\\CarbonInterval\)\|null but returns Carbon\\CarbonInterval(\|null)?\.$#'
# - '#should return (\S*)static\(Carbon\\CarbonPeriod\) but returns Carbon\\CarbonPeriod\.$#'
- '#should return (\S*)static\(Carbon\\Carbon\) but returns Carbon\\Carbon(Interface)?\.$#'
- '#should return (\S*)static\(Carbon\\CarbonImmutable\) but returns Carbon\\Carbon(Immutable|Interface)\.$#'
- '#should return (\S*)static\(Carbon\\CarbonImmutable\)\|null but returns Carbon\\Carbon(Immutable|Interface)\|null\.$#'
- '#should return (\S*)static\(Carbon\\Carbon\)(\|null)? but returns Carbon\\Carbon(Interface)?(\|null)?\.$#'
- '#should return (\S*)static\(Carbon\\CarbonImmutable\)(\|null)? but returns Carbon\\Carbon(Immutable|Interface)(\|null)?\.$#'
- '#^PHPDoc tag @return with type Carbon\\CarbonTimeZone is not subtype of native type static\(Carbon\\CarbonTimeZone\)\.$#'
- '#^PHPDoc tag @mixin contains invalid type Carbon\\Traits\\DeprecatedProperties\.$#'
- '#^Implementing PHPStan\\Reflection\\Php\\BuiltinMethodReflection is not covered by backward compatibility promise\.#'
Expand Down
2 changes: 2 additions & 0 deletions src/Carbon/CarbonInterval.php
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ protected static function this(): static
*
* @param string $intervalDefinition
*
* @throws InvalidIntervalException
*
* @return static
*/
public static function fromString(string $intervalDefinition): static
Expand Down
1 change: 0 additions & 1 deletion src/Carbon/Traits/Units.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ public function subtract($unit, $value = 1, ?bool $overflow = null): static
private static function rawAddUnit(self $date, string $unit, int|float $value): ?static
{
try {

if ($unit === 'microsecond' && version_compare(PHP_VERSION, '8.1.0-dev', '>=')) {
throw new UnsupportedUnitException($unit, '8.1'); // @codeCoverageIgnore
}
Expand Down

0 comments on commit cb20bc3

Please sign in to comment.