Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit 5accb70

Browse files
Must use nullable types (#19)
1 parent 3282785 commit 5accb70

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Libero/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<property name="spacesCountAroundEqualsSign" value="0"/>
4848
</properties>
4949
</rule>
50+
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
5051
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
5152
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
5253
<properties>

tests/cases/php/nullable-type

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---DESCRIPTION---
2+
Must use nullable types
3+
---CONTENTS---
4+
<?php
5+
6+
declare(strict_types=1);
7+
8+
function foo(Bar $baz = null, int $qux = null) : void
9+
{
10+
}
11+
12+
---FIXED---
13+
<?php
14+
15+
declare(strict_types=1);
16+
17+
function foo(?Bar $baz = null, ?int $qux = null) : void
18+
{
19+
}
20+
21+
---

0 commit comments

Comments
 (0)