Skip to content

Commit

Permalink
Remove unused method (revert 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Feb 6, 2024
1 parent a30bf6f commit 849dd20
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ConcurrentItemsStorageDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(private ItemsStorageInterface|FileStorageInterface $
public function clear(): void
{
$this->storage->clear();
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function getAll(): array
Expand Down Expand Up @@ -64,21 +64,21 @@ public function add(Permission|Role $item): void
{
$this->load();
$this->storage->add($item);
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function update(string $name, Permission|Role $item): void
{
$this->load();
$this->storage->update($name, $item);
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function remove(string $name): void
{
$this->load();
$this->storage->remove($name);
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function getRoles(): array
Expand Down Expand Up @@ -106,7 +106,7 @@ public function clearRoles(): void
{
$this->load();

Check warning on line 107 in src/ConcurrentItemsStorageDecorator.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } public function clearRoles() : void { - $this->load(); + $this->storage->clearRoles(); $this->currentFileUpdatedAt = $this->getFileUpdatedAt(); }
$this->storage->clearRoles();
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function getPermissions(): array
Expand Down Expand Up @@ -134,7 +134,7 @@ public function clearPermissions(): void
{
$this->load();
$this->storage->clearPermissions();
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function getParents(string $name): array
Expand Down Expand Up @@ -204,21 +204,21 @@ public function addChild(string $parentName, string $childName): void
{
$this->load();
$this->storage->addChild($parentName, $childName);
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function removeChild(string $parentName, string $childName): void
{
$this->load();

Check warning on line 212 in src/ConcurrentItemsStorageDecorator.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } public function removeChild(string $parentName, string $childName) : void { - $this->load(); + $this->storage->removeChild($parentName, $childName); $this->currentFileUpdatedAt = $this->getFileUpdatedAt(); }
$this->storage->removeChild($parentName, $childName);
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function removeChildren(string $parentName): void
{
$this->load();

Check warning on line 219 in src/ConcurrentItemsStorageDecorator.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } public function removeChildren(string $parentName) : void { - $this->load(); + $this->storage->removeChildren($parentName); $this->currentFileUpdatedAt = $this->getFileUpdatedAt(); }

Check warning on line 219 in src/ConcurrentItemsStorageDecorator.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } public function removeChildren(string $parentName) : void { - $this->load(); + $this->storage->removeChildren($parentName); $this->currentFileUpdatedAt = $this->getFileUpdatedAt(); }
$this->storage->removeChildren($parentName);
$this->currentFileUpdatedAt = $this->storage->getFileUpdatedAt();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

public function load(): void
Expand Down
5 changes: 5 additions & 0 deletions src/ConcurrentStorageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ trait ConcurrentStorageTrait
{
private ?int $currentFileUpdatedAt = null;

public function getFileUpdatedAt(): int
{
return $this->storage->getFileUpdatedAt();
}

private function loadInternal(FileStorageInterface $storage): void
{
try {
Expand Down
2 changes: 2 additions & 0 deletions src/FileStorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
interface FileStorageInterface
{
public function load(): void;

public function getFileUpdatedAt(): int;
}

0 comments on commit 849dd20

Please sign in to comment.