Skip to content

Commit 23a8ea7

Browse files
committed
exception: use natural explanatory style
1 parent 2a404d4 commit 23a8ea7

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

src/Utils/exceptions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,39 @@
1111

1212

1313
/**
14-
* The exception that is thrown when an image error occurs.
14+
* An error occurred while working with the image.
1515
*/
1616
class ImageException extends \Exception
1717
{
1818
}
1919

2020

2121
/**
22-
* The exception that indicates invalid image file.
22+
* The image file is invalid or in an unsupported format.
2323
*/
2424
class UnknownImageFileException extends ImageException
2525
{
2626
}
2727

2828

2929
/**
30-
* The exception that indicates error of JSON encoding/decoding.
30+
* JSON encoding or decoding failed.
3131
*/
3232
class JsonException extends \JsonException
3333
{
3434
}
3535

3636

3737
/**
38-
* The exception that indicates error of the last Regexp execution.
38+
* Regular expression pattern or execution failed.
3939
*/
4040
class RegexpException extends \Exception
4141
{
4242
}
4343

4444

4545
/**
46-
* The exception that indicates assertion error.
46+
* Type validation failed. The value doesn't match the expected type constraints.
4747
*/
4848
class AssertionException extends \Exception
4949
{

src/exceptions.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,98 +11,95 @@
1111

1212

1313
/**
14-
* The exception that is thrown when the value of an argument is
15-
* outside the allowable range of values as defined by the invoked method.
14+
* The value is outside the allowed range.
1615
*/
1716
class ArgumentOutOfRangeException extends \InvalidArgumentException
1817
{
1918
}
2019

2120

2221
/**
23-
* The exception that is thrown when a method call is invalid for the object's
24-
* current state, method has been invoked at an illegal or inappropriate time.
22+
* The object is in a state that does not allow the requested operation.
2523
*/
2624
class InvalidStateException extends \RuntimeException
2725
{
2826
}
2927

3028

3129
/**
32-
* The exception that is thrown when a requested method or operation is not implemented.
30+
* The requested feature is not implemented.
3331
*/
3432
class NotImplementedException extends \LogicException
3533
{
3634
}
3735

3836

3937
/**
40-
* The exception that is thrown when an invoked method is not supported. For scenarios where
41-
* it is sometimes possible to perform the requested operation, see InvalidStateException.
38+
* The requested operation is not supported.
4239
*/
4340
class NotSupportedException extends \LogicException
4441
{
4542
}
4643

4744

4845
/**
49-
* The exception that is thrown when a requested method or operation is deprecated.
46+
* The requested feature is deprecated and no longer available.
5047
*/
5148
class DeprecatedException extends NotSupportedException
5249
{
5350
}
5451

5552

5653
/**
57-
* The exception that is thrown when accessing a class member (property or method) fails.
54+
* Cannot access the requested class property or method.
5855
*/
5956
class MemberAccessException extends \Error
6057
{
6158
}
6259

6360

6461
/**
65-
* The exception that is thrown when an I/O error occurs.
62+
* Failed to read from or write to a file or stream.
6663
*/
6764
class IOException extends \RuntimeException
6865
{
6966
}
7067

7168

7269
/**
73-
* The exception that is thrown when accessing a file that does not exist on disk.
70+
* The requested file does not exist.
7471
*/
7572
class FileNotFoundException extends IOException
7673
{
7774
}
7875

7976

8077
/**
81-
* The exception that is thrown when part of a file or directory cannot be found.
78+
* The requested directory does not exist.
8279
*/
8380
class DirectoryNotFoundException extends IOException
8481
{
8582
}
8683

8784

8885
/**
89-
* The exception that is thrown when an argument does not match with the expected value.
86+
* The provided argument has invalid type or format.
9087
*/
9188
class InvalidArgumentException extends \InvalidArgumentException
9289
{
9390
}
9491

9592

9693
/**
97-
* The exception that is thrown when an illegal index was requested.
94+
* The requested array or collection index does not exist.
9895
*/
9996
class OutOfRangeException extends \OutOfRangeException
10097
{
10198
}
10299

103100

104101
/**
105-
* The exception that is thrown when a value (typically returned by function) does not match with the expected value.
102+
* The returned value has unexpected type or format.
106103
*/
107104
class UnexpectedValueException extends \UnexpectedValueException
108105
{

0 commit comments

Comments
 (0)