Skip to content

Commit

Permalink
Deprecate exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Feb 24, 2024
1 parent 9793f7c commit ce149a8
Show file tree
Hide file tree
Showing 33 changed files with 128 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,38 @@ Incoming
* Deprecate `Pattern.list()`
* Deprecate `PatternList`
* Deprecate `Pattern.mask()`
* Deprecate exceptions unqualified for release candidate.
* Deprecate `EmptyOptionalException`
* Deprecate `ExplicitDelimiterRequiredException`, to be refactored to `DelimiterException`
* Deprecate `GroupNotMatchedException`, to be refactored to `GroupException`
* Deprecate `IntegerFormatException`
* Deprecate `IntegerOverflowException`
* Deprecate `InternalCleanRegexException`
* Deprecate `InvalidIntegerTypeException`
* Deprecate `InvalidReplacementException`, to be refactored to `\UnexpectedValueException`
* Deprecate `InvalidReturnValueException`
* Deprecate `MalformedPcreTemplateException`, to be refactored to `SyntaxException`
* Deprecate `MaskMalformedPatternException`
* Deprecate `NonexistentGroupException`, to be refactored to `GroupException`
* Deprecate `NoSuchNthElementException`
* Deprecate `NoSuchStreamElementException`
* Deprecate `PatternMalformedPatternException`
* Deprecate `PlaceholderFigureException`
* Deprecate `ReplacementExpectationFailedException`
* Deprecate `SubjectNotMatchedException`, to be refactored to `NoMatchException`
* Deprecate `UnevenCutException`
* Deprecate `MalformedPatternException`, to be refactored to `SyntaxException`
* Deprecate `PatternSyntaxException`
* Deprecate `CatastrophicBacktrackingException`, to be refactored to `BacktrackException`
* Deprecate `CompilePregException`, to be refactored to `SyntaxException`
* Deprecate `JitStackLimitException`, to be refactored to `JitException`
* Deprecate `PatternStructureException`
* Deprecate `PregException`
* Deprecate `PregMalformedPatternException`, to be refactored to `SyntaxException`
* Deprecate `RuntimePregException`, to be refactored to `MatchException`
* Deprecate `SubjectEncodingException`, to be refactored to `UnicodeException`
* Deprecate `SuspectedReturnPregException`
* Deprecate `UnicodeOffsetException`, to be refactored to `UnicodeException`

Added in 0.41.5
---------------
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/EmptyOptionalException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class EmptyOptionalException extends \RuntimeException
{
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class ExplicitDelimiterRequiredException extends \RuntimeException implements PatternException
{
public function __construct(string $template)
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/GroupNotMatchedException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class GroupNotMatchedException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/IntegerFormatException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class IntegerFormatException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/IntegerOverflowException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class IntegerOverflowException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/InternalCleanRegexException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class InternalCleanRegexException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/InvalidIntegerTypeException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class InvalidIntegerTypeException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/InvalidReplacementException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\CleanRegex\Internal\Type\Type;

/**
* @deprecated
*/
class InvalidReplacementException extends InvalidReturnValueException
{
public function __construct(Type $replacementType)
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/InvalidReturnValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\CleanRegex\Internal\Type\Type;

/**
* @deprecated
*/
class InvalidReturnValueException extends \RuntimeException implements PatternException
{
public function __construct(string $methodName, string $expectedReturnType, Type $type)
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/MalformedPcreTemplateException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class MalformedPcreTemplateException extends PatternMalformedPatternException
{
public function __construct(string $message)
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/MaskMalformedPatternException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class MaskMalformedPatternException extends PatternMalformedPatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/NoSuchNthElementException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class NoSuchNthElementException extends \RuntimeException implements PatternException
{
public static function forSubject(int $index, int $total): self
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/NoSuchStreamElementException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class NoSuchStreamElementException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/NonexistentGroupException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\CleanRegex\Internal\GroupKey\GroupKey;

/**
* @deprecated
*/
class NonexistentGroupException extends \RuntimeException implements PatternException
{
public function __construct(GroupKey $group)
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/PatternMalformedPatternException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\Exception\MalformedPatternException;

/**
* @deprecated
*/
class PatternMalformedPatternException extends \RuntimeException implements PatternException, MalformedPatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/PlaceholderFigureException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class PlaceholderFigureException extends \RuntimeException implements PatternException
{
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class ReplacementExpectationFailedException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/SubjectNotMatchedException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class SubjectNotMatchedException extends \RuntimeException implements PatternException
{
public function __construct()
Expand Down
3 changes: 3 additions & 0 deletions src/CleanRegex/Exception/UnevenCutException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\CleanRegex\Exception;

/**
* @deprecated
*/
class UnevenCutException extends \RuntimeException implements PatternException
{
}
3 changes: 3 additions & 0 deletions src/Exception/MalformedPatternException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\Exception;

/**
* @deprecated
*/
interface MalformedPatternException extends PatternSyntaxException
{
}
3 changes: 3 additions & 0 deletions src/Exception/PatternSyntaxException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\Exception;

/**
* @deprecated
*/
interface PatternSyntaxException extends RegexException
{
}
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/CatastrophicBacktrackingException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class CatastrophicBacktrackingException extends RuntimePregException implements PatternStructureException
{
public function __construct($pattern, string $methodName, int $errorCode, string $errorName)
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/CompilePregException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\SafeRegex\Internal\PhpError;

/**
* @deprecated
*/
class CompilePregException extends \RuntimeException implements PregException
{
/** @var PhpError */
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/InvalidReturnValueException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class InvalidReturnValueException extends \RuntimeException implements PregException
{
/** @var string */
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/JitStackLimitException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class JitStackLimitException extends RuntimePregException implements PatternStructureException
{
public function __construct($pattern, string $methodName, int $errorCode, string $errorName)
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/PatternStructureException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
interface PatternStructureException extends PregException
{
}
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/PregException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\Exception\RegexException;

/**
* @deprecated
*/
interface PregException extends RegexException
{
public function getInvokingMethod(): string;
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/PregMalformedPatternException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use TRegx\Exception\MalformedPatternException;

/**
* @deprecated
*/
class PregMalformedPatternException extends CompilePregException implements MalformedPatternException
{
}
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/RuntimePregException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class RuntimePregException extends \RuntimeException implements PregException
{
/** @var string */
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/SubjectEncodingException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class SubjectEncodingException extends RuntimePregException
{
public function __construct($pattern, string $methodName, int $errorCode, string $errorName)
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/SuspectedReturnPregException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class SuspectedReturnPregException extends \RuntimeException implements PregException
{
/** @var string */
Expand Down
3 changes: 3 additions & 0 deletions src/SafeRegex/Exception/UnicodeOffsetException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace TRegx\SafeRegex\Exception;

/**
* @deprecated
*/
class UnicodeOffsetException extends RuntimePregException
{
public function __construct($pattern, string $methodName, int $errorCode, string $errorName)
Expand Down

0 comments on commit ce149a8

Please sign in to comment.