8000 [DI][Yaml] Add the !yaml_file YAML tag to inject parsed YAML in a service by GaryPEGEOT · Pull Request #30446 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI][Yaml] Add the !yaml_file YAML tag to inject parsed YAML in a service #30446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add YAML file as resource
  • Loading branch information
GaryPEGEOT committed Mar 23, 2019
commit cc2ac58e7068d828ba2914765570a7febca70470
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\DependencyInjection\Loader;

use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
Expand Down Expand Up @@ -770,6 +771,8 @@ private function resolveServices($value, $file, $isParameter = false)
throw new InvalidArgumentException("Unable to locate file \"$argument\". Please provide a path relative to \"$rootDir\" or an absolute path.");
}

$this->container->addResource(new FileResource($filePath));

return $this->yamlParser->parseFile($filePath, Yaml::PARSE_CONSTANT);
}

Expand Down
0