Skip to content

Commit be70f5e

Browse files
committed
Add DiffHelper::getProjectDirectory()
Signed-off-by: Jack Cherng <[email protected]>
1 parent 4937417 commit be70f5e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/DiffHelper.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ private function __construct()
1616
{
1717
}
1818

19+
/**
20+
* Get the absolute path of the project root directory.
21+
*
22+
* @return string
23+
*/
24+
public static function getProjectDirectory(): string
25+
{
26+
static $path;
27+
28+
return $path = $path ?? realpath(__DIR__ . '/..');
29+
}
30+
1931
/**
2032
* Get the information about available templates.
2133
*

0 commit comments

Comments
 (0)