added checks for public services on compiler passes that use service ids and not references #20112

Merged
merged 1 commit into from Oct 1, 2016

Projects

None yet

5 participants

@fabpot
Member
fabpot commented Sep 30, 2016
Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a
@@ -231,6 +231,7 @@ public function testRuntimeLoader()
$loader = $container->getDefinition('twig.runtime_loader');
$args = $loader->getArgument(1);
+print_r($loader->getArguments());
@javiereguiluz
javiereguiluz Sep 30, 2016 Member

This looks like a debug leftover

+ throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as it can be lazy-loaded.', $id));
+ }
+
+ $validators[$definition->getClass()] = $id;
@stof
stof Sep 30, 2016 Member

shouldn't this be done in older branches ?

@fabpot fabpot added checks for public services on compiler passes that use service …
…id and not references
82fa942
@fabpot fabpot merged commit 82fa942 into symfony:master Oct 1, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
@fabpot fabpot added a commit that referenced this pull request Oct 1, 2016
@fabpot fabpot bug #20112 added checks for public services on compiler passes that u…
…se service ids and not references (fabpot)

This PR was merged into the 3.2-dev branch.

Discussion
----------

added checks for public services on compiler passes that use service ids and not references

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

82fa942 added checks for public services on compiler passes that use service id and not references
5775236
@fabpot fabpot deleted the fabpot:public-services branch Oct 24, 2016
@fabpot fabpot referenced this pull request Oct 27, 2016
Merged

Release v3.2.0-BETA1 #20317

+ }
+
+ if ($def->isAbstract()) {
+ throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as it can be lazy-loaded.', $id));
@lyrixx
lyrixx Feb 1, 2017 Member

The message here is not very accurate. An abstract service is not "get() able". It's not about lazy-loading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment