LcaManager.php in Conflict 8
File
src/LcaManager.php
View source
<?php
namespace Drupal\conflict;
use Fhaculty\Graph\Graph;
use Drupal\Core\Entity\RevisionableInterface;
class LcaManager {
protected $resolvers = [];
public function addLcaResolver(ConflictAncestorResolverInterface $resolver) {
$this->resolvers[] = $resolver;
}
public function resolveLowestCommonAncestor(RevisionableInterface $revision1, RevisionableInterface $revision2, Graph $graph = NULL) {
foreach ($this->resolvers as $resolver) {
if ($resolver
->applies()) {
return $resolver
->resolve($revision1, $revision2, $graph);
}
}
}
}