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

Commit ac243c9

Browse files
Functions must not be nested (#23)
* Functions must not be nested * Fix braces
1 parent 09065ca commit ac243c9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Libero/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
</properties>
5858
</rule>
5959
<rule ref="Squiz.Classes.ClassFileName"/>
60+
<rule ref="Squiz.PHP.InnerFunctions"/>
6061
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
6162
<properties>
6263
<property name="ignoreNewlines" value="true"/>

tests/cases/functions/nested

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---DESCRIPTION---
2+
Functions must not be nested
3+
---CONTENTS---
4+
<?php
5+
6+
declare(strict_types=1);
7+
8+
namespace Vendor;
9+
10+
function foo() : void
11+
{
12+
function bar() : void
13+
{
14+
}
15+
}
16+
17+
---MESSAGES---
18+
9:5 Squiz.PHP.InnerFunctions.NotAllowed
19+
---

0 commit comments

Comments
 (0)