Phrozn\Provider\LoadFromFile::get PHP Method

get() public method

Get generated content
public get ( ) : mixed
return mixed
    public function get()
    {
        $config = $this->getConfig();
        if (!isset($config['input'])) {
            throw new \RuntimeException('No input file provided.');
        }
        $path = $this->getProjectPath() . '/' . $config['input'];
        if (!is_readable($path)) {
            throw new \RuntimeException(sprintf('Input file "%s" not found.', $path));
        }
        return file_get_contents($path);
    }

Usage Example

Example #1
0
 public function testProviderNoInputSet()
 {
     $this->setExpectedException('RuntimeException', 'No input file provided');
     $provider = new Provider();
     $provider->get();
 }
LoadFromFile