#!/usr/bin/env php
<?php

declare(strict_types=1);

if (file_exists(__DIR__.'/../../../autoload.php')) {
    require_once __DIR__.'/../../../autoload.php';
} elseif (file_exists(__DIR__.'/../vendor/autoload.php')) {
    require_once __DIR__.'/../vendor/autoload.php';
} else {
    echo 'You must set up the project dependencies, run the following commands:'.\PHP_EOL
        .'curl -s http://getcomposer.org/installer | php'.\PHP_EOL
        .'php composer.phar install'.\PHP_EOL;
    exit(1);
}

use TwigCsFixer\Console\Application;
use TwigCsFixer\Console\Command\TwigCsFixerCommand;

$command = new TwigCsFixerCommand();

$application = new Application();
$application->addCommands([$command]);
$application->setDefaultCommand(TwigCsFixerCommand::NAME);
$application->run();
