Skip to content

Commit 3eb56bd

Browse files
committed
Core: Fix some issues with version reporting
1 parent 9ed179c commit 3eb56bd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/PHPDraft/In/Tests/ApibFileParserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testFilenameSetup()
5555
* Test if exception when the file doesn't exist
5656
* @expectedException \RuntimeException
5757
* @expectedExceptionCode 1
58-
* @expectedExceptionMessageRegExp "API File not found: [a-zA-Z0-9\/]*\/drafter\/non_existing_including_apib"
58+
* @expectedExceptionMessageRegExp "API File not found: [\w\W]*\/drafter\/non_existing_including_apib"
5959
*
6060
* @return void
6161
*/

src/PHPDraft/Out/UI.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function main($argv = [])
4646

4747
if (!isset($argv[1])) {
4848
file_put_contents('php://stderr', 'Not enough arguments' . PHP_EOL);
49-
self::help();
49+
(new UI)->help();
5050
throw new \RuntimeException('', 1);
5151
}
5252

@@ -60,12 +60,12 @@ public static function main($argv = [])
6060

6161
if (boolval(preg_match('/^\-/', $argv[1]))) {
6262
if (isset($options['h'])) {
63-
self::help();
63+
(new UI)->help();
6464
throw new \RuntimeException('', 0);
6565
}
6666

6767
if (isset($options['v'])) {
68-
self::version();
68+
(new UI)->version();
6969
throw new \RuntimeException('', 0);
7070
}
7171

@@ -104,14 +104,14 @@ public static function main($argv = [])
104104
public function help()
105105
{
106106
echo 'This is a parser for API Blueprint files in PHP.' . PHP_EOL . PHP_EOL;
107-
echo "The following options can be used:.\n";
108-
echo "\t-f\tSpecifies the file to parse.\n";
109-
echo "\t-t\tSpecifies the template to use. (defaults to 'default')\n";
110-
echo "\t-s\tSort displayed values [All|None|Structures|Webservices] (defaults to the way the objects are in the file)\n";
111-
echo "\t-i\tSpecifies an image to display in the header.\n";
112-
echo "\t-c\tSpecifies a CSS file to include (value is put in a link element without checking).\n";
113-
echo "\t-j\tSpecifies a JS file to include (value is put in a script element without checking).\n";
114-
echo "\t-h\tDisplays this text.\n";
107+
echo "The following options can be used:.".PHP_EOL;
108+
echo "\t-f\tSpecifies the file to parse.".PHP_EOL;
109+
echo "\t-t\tSpecifies the template to use. (defaults to 'default')".PHP_EOL;
110+
echo "\t-s\tSort displayed values [All|None|Structures|Webservices] (defaults to the way the objects are in the file)".PHP_EOL;
111+
echo "\t-i\tSpecifies an image to display in the header.".PHP_EOL;
112+
echo "\t-c\tSpecifies a CSS file to include (value is put in a link element without checking).".PHP_EOL;
113+
echo "\t-j\tSpecifies a JS file to include (value is put in a script element without checking).".PHP_EOL;
114+
echo "\t-h\tDisplays this text.".PHP_EOL;
115115
}
116116

117117
/**

0 commit comments

Comments
 (0)