Skip to content

Commit e570295

Browse files
Declare classes final
1 parent 2b06c30 commit e570295

File tree

81 files changed

+83
-83
lines changed

Some content is hidden

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

81 files changed

+83
-83
lines changed

tests/_files/AlternativeSuffixTest.test.php

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

1212
use PHPUnit\Framework\TestCase;
1313

14-
class AlternativeSuffixTest extends TestCase
14+
final class AlternativeSuffixTest extends TestCase
1515
{
1616
public function testOne(): void
1717
{

tests/_files/AssertionExample.php

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

1212
use function assert;
1313

14-
class AssertionExample
14+
final class AssertionExample
1515
{
1616
public function doSomething(): void
1717
{

tests/_files/AssertionExampleTest.php

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

1212
use PHPUnit\Framework\TestCase;
1313

14-
class AssertionExampleTest extends TestCase
14+
final class AssertionExampleTest extends TestCase
1515
{
1616
public function testOne(): void
1717
{

tests/_files/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
namespace PHPUnit\TestFixture;
1111

12-
class Author
12+
final class Author
1313
{
1414
// the order of properties is important for testing the cycle!
1515
public $books = [];

tests/_files/BankAccount.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
*/
1010
namespace PHPUnit\TestFixture;
1111

12-
class BankAccount
12+
final class BankAccount
1313
{
1414
/**
1515
* The bank account's balance.
1616
*
1717
* @var float
1818
*/
19-
protected $balance = 0;
19+
private $balance = 0;
2020

2121
/**
2222
* Returns the bank account's balance.
@@ -63,7 +63,7 @@ public function withdrawMoney($balance)
6363
*
6464
* @throws BankAccountException
6565
*/
66-
protected function setBalance($balance): void
66+
private function setBalance($balance): void
6767
{
6868
if ($balance >= 0) {
6969
$this->balance = $balance;

tests/_files/BankAccountException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
use RuntimeException;
1313

14-
class BankAccountException extends RuntimeException
14+
final class BankAccountException extends RuntimeException
1515
{
1616
}

tests/_files/BankAccountTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515

1616
#[CoversFunction(BankAccount::class)]
17-
class BankAccountTest extends TestCase
17+
final class BankAccountTest extends TestCase
1818
{
1919
#[Group('balanceIsInitiallyZero')]
2020
#[Group('specification')]

tests/_files/BeforeClassAndAfterClassTest.php

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

1212
use PHPUnit\Framework\TestCase;
1313

14-
class BeforeClassAndAfterClassTest extends TestCase
14+
final class BeforeClassAndAfterClassTest extends TestCase
1515
{
1616
public static $beforeClassWasRun = 0;
1717
public static $afterClassWasRun = 0;

tests/_files/BeforeClassWithOnlyDataProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use PHPUnit\Framework\Attributes\DataProvider;
1313
use PHPUnit\Framework\TestCase;
1414

15-
class BeforeClassWithOnlyDataProviderTest extends TestCase
15+
final class BeforeClassWithOnlyDataProviderTest extends TestCase
1616
{
1717
public static $setUpBeforeClassWasCalled;
1818
public static $beforeClassWasCalled;

tests/_files/Book.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
namespace PHPUnit\TestFixture;
1111

12-
class Book
12+
final class Book
1313
{
1414
// the order of properties is important for testing the cycle!
1515
public $author;

0 commit comments

Comments
 (0)