Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Diff\ClaimDifferenceVisualizer Class Reference

Class for generating HTML for Claim Diffs. More...

Public Member Functions

 __construct (DifferencesSnakVisualizer $snakVisualizer, $languageCode)
 
 visualizeClaimChange (ClaimDifference $claimDifference, Statement $baseStatement, array $path=[])
 Generates HTML of a statement change.
 
 visualizeNewClaim (Statement $statement, array $path=[])
 Get diff html for a new claim.
 
 visualizeRemovedClaim (Statement $statement, array $path=[])
 Get diff html for a removed claim.
 

Private Member Functions

 visualizeMainSnakChange ( $headerPrefix, DiffOpChange $mainSnakChange, Snak $oldestMainSnak, Snak $newestMainSnak)
 
 visualizeRankChange ( $headerPrefix, DiffOpChange $rankChange, Snak $oldestMainSnak, Snak $newestMainSnak)
 
 getRankHtml ( $rank)
 
 visualizeReferenceChanges ( $headerPrefix, Diff $changes, Snak $oldestMainSnak, Snak $newestMainSnak)
 
 visualizeSnaks (SnakList $snaks)
 
 visualizeQualifierChanges ( $headerPrefix, Diff $changes, Snak $oldestMainSnak, Snak $newestMainSnak)
 

Private Attributes

 $snakVisualizer
 
 $languageCode
 

Detailed Description

Class for generating HTML for Claim Diffs.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::__construct ( DifferencesSnakVisualizer $snakVisualizer,
$languageCode )
Parameters
DifferencesSnakVisualizer$snakVisualizer
string$languageCode

Member Function Documentation

◆ getRankHtml()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::getRankHtml ( $rank)
private
Parameters
string | int | null$rank
Returns
string|null HTML

◆ visualizeClaimChange()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeClaimChange ( ClaimDifference $claimDifference,
Statement $baseStatement,
array $path = [] )

Generates HTML of a statement change.

Parameters
ClaimDifference$claimDifference
Statement$baseStatementThe new statement, if it exists. Otherwise the old statement.
string[]$pathThe path to prepend in the header
Returns
string HTML

◆ visualizeMainSnakChange()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeMainSnakChange ( $headerPrefix,
DiffOpChange $mainSnakChange,
Snak $oldestMainSnak,
Snak $newestMainSnak )
private
Parameters
string$headerPrefix
DiffOpChange$mainSnakChange
Snak$oldestMainSnakThe old main snak, if present; otherwise, the new main snak
Snak$newestMainSnakThe new main snak, if present; otherwise, the old main snak
Returns
string HTML

◆ visualizeNewClaim()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeNewClaim ( Statement $statement,
array $path = [] )

Get diff html for a new claim.

Parameters
Statement$statement
string[]$pathThe path to prepend in the header
Returns
string HTML

◆ visualizeQualifierChanges()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeQualifierChanges ( $headerPrefix,
Diff $changes,
Snak $oldestMainSnak,
Snak $newestMainSnak )
private
Parameters
string$headerPrefix
Diff$changes
Snak$oldestMainSnakThe old main snak, if present; otherwise, the new main snak
Snak$newestMainSnakThe new main snak, if present; otherwise, the old main snak
Returns
string HTML

◆ visualizeRankChange()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeRankChange ( $headerPrefix,
DiffOpChange $rankChange,
Snak $oldestMainSnak,
Snak $newestMainSnak )
private
Parameters
string$headerPrefix
DiffOpChange$rankChange
Snak$oldestMainSnakThe old main snak, if present; otherwise, the new main snak
Snak$newestMainSnakThe new main snak, if present; otherwise, the old main snak
Returns
string HTML

◆ visualizeReferenceChanges()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeReferenceChanges ( $headerPrefix,
Diff $changes,
Snak $oldestMainSnak,
Snak $newestMainSnak )
private
Parameters
string$headerPrefix
Diff$changes
Snak$oldestMainSnakThe old main snak, if present; otherwise, the new main snak
Snak$newestMainSnakThe new main snak, if present; otherwise, the old main snak
Returns
string HTML

◆ visualizeRemovedClaim()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeRemovedClaim ( Statement $statement,
array $path = [] )

Get diff html for a removed claim.

Parameters
Statement$statement
string[]$pathThe path to prepend in the header
Returns
string HTML

◆ visualizeSnaks()

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::visualizeSnaks ( SnakList $snaks)
private
Parameters
SnakList$snaks
Returns
string[] HTML

Member Data Documentation

◆ $languageCode

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::$languageCode
private

◆ $snakVisualizer

Wikibase\Repo\Diff\ClaimDifferenceVisualizer::$snakVisualizer
private

The documentation for this class was generated from the following file: