PHPCSUtils 1.1.0

FileInfo
in package

FinalYes

Utility functions to retrieve information about the file under scan.

Tags
since
1.1.0

Table of Contents

Methods

hasByteOrderMark()  : string|false
Determine whether the file under scan has a byte-order mark at the start.
hasSheBang()  : bool
Determine whether the file under scan has a shebang line at the start.

Methods

hasByteOrderMark()

Determine whether the file under scan has a byte-order mark at the start.

public static hasByteOrderMark(File $phpcsFile) : string|false

Inspired by similar code being used in a couple of PHPCS native sniffs.

Parameters
$phpcsFile : File

The file being scanned.

Tags
since
1.1.0
Return values
string|false

Name of the type of BOM found or FALSE when the file does not start with a BOM.

hasSheBang()

Determine whether the file under scan has a shebang line at the start.

public static hasSheBang(File $phpcsFile) : bool
Parameters
$phpcsFile : File

The file being scanned.

Tags
since
1.1.0
Return values
bool

        
On this page

Search results