The goal set by ContainerInterface is to standardize how frameworks and libraries make use of a container to obtain objects and parameters. An entry identifier is any PHP-legal string of at least one character that uniquely identifies an item within a container. An entry identifier is an opaque string, so callers should not assume that the structure of the string carries any semantic meaning. The Psr\Container\ContainerInterface exposes two methods, get and has. get takes one mandatory parameter: an entry identifier, which must be a string. get can return anything (a mixed value), or throw a NotFoundExceptionInterface if the identifier is not known to the container. Two successive calls to get with the same identifier should return the same value. has takes one unique parameter: an entry identifier, which must be a string. has must return true if an entry identifier is known to the container and false if it is not.

Features

  • The interfaces and classes described as well as relevant exceptions are provided as part of the psr/container package
  • Standardize how frameworks and libraries make use of a container to obtain objects and parameters
  • All containers offer a method to get an entry by its id
  • Compatible with existing containers that have additional optional parameters
  • PHP allows an implementation to offer more parameters as long as they are optional
  • This PSR provides 2 interfaces meant to be implemented by container exceptions

Project Samples

Project Activity

See All Activity >

Categories

Frameworks, Libraries

License

MIT License

Follow PSR-11 Container interface

PSR-11 Container interface Web Site

Other Useful Business Software
Stop Cyber Threats with VM-Series Next-Gen Firewall on Azure Icon
Stop Cyber Threats with VM-Series Next-Gen Firewall on Azure

Native application identity and user-based security for your Azure cloud

Gain integrated visibility across all traffic in a single pass. Deploy Palo Alto Networks VM-Series to determine application identity and content while automating security policy updates via rich APIs.
Get a free trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of PSR-11 Container interface!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Frameworks, PHP Libraries

Registered

2021-06-22