Skip to content

Commit 0f7b837

Browse files
committed
Removed extension points with final declaration
1 parent ae724fd commit 0f7b837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+41
-173
lines changed

src/Coduo/PHPMatcher/AST/Expander.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\AST;
44

5-
class Expander implements Node
5+
final class Expander implements Node
66
{
77
/**
88
* @var

src/Coduo/PHPMatcher/AST/Pattern.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\AST;
44

5-
class Pattern implements Node
5+
final class Pattern implements Node
66
{
77
/**
88
* @var Type

src/Coduo/PHPMatcher/AST/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\AST;
44

5-
class Type implements Node
5+
final class Type implements Node
66
{
77
/**
88
* @var string

src/Coduo/PHPMatcher/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Doctrine\Common\Lexer\AbstractLexer;
66

7-
class Lexer extends AbstractLexer
7+
final class Lexer extends AbstractLexer
88
{
99
const T_NONE = 1;
1010
const T_EXPANDER_NAME = 2;

src/Coduo/PHPMatcher/Matcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\PHPMatcher\Matcher\ValueMatcher;
66

7-
class Matcher
7+
final class Matcher
88
{
99
/**
1010
* @var ValueMatcher

src/Coduo/PHPMatcher/Matcher/ArrayMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Symfony\Component\PropertyAccess\PropertyAccess;
88
use Symfony\Component\PropertyAccess\PropertyAccessor;
99

10-
class ArrayMatcher extends Matcher
10+
final class ArrayMatcher extends Matcher
1111
{
1212
const UNBOUNDED_PATTERN = '@...@';
1313

src/Coduo/PHPMatcher/Matcher/BooleanMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\ToString\StringConverter;
66

7-
class BooleanMatcher extends Matcher
7+
final class BooleanMatcher extends Matcher
88
{
99
const BOOLEAN_PATTERN = '/^@boolean@$/';
1010

src/Coduo/PHPMatcher/Matcher/CallbackMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\Matcher;
44

5-
class CallbackMatcher extends Matcher
5+
final class CallbackMatcher extends Matcher
66
{
77
/**
88
* {@inheritdoc}

src/Coduo/PHPMatcher/Matcher/CaptureMatcher.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/Coduo/PHPMatcher/Matcher/ChainMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\ToString\StringConverter;
66

7-
class ChainMatcher extends Matcher
7+
final class ChainMatcher extends Matcher
88
{
99
/**
1010
* @var array|ValueMatcher[]

src/Coduo/PHPMatcher/Matcher/DoubleMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Parser;
66
use Coduo\ToString\StringConverter;
77

8-
class DoubleMatcher extends Matcher
8+
final class DoubleMatcher extends Matcher
99
{
1010
/**
1111
* @var Parser

src/Coduo/PHPMatcher/Matcher/ExpressionMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\ToString\StringConverter;
66
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
77

8-
class ExpressionMatcher extends Matcher
8+
final class ExpressionMatcher extends Matcher
99
{
1010
const MATCH_PATTERN = "/^expr\((.*?)\)$/";
1111

src/Coduo/PHPMatcher/Matcher/IntegerMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Parser;
66
use Coduo\ToString\StringConverter;
77

8-
class IntegerMatcher extends Matcher
8+
final class IntegerMatcher extends Matcher
99
{
1010
/**
1111
* @var Parser

src/Coduo/PHPMatcher/Matcher/JsonMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\PHPMatcher\Matcher\Pattern\Assert\Json;
66

7-
class JsonMatcher extends Matcher
7+
final class JsonMatcher extends Matcher
88
{
99
/**
1010
* @var

src/Coduo/PHPMatcher/Matcher/NullMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\ToString\StringConverter;
66

7-
class NullMatcher extends Matcher
7+
final class NullMatcher extends Matcher
88
{
99
const MATCH_PATTERN = "/^@null@$/";
1010

src/Coduo/PHPMatcher/Matcher/NumberMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\ToString\StringConverter;
66

7-
class NumberMatcher extends Matcher
7+
final class NumberMatcher extends Matcher
88
{
99
const NUMBER_PATTERN = '/^@number@$/';
1010

src/Coduo/PHPMatcher/Matcher/Pattern/Assert/Json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\Matcher\Pattern\Assert;
44

5-
class Json
5+
final class Json
66
{
77
const TRANSFORM_QUOTATION_PATTERN = '/([^"])@([a-zA-Z0-9\.]+)@([^"])/';
88
const TRANSFORM_QUOTATION_REPLACEMENT = '$1"@$2@"$3';

src/Coduo/PHPMatcher/Matcher/Pattern/Assert/Xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\Matcher\Pattern\Assert;
44

5-
class Xml
5+
final class Xml
66
{
77
/**
88
* @param $value

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/Contains.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class Contains implements PatternExpander
8+
final class Contains implements PatternExpander
99
{
1010
/**
1111
* @var null|string

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/EndsWith.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class EndsWith implements PatternExpander
8+
final class EndsWith implements PatternExpander
99
{
1010
/**
1111
* @var

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/GreaterThan.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class GreaterThan implements PatternExpander
8+
final class GreaterThan implements PatternExpander
99
{
1010
/**
1111
* @var
@@ -22,7 +22,7 @@ class GreaterThan implements PatternExpander
2222
*/
2323
public function __construct($boundary)
2424
{
25-
if (!is_float($boundary) && !is_integer($boundary) && !is_double($boundary)) {
25+
if (!is_float($boundary) && !is_int($boundary)) {
2626
throw new \InvalidArgumentException(sprintf("Boundary value \"%s\" is not a valid number.", new StringConverter($boundary)));
2727
}
2828

@@ -35,7 +35,7 @@ public function __construct($boundary)
3535
*/
3636
public function match($value)
3737
{
38-
if (!is_float($value) && !is_integer($value) && !is_double($value) && !is_numeric($value)) {
38+
if (!is_float($value) && !is_int($value) && !is_numeric($value)) {
3939
$this->error = sprintf("Value \"%s\" is not a valid number.", new StringConverter($value));
4040
return false;
4141
}

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/InArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class InArray implements PatternExpander
8+
final class InArray implements PatternExpander
99
{
1010
/**
1111
* @var null|string

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/IsDateTime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class IsDateTime implements PatternExpander
8+
final class IsDateTime implements PatternExpander
99
{
1010
/**
1111
* @var null|string

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/IsEmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class IsEmail implements PatternExpander
8+
final class IsEmail implements PatternExpander
99
{
1010
/**
1111
* @var null|string

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/IsUrl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class IsUrl implements PatternExpander
8+
final class IsUrl implements PatternExpander
99
{
1010
/**
1111
* @var null|string

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/LowerThan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class LowerThan implements PatternExpander
8+
final class LowerThan implements PatternExpander
99
{
1010
/**
1111
* @var

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/MatchRegex.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
/**
9-
* @author Benjamin Lazarecki <[email protected]>
10-
*/
11-
class MatchRegex implements PatternExpander
8+
final class MatchRegex implements PatternExpander
129
{
1310
/**
1411
* @var null|string

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/NotEmpty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class NotEmpty implements PatternExpander
8+
final class NotEmpty implements PatternExpander
99
{
1010
private $error;
1111

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/OneOf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class OneOf implements PatternExpander
8+
final class OneOf implements PatternExpander
99
{
1010
/**
1111
* @var PatternExpander[]

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/StartsWith.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
class StartsWith implements PatternExpander
8+
final class StartsWith implements PatternExpander
99
{
1010
/**
1111
* @var

src/Coduo/PHPMatcher/Matcher/Pattern/Expander/isEmpty.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
66
use Coduo\ToString\StringConverter;
77

8-
/**
9-
* @author Benjamin Lazarecki <[email protected]>
10-
*/
11-
class isEmpty implements PatternExpander
8+
final class isEmpty implements PatternExpander
129
{
1310
private $error;
1411

src/Coduo/PHPMatcher/Matcher/Pattern/RegexConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\PHPMatcher\Exception\UnknownTypeException;
66

7-
class RegexConverter
7+
final class RegexConverter
88
{
99
public function toRegex(TypePattern $typePattern)
1010
{

src/Coduo/PHPMatcher/Matcher/Pattern/TypePattern.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Coduo\PHPMatcher\Matcher\Pattern;
44

5-
class TypePattern implements Pattern
5+
final class TypePattern implements Pattern
66
{
77
/**
88
* @var string

src/Coduo/PHPMatcher/Matcher/ScalarMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Coduo\ToString\StringConverter;
66

7-
class ScalarMatcher extends Matcher
7+
final class ScalarMatcher extends Matcher
88
{
99
/**
1010
* {@inheritDoc}

src/Coduo/PHPMatcher/Matcher/StringMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Coduo\PHPMatcher\Parser;
66
use Coduo\ToString\StringConverter;
77

8-
class StringMatcher extends Matcher
8+
final class StringMatcher extends Matcher
99
{
1010
/**
1111
* @var Parser

src/Coduo/PHPMatcher/Matcher/TextMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Coduo\PHPMatcher\Matcher\Pattern\RegexConverter;
1111
use Coduo\ToString\StringConverter;
1212

13-
class TextMatcher extends Matcher
13+
final class TextMatcher extends Matcher
1414
{
1515
const PATTERN_REGEXP = "/@[a-zA-Z\\.]+@(\\.[a-zA-Z0-9_]+\\([a-zA-Z0-9{},:@\\.\"'\\(\\)]*\\))*/";
1616

0 commit comments

Comments
 (0)