This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/GetterOverriding.php
2017-02-02 20:37:38 +01:00

66 lines
1.3 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
use Symfony\Component\DependencyInjection\Tests\Compiler\A;
use Symfony\Component\DependencyInjection\Tests\Compiler\B;
use Symfony\Component\DependencyInjection\Tests\Compiler\Bar;
use Symfony\Component\DependencyInjection\Tests\Compiler\Foo;
/**
* To test getter autowiring with PHP >= 7.1.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class GetterOverriding
{
public function getFoo(): ?Foo
{
// should be called
}
protected function getBar(): Bar
{
// should be called
}
public function getNoTypeHint()
{
// should not be called
}
public function getUnknown(): NotExist
{
// should not be called
}
public function getExplicitlyDefined(): B
{
// should be called but not autowired
}
public function getScalar(): string
{
// should not be called
}
final public function getFinal(): A
{
// should not be called
}
public function &getReference(): A
{
// should not be called
}
}