src/Service/DbCleaner.php
private function strategy(callable $action)
    {
        $report = false;

        $wehave = Block::all();

        $mustbe = $this->taxonomy->getBlocks();

        foreach($wehave as $block)
        {
            if(!$mustbe->exist($block->name))
            {
                $action(TypeRank::BLOCK, $block);
                $report = true;
            }
        }


        $wehave = Group::all();

        $mustbe = $this->taxonomy->getGroups();

        foreach($wehave as $group)
        {
            if(!$mustbe->exist($group->name))
            {
                $action(TypeRank::GROUP, $group);
                $report = true;
            }
        }

        return $report;
    }
private function strategy(callable $action)
    {
        $report = false;

        $wehave = Block::all();

        $mustbe = $this->taxonomy->getBlocks();

        foreach($wehave as $block)
        {
            if(!$mustbe->exist($block->name))
            {
                $action(TypeRank::BLOCK, $block);
                $report = true;
            }
        }


        $wehave = Group::all();

        $mustbe = $this->taxonomy->getGroups();

        foreach($wehave as $group)
        {
            if(!$mustbe->exist($group->name))
            {
                $action(TypeRank::GROUP, $group);
                $report = true;
            }
        }

        return $report;
    }
@param callable $action

@return bool