Loads from annotations from a file.
string $file A PHP file path:
string $type The resource type:
RouteCollection A RouteCollection instance
\InvalidArgumentException When the file does not exist or its routes cannot be parsed
public function load($file, $type = null) {
$path = $this->locator
->locate($file);
$collection = new RouteCollection();
if ($class = $this
->findClass($path)) {
$collection
->addResource(new FileResource($path));
$collection
->addCollection($this->loader
->load($class, $type));
}
return $collection;
}