-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DependencyInjection] Add tests for repeating
#[Autoconfigure]
attr…
…ibutes
- Loading branch information
1 parent
8f4bb4b
commit 960d259
Showing
7 changed files
with
172 additions
and
0 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
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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; | ||
|
||
#[Autoconfigure(public: true, shared: false)] | ||
#[Autoconfigure(lazy: true)] | ||
class AutoconfigureRepeated | ||
{ | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; | ||
|
||
#[Autoconfigure(bind: ['$arg' => 'foo'])] | ||
#[Autoconfigure(bind: ['$arg' => 'bar'])] | ||
class AutoconfigureRepeatedBindings | ||
{ | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; | ||
|
||
#[Autoconfigure(calls: [['setBar', ['arg2']]])] | ||
#[Autoconfigure(calls: [['setFoo', ['arg1']]])] | ||
class AutoconfigureRepeatedCalls | ||
{ | ||
public function setFoo(string $arg) | ||
{ | ||
} | ||
|
||
public function setBar(string $arg) | ||
{ | ||
} | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; | ||
|
||
#[Autoconfigure(public: true, shared: false)] | ||
#[Autoconfigure(lazy: true, shared: true, public: false)] | ||
class AutoconfigureRepeatedOverwrite | ||
{ | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; | ||
|
||
#[Autoconfigure(properties: ['$replaced' => 'to be replaced', '$bar' => 'existing to be replaced'])] | ||
#[Autoconfigure(properties: ['$foo' => 'bar', '$bar' => 'baz'])] | ||
class AutoconfigureRepeatedProperties | ||
{ | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; | ||
|
||
#[AutoconfigureTag('foo', ['priority' => 2])] | ||
#[AutoconfigureTag('bar')] | ||
class AutoconfigureRepeatedTag | ||
{ | ||
} |