Skip to content

Instantly share code, notes, and snippets.

@PJZ9n
Created February 11, 2020 19:56
Show Gist options
  • Save PJZ9n/439967a23e88426f70bc8c35f4352c2d to your computer and use it in GitHub Desktop.
Save PJZ9n/439967a23e88426f70bc8c35f4352c2d to your computer and use it in GitHub Desktop.
<?php
/** @var string */
private static $composerAutoloaderPath = null;
/**
* @return string
*/
public static function getComposerAutoloaderPath(): string
{
if (self::$composerAutoloaderPath === null) {
self::$composerAutoloaderPath = __DIR__ . "/../../../vendor/autoload.php";
}
return self::$composerAutoloaderPath;
}
public function onLoad(): void
{
require_once self::getComposerAutoloaderPath();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment