Skip to content

Commit 0492f91

Browse files
Optimized code
* ValidatesAttributes remove catch "Exception" * Added Annotations of PHP8 for devtool. Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent c5e3d3c commit 0492f91

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/Concerns/FormatsMessages.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ public function getDisplayableAttribute(string $attribute): string
8383
* Get the displayable name of the value.
8484
*
8585
* @param mixed $value
86-
* @return string
8786
*/
88-
public function getDisplayableValue(string $attribute, $value)
87+
public function getDisplayableValue(string $attribute, $value): string
8988
{
9089
if (isset($this->customValues[$attribute][$value])) {
9190
return $this->customValues[$attribute][$value];

src/Concerns/ValidatesAttributes.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,8 +1057,6 @@ public function validateTimezone(string $attribute, $value): bool
10571057
{
10581058
try {
10591059
new DateTimeZone($value);
1060-
} catch (Exception $e) {
1061-
return false;
10621060
} catch (Throwable $e) {
10631061
return false;
10641062
}

0 commit comments

Comments
 (0)