PHP 클래스 Flitch\File\File

상속: extends SplDoublyLinkedLis\SplDoublyLinkedList, implements SeekableIterato\SeekableIterator
파일 보기 프로젝트 열기: dasprid/flitch 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$encoding string Encoding of the file.
$filename string Filename of the represented file.
$lines array Lines of the file.
$source string Source code of the represented file.
$violations array Violations in this file.

공개 메소드들

메소드 설명
__construct ( string $filename, string $source, string $encoding = 'utf-8' ) : void Create a new file representation.
addViolation ( Violation $violation ) : void Add a violation to the file.
getEncoding ( ) : string Get encoding of the file.
getFilename ( ) : string Get the filename of the represented file.
getLines ( ) : array Get all lines of the source code as array.
getSource ( ) : string Get the source code of the represented file.
getViolations ( ) : array Get all produced violations.
seek ( integer $position ) : void seek(): defined by SeekableIterator interface.
seekNextLine ( ) : boolean Seek to the next line.
seekTokenType ( mixed $type, boolean $backwards = false, mixed $stopper = null ) : boolean Seek to a specific token type.

메소드 상세

__construct() 공개 메소드

Create a new file representation.
public __construct ( string $filename, string $source, string $encoding = 'utf-8' ) : void
$filename string
$source string
$encoding string
리턴 void

addViolation() 공개 메소드

Add a violation to the file.
public addViolation ( Violation $violation ) : void
$violation Violation
리턴 void

getEncoding() 공개 메소드

Get encoding of the file.
public getEncoding ( ) : string
리턴 string

getFilename() 공개 메소드

Get the filename of the represented file.
public getFilename ( ) : string
리턴 string

getLines() 공개 메소드

Get all lines of the source code as array.
public getLines ( ) : array
리턴 array

getSource() 공개 메소드

Get the source code of the represented file.
public getSource ( ) : string
리턴 string

getViolations() 공개 메소드

Violations will be sorted by line/column before being returned.
public getViolations ( ) : array
리턴 array

seek() 공개 메소드

seek(): defined by SeekableIterator interface.
또한 보기: SeekableIterator::seek()
public seek ( integer $position ) : void
$position integer
리턴 void

seekNextLine() 공개 메소드

Seek to the next line.
public seekNextLine ( ) : boolean
리턴 boolean

seekTokenType() 공개 메소드

Returns true on success and false if the token can not be found. Seeking starts from current element. If the current token matches the given type, the position is not changed. In case a stopper is supplied, the seeking will stop at the given token.
public seekTokenType ( mixed $type, boolean $backwards = false, mixed $stopper = null ) : boolean
$type mixed
$backwards boolean
$stopper mixed
리턴 boolean

프로퍼티 상세

$encoding 보호되어 있는 프로퍼티

Encoding of the file.
protected string $encoding
리턴 string

$filename 보호되어 있는 프로퍼티

Filename of the represented file.
protected string $filename
리턴 string

$lines 보호되어 있는 프로퍼티

Lines of the file.
protected array $lines
리턴 array

$source 보호되어 있는 프로퍼티

Source code of the represented file.
protected string $source
리턴 string

$violations 보호되어 있는 프로퍼티

Violations in this file.
protected array $violations
리턴 array