FileInfo
in package
FinalYes
Utility functions to retrieve information about the file under scan.
Tags
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
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.