Skip to content

Commit 2d5fb74

Browse files
committed
Remove useless @param and @return annotations
1 parent e6e08b3 commit 2d5fb74

File tree

82 files changed

+21
-288
lines changed

Some content is hidden

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

82 files changed

+21
-288
lines changed

phpcs.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
</properties>
113113

114114
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
115-
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation" />
116115
</rule>
117116

118117
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
@@ -126,7 +125,6 @@
126125
</properties>
127126

128127
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
129-
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.UselessAnnotation" />
130128
</rule>
131129

132130
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
@@ -140,7 +138,6 @@
140138
</properties>
141139

142140
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
143-
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation" />
144141
</rule>
145142

146143

src/BulkWriteResult.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class BulkWriteResult
3535
private $isAcknowledged;
3636

3737
/**
38-
* @param WriteResult $writeResult
39-
* @param mixed[] $insertedIds
38+
* @param mixed[] $insertedIds
4039
*/
4140
public function __construct(WriteResult $writeResult, array $insertedIds)
4241
{

src/ChangeStream.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ class ChangeStream implements Iterator
9090

9191
/**
9292
* @internal
93-
* @param ChangeStreamIterator $iterator
94-
* @param callable $resumeCallable
9593
*/
9694
public function __construct(ChangeStreamIterator $iterator, callable $resumeCallable)
9795
{
@@ -194,8 +192,6 @@ public function valid()
194192
* Determines if an exception is a resumable error.
195193
*
196194
* @see https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst#resumable-error
197-
* @param RuntimeException $exception
198-
* @return boolean
199195
*/
200196
private function isResumableError(RuntimeException $exception): bool
201197
{
@@ -251,8 +247,6 @@ private function onIteration(bool $incrementKey): void
251247

252248
/**
253249
* Recreates the ChangeStreamIterator after a resumable server error.
254-
*
255-
* @return void
256250
*/
257251
private function resume(): void
258252
{
@@ -265,7 +259,6 @@ private function resume(): void
265259
/**
266260
* Either resumes after a resumable error or re-throws the exception.
267261
*
268-
* @param RuntimeException $exception
269262
* @throws RuntimeException
270263
*/
271264
private function resumeOrThrow(RuntimeException $exception): void

src/Command/ListCollections.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public function __construct(string $databaseName, array $options = [])
103103
* Execute the operation.
104104
*
105105
* @see Executable::execute()
106-
* @param Server $server
107106
* @return CachingIterator
108107
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
109108
*/
@@ -117,8 +116,6 @@ public function execute(Server $server)
117116

118117
/**
119118
* Create the listCollections command.
120-
*
121-
* @return Command
122119
*/
123120
private function createCommand(): Command
124121
{

src/Command/ListDatabases.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public function __construct(array $options = [])
9999
* Execute the operation.
100100
*
101101
* @see Executable::execute()
102-
* @param Server $server
103102
* @return array An array of database info structures
104103
* @throws UnexpectedValueException if the command response was malformed
105104
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
@@ -119,8 +118,6 @@ public function execute(Server $server)
119118

120119
/**
121120
* Create the listDatabases command.
122-
*
123-
* @return Command
124121
*/
125122
private function createCommand(): Command
126123
{

src/Database.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ public function command($command, array $options = [])
257257
* Create a new collection explicitly.
258258
*
259259
* @see CreateCollection::__construct() for supported options
260-
* @param string $collectionName
261-
* @param array $options
260+
* @param array $options
262261
* @return array|object Command result document
263262
* @throws UnsupportedException if options are not supported by the selected server
264263
* @throws InvalidArgumentException for parameter/option parsing errors

src/GridFS/Bucket.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ public function uploadFromStream(string $filename, $source, array $options = [])
641641
* Creates a path for an existing GridFS file.
642642
*
643643
* @param stdClass $file GridFS file document
644-
* @return string
645644
*/
646645
private function createPathForFile(stdClass $file): string
647646
{
@@ -662,8 +661,6 @@ private function createPathForFile(stdClass $file): string
662661

663662
/**
664663
* Creates a path for a new GridFS file, which does not yet have an ID.
665-
*
666-
* @return string
667664
*/
668665
private function createPathForUpload(): string
669666
{
@@ -677,8 +674,6 @@ private function createPathForUpload(): string
677674

678675
/**
679676
* Returns the names of the files collection.
680-
*
681-
* @return string
682677
*/
683678
private function getFilesNamespace(): string
684679
{
@@ -692,7 +687,6 @@ private function getFilesNamespace(): string
692687
* respect the Bucket's type map.
693688
*
694689
* @param resource $stream GridFS stream
695-
* @return stdClass
696690
* @throws InvalidArgumentException
697691
*/
698692
private function getRawFileDocumentForStream($stream): stdClass

src/GridFS/CollectionWrapper.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ public function findChunksByFileId($id, int $fromChunk = 0)
138138
*
139139
* @see Bucket::downloadToStreamByName()
140140
* @see Bucket::openDownloadStreamByName()
141-
* @param string $filename
142-
* @param integer $revision
143141
* @return stdClass|null
144142
*/
145143
public function findFileByFilenameAndRevision(string $filename, int $revision)
@@ -277,8 +275,7 @@ public function insertFile($file)
277275
/**
278276
* Updates the filename field in the file document for a given ID.
279277
*
280-
* @param mixed $id
281-
* @param string $filename
278+
* @param mixed $id
282279
* @return UpdateResult
283280
*/
284281
public function updateFilenameForId($id, string $filename)
@@ -375,8 +372,6 @@ private function indexKeysMatch(array $expectedKeys, array $actualKeys): bool
375372

376373
/**
377374
* Returns whether the files collection is empty.
378-
*
379-
* @return boolean
380375
*/
381376
private function isFilesCollectionEmpty(): bool
382377
{

src/GridFS/ReadableStream.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ public function readBytes(int $length)
196196
/**
197197
* Seeks the chunk and buffer offsets for the next read operation.
198198
*
199-
* @param integer $offset
200199
* @throws InvalidArgumentException if $offset is out of range
201200
*/
202201
public function seek(int $offset)

src/GridFS/StreamWrapper.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ private function getStatTemplate(): array
281281
* Initialize the protocol from the given path.
282282
*
283283
* @see StreamWrapper::stream_open()
284-
* @param string $path
285284
*/
286285
private function initProtocol(string $path): void
287286
{
@@ -293,7 +292,6 @@ private function initProtocol(string $path): void
293292
* Initialize the internal stream for reading.
294293
*
295294
* @see StreamWrapper::stream_open()
296-
* @return boolean
297295
*/
298296
private function initReadableStream(): bool
299297
{
@@ -311,7 +309,6 @@ private function initReadableStream(): bool
311309
* Initialize the internal stream for writing.
312310
*
313311
* @see StreamWrapper::stream_open()
314-
* @return boolean
315312
*/
316313
private function initWritableStream(): bool
317314
{

src/InsertManyResult.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class InsertManyResult
3535
private $isAcknowledged;
3636

3737
/**
38-
* @param WriteResult $writeResult
39-
* @param mixed[] $insertedIds
38+
* @param mixed[] $insertedIds
4039
*/
4140
public function __construct(WriteResult $writeResult, array $insertedIds)
4241
{

src/InsertOneResult.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class InsertOneResult
3535
private $isAcknowledged;
3636

3737
/**
38-
* @param WriteResult $writeResult
39-
* @param mixed $insertedId
38+
* @param mixed $insertedId
4039
*/
4140
public function __construct(WriteResult $writeResult, $insertedId)
4241
{

src/Model/BSONDocument.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function __clone()
5050
* by default.
5151
*
5252
* @see https://php.net/arrayobject.construct
53-
* @param array $input
54-
* @param integer $flags
55-
* @param string $iteratorClass
53+
* @param array $input
5654
*/
5755
public function __construct(array $input = [], int $flags = ArrayObject::ARRAY_AS_PROPS, string $iteratorClass = 'ArrayIterator')
5856
{

src/Model/BSONIterator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public function rewind()
130130

131131
/**
132132
* @see https://php.net/iterator.valid
133-
* @return boolean
134133
*/
135134
#[ReturnTypeWillChange]
136135
public function valid(): bool

src/Model/ChangeStreamIterator.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ class ChangeStreamIterator extends IteratorIterator implements CommandSubscriber
7171

7272
/**
7373
* @internal
74-
* @param Cursor $cursor
75-
* @param integer $firstBatchSize
7674
* @param array|object|null $initialResumeToken
77-
* @param object|null $postBatchResumeToken
7875
*/
7976
public function __construct(Cursor $cursor, int $firstBatchSize, $initialResumeToken, ?object $postBatchResumeToken)
8077
{
@@ -270,8 +267,6 @@ private function extractResumeToken($document)
270267

271268
/**
272269
* Return whether the iterator is positioned at the end of the batch.
273-
*
274-
* @return boolean
275270
*/
276271
private function isAtEndOfBatch(): bool
277272
{
@@ -282,7 +277,6 @@ private function isAtEndOfBatch(): bool
282277
* Perform housekeeping after an iteration event.
283278
*
284279
* @see https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst#updating-the-cached-resume-token
285-
* @param boolean $incrementBatchPosition
286280
*/
287281
private function onIteration(bool $incrementBatchPosition): void
288282
{

src/Model/CollectionInfo.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ public function getOptions()
131131
* Return the collection type.
132132
*
133133
* @see https://mongodb.com/docs/manual/reference/command/listCollections/#output
134-
* @return string
135134
*/
136135
public function getType(): string
137136
{

src/Operation/Aggregate.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ public function __construct(string $databaseName, ?string $collectionName, array
256256
* Execute the operation.
257257
*
258258
* @see Executable::execute()
259-
* @param Server $server
260259
* @return Traversable
261260
* @throws UnexpectedValueException if the command response was malformed
262261
* @throws UnsupportedException if read concern or write concern is used and unsupported
@@ -307,7 +306,6 @@ public function execute(Server $server)
307306
* Returns the command document for this operation.
308307
*
309308
* @see Explainable::getCommandDocument()
310-
* @param Server $server
311309
* @return array
312310
*/
313311
public function getCommandDocument(Server $server)

src/Operation/BulkWrite.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ public function __construct(string $databaseName, string $collectionName, array
307307
* Execute the operation.
308308
*
309309
* @see Executable::execute()
310-
* @param Server $server
311310
* @return BulkWriteResult
312311
* @throws UnsupportedException if write concern is used and unsupported
313312
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/Count.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public function __construct(string $databaseName, string $collectionName, $filte
142142
* Execute the operation.
143143
*
144144
* @see Executable::execute()
145-
* @param Server $server
146145
* @return integer
147146
* @throws UnexpectedValueException if the command response was malformed
148147
* @throws UnsupportedException if read concern is used and unsupported
@@ -170,7 +169,6 @@ public function execute(Server $server)
170169
* Returns the command document for this operation.
171170
*
172171
* @see Explainable::getCommandDocument()
173-
* @param Server $server
174172
* @return array
175173
*/
176174
public function getCommandDocument(Server $server)

src/Operation/CountDocuments.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ public function __construct(string $databaseName, string $collectionName, $filte
121121
* Execute the operation.
122122
*
123123
* @see Executable::execute()
124-
* @param Server $server
125124
* @return integer
126125
* @throws UnexpectedValueException if the command response was malformed
127126
* @throws UnsupportedException if collation or read concern is used and unsupported

src/Operation/CreateCollection.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ public function __construct(string $databaseName, string $collectionName, array
265265
* Execute the operation.
266266
*
267267
* @see Executable::execute()
268-
* @param Server $server
269268
* @return array|object Command result document
270269
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
271270
*/
@@ -282,8 +281,6 @@ public function execute(Server $server)
282281

283282
/**
284283
* Create the create command.
285-
*
286-
* @return Command
287284
*/
288285
private function createCommand(): Command
289286
{

src/Operation/CreateIndexes.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ public function __construct(string $databaseName, string $collectionName, array
135135
* Execute the operation.
136136
*
137137
* @see Executable::execute()
138-
* @param Server $server
139138
* @return string[] The names of the created indexes
140139
* @throws UnsupportedException if write concern is used and unsupported
141140
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
@@ -179,7 +178,6 @@ private function createOptions(): array
179178
* Create one or more indexes for the collection using the createIndexes
180179
* command.
181180
*
182-
* @param Server $server
183181
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
184182
*/
185183
private function executeCommand(Server $server): void

src/Operation/DatabaseCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public function __construct(string $databaseName, $command, array $options = [])
9292
* Execute the operation.
9393
*
9494
* @see Executable::execute()
95-
* @param Server $server
9695
* @return Cursor
9796
*/
9897
public function execute(Server $server)

src/Operation/Delete.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public function __construct(string $databaseName, string $collectionName, $filte
142142
* Execute the operation.
143143
*
144144
* @see Executable::execute()
145-
* @param Server $server
146145
* @return DeleteResult
147146
* @throws UnsupportedException if hint or write concern is used and unsupported
148147
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
@@ -175,7 +174,6 @@ public function execute(Server $server)
175174
* Returns the command document for this operation.
176175
*
177176
* @see Explainable::getCommandDocument()
178-
* @param Server $server
179177
* @return array
180178
*/
181179
public function getCommandDocument(Server $server)

0 commit comments

Comments
 (0)