1 | <?php |
||
38 | class Application extends \Symfony\Component\Console\Application implements ContainerAwareInterface |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * Regex to read the actual version number from the .semver file. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | 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\.]*)?)'/"; |
||
47 | |||
48 | /** |
||
49 | * The application name. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $name = 'M2IF - Simple Console Tool'; |
||
54 | |||
55 | /** |
||
56 | * The DI container instance. |
||
57 | * |
||
58 | * @var \Symfony\Component\DependencyInjection\ContainerInterface |
||
59 | */ |
||
60 | protected $container; |
||
61 | |||
62 | /** |
||
63 | * The constructor to initialize the instance. |
||
64 | * |
||
65 | * @param \Symfony\Component\DependencyInjection\ContainerInterface $container The DI container instance |
||
66 | */ |
||
67 | 1 | public function __construct(ContainerInterface $container) |
|
76 | |||
77 | /** |
||
78 | * Sets the DI container instance. |
||
79 | * |
||
80 | * @param \Symfony\Component\DependencyInjection\ContainerInterface|null $container The DI container instance |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | 1 | public function setContainer(ContainerInterface $container = null) |
|
88 | |||
89 | /** |
||
90 | * Return's the DI container instance. |
||
91 | * |
||
92 | * @return \Symfony\Component\DependencyInjection\ContainerInterface|null The DI container instance |
||
93 | */ |
||
94 | 1 | public function getContainer() |
|
98 | |||
99 | /** |
||
100 | * Parse and return the version number from the application's .semver file. |
||
101 | * |
||
102 | * @param string $semverFile The path to the semver file |
||
103 | * |
||
104 | * @return array The array with the version information |
||
105 | * @throws \Exception Is thrown, if the .semver file is not available or invalid |
||
106 | */ |
||
107 | 1 | protected function parse($semverFile) |
|
125 | } |
||
126 |