Skip to content

Commit 6ddb458

Browse files
committed
Exceptions code formatting
1 parent 2313910 commit 6ddb458

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/Reactable/Exceptions/ReactableInvalid.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ final class ReactableInvalid extends RuntimeException implements
2222
{
2323
public static function classNotExists(string $type): self
2424
{
25-
return new static("[{$type}] class or morph map not found.");
25+
return new static(sprintf(
26+
'[%s] class or morph map not found.',
27+
$type
28+
));
2629
}
2730

2831
public static function notImplementInterface(string $type): self
2932
{
30-
return new static(sprintf('[%s] must implement `%s` contract.', $type, ReactableContract::class));
33+
return new static(sprintf(
34+
'[%s] must implement `%s` contract.',
35+
$type, ReactableContract::class
36+
));
3137
}
3238
}

src/Reaction/Exceptions/RateOutOfRange.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace I\Love\Reaction\Exceptions;
1515

1616
use I\Love\Exceptions\LoveThrowable;
17-
use Cog\Laravel\Love\Reaction\Models\Reaction;
17+
use I\Love\Reaction\Models\Reaction;
1818
use OutOfRangeException;
1919

2020
final class RateOutOfRange extends OutOfRangeException implements
@@ -24,9 +24,7 @@ public static function withValue(float $rate): self
2424
{
2525
return new self(sprintf(
2626
'Invalid Reaction rate: `%s`. Must be between `%s` and `%s`',
27-
$rate,
28-
Reaction::RATE_MIN,
29-
Reaction::RATE_MAX
27+
$rate, Reaction::RATE_MIN, Reaction::RATE_MAX
3028
));
3129
}
3230
}

src/ReactionType/Exceptions/ReactionTypeInvalid.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ final class ReactionTypeInvalid extends RuntimeException implements
2121
{
2222
public static function nameNotExists(string $name): self
2323
{
24-
return new static("ReactionType with name `{$name}` not exists.");
24+
return new static(sprintf(
25+
'ReactionType with name `%s` not exists.',
26+
$name
27+
));
2528
}
2629
}

0 commit comments

Comments
 (0)