Skip to content

Commit

Permalink
Generic/UpperCaseConstantName: move parse error test to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Nov 26, 2024
1 parent e861eaf commit af0b0f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $foo->getBar()?->define('foo');

// PHP 8.3 introduces typed constants.
class TypedConstants {
const MISSING_VALUE; // Parse error.

const MyClass MYCONST = new MyClass;
const int VALID_NAME = 0;
final public const INT invalid_name = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

// Intentional parse error (missing class constant value).
// This should be the only test in this file.
// Testing that the sniff is *not* triggered.

class TypedConstants {
const MISSING_VALUE;
}

0 comments on commit af0b0f5

Please sign in to comment.