Loads a PHP file.
@api
string $file A PHP file path:
string|null $type The resource type:
RouteCollection A RouteCollection instance
public function load($file, $type = null) {
// the loader variable is exposed to the included file below
$loader = $this;
$path = $this->locator
->locate($file);
$this
->setCurrentDir(dirname($path));
$collection = (include $path);
$collection
->addResource(new FileResource($path));
return $collection;
}