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;
            }
        );
    }
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;
            }
        );
    }
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 ; } ) ; }
Compare hashes
If returned false, the files have not been changed. Otherwise, return true.

@psalm-suppress MixedTypeCoercion Incorrect resolving the value of the promise

@return Promise<bool>
Compare hashes If returned false the files have not been changed . Otherwise return true .