Doctrine\DBAL\Migrations\Tools\Console\Command\UpToDateCommand::execute PHP Method

execute() public method

public execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | null
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return integer | null
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $configuration = $this->getMigrationConfiguration($input, $output);
        $migrations = count($configuration->getMigrations());
        $migratedVersions = count($configuration->getMigratedVersions());
        $availableMigrations = $migrations - $migratedVersions;
        if ($availableMigrations === 0) {
            $output->writeln('<comment>Up-to-date! No migrations to execute.</comment>');
            return 0;
        }
        $output->writeln(sprintf('<comment>Out-of-date! %u migration%s available to execute.</comment>', $availableMigrations, $availableMigrations > 1 ? 's are' : ' is'));
        return 1;
    }
UpToDateCommand