Skip to content
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## Unreleased (0.6.0)
## Unreleased (0.7.0)

### Changed
- Exclude `load.php` from `NamespaceDirectoryNameSniff`

## 0.6.0 (April 2, 2019)

### Summation:
- Updated PHPCS to v3.4 #88
Expand Down
2 changes: 1 addition & 1 deletion HM/Sniffs/Files/NamespaceDirectoryNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function process( File $phpcsFile, $stackPtr ) {
$directory = str_replace( DIRECTORY_SEPARATOR, '/', $directory );
}

if ( $filename === 'plugin.php' || $filename === 'functions.php' ) {
if ( $filename === 'plugin.php' || $filename === 'functions.php' || $filename === 'load.php' ) {
// Ignore the main file.
return;
}
Expand Down
13 changes: 13 additions & 0 deletions tests/fixtures/pass/load.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* Package load file.
*
* This file should be excluded from the namespace directory test, as it's
* allowed to include files and run functions.
*/

namespace HM\Coding\Standards\Test;

require __DIR__ . '/inc/namespace.php';

bootstrap();