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

Commit a2c2c6a

Browse files
Class and interface constants must have visibility declared (#10)
1 parent f7c3df5 commit a2c2c6a

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

src/Libero/ruleset.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/>
1111
</rule>
1212

13+
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility">
14+
<properties>
15+
<property name="fixable" value="true"/>
16+
</properties>
17+
</rule>
1318
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
1419
<properties>
1520
<property name="psr12Compatible" value="true"/>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---DESCRIPTION---
2+
Class constants must have visibility declared
3+
---FILENAME---
4+
Foo.php
5+
---CONTENTS---
6+
<?php
7+
8+
declare(strict_types=1);
9+
10+
namespace Vendor;
11+
12+
class Foo
13+
{
14+
const FOO = 'bar';
15+
}
16+
17+
---FIXED---
18+
<?php
19+
20+
declare(strict_types=1);
21+
22+
namespace Vendor;
23+
24+
class Foo
25+
{
26+
public const FOO = 'bar';
27+
}
28+
29+
---
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---DESCRIPTION---
2+
Interface constants must have visibility declared
3+
---FILENAME---
4+
Foo.php
5+
---CONTENTS---
6+
<?php
7+
8+
declare(strict_types=1);
9+
10+
namespace Vendor;
11+
12+
interface Foo
13+
{
14+
const FOO = 'bar';
15+
}
16+
17+
---FIXED---
18+
<?php
19+
20+
declare(strict_types=1);
21+
22+
namespace Vendor;
23+
24+
interface Foo
25+
{
26+
public const FOO = 'bar';
27+
}
28+
29+
---

0 commit comments

Comments
 (0)