digipolisgent/robo-digipolis-symfony

View on GitHub
src/EventHandler/UpdateSymfonyHandler.php

Summary

Maintainability
A
45 mins
Test Coverage
<?php

namespace DigipolisGent\Robo\Symfony\EventHandler;

use Symfony\Component\EventDispatcher\GenericEvent;

class UpdateSymfonyHandler extends SymfonyHandler
{

    use \Robo\Task\Base\Tasks;

    /**
     * {@inheritDoc}
     */
    public function handle(GenericEvent $event)
    {
        $collection = $this->collectionBuilder();

        $console = $this->getConsolePath();
        $collection
            ->taskExecStack()
                ->exec($console . ' cache:clear')
                ->exec($console . ' doctrine:migrations:migrate --no-interaction');
        return $collection;
    }
}