Skip to content

Commit

Permalink
Make these classes final
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 19, 2019
1 parent e8850c1 commit f044a33
Show file tree
Hide file tree
Showing 94 changed files with 93 additions and 141 deletions.
2 changes: 1 addition & 1 deletion src/Framework/Constraint/ArrayHasKey.php
Expand Up @@ -19,7 +19,7 @@
*
* The array key is passed in the constructor.
*/
class ArrayHasKey extends Constraint
final class ArrayHasKey extends Constraint
{
/**
* @var int|string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/ArraySubset.php
Expand Up @@ -18,7 +18,7 @@
* Uses array_replace_recursive() to check if a key value subset is part of the
* subject array.
*/
class ArraySubset extends Constraint
final class ArraySubset extends Constraint
{
/**
* @var iterable
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Attribute.php
Expand Up @@ -12,7 +12,7 @@
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\ExpectationFailedException;

class Attribute extends Composite
final class Attribute extends Composite
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Callback.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that evaluates against a specified closure.
*/
class Callback extends Constraint
final class Callback extends Constraint
{
/**
* @var callable
Expand Down
1 change: 1 addition & 0 deletions src/Framework/Constraint/ClassHasAttribute.php
Expand Up @@ -47,6 +47,7 @@ public function toString(): string
* constraint is met, false otherwise.
*
* @param mixed $other value or object to evaluate
* @throws \ReflectionException
*/
protected function matches($other): bool
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/ClassHasStaticAttribute.php
Expand Up @@ -17,7 +17,7 @@
*
* The attribute name is passed in the constructor.
*/
class ClassHasStaticAttribute extends ClassHasAttribute
final class ClassHasStaticAttribute extends ClassHasAttribute
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/DirectoryExists.php
Expand Up @@ -14,7 +14,7 @@
*
* The file path to check is passed as $other in evaluate().
*/
class DirectoryExists extends Constraint
final class DirectoryExists extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Exception.php
Expand Up @@ -12,7 +12,7 @@
use PHPUnit\Util\Filter;
use Throwable;

class Exception extends Constraint
final class Exception extends Constraint
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/ExceptionCode.php
Expand Up @@ -9,7 +9,7 @@
*/
namespace PHPUnit\Framework\Constraint;

class ExceptionCode extends Constraint
final class ExceptionCode extends Constraint
{
/**
* @var int|string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/ExceptionMessage.php
Expand Up @@ -9,7 +9,7 @@
*/
namespace PHPUnit\Framework\Constraint;

class ExceptionMessage extends Constraint
final class ExceptionMessage extends Constraint
{
/**
* @var string
Expand Down
Expand Up @@ -11,7 +11,7 @@

use PHPUnit\Util\RegularExpression as RegularExpressionUtil;

class ExceptionMessageRegularExpression extends Constraint
final class ExceptionMessageRegularExpression extends Constraint
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/FileExists.php
Expand Up @@ -14,7 +14,7 @@
*
* The file path to check is passed as $other in evaluate().
*/
class FileExists extends Constraint
final class FileExists extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/GreaterThan.php
Expand Up @@ -13,7 +13,7 @@
* Constraint that asserts that the value it is evaluated for is greater
* than a given value.
*/
class GreaterThan extends Constraint
final class GreaterThan extends Constraint
{
/**
* @var float|int
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsAnything.php
Expand Up @@ -14,7 +14,7 @@
/**
* Constraint that accepts any input value.
*/
class IsAnything extends Constraint
final class IsAnything extends Constraint
{
/**
* Evaluates the constraint for parameter $other
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsEmpty.php
Expand Up @@ -14,7 +14,7 @@
/**
* Constraint that checks whether a variable is empty().
*/
class IsEmpty extends Constraint
final class IsEmpty extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsEqual.php
Expand Up @@ -22,7 +22,7 @@
*
* The expected value is passed in the constructor.
*/
class IsEqual extends Constraint
final class IsEqual extends Constraint
{
/**
* @var mixed
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsFalse.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that accepts false.
*/
class IsFalse extends Constraint
final class IsFalse extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsFinite.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that accepts finite.
*/
class IsFinite extends Constraint
final class IsFinite extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsIdentical.php
Expand Up @@ -23,7 +23,7 @@
*
* The expected value is passed in the constructor.
*/
class IsIdentical extends Constraint
final class IsIdentical extends Constraint
{
/**
* @var float
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsInfinite.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that accepts infinite.
*/
class IsInfinite extends Constraint
final class IsInfinite extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsInstanceOf.php
Expand Up @@ -18,7 +18,7 @@
*
* The expected class name is passed in the constructor.
*/
class IsInstanceOf extends Constraint
final class IsInstanceOf extends Constraint
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsJson.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that asserts that a string is valid JSON.
*/
class IsJson extends Constraint
final class IsJson extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsNan.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that accepts nan.
*/
class IsNan extends Constraint
final class IsNan extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsNull.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that accepts null.
*/
class IsNull extends Constraint
final class IsNull extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsReadable.php
Expand Up @@ -14,7 +14,7 @@
*
* The file path to check is passed as $other in evaluate().
*/
class IsReadable extends Constraint
final class IsReadable extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsTrue.php
Expand Up @@ -12,7 +12,7 @@
/**
* Constraint that accepts true.
*/
class IsTrue extends Constraint
final class IsTrue extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsType.php
Expand Up @@ -15,7 +15,7 @@
*
* The expected value is passed in the constructor.
*/
class IsType extends Constraint
final class IsType extends Constraint
{
public const TYPE_ARRAY = 'array';

Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsWritable.php
Expand Up @@ -14,7 +14,7 @@
*
* The file path to check is passed as $other in evaluate().
*/
class IsWritable extends Constraint
final class IsWritable extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/JsonMatches.php
Expand Up @@ -16,7 +16,7 @@
/**
* Asserts whether or not two JSON objects are equal.
*/
class JsonMatches extends Constraint
final class JsonMatches extends Constraint
{
/**
* @var string
Expand Down
Expand Up @@ -12,7 +12,7 @@
/**
* Provides human readable messages for each JSON error.
*/
class JsonMatchesErrorMessageProvider
final class JsonMatchesErrorMessageProvider
{
/**
* Translates JSON error to a human readable string.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/LessThan.php
Expand Up @@ -13,7 +13,7 @@
* Constraint that asserts that the value it is evaluated for is less than
* a given value.
*/
class LessThan extends Constraint
final class LessThan extends Constraint
{
/**
* @var float|int
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/LogicalAnd.php
Expand Up @@ -14,7 +14,7 @@
/**
* Logical AND.
*/
class LogicalAnd extends Constraint
final class LogicalAnd extends Constraint
{
/**
* @var Constraint[]
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/LogicalNot.php
Expand Up @@ -14,7 +14,7 @@
/**
* Logical NOT.
*/
class LogicalNot extends Constraint
final class LogicalNot extends Constraint
{
/**
* @var Constraint
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/LogicalOr.php
Expand Up @@ -14,7 +14,7 @@
/**
* Logical OR.
*/
class LogicalOr extends Constraint
final class LogicalOr extends Constraint
{
/**
* @var Constraint[]
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/LogicalXor.php
Expand Up @@ -14,7 +14,7 @@
/**
* Logical XOR.
*/
class LogicalXor extends Constraint
final class LogicalXor extends Constraint
{
/**
* @var Constraint[]
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/ObjectHasAttribute.php
Expand Up @@ -17,7 +17,7 @@
*
* The attribute name is passed in the constructor.
*/
class ObjectHasAttribute extends ClassHasAttribute
final class ObjectHasAttribute extends ClassHasAttribute
{
/**
* Evaluates the constraint for parameter $other. Returns true if the
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/SameSize.php
Expand Up @@ -9,7 +9,7 @@
*/
namespace PHPUnit\Framework\Constraint;

class SameSize extends Count
final class SameSize extends Count
{
public function __construct(iterable $expected)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/StringContains.php
Expand Up @@ -18,7 +18,7 @@
*
* The sub-string is passed in the constructor.
*/
class StringContains extends Constraint
final class StringContains extends Constraint
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/StringEndsWith.php
Expand Up @@ -13,7 +13,7 @@
* Constraint that asserts that the string it is evaluated for ends with a given
* suffix.
*/
class StringEndsWith extends Constraint
final class StringEndsWith extends Constraint
{
/**
* @var string
Expand Down
Expand Up @@ -14,7 +14,7 @@
/**
* ...
*/
class StringMatchesFormatDescription extends RegularExpression
final class StringMatchesFormatDescription extends RegularExpression
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/StringStartsWith.php
Expand Up @@ -13,7 +13,7 @@
* Constraint that asserts that the string it is evaluated for begins with a
* given prefix.
*/
class StringStartsWith extends Constraint
final class StringStartsWith extends Constraint
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/TraversableContains.php
Expand Up @@ -15,7 +15,7 @@
* Constraint that asserts that the Traversable it is applied to contains
* a given value.
*/
class TraversableContains extends Constraint
final class TraversableContains extends Constraint
{
/**
* @var bool
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/TraversableContainsOnly.php
Expand Up @@ -15,7 +15,7 @@
* Constraint that asserts that the Traversable it is applied to contains
* only values of a given type.
*/
class TraversableContainsOnly extends Constraint
final class TraversableContainsOnly extends Constraint
{
/**
* @var Constraint
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/CoveredCodeNotExecutedException.php
Expand Up @@ -9,6 +9,6 @@
*/
namespace PHPUnit\Framework;

class CoveredCodeNotExecutedException extends RiskyTestError
final class CoveredCodeNotExecutedException extends RiskyTestError
{
}

0 comments on commit f044a33

Please sign in to comment.