🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@chalasr
Copy link
Contributor

@chalasr chalasr commented Feb 17, 2017

}

if (null !== $this->logger) {
$this->logger->warning(sprintf('Class "%s" is not configured as a Twig runtime service.', $class));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should keep this logging call. If another loader is able to load the runtime, this is just spamming logs (especially at warning level). and if no loader can load it, Twig_Environment::getRuntime throws an exception with a meaningful message already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, removed the logger dependency.

@chalasr chalasr force-pushed the container-runtime-loader branch 2 times, most recently from 5bcfc96 to b129065 Compare February 17, 2017 18:07
use Psr\Container\ContainerInterface;

/**
* Lazily loads Twig runtime implementations from a container.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say from a PSR-11 container.

And the long description of the class should explain that it expects being able to use the runtime class as an identifier in the container

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@fabpot
Copy link
Contributor

fabpot commented Feb 17, 2017

Should be for the 1.x branch in which we still can add new features (as long as they don't break BC of course as we cannot add new deprecation notices).

@chalasr chalasr force-pushed the container-runtime-loader branch from 5940d5f to 964a51b Compare February 17, 2017 18:29
@chalasr chalasr changed the base branch from 2.x to 1.x February 17, 2017 18:29
@chalasr
Copy link
Contributor Author

chalasr commented Feb 17, 2017

Rebased!

@fabpot
Copy link
Contributor

fabpot commented Feb 17, 2017

I will take care of bumping the version when merging.

@fabpot
Copy link
Contributor

fabpot commented Feb 17, 2017

Thank you @chalasr.

@fabpot fabpot merged commit 964a51b into twigphp:1.x Feb 17, 2017
fabpot added a commit that referenced this pull request Feb 17, 2017
This PR was merged into the 1.x branch.

Discussion
----------

Add ContainerRuntimeLoader

Next to symfony/symfony#21625 (comment)

Commits
-------

964a51b Add ContainerRuntimeLoader
@chalasr chalasr deleted the container-runtime-loader branch February 17, 2017 19:15
@chalasr chalasr changed the title Add ContainerRuntimeLoader Add PSR-11 compatible ContainerRuntimeLoader Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants