Skip to content

Commit

Permalink
Remove calls to deprecated 'destroy' method (#3711)
Browse files Browse the repository at this point in the history
  • Loading branch information
Clayton Liddell authored Nov 19, 2021
1 parent 384fbc0 commit 0d8c6fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function testGetSummary() {
/**
*
*/
public function testDestroy() {
public function testDestruct() {
$connectionChain = $this->getConnectionChain();

$databaseTable = new DatabaseTable(
Expand Down
8 changes: 4 additions & 4 deletions modules/harvest/src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ public function deregisterHarvest(string $id) {
/**
* Public.
*
* @todo the destroy method should be part of some interface.
* @todo the destruct method should be part of some interface.
*/
public function revertHarvest($id) {
$run_store = $this->storeFactory->getInstance("harvest_{$id}_runs");
if (!method_exists($run_store, "destroy")) {
throw new \Exception("Storage of class " . get_class($run_store) . " does not implement destroy method.");
if (!method_exists($run_store, "destruct")) {
throw new \Exception("Storage of class " . get_class($run_store) . " does not implement destruct method.");
}
$run_store->destroy();
$run_store->destruct();
$harvester = $this->getHarvester($id);
return $harvester->revert();
}
Expand Down
2 changes: 1 addition & 1 deletion modules/harvest/tests/src/Unit/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function retrieveAll(): array {
/**
*
*/
public function destroy() {
public function destruct() {
$this->storage = [];
}

Expand Down

0 comments on commit 0d8c6fd

Please sign in to comment.