PHP Class SebastianBergmann\PHPCPD\CodeCloneMap

Inheritance: implements Countable, implements Iterator
Show file Open project: sebastianbergmann/phpcpd Class Usage Examples

Protected Properties

Property Type Description
$clones The clones in the clone map
$clonesById The clones in the clone map, stored by ID
$numDuplicateLines Number of duplicate lines in the clone map
$numLines Number of lines analyzed
$position Current position while iterating the clone map

Public Methods

Method Description
addClone ( CodeClone $clone ) Adds a clone to the map.
count ( ) Returns the number of clones stored in this map.
current ( ) : CodeClone Returns the current element.
getClones ( ) : CodeClone[] Returns the clones stored in this map.
getNumLines ( ) : integer Returns the number of lines analyzed.
getPercentage ( ) : string Returns the percentage of duplicated code lines in the project.
key ( ) : integer Returns the key of the current element.
next ( ) Moves forward to next element.
rewind ( ) Rewinds the Iterator to the first element.
setNumLines ( integer $numLines ) Sets the number of physical source code lines in the project.
valid ( ) : boolean Checks if there is a current element after calls to rewind() or next().

Method Details

addClone() public method

Adds a clone to the map.
public addClone ( CodeClone $clone )
$clone CodeClone

count() public method

Returns the number of clones stored in this map.
public count ( )

current() public method

Returns the current element.
public current ( ) : CodeClone
return CodeClone

getClones() public method

Returns the clones stored in this map.
public getClones ( ) : CodeClone[]
return CodeClone[]

getNumLines() public method

Returns the number of lines analyzed.
public getNumLines ( ) : integer
return integer

getPercentage() public method

Returns the percentage of duplicated code lines in the project.
public getPercentage ( ) : string
return string

key() public method

Returns the key of the current element.
public key ( ) : integer
return integer

next() public method

Moves forward to next element.
public next ( )

rewind() public method

Rewinds the Iterator to the first element.
public rewind ( )

setNumLines() public method

Sets the number of physical source code lines in the project.
public setNumLines ( integer $numLines )
$numLines integer

valid() public method

Checks if there is a current element after calls to rewind() or next().
public valid ( ) : boolean
return boolean

Property Details

$clones protected property

The clones in the clone map
protected $clones

$clonesById protected property

The clones in the clone map, stored by ID
protected $clonesById

$numDuplicateLines protected property

Number of duplicate lines in the clone map
protected $numDuplicateLines

$numLines protected property

Number of lines analyzed
protected $numLines

$position protected property

Current position while iterating the clone map
protected $position