mirror of
https://github.com/danog/psalm-plugin-symfony.git
synced 2025-01-22 21:12:17 +01:00
assume service as public if public attribute is missing (#15)
This commit is contained in:
parent
007d3c6511
commit
c2b2dd4ae7
@ -33,7 +33,7 @@ class ContainerMeta
|
||||
if (isset($serviceAttributes->alias)) {
|
||||
$service->setAlias((string) $serviceAttributes->alias);
|
||||
}
|
||||
$service->setIsPublic('true' === (string) $serviceAttributes->public);
|
||||
$service->setIsPublic('false' !== (string) $serviceAttributes->public);
|
||||
|
||||
$this->add($service);
|
||||
}
|
||||
|
@ -16,5 +16,6 @@
|
||||
<service id="Symfony\Component\HttpKernel\HttpKernelInterface" alias="http_kernel" public="true"/>
|
||||
<service id="Foo\Bar" class="Foo\Bar" public="false"/>
|
||||
<service id="private_service" class="Foo\Bar" public="false"/>
|
||||
<service id="public_service_wo_public_attr" class="Foo\Bar"/>
|
||||
</services>
|
||||
</container>
|
||||
|
@ -57,6 +57,11 @@ class ContainerMetaTest extends TestCase
|
||||
'className' => 'Symfony\Component\HttpKernel\HttpKernel',
|
||||
'isPublic' => true,
|
||||
],
|
||||
[
|
||||
'id' => 'public_service_wo_public_attr',
|
||||
'className' => 'Foo\Bar',
|
||||
'isPublic' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user