public static function generate(Event $event)
    {
        $args = $event->getArguments();
        if (empty($args)) {
            echo "Usage:\n\n"
                . "    composer yasql-generate -- YASQL_FILE [INDENTATION]\n\n"
                . "By default, INDENTATION is 2\n";
            die(1);
        }

        echo Controller::generate(
            file_get_contents($args[0]),
            null,
            $args[1] ?? 2
        );
    }
public static function generate(Event $event)
    {
        $args = $event->getArguments();
        if (empty($args)) {
            echo "Usage:\n\n"
                . "    composer yasql-generate -- YASQL_FILE [INDENTATION]\n\n"
                . "By default, INDENTATION is 2\n";
            die(1);
        }

        echo Controller::generate(
            file_get_contents($args[0]),
            null,
            $args[1] ?? 2
        );
    }
public static function generate ( Event $ event ) { $ args = $ event -> getArguments ( ) ; if ( empty ( $ args ) ) { echo "Usage:\n\n" . "    composer yasql-generate -- YASQL_FILE [INDENTATION]\n\n" . "By default, INDENTATION is 2\n" ; die ( 1 ) ; } echo Controller :: generate ( file_get_contents ( $ args [ 0 ] ) , null , $ args [ 1 ] ?? 2 ) ; }
Generates the SQL from a YASQL file

Arguments:

string $1 Path to YASQL file
int    $2 How many spaces per indentation level

@param Event $event Composer run-script event
Generates the SQL from a YASQL file