From 2336a5018d16e43f621182afc8e988ad1e55177a Mon Sep 17 00:00:00 2001 From: Joel Alphonso Date: Fri, 30 Sep 2022 16:07:30 -0400 Subject: [PATCH] fix(revisions): fix remaining revisionService renaming --- .../Admin/Action/Object/RevertRevisionAction.php | 10 +++++----- .../src/Charcoal/Admin/Ui/ObjectRevisionsTrait.php | 8 ++++---- .../Widget/FormGroup/ObjectRevisionsFormGroup.php | 8 ++++---- .../src/Charcoal/Admin/Widget/FormSidebarWidget.php | 10 +++++----- .../Charcoal/Admin/Widget/ObjectRevisionsWidget.php | 8 ++++---- .../src/Charcoal/Object/GenerateRevisionListener.php | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/admin/src/Charcoal/Admin/Action/Object/RevertRevisionAction.php b/packages/admin/src/Charcoal/Admin/Action/Object/RevertRevisionAction.php index 8709efb22..5bb035f48 100644 --- a/packages/admin/src/Charcoal/Admin/Action/Object/RevertRevisionAction.php +++ b/packages/admin/src/Charcoal/Admin/Action/Object/RevertRevisionAction.php @@ -46,13 +46,13 @@ class RevertRevisionAction extends AdminAction implements ObjectContainerInterfa */ protected $revNum; - private RevisionsManager $revisionService; + private RevisionsManager $revisionManager; protected function setDependencies(Container $container) { parent::setDependencies($container); - $this->revisionService = $container->get('revisions/manager'); + $this->revisionManager = $container->get('revisions/manager'); } /** @@ -119,9 +119,9 @@ public function run(RequestInterface $request, ResponseInterface $response) $obj = $this->obj(); $revNum = $this->revNum(); - $this->revisionService->setModel($obj); + $this->revisionManager->setModel($obj); - $revision = $this->revisionService->getRevisionFromNumber($revNum); + $revision = $this->revisionManager->getRevisionFromNumber($revNum); if (!$revision['id']) { $this->setSuccess(false); @@ -141,7 +141,7 @@ public function run(RequestInterface $request, ResponseInterface $response) return $response->withStatus(404); } - $result = $this->revisionService->revertToRevision($revNum); + $result = $this->revisionManager->revertToRevision($revNum); if ($result) { $doneMessage = $translator->translate( diff --git a/packages/admin/src/Charcoal/Admin/Ui/ObjectRevisionsTrait.php b/packages/admin/src/Charcoal/Admin/Ui/ObjectRevisionsTrait.php index dd38525b8..f03edf9fe 100644 --- a/packages/admin/src/Charcoal/Admin/Ui/ObjectRevisionsTrait.php +++ b/packages/admin/src/Charcoal/Admin/Ui/ObjectRevisionsTrait.php @@ -25,9 +25,9 @@ public function objectRevisions(): array $obj = $this->modelFactory()->create($this->objType()); $obj->setId($this->objId()); - $this->revisionService()->setModel($obj); + $this->revisionManager()->setModel($obj); - $lastRevision = $this->revisionService()->getLatestRevision(); + $lastRevision = $this->revisionManager()->getLatestRevision(); $propLabel = '%2$s'; $callback = function (ObjectRevisionInterface &$revision) use ($lastRevision, $obj, $propLabel) { @@ -70,7 +70,7 @@ public function objectRevisions(): array $revision->allowRevert = ($lastRevision['revNum'] !== $revision['revNum']); }; - return $this->revisionService()->getAllRevisions($callback); + return $this->revisionManager()->getAllRevisions($callback); } /** @@ -92,5 +92,5 @@ abstract public function objId(); */ abstract protected function modelFactory(); - abstract protected function revisionService(): RevisionsManager; + abstract protected function revisionManager(): RevisionsManager; } diff --git a/packages/admin/src/Charcoal/Admin/Widget/FormGroup/ObjectRevisionsFormGroup.php b/packages/admin/src/Charcoal/Admin/Widget/FormGroup/ObjectRevisionsFormGroup.php index 55bc1a978..9c1309345 100644 --- a/packages/admin/src/Charcoal/Admin/Widget/FormGroup/ObjectRevisionsFormGroup.php +++ b/packages/admin/src/Charcoal/Admin/Widget/FormGroup/ObjectRevisionsFormGroup.php @@ -38,11 +38,11 @@ class ObjectRevisionsFormGroup extends AbstractFormGroup implements */ public $widgetId; - private RevisionsManager $revisionService; + private RevisionsManager $revisionManager; - protected function revisionService(): RevisionsManager + protected function revisionManager(): RevisionsManager { - return $this->revisionService; + return $this->revisionManager; } /** @@ -117,7 +117,7 @@ protected function setDependencies(Container $container) parent::setDependencies($container); $this->setModelFactory($container['model/factory']); - $this->revisionService = $container['revisions/manager']; + $this->revisionManager = $container['revisions/manager']; $this->objType = $container['request']->getParam('obj_type'); $this->objId = $container['request']->getParam('obj_id'); diff --git a/packages/admin/src/Charcoal/Admin/Widget/FormSidebarWidget.php b/packages/admin/src/Charcoal/Admin/Widget/FormSidebarWidget.php index e2bdd4faf..bec6645f5 100644 --- a/packages/admin/src/Charcoal/Admin/Widget/FormSidebarWidget.php +++ b/packages/admin/src/Charcoal/Admin/Widget/FormSidebarWidget.php @@ -163,7 +163,7 @@ class FormSidebarWidget extends AdminWidget implements */ private $requiredGlobalAclPermissions = []; - private RevisionsManager $revisionService; + private RevisionsManager $revisionManager; /** * @param array|ArrayInterface $data Class data. @@ -554,10 +554,10 @@ public function isObjRevisionable() return $this->isObjRevisionable; } - $this->revisionService->setModel($obj); + $this->revisionManager->setModel($obj); - if ($this->revisionService->isRevisionEnabled()) { - $this->isObjRevisionable = !!count($this->revisionService->getAllRevisions()); + if ($this->revisionManager->isRevisionEnabled()) { + $this->isObjRevisionable = !!count($this->revisionManager->getAllRevisions()); } } } @@ -903,6 +903,6 @@ protected function setDependencies(Container $container) { parent::setDependencies($container); - $this->revisionService = $container['revisions/manager']; + $this->revisionManager = $container['revisions/manager']; } } diff --git a/packages/admin/src/Charcoal/Admin/Widget/ObjectRevisionsWidget.php b/packages/admin/src/Charcoal/Admin/Widget/ObjectRevisionsWidget.php index 8b52e753e..e8299def0 100644 --- a/packages/admin/src/Charcoal/Admin/Widget/ObjectRevisionsWidget.php +++ b/packages/admin/src/Charcoal/Admin/Widget/ObjectRevisionsWidget.php @@ -29,18 +29,18 @@ class ObjectRevisionsWidget extends AdminWidget implements */ protected $objId; - private RevisionsManager $revisionService; + private RevisionsManager $revisionManager; protected function setDependencies(Container $container) { parent::setDependencies($container); - $this->revisionService = $container['revisions/manager']; + $this->revisionManager = $container['revisions/manager']; } - protected function revisionService(): RevisionsManager + protected function revisionManager(): RevisionsManager { - return $this->revisionService; + return $this->revisionManager; } /** diff --git a/packages/object/src/Charcoal/Object/GenerateRevisionListener.php b/packages/object/src/Charcoal/Object/GenerateRevisionListener.php index 7abed4340..aaaf64bdf 100644 --- a/packages/object/src/Charcoal/Object/GenerateRevisionListener.php +++ b/packages/object/src/Charcoal/Object/GenerateRevisionListener.php @@ -11,20 +11,20 @@ */ class GenerateRevisionListener extends AbstractEventListener { - protected RevisionsManager $revisionService; + protected RevisionsManager $revisionManager; public function __invoke(object $event) { /** @var ModelInterface $model */ $model = $event->getObject(); - $this->revisionService->setModel($model)->generateRevision(); + $this->revisionManager->setModel($model)->generateRevision(); } public function setDependencies(Container $container) { parent::setDependencies($container); - $this->revisionService = $container->get('revisions/manager'); + $this->revisionManager = $container->get('revisions/manager'); } }