File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ language : php
2+
3+ php :
4+ - 7.1
5+ - 7.2
6+
7+ cache :
8+ directories :
9+ - $HOME/.composer/cache
10+
11+ install : composer install
12+
13+ script : vendor/bin/phpcs --standard=src/LEVIY/ruleset.xml --basepath=. --report-file=phpcs.log --report-width=120 tests/; diff tests/expected.log phpcs.log
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types = 1 );
4+
5+ namespace Bar ;
6+
7+ use \DateTime ;
8+
9+ class Bar
10+ {
11+ const NOW = 'now ' ;
12+
13+ public function getDate () : DateTime
14+ {
15+ $ now = strtolower (self ::NOW );
16+
17+ return new DateTime ($ now );
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ namespace Bar ;
5+
6+ use DateTime ;
7+
8+ class Foo
9+ {
10+ private const NOW = 'now ' ;
11+
12+ public function getDate (): DateTime
13+ {
14+ return new DateTime (self ::NOW );
15+ }
16+ }
Original file line number Diff line number Diff line change 1+
2+ FILE: tests/Bar.php
3+ ----------------------------------------------------------------------------------------------------------------------
4+ FOUND 6 ERRORS AFFECTING 5 LINES
5+ ----------------------------------------------------------------------------------------------------------------------
6+ 3 | ERROR | [x] Expected 1 newlines between PHP open tag and declare statement, found 2.
7+ 3 | ERROR | [x] Expected strict_types=1, found strict_types = 1.
8+ 7 | ERROR | [x] Use statement cannot start with a backslash.
9+ 11 | ERROR | [ ] Constant \Bar\Bar::NOW visibility missing.
10+ 13 | ERROR | [x] There must be no whitespace between closing parenthesis and return type colon.
11+ 15 | ERROR | [x] Function strtolower() should not be referenced via a fallback global name, but via a use statement.
12+ ----------------------------------------------------------------------------------------------------------------------
13+ PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
14+ ----------------------------------------------------------------------------------------------------------------------
15+
16+
You can’t perform that action at this time.
0 commit comments