src/Helper.php
public static function getProjectRootDirectory(): string
    {
        if (null === self::$projectRootDirectory) {
            $reflection                 = new \ReflectionClass(ClassLoader::class);
            self::$projectRootDirectory = \dirname((string)$reflection->getFileName(), 3);
        }

        return self::$projectRootDirectory;
    }
public static function getProjectRootDirectory(): string
    {
        if (null === self::$projectRootDirectory) {
            $reflection                 = new \ReflectionClass(ClassLoader::class);
            self::$projectRootDirectory = \dirname((string)$reflection->getFileName(), 3);
        }

        return self::$projectRootDirectory;
    }
public static function getProjectRootDirectory ( ) : string { if ( null === self :: $ projectRootDirectory ) { $ reflection = new \ ReflectionClass ( ClassLoader :: class ) ; self :: $ projectRootDirectory = \ dirname ( ( string ) $ reflection -> getFileName ( ) , 3 ) ; } return self :: $ projectRootDirectory ; }
Get the absolute path to the root of the current project

It does this by working from the Composer autoloader which we know will be in a certain place in `vendor`

@return string
@throws \Exception
Get the absolute path to the root of the current project