Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Traits

  • CollectionTrait
  • ContainerTrait

Trait ContainerTrait

An implementation of \Psr\Container\ContainerInterface as a trait, which can be bound to any class to fulfill the requirements of the container interface.

oroboros\core\traits\libraries\container\ContainerTrait uses oroboros\core\traits\patterns\behavioral\RegistryTrait

Direct Known Users

oroboros\core\abstracts\libraries\container\AbstractContainer, oroboros\core\traits\libraries\container\CollectionTrait

Namespace: oroboros\core\traits\libraries\container
Author: Brian Dayhoff mopsyd@me.com
See: http://www.php-fig.org/psr/psr-11/
Satisfies: \Psr\Container\ContainerInterface
Satisfies: \oroboros\core\interfaces\contract\libraries\container\ContainerContract
Located at core/traits/libraries/container/ContainerTrait.php

Methods summary

public mixed
# get( string $id )

Finds an entry of the container by its identifier and returns it.

Finds an entry of the container by its identifier and returns it.

Parameters

$id
Identifier of the entry to look for.

Returns

mixed
Entry.

Throws

NotFoundExceptionInterface
No entry was found for this identifier.
ContainerExceptionInterface
Error while retrieving the entry.
public boolean
# has( string $id )

Returns true if the container can return an entry for the given identifier. Returns false otherwise.

Returns true if the container can return an entry for the given identifier. Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters

$id
Identifier of the entry to look for.

Returns

boolean
protected boolean
# _set( scalar $key, mixed $value, boolean $safe = false )

Parameters

$key
The key to identify the value by.
$value
The container value to set.
$safe
If true, will not overwrite existing values. Default false.

Returns

boolean

Throws

oroboros\core\utilities\exception\container\ContainerException
if a non-scalar value is passed.
protected mixed
# _get( scalar $key )

Returns the requested value if it exists in the container.

Returns the requested value if it exists in the container.

Parameters

$key

Returns

mixed

Throws

oroboros\core\utilities\exception\container\ContainerException
If a non-scalar value is passed, or any other problem occurs with retrieval.
oroboros\core\utilities\exception\container\NotFoundException
If the value does not exist in the container.
protected boolean
# _check( scalar $key )

Returns a boolean determination as to whether a specific value exists. This method is safe and does not throw exceptions.

Returns a boolean determination as to whether a specific value exists. This method is safe and does not throw exceptions.

Parameters

$key

Returns

boolean

Methods used from oroboros\core\traits\patterns\behavioral\RegistryTrait

_checkRegistryKeyMapping(), _checkRegistryValue(), _countRegistryKeys(), _deleteRegistryKeyMapping(), _extractRegistryLocalizedIndex(), _fetchRegistry(), _getRegistryIndexSeparator(), _getRegistryKeyMapping(), _getRegistryValue(), _getRegistryValueReference(), _initializeRegistry(), _resetRegistry(), _resetRegistryIndexSeparator(), _resolveRegistryKeyMapping(), _setRegistryIndexSeparator(), _setRegistryKeyMapping(), _setRegistryValue(), _unsetRegistryIndex()

Properties summary

Properties used from oroboros\core\traits\patterns\behavioral\RegistryTrait

$_registry_default_index_separator, $_registry_index_separator, $_registry_values

Oroboros Core API documentation generated by ApiGen