Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
957078ec
Commit
957078ec
authored
Nov 8, 2014
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2105693
by cilefen | jhodgdon: Fixed ContainerInjectionInterface docs need update.
parent
0506d2cb
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php
+8
-15
8 additions, 15 deletions
.../Core/DependencyInjection/ContainerInjectionInterface.php
with
8 additions
and
15 deletions
core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php
+
8
−
15
View file @
957078ec
...
...
@@ -10,30 +10,23 @@
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Defines a common interface for
route controllers
.
* Defines a common interface for
dependency container injection
.
*
* This interface gives controller classes a factory method for instantiation
* rather than relying on a services.yml entry. However, it may result in
* a lot of boilerplate code in the class. As an alternative, controllers that
* contain only limited glue code ("thin" controllers) should instead extend
* ControllerBase as that allows direct access to the container. That renders
* the controller very difficult to unit test so should only be used for
* controllers that are trivial in complexity.
*
* @ingroup menu
* This interface gives classes who need services a factory method for
* instantiation rather than defining a new service.
*/
interface
ContainerInjectionInterface
{
/**
* Instantiates a new instance of this c
ontroller
.
* Instantiates a new instance of this c
lass
.
*
* This is a factory method that returns a new instance of this
object
. The
* This is a factory method that returns a new instance of this
class
. The
* factory should pass any needed dependencies into the constructor of this
*
object
, but not the container itself. Every call to this method must return
* a new instance of this
object
; that is, it may not implement a singleton.
*
class
, but not the container itself. Every call to this method must return
* a new instance of this
class
; that is, it may not implement a singleton.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The service container this
object
should use.
* The service container this
instance
should use.
*/
public
static
function
create
(
ContainerInterface
$container
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment