for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Storeman\Index\Diff;
use Storeman\Index\IndexObject;
/**
* Represents the difference between two index objects.
*/
class IndexObjectDifference
{
* @var string
protected $relativePath;
* @var IndexObject
protected $indexObjectA;
protected $indexObjectB;
public function __construct(?IndexObject $indexObjectA, ?IndexObject $indexObjectB)
assert(($indexObjectA === null) xor ($indexObjectB === null));
assert(
($indexObjectA === null || $indexObjectB === null) ||
($indexObjectA->getRelativePath() === $indexObjectB->getRelativePath())
);
if ($indexObjectA instanceof IndexObject)
$this->relativePath = $indexObjectA->getRelativePath();
}
elseif ($indexObjectB instanceof IndexObject)
$this->relativePath = $indexObjectB->getRelativePath();
else
throw new \LogicException();
$this->indexObjectA = $indexObjectA;
$this->indexObjectB = $indexObjectB;
public function getRelativePath(): string
return $this->relativePath;
public function getIndexObjectA(): ?IndexObject
return $this->indexObjectA;
public function getIndexObjectB(): ?IndexObject
return $this->indexObjectB;