public function compare(): Promise
    {
        /** @psalm-suppress InvalidArgument Incorrect psalm unpack parameters (...$args) */
        return call(
            function(): \Generator
            {
                /** @var string $bufferContent */
                $bufferContent = yield from self::execute($this->directory);

                $hash = self::extractHash($bufferContent);

                /** A runtime error has occurred */
                // @codeCoverageIgnoreStart
                if (null === $hash)
                {
                    return false;
                }
                // @codeCoverageIgnoreEnd

                /** New hash is different from previously received */
                if (null !== $this->previousHash && $this->previousHash !== $hash)
                {
                    return true;
                }

                $this->previousHash = $hash;

                return false;
            }
        );
    }