Skip to content

Commit cd88a8b

Browse files
committed
UserExperience/AdminBarRemoval: minor simplification
Let PHP sort out splitting the extension off the file name.
1 parent b42d405 commit cd88a8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function register() {
160160
public function process_token( $stackPtr ) {
161161

162162
$file_name = FilePath::getName( $this->phpcsFile );
163-
$file_extension = substr( strrchr( $file_name, '.' ), 1 );
163+
$file_extension = pathinfo( $file_name, \PATHINFO_EXTENSION );
164164

165165
if ( $file_extension === 'css' ) {
166166
if ( $this->tokens[ $stackPtr ]['code'] === \T_STYLE ) {

0 commit comments

Comments
 (0)