Skip to content

Commit 012650f

Browse files
committed
Remove useless param and return annotations
1 parent e6e08b3 commit 012650f

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
{

0 commit comments

Comments
 (0)