PHP Класс VersionPress\Tests\Utils\ChangeInfoUtils

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

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

Метод Описание
captureSameAction ( TrackedChangeInfo | ChangeInfoEnvelope $changeInfo1, TrackedChangeInfo | ChangeInfoEnvelope $changeInfo2 ) : boolean Returns true if two changeinfos capture the same thing, i.e., if their commits are logically equivalent. Currently compares that it was the same action on the same entity (incl. VPID) and that the set of custom VP tags is the same (keys must be the same, values may differ).
containsAction ( ChangeInfoEnvelope | UntrackedChangeInfo $changeInfo, string $fullAction ) : boolean
getCustomTagValue ( VersionPress\ChangeInfos\ChangeInfo $changeInfo, string $tagKey ) : string | null
getFullAction ( VersionPress\ChangeInfos\ChangeInfo $changeInfo ) : string Returns full action such as "post/edit" or "wordpress/update".
getTrackedChangeInfo ( VersionPress\ChangeInfos\ChangeInfo $changeInfo ) : TrackedChangeInfo Returns an actionable tracked change info (ChangeInfoEnvelope isn't so it returns its most important internal changeinfo).
getVpid ( $changeInfo )

Приватные методы

Метод Описание
bothAreEnvelopesContainingTheSame ( ChangeInfoEnvelope $firstChangeInfo, ChangeInfoEnvelope $secondChangeInfo ) : boolean
firstIsEnvelopeContainingSecond ( $firstChangeInfo, $secondChangeInfo )
listsContainSameChangeInfos ( TrackedChangeInfo[] $firstChangeInfoList, TrackedChangeInfo[] $secondChangeInfoList ) : boolean

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

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

Returns true if two changeinfos capture the same thing, i.e., if their commits are logically equivalent. Currently compares that it was the same action on the same entity (incl. VPID) and that the set of custom VP tags is the same (keys must be the same, values may differ).
public static captureSameAction ( TrackedChangeInfo | ChangeInfoEnvelope $changeInfo1, TrackedChangeInfo | ChangeInfoEnvelope $changeInfo2 ) : boolean
$changeInfo1 VersionPress\ChangeInfos\TrackedChangeInfo | VersionPress\ChangeInfos\ChangeInfoEnvelope
$changeInfo2 VersionPress\ChangeInfos\TrackedChangeInfo | VersionPress\ChangeInfos\ChangeInfoEnvelope
Результат boolean

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

public static containsAction ( ChangeInfoEnvelope | UntrackedChangeInfo $changeInfo, string $fullAction ) : boolean
$changeInfo VersionPress\ChangeInfos\ChangeInfoEnvelope | VersionPress\ChangeInfos\UntrackedChangeInfo
$fullAction string
Результат boolean

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

public static getCustomTagValue ( VersionPress\ChangeInfos\ChangeInfo $changeInfo, string $tagKey ) : string | null
$changeInfo VersionPress\ChangeInfos\ChangeInfo
$tagKey string
Результат string | null Value or null if key not found

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

Note: changeinfo objects in production code don't have a need to represent the concept of "full action"; tracked entities simply have entity names and actions. This helper is so far useful only in tests so it has been moved here.
public static getFullAction ( VersionPress\ChangeInfos\ChangeInfo $changeInfo ) : string
$changeInfo VersionPress\ChangeInfos\ChangeInfo
Результат string

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

Returns an actionable tracked change info (ChangeInfoEnvelope isn't so it returns its most important internal changeinfo).
public static getTrackedChangeInfo ( VersionPress\ChangeInfos\ChangeInfo $changeInfo ) : TrackedChangeInfo
$changeInfo VersionPress\ChangeInfos\ChangeInfo
Результат VersionPress\ChangeInfos\TrackedChangeInfo

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

public static getVpid ( $changeInfo )