Skip to content

Commit ade256e

Browse files
bshaffercopybara-github
authored andcommitted
chore: fix php lint (#11417)
fixes #11387 Addresses misc PHPDoc formatting issues. Note: This does the bare minimum to suppress the errors. In some cases, most notably in `CodedInputStream`, the `@param` tag is still missing a typehint, and should have one added (in those cases, the variable is being passed in as `int`, but then used in the function as `string`, so it will take consideration) Closes #11417 COPYBARA_INTEGRATE_REVIEW=#11417 from bshaffer:fix-php-lint 32c665d PiperOrigin-RevId: 499952558
1 parent 258d67c commit ade256e

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

php/src/Google/Protobuf/Internal/AnyBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function unpack()
5050
/**
5151
* The type_url will be created according to the given message’s type and
5252
* the value is encoded data from the given message..
53-
* @param message: A proto message.
53+
* @param Message $msg A proto message.
5454
*/
5555
public function pack($msg)
5656
{
@@ -73,7 +73,7 @@ public function pack($msg)
7373
/**
7474
* This method returns whether the type_url in any_message is corresponded
7575
* to the given class.
76-
* @param klass: The fully qualified PHP class name of a proto message type.
76+
* @param string $klass The fully qualified PHP class name of a proto message type.
7777
*/
7878
public function is($klass)
7979
{

php/src/Google/Protobuf/Internal/CodedInputStream.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function consumedEntireMessage()
113113
/**
114114
* Read uint32 into $var. Advance buffer with consumed bytes. If the
115115
* contained varint is larger than 32 bits, discard the high order bits.
116-
* @param $var.
116+
* @param $var
117117
*/
118118
public function readVarint32(&$var)
119119
{
@@ -142,7 +142,7 @@ public function readVarint32(&$var)
142142

143143
/**
144144
* Read Uint64 into $var. Advance buffer with consumed bytes.
145-
* @param $var.
145+
* @param $var
146146
*/
147147
public function readVarint64(&$var)
148148
{
@@ -208,7 +208,7 @@ public function readVarint64(&$var)
208208
/**
209209
* Read int into $var. If the result is larger than the largest integer, $var
210210
* will be -1. Advance buffer with consumed bytes.
211-
* @param $var.
211+
* @param $var
212212
*/
213213
public function readVarintSizeAsInt(&$var)
214214
{
@@ -222,7 +222,7 @@ public function readVarintSizeAsInt(&$var)
222222
/**
223223
* Read 32-bit unsigned integer to $var. If the buffer has less than 4 bytes,
224224
* return false. Advance buffer with consumed bytes.
225-
* @param $var.
225+
* @param $var
226226
*/
227227
public function readLittleEndian32(&$var)
228228
{
@@ -238,7 +238,7 @@ public function readLittleEndian32(&$var)
238238
/**
239239
* Read 64-bit unsigned integer to $var. If the buffer has less than 8 bytes,
240240
* return false. Advance buffer with consumed bytes.
241-
* @param $var.
241+
* @param $var
242242
*/
243243
public function readLittleEndian64(&$var)
244244
{
@@ -261,7 +261,6 @@ public function readLittleEndian64(&$var)
261261

262262
/**
263263
* Read tag into $var. Advance buffer with consumed bytes.
264-
* @param $var.
265264
*/
266265
public function readTag()
267266
{

php/src/Google/Protobuf/Internal/MapFieldIter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ class MapFieldIter implements \Iterator
5252
/**
5353
* Create iterator instance for MapField.
5454
*
55-
* @param MapField The MapField instance for which this iterator is
56-
* created.
57-
* @param GPBType Map key type.
55+
* @param array $container
56+
* @param GPBType $key_type Map key type.
5857
* @ignore
5958
*/
6059
public function __construct($container, $key_type)

php/src/Google/Protobuf/Internal/Message.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ private function parseFieldFromStream($tag, $input, $field)
544544

545545
/**
546546
* Clear all containing fields.
547-
* @return null.
547+
* @return null
548548
*/
549549
public function clear()
550550
{
@@ -654,7 +654,7 @@ public function clear()
654654

655655
/**
656656
* Clear all unknown fields previously parsed.
657-
* @return null.
657+
* @return null
658658
*/
659659
public function discardUnknownFields()
660660
{
@@ -700,7 +700,7 @@ public function discardUnknownFields()
700700
* sub-messages are deep-copied.
701701
*
702702
* @param object $msg Protobuf message to be merged from.
703-
* @return null.
703+
* @return null
704704
*/
705705
public function mergeFrom($msg)
706706
{
@@ -767,7 +767,7 @@ public function mergeFrom($msg)
767767
* specified message.
768768
*
769769
* @param string $data Binary protobuf data.
770-
* @return null.
770+
* @return null
771771
* @throws \Exception Invalid data.
772772
*/
773773
public function mergeFromString($data)
@@ -785,7 +785,8 @@ public function mergeFromString($data)
785785
* specified message.
786786
*
787787
* @param string $data Json protobuf data.
788-
* @return null.
788+
* @param bool $ignore_unknown
789+
* @return null
789790
* @throws \Exception Invalid data.
790791
*/
791792
public function mergeFromJsonString($data, $ignore_unknown = false)
@@ -1053,7 +1054,7 @@ private function convertJsonValueToProtoValue(
10531054
* must receive data that is either a string or a StringValue object.
10541055
*
10551056
* @param array $array An array containing message properties and values.
1056-
* @return null.
1057+
* @return null
10571058
*/
10581059
protected function mergeFromArray(array $array)
10591060
{

php/src/Google/Protobuf/Internal/RepeatedFieldIter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ class RepeatedFieldIter implements \Iterator
5656
/**
5757
* Create iterator instance for RepeatedField.
5858
*
59-
* @param RepeatedField The RepeatedField instance for which this iterator
60-
* is created.
59+
* @param array $container
6160
* @ignore
6261
*/
6362
public function __construct($container)

0 commit comments

Comments
 (0)