PHP Класс Mutagenesis\Mutation\MutationAbstract

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
_reconstructFromTokens ( array $tokens ) : string Reconstruct a new mutation into a source code string based on the returned tokens

Описание методов

__construct() публичный Метод

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

_reconstructFromTokens() защищенный Метод

Reconstruct a new mutation into a source code string based on the returned tokens
protected _reconstructFromTokens ( array $tokens ) : string
$tokens array
Результат string

getDiff() публичный Метод

Calculate the unified diff between the original source code and its its mutated form
public getDiff ( ) : string
Результат string

getFilename() публичный Метод

Return the file path of the file which is currently being assessed for mutations.
public getFilename ( ) : string
Результат string

getMutation() абстрактный публичный Метод

Get a new mutation as an array of changed tokens
abstract public getMutation ( array $tokens, integer $index ) : array
$tokens array
$index integer
Результат array

mutate() публичный Метод

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

Описание свойств

$_filename защищенное свойство

Name and relative path of the file being mutated
protected string $_filename
Результат string

$_tokensMutated защищенное свойство

Array of source code tokens after a mutation has been applied
protected array $_tokensMutated
Результат array

$_tokensOriginal защищенное свойство

Array of original source code tokens prior to mutation
protected array $_tokensOriginal
Результат array