-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #3085751 by alexpott, Deepak Goyal, rpayanm, longwave, catch, v…
…olkerk, kristiaanvandeneynde, dww: [backport] Setter injection arguments are not checked for unmet dependencies (cherry picked from commit 2a71dd80fe94e30ebff5d76aff6f2a174c793fd8)
- Loading branch information
catch
committed
Jul 17, 2020
1 parent
a345851
commit 5459f78
Showing
5 changed files
with
87 additions
and
6 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
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
39 changes: 39 additions & 0 deletions
39
modules/system/tests/modules/new_dependency_test/src/SetterInjection.php
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,39 @@ | ||
<?php | ||
|
||
namespace Drupal\new_dependency_test; | ||
|
||
use Drupal\new_dependency_test_with_service\NewService; | ||
|
||
/** | ||
* Generic service which uses setter injection. | ||
*/ | ||
class SetterInjection { | ||
|
||
/** | ||
* The injected service. | ||
* | ||
* @var \Drupal\new_dependency_test_with_service\NewService | ||
*/ | ||
protected $service; | ||
|
||
/** | ||
* SetterInjection constructor. | ||
* | ||
* @param \Drupal\new_dependency_test_with_service\NewService $service | ||
* The service of the new module. | ||
*/ | ||
public function setter(NewService $service) { | ||
$this->service = $service; | ||
} | ||
|
||
/** | ||
* Get the simple greeting from the service. | ||
* | ||
* @return string | ||
* The greeting. | ||
*/ | ||
public function greet() { | ||
return $this->service->greet(); | ||
} | ||
|
||
} |
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