public function cleanupPackages(Storage $storage, callable $callback = null)
    {
        $count = 0;
        $storageNode = $storage->node();
        $query = new FlowQuery([$storageNode]);
        $query = $query->find('[instanceof Neos.MarketPlace:Package]');
        $upstreamPackages = $this->getProcessedPackages();
        foreach ($query as $package) {
            /** @var NodeInterface $package */
            if (in_array($package->getProperty('title'), $upstreamPackages)) {
                continue;
            }
            $package->remove();
            if ($callback !== null) {
                $callback($package);
            }
            $this->emitPackageDeleted($package);
            $count++;
        }
        return $count;
    }
public function cleanupPackages(Storage $storage, callable $callback = null)
    {
        $count = 0;
        $storageNode = $storage->node();
        $query = new FlowQuery([$storageNode]);
        $query = $query->find('[instanceof Neos.MarketPlace:Package]');
        $upstreamPackages = $this->getProcessedPackages();
        foreach ($query as $package) {
            /** @var NodeInterface $package */
            if (in_array($package->getProperty('title'), $upstreamPackages)) {
                continue;
            }
            $package->remove();
            if ($callback !== null) {
                $callback($package);
            }
            $this->emitPackageDeleted($package);
            $count++;
        }
        return $count;
    }
public function cleanupPackages ( Storage $ storage , callable $ callback = null ) { $ count = 0 ; $ storageNode = $ storage -> node ( ) ; $ query = new FlowQuery ( [ $ storageNode ] ) ; $ query = $ query -> find ( '[instanceof Neos.MarketPlace:Package]' ) ; $ upstreamPackages = $ this -> getProcessedPackages ( ) ; foreach ( $ query as $ package ) { /** @var NodeInterface $package */ if ( in_array ( $ package -> getProperty ( 'title' ) , $ upstreamPackages ) ) { continue ; } $ package -> remove ( ) ; if ( $ callback !== null ) { $ callback ( $ package ) ; } $ this -> emitPackageDeleted ( $ package ) ; $ count ++ ; } return $ count ; }
Remove local package not preset in the processed packages list

@param Storage $storage
@param callable $callback function called after the package removal
@return integer
Remove local package not preset in the processed packages list