1 | <?php |
||
35 | class Application extends \Symfony\Component\Console\Application |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * Regex to read the actual version number from the .semver file. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | const REGEX = "/^\-\-\-\n:major:\s(0|[1-9]\d*)\n:minor:\s(0|[1-9]\d*)\n:patch:\s(0|[1-9]\d*)\n:special:\s'([a-zA-z0-9]*\.?(?:0|[1-9]\d*)?)'\n:metadata:\s'((?:0|[1-9]\d*)?(?:\.[a-zA-z0-9\.]*)?)'/"; |
||
44 | |||
45 | /** |
||
46 | * The application name. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $name = 'M2IF - Simple Console Tool'; |
||
51 | |||
52 | /** |
||
53 | * The constructor to initialize the instance. |
||
54 | */ |
||
55 | public function __construct() |
||
61 | |||
62 | /** |
||
63 | * Parse and return the version number from the application's .semver file. |
||
64 | * |
||
65 | * @param string $semverFile The path to the semver file |
||
66 | * |
||
67 | * @return array The array with the version information |
||
68 | * @throws \Exception Is thrown, if the .semver file is not available or invalid |
||
69 | */ |
||
70 | protected function parse($semverFile) |
||
85 | } |
||
86 |