PHPComposter\PHPComposter\Plugin::getConfig PHP Method

getConfig() public static method

Generate the config file.
Since: 0.1.0
public static getConfig ( ) : string
return string Generated Config file.
    public static function getConfig()
    {
        $output = '<?php' . PHP_EOL;
        $output .= '// PHP Composter configuration file.' . PHP_EOL;
        $output .= '// Do not edit, this file is generated automatically.' . PHP_EOL;
        $output .= '// Timestamp: ' . date('Y/m/d H:m:s') . PHP_EOL;
        $output .= PHP_EOL;
        $output .= 'return array(' . PHP_EOL;
        foreach (static::getGitHookNames() as $hook) {
            $entries = HookConfig::getEntries($hook);
            $output .= '    \'' . $hook . '\' => array(' . PHP_EOL;
            foreach ($entries as $priority => $methods) {
                $output .= '        ' . $priority . ' => array(' . PHP_EOL;
                foreach ($methods as $method) {
                    $output .= '            \'' . $method . '\',' . PHP_EOL;
                }
                $output .= '        ),' . PHP_EOL;
            }
            $output .= '    ),' . PHP_EOL;
        }
        $output .= ');' . PHP_EOL;
        return $output;
    }