Skip to content
This repository was archived by the owner on Feb 1, 2020. It is now read-only.

Make compatible with newer Symfony versions #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib/Herrera/Wise/Loader/YamlFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public function supports($resource, $type = null)
*/
protected function doLoad($file)
{
return Parser::parse($file);
if (!file_exists($file) || !is_readable($file)) {
throw new \InvalidArgumentException(sprintf('Unable to read file: %s', $file));
}
return Parser::parse(file_get_contents($file));
}
}
4 changes: 4 additions & 0 deletions src/lib/Herrera/Wise/Wise.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ public function load($resource, $type = null, $require = false)
);

if ($cache->isFresh()) {
if (method_exists($cache, 'getPath')) {
/** @noinspection PhpIncludeInspection */
return require $cache->getPath();
}
/** @noinspection PhpIncludeInspection */
return require $cache;
}
Expand Down