Skip to content

Commit 03b0bca

Browse files
authored
Merge #502 - Add remaining native return types
Pull-Request: #502
2 parents ea86a5c + 2b3cf84 commit 03b0bca

34 files changed

+59
-163
lines changed

‎phpcs.xml.dist‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint">
6767
<severity>4</severity>
6868
</rule>
69-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
70-
<severity>4</severity>
71-
</rule>
7269
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps">
7370
<severity>4</severity>
7471
</rule>

‎psalm-baseline.xml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,6 @@
857857
<code>$built[$field]</code>
858858
<code><![CDATA[$parsedClauses[$token->value]]]></code>
859859
</InvalidArgument>
860-
<MethodSignatureMustProvideReturnType>
861-
<code>__toString</code>
862-
</MethodSignatureMustProvideReturnType>
863860
<MixedArrayOffset>
864861
<code><![CDATA[$parsedClauses[$token->value]]]></code>
865862
<code><![CDATA[$parsedClauses[$token->value]]]></code>
@@ -1206,9 +1203,6 @@
12061203
</RedundantConditionGivenDocblockType>
12071204
</file>
12081205
<file src="src/UtfString.php">
1209-
<MethodSignatureMustProvideReturnType>
1210-
<code>__toString</code>
1211-
</MethodSignatureMustProvideReturnType>
12121206
<PossiblyUnusedProperty>
12131207
<code>$byteLen</code>
12141208
</PossiblyUnusedProperty>

‎src/Component.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ interface Component extends Stringable
2222
* @param Parser $parser the parser that serves as context
2323
* @param TokensList $list the list of tokens that are being parsed
2424
* @param array<string, mixed> $options parameters for parsing
25-
*
26-
* @return mixed
2725
*/
28-
public static function parse(Parser $parser, TokensList $list, array $options = []);
26+
public static function parse(Parser $parser, TokensList $list, array $options = []): mixed;
2927

3028
/**
3129
* Builds the string representation of a component of this type.

‎src/Components/AlterOperation.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,8 @@ public function __construct(
300300
* @param Parser $parser the parser that serves as context
301301
* @param TokensList $list the list of tokens that are being parsed
302302
* @param array<string, mixed> $options parameters for parsing
303-
*
304-
* @return AlterOperation
305303
*/
306-
public static function parse(Parser $parser, TokensList $list, array $options = [])
304+
public static function parse(Parser $parser, TokensList $list, array $options = []): AlterOperation
307305
{
308306
$ret = new static();
309307

‎src/Components/ArrayObj.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(array $raw = [], array $values = [])
4949
*
5050
* @return ArrayObj|Component[]
5151
*/
52-
public static function parse(Parser $parser, TokensList $list, array $options = [])
52+
public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj|array
5353
{
5454
$ret = empty($options['type']) ? new static() : [];
5555

‎src/Components/CaseExpression.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ final class CaseExpression implements Component
7070
* @param Parser $parser the parser that serves as context
7171
* @param TokensList $list the list of tokens that are being parsed
7272
* @param array<string, mixed> $options parameters for parsing
73-
*
74-
* @return CaseExpression
7573
*/
76-
public static function parse(Parser $parser, TokensList $list, array $options = [])
74+
public static function parse(Parser $parser, TokensList $list, array $options = []): CaseExpression
7775
{
7876
$ret = new static();
7977

‎src/Components/CreateDefinition.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function __construct(
180180
*
181181
* @return CreateDefinition[]
182182
*/
183-
public static function parse(Parser $parser, TokensList $list, array $options = [])
183+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
184184
{
185185
$ret = [];
186186

‎src/Components/DataType.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ public function __construct(
9393
* @param Parser $parser the parser that serves as context
9494
* @param TokensList $list the list of tokens that are being parsed
9595
* @param array<string, mixed> $options parameters for parsing
96-
*
97-
* @return DataType|null
9896
*/
99-
public static function parse(Parser $parser, TokensList $list, array $options = [])
97+
public static function parse(Parser $parser, TokensList $list, array $options = []): DataType|null
10098
{
10199
$ret = new static();
102100

‎src/Components/FunctionCall.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ public function __construct($name = null, $parameters = null)
4848
* @param Parser $parser the parser that serves as context
4949
* @param TokensList $list the list of tokens that are being parsed
5050
* @param array<string, mixed> $options parameters for parsing
51-
*
52-
* @return FunctionCall
5351
*/
54-
public static function parse(Parser $parser, TokensList $list, array $options = [])
52+
public static function parse(Parser $parser, TokensList $list, array $options = []): FunctionCall
5553
{
5654
$ret = new static();
5755

‎src/Components/IntoKeyword.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,8 @@ public function __construct(
137137
* @param Parser $parser the parser that serves as context
138138
* @param TokensList $list the list of tokens that are being parsed
139139
* @param array<string, mixed> $options parameters for parsing
140-
*
141-
* @return IntoKeyword
142140
*/
143-
public static function parse(Parser $parser, TokensList $list, array $options = [])
141+
public static function parse(Parser $parser, TokensList $list, array $options = []): IntoKeyword
144142
{
145143
$ret = new static();
146144

0 commit comments

Comments
 (0)