1.2.956. PSR-11 Usage¶
PSR-11 describes a common interface for dependency injection containers.
It is supported by an set of interfaces, that one may use in the code.
<?php
namespace MyNamespace;
// MyContainerInterface implements the PSR-7 ServerRequestInterface.
// MyContainerInterface is more of a black hole than a real Container.
class MyContainerInterface implements \Psr\Container\ContainerInterface {
public function get($id) {}
public function has($id) {}
}
?>
See also PSR-11 : Dependency injection container.
1.2.956.1. Connex PHP features¶
1.2.956.1.1. Specs¶
Short name |
Psr/Psr11Usage |
Rulesets |
|
Exakat since |
0.11.5 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |