Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Libero/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/>
</rule>

<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility">
<properties>
<property name="fixable" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="psr12Compatible" value="true"/>
Expand Down
29 changes: 29 additions & 0 deletions tests/cases/classes/constant-visibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---DESCRIPTION---
Class constants must have visibility declared
---FILENAME---
Foo.php
---CONTENTS---
<?php

declare(strict_types=1);

namespace Vendor;

class Foo
{
const FOO = 'bar';
}

---FIXED---
<?php

declare(strict_types=1);

namespace Vendor;

class Foo
{
public const FOO = 'bar';
}

---
29 changes: 29 additions & 0 deletions tests/cases/interfaces/constant-visibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---DESCRIPTION---
Interface constants must have visibility declared
---FILENAME---
Foo.php
---CONTENTS---
<?php

declare(strict_types=1);

namespace Vendor;

interface Foo
{
const FOO = 'bar';
}

---FIXED---
<?php

declare(strict_types=1);

namespace Vendor;

interface Foo
{
public const FOO = 'bar';
}

---