-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52072e6
commit 251bd72
Showing
8 changed files
with
186 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
/** | ||
* @Annotation | ||
* @Target("CLASS") | ||
* @Target({"CLASS", "METHOD"}) | ||
*/ | ||
final class Service | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Factory; | ||
|
||
use JMS\DiExtraBundle\Annotation as DI; | ||
|
||
/** @DI\Service("my_factory") */ | ||
class MyFactory | ||
{ | ||
/** @DI\Service("factory_generic_service") */ | ||
public function createGenericService(): \stdClass | ||
{ | ||
return new \stdClass(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace JMS\DiExtraBundle\Tests\Functional; | ||
|
||
use JMS\DiExtraBundle\Tests\Functional\BaseTestCase; | ||
|
||
class FactoryTest extends BaseTestCase | ||
{ | ||
public function testGetFactoryService() | ||
{ | ||
if (version_compare(PHP_VERSION, '7.0.0', '<')) { | ||
$this->markTestSkipped('Requires PHP 7.0'); | ||
} | ||
|
||
$this->createClient(); | ||
$container = self::$kernel->getContainer(); | ||
|
||
$service = $container->get('factory_generic_service'); | ||
$this->assertInstanceOf('stdClass', $service); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters