Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Type/Php/DateIntervalConstructorThrowTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use Throwable;
use function count;

#[AutowiredService]
Expand Down Expand Up @@ -40,7 +41,7 @@ public function getThrowTypeFromStaticMethodCall(MethodReflection $methodReflect
foreach ($constantStrings as $constantString) {
try {
new DateInterval($constantString->getValue());
} catch (\Exception $e) { // phpcs:ignore
} catch (Throwable) {
return $this->exceptionType();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Type/Php/DateTimeConstructorThrowTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use Throwable;
use function count;
use function in_array;

Expand Down Expand Up @@ -42,7 +43,7 @@ public function getThrowTypeFromStaticMethodCall(MethodReflection $methodReflect
foreach ($constantStrings as $constantString) {
try {
new DateTime($constantString->getValue());
} catch (\Exception $e) { // phpcs:ignore
} catch (Throwable) {
return $this->exceptionType();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Type/Php/DateTimeModifyMethodThrowTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use Throwable;
use function count;
use function in_array;

Expand Down Expand Up @@ -47,7 +48,7 @@ public function getThrowTypeFromMethodCall(MethodReflection $methodReflection, M
try {
$dateTime = new DateTime();
$dateTime->modify($constantString->getValue());
} catch (\Exception $e) { // phpcs:ignore
} catch (Throwable) {
return $this->exceptionType();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Type/Php/DateTimeZoneConstructorThrowTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use Throwable;
use function count;

#[AutowiredService]
Expand Down Expand Up @@ -40,7 +41,7 @@ public function getThrowTypeFromStaticMethodCall(MethodReflection $methodReflect
foreach ($constantStrings as $constantString) {
try {
new DateTimeZone($constantString->getValue());
} catch (\Exception $e) { // phpcs:ignore
} catch (Throwable) {
return $this->exceptionType();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use SimpleXMLElement;
use Throwable;
use function count;
use function extension_loaded;
use function libxml_use_internal_errors;
Expand Down Expand Up @@ -41,7 +42,7 @@ public function getThrowTypeFromStaticMethodCall(MethodReflection $methodReflect
foreach ($constantStrings as $constantString) {
try {
new SimpleXMLElement($constantString->getValue());
} catch (\Exception $e) { // phpcs:ignore
} catch (Throwable) {
return $methodReflection->getThrowType();
}

Expand Down
Loading