diff --git a/CHANGELOG.md b/CHANGELOG.md index 07082e9..24e639a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.0] - 2026-05-04 +### Changed +- Marked `\CodeOwners\Exception\NoMatchFoundException` and `\CodeOwners\Exception\UnableToParseException` as final + +## Backwards compatibility breaking changes +If you are extending `\CodeOwners\Exception\NoMatchFoundException` or `\CodeOwners\Exception\UnableToParseException` in your code, you will need to update your code to not extend these classes. + ## [2.3.1] - 2025-01-29 ### Removed - Support for PHP 8.0 diff --git a/src/Exception/NoMatchFoundException.php b/src/Exception/NoMatchFoundException.php index f69502c..66c9088 100644 --- a/src/Exception/NoMatchFoundException.php +++ b/src/Exception/NoMatchFoundException.php @@ -4,6 +4,6 @@ namespace CodeOwners\Exception; -class NoMatchFoundException extends \RuntimeException +final class NoMatchFoundException extends \RuntimeException { } diff --git a/src/Exception/UnableToParseException.php b/src/Exception/UnableToParseException.php index 1a78f8b..1a0c1f6 100644 --- a/src/Exception/UnableToParseException.php +++ b/src/Exception/UnableToParseException.php @@ -6,6 +6,6 @@ use RuntimeException; -class UnableToParseException extends RuntimeException +final class UnableToParseException extends RuntimeException { } diff --git a/src/Parser.php b/src/Parser.php index f17ed49..16f7b97 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -13,7 +13,7 @@ final class Parser implements ParserInterface * @return Pattern[] * @throws UnableToParseException */ - public function parseFile(string $file): array + #[\Override] public function parseFile(string $file): array { return $this->parseIterable($this->getFileIterable($file), $file); } @@ -24,7 +24,7 @@ public function parseFile(string $file): array * @return Pattern[] * @throws UnableToParseException */ - public function parseString(string $lines, ?string $filename = null): array + #[\Override] public function parseString(string $lines, ?string $filename = null): array { return $this->parseIterable(explode(PHP_EOL, $lines), $filename); } diff --git a/src/PatternMatcher.php b/src/PatternMatcher.php index 587983a..3ed34cc 100644 --- a/src/PatternMatcher.php +++ b/src/PatternMatcher.php @@ -19,7 +19,7 @@ public function __construct(Pattern ...$patterns) $this->patterns = $patterns; } - public function match(string $filename): Pattern + #[\Override] public function match(string $filename): Pattern { $matchedPatterns = array_filter( $this->patterns,