Skip to content

Commit fc4dfd4

Browse files
committed
PHPLIB-953 Make internal classes final
1 parent 5858396 commit fc4dfd4

20 files changed

+21
-21
lines changed

src/Command/ListCollections.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @internal
3737
* @see https://mongodb.com/docs/manual/reference/command/listCollections/
3838
*/
39-
class ListCollections implements Executable
39+
final class ListCollections implements Executable
4040
{
4141
/**
4242
* Constructs a listCollections command.

src/Command/ListDatabases.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @internal
3838
* @see https://mongodb.com/docs/manual/reference/command/listDatabases/
3939
*/
40-
class ListDatabases implements Executable
40+
final class ListDatabases implements Executable
4141
{
4242
/**
4343
* Constructs a listDatabases command.

src/GridFS/CollectionWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*
4040
* @internal
4141
*/
42-
class CollectionWrapper
42+
final class CollectionWrapper
4343
{
4444
private Collection $chunksCollection;
4545

src/GridFS/ReadableStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* @internal
4040
*/
41-
class ReadableStream
41+
final class ReadableStream
4242
{
4343
private ?string $buffer = null;
4444

src/GridFS/StreamWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* @see Bucket::openDownloadStream()
5050
* @psalm-type ContextOptions = array{collectionWrapper: CollectionWrapper, file: object}|array{collectionWrapper: CollectionWrapper, filename: string, options: array}
5151
*/
52-
class StreamWrapper
52+
final class StreamWrapper
5353
{
5454
/** @var resource|null Stream context (set by PHP) */
5555
public $context;
@@ -89,7 +89,7 @@ public static function register(string $protocol = 'gridfs'): void
8989
stream_wrapper_unregister($protocol);
9090
}
9191

92-
stream_wrapper_register($protocol, static::class, STREAM_IS_URL);
92+
stream_wrapper_register($protocol, self::class, STREAM_IS_URL);
9393
}
9494

9595
/**

src/GridFS/WritableStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
* @internal
4444
*/
45-
class WritableStream
45+
final class WritableStream
4646
{
4747
private const DEFAULT_CHUNK_SIZE_BYTES = 261120;
4848

src/Model/CachingIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @template TValue
4141
* @template-implements Iterator<TKey, TValue>
4242
*/
43-
class CachingIterator implements Countable, Iterator
43+
final class CachingIterator implements Countable, Iterator
4444
{
4545
private const FIELD_KEY = 0;
4646
private const FIELD_VALUE = 1;

src/Model/CallbackIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @template TCallbackValue
3535
* @template-implements Iterator<TKey, TCallbackValue>
3636
*/
37-
class CallbackIterator implements Iterator
37+
final class CallbackIterator implements Iterator
3838
{
3939
/** @var callable(TValue, TKey): TCallbackValue */
4040
private $callback;

src/Model/ChangeStreamIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @template TValue of array|object
5252
* @template-extends IteratorIterator<int, TValue, CursorInterface<int, TValue>&Iterator<int, TValue>>
5353
*/
54-
class ChangeStreamIterator extends IteratorIterator implements CommandSubscriber
54+
final class ChangeStreamIterator extends IteratorIterator implements CommandSubscriber
5555
{
5656
private int $batchPosition = 0;
5757

src/Model/CollectionInfoCommandIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @see https://mongodb.com/docs/manual/reference/command/listCollections/
3333
* @template-extends IteratorIterator<int, array, Traversable<int, array>>
3434
*/
35-
class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator
35+
final class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator
3636
{
3737
/** @param Traversable<int, array> $iterator */
3838
public function __construct(Traversable $iterator, private ?string $databaseName = null)

src/Model/DatabaseInfoLegacyIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @see \MongoDB\Client::listDatabases()
3333
* @see https://mongodb.com/docs/manual/reference/command/listDatabases/
3434
*/
35-
class DatabaseInfoLegacyIterator implements DatabaseInfoIterator
35+
final class DatabaseInfoLegacyIterator implements DatabaseInfoIterator
3636
{
3737
public function __construct(private array $databases)
3838
{

src/Model/IndexInfoIteratorIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @see https://mongodb.com/docs/manual/reference/system-collections/
3737
* @template-extends IteratorIterator<int, array, Traversable<int, array>>
3838
*/
39-
class IndexInfoIteratorIterator extends IteratorIterator implements IndexInfoIterator
39+
final class IndexInfoIteratorIterator extends IteratorIterator implements IndexInfoIterator
4040
{
4141
/** @param Traversable<int, array> $iterator */
4242
public function __construct(Traversable $iterator, private ?string $ns = null)

src/Model/IndexInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst
3939
* @see https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/
4040
*/
41-
class IndexInput implements Serializable
41+
final class IndexInput implements Serializable
4242
{
4343
/**
4444
* @param array $index Index specification

src/Model/SearchIndexInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @see https://github.com/mongodb/specifications/blob/master/source/index-management/index-management.rst#search-indexes
3535
* @see https://mongodb.com/docs/manual/reference/method/db.collection.createSearchIndex/
3636
*/
37-
class SearchIndexInput implements Serializable
37+
final class SearchIndexInput implements Serializable
3838
{
3939
/**
4040
* @param array{definition: array|object, name?: string, type?: string} $index Search index specification

src/Operation/CreateEncryptedCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#create-encrypted-collection-helper
4949
* @see https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/manage-collections/
5050
*/
51-
class CreateEncryptedCollection implements Executable
51+
final class CreateEncryptedCollection implements Executable
5252
{
5353
private const WIRE_VERSION_FOR_QUERYABLE_ENCRYPTION_V2 = 21;
5454

src/Operation/Delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* @internal
4343
* @see https://mongodb.com/docs/manual/reference/command/delete/
4444
*/
45-
class Delete implements Executable, Explainable
45+
final class Delete implements Executable, Explainable
4646
{
4747
private const WIRE_VERSION_FOR_HINT = 9;
4848

src/Operation/DropEncryptedCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#drop-collection-helper
3838
* @see https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/manage-collections/
3939
*/
40-
class DropEncryptedCollection implements Executable
40+
final class DropEncryptedCollection implements Executable
4141
{
4242
private DropCollection $dropCollection;
4343

src/Operation/FindAndModify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @internal
5252
* @see https://mongodb.com/docs/manual/reference/command/findAndModify/
5353
*/
54-
class FindAndModify implements Executable, Explainable
54+
final class FindAndModify implements Executable, Explainable
5555
{
5656
private const WIRE_VERSION_FOR_HINT = 9;
5757

src/Operation/Update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* @internal
4646
* @see https://mongodb.com/docs/manual/reference/command/update/
4747
*/
48-
class Update implements Executable, Explainable
48+
final class Update implements Executable, Explainable
4949
{
5050
private const WIRE_VERSION_FOR_HINT = 8;
5151

src/Operation/WithTransaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use function time;
1212

1313
/** @internal */
14-
class WithTransaction
14+
final class WithTransaction
1515
{
1616
/** @var callable */
1717
private $callback;

0 commit comments

Comments
 (0)