protected function iocContainer()
    {
        if (
            property_exists($this, 'container')
            && isset($this->container)
            && $this->container instanceof ContainerInterface
        ) {
            return $this->container;
        }

        /*
         * Technically your code can work without ever being using fallback container, all
         * spiral components can do that and only few traits will require few extra parameters.
         *
         * I'm planning one day (update: DONE) to run spiral as worker and later in async mode (few app
         * processes in memory), memory schemas might help a lot by minimizing runtime code by using
         * pre-calculated behaviours.
         */

        return self::$staticContainer;
    }
protected function iocContainer()
    {
        if (
            property_exists($this, 'container')
            && isset($this->container)
            && $this->container instanceof ContainerInterface
        ) {
            return $this->container;
        }

        /*
         * Technically your code can work without ever being using fallback container, all
         * spiral components can do that and only few traits will require few extra parameters.
         *
         * I'm planning one day (update: DONE) to run spiral as worker and later in async mode (few app
         * processes in memory), memory schemas might help a lot by minimizing runtime code by using
         * pre-calculated behaviours.
         */

        return self::$staticContainer;
    }
protected function iocContainer ( ) { if ( property_exists ( $ this , 'container' ) && isset ( $ this -> container ) && $ this -> container instanceof ContainerInterface ) { return $ this -> container ; } /*
         * Technically your code can work without ever being using fallback container, all
         * spiral components can do that and only few traits will require few extra parameters.
         *
         * I'm planning one day (update: DONE) to run spiral as worker and later in async mode (few app
         * processes in memory), memory schemas might help a lot by minimizing runtime code by using
         * pre-calculated behaviours.
         */ return self :: $ staticContainer ; }
Get instance of container associated with given object, uses global container as fallback
if not. Method generally used by traits.

@return ContainerInterface|null
Get instance of container associated with given object uses global container as fallback if not . Method generally used by traits .