Skip to content

Commit

Permalink
fixed displaying the cleanup result when using a parameter `--no-auto…
Browse files Browse the repository at this point in the history
…loader`
  • Loading branch information
liborm85 committed Mar 19, 2020
1 parent 6be82a9 commit fa7a0ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- fixed displaying the cleanup result when using a parameter `--no-autoloader`

## 1.2.0 - 2020-03-15

- feature for cleanup in composer `bin` directory
Expand Down
14 changes: 14 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ class Plugin implements PluginInterface, EventSubscriberInterface
*/
private $actionIsDumpAutoload = true;

/**
* @var bool
*/
private $isCleaningFinished = false;

public function __destruct()
{
if (!$this->cleaner && !$this->isCleaningFinished) {
$this->cleaner->finishCleanup();
}
}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -125,6 +137,8 @@ public function cleanup(Event $event)
if ($this->actionIsDumpAutoload || $this->isCleanedPackages) {
$this->cleaner->cleanupBinary($this->binDir);
$this->cleaner->finishCleanup();

$this->isCleaningFinished = true;
}

$this->isCleanedPackages = true;
Expand Down

0 comments on commit fa7a0ad

Please sign in to comment.