PHP Class Mutagenesis\Mutation\MutationAbstract

Afficher le fichier Open project: padraic/mutagenesis Class Usage Examples

Protected Properties

Свойство Type Description
$_filename string Name and relative path of the file being mutated
$_tokensMutated array Array of source code tokens after a mutation has been applied
$_tokensOriginal array Array of original source code tokens prior to mutation

Méthodes publiques

Méthode Description
__construct ( string $filename = '' ) Constructor; sets name and relative path of the file being mutated
getDiff ( ) : string Calculate the unified diff between the original source code and its its mutated form
getFilename ( ) : string Return the file path of the file which is currently being assessed for mutations.
getMutation ( array $tokens, integer $index ) : array Get a new mutation as an array of changed tokens
mutate ( array $tokens, integer $index ) Perform a mutation against the given original source code tokens for a mutable element

Méthodes protégées

Méthode Description
_reconstructFromTokens ( array $tokens ) : string Reconstruct a new mutation into a source code string based on the returned tokens

Method Details

__construct() public méthode

Constructor; sets name and relative path of the file being mutated
public __construct ( string $filename = '' )
$filename string

_reconstructFromTokens() protected méthode

Reconstruct a new mutation into a source code string based on the returned tokens
protected _reconstructFromTokens ( array $tokens ) : string
$tokens array
Résultat string

getDiff() public méthode

Calculate the unified diff between the original source code and its its mutated form
public getDiff ( ) : string
Résultat string

getFilename() public méthode

Return the file path of the file which is currently being assessed for mutations.
public getFilename ( ) : string
Résultat string

getMutation() abstract public méthode

Get a new mutation as an array of changed tokens
abstract public getMutation ( array $tokens, integer $index ) : array
$tokens array
$index integer
Résultat array

mutate() public méthode

Perform a mutation against the given original source code tokens for a mutable element
public mutate ( array $tokens, integer $index )
$tokens array
$index integer

Property Details

$_filename protected_oe property

Name and relative path of the file being mutated
protected string $_filename
Résultat string

$_tokensMutated protected_oe property

Array of source code tokens after a mutation has been applied
protected array $_tokensMutated
Résultat array

$_tokensOriginal protected_oe property

Array of original source code tokens prior to mutation
protected array $_tokensOriginal
Résultat array