private function loadDynamicServices(): void
    {
        $this->startMeasure(__METHOD__);

        /** @var array $objects */
        $objects = App::$Properties->getAll('object');
        if (!Any::isArray($objects)) {
            throw new NativeException('Object configurations is not loaded: /Private/Config/Object.php');
        }

        // each all objects as service_name => service_instance()
        foreach ($objects as $name => $instance) {
            // check if definition of object is exist and services list contains it or is null to auto build
            if (property_exists(get_called_class(), $name) && $instance instanceof \Closure && (isset($this->_services[$name]) || $this->_services === null)) {
                if ($this->_services[$name] === true || $this->_services === null) { // initialize from configs
                    self::${$name} = $instance();
                } elseif (is_callable($this->_services[$name])) { // raw initialization from App::run()
                    self::${$name} = $this->_services[$name]();
                }
            } elseif (Str::startsWith('_', $name)) { // just anonymous callback without entry-point
                @call_user_func($instance);
            }
        }

        $this->stopMeasure(__METHOD__);
    }
private function loadDynamicServices(): void
    {
        $this->startMeasure(__METHOD__);

        /** @var array $objects */
        $objects = App::$Properties->getAll('object');
        if (!Any::isArray($objects)) {
            throw new NativeException('Object configurations is not loaded: /Private/Config/Object.php');
        }

        // each all objects as service_name => service_instance()
        foreach ($objects as $name => $instance) {
            // check if definition of object is exist and services list contains it or is null to auto build
            if (property_exists(get_called_class(), $name) && $instance instanceof \Closure && (isset($this->_services[$name]) || $this->_services === null)) {
                if ($this->_services[$name] === true || $this->_services === null) { // initialize from configs
                    self::${$name} = $instance();
                } elseif (is_callable($this->_services[$name])) { // raw initialization from App::run()
                    self::${$name} = $this->_services[$name]();
                }
            } elseif (Str::startsWith('_', $name)) { // just anonymous callback without entry-point
                @call_user_func($instance);
            }
        }

        $this->stopMeasure(__METHOD__);
    }
private function loadDynamicServices ( ) : void { $ this -> startMeasure ( __METHOD__ ) ; /** @var array $objects */ $ objects = App :: $ Properties -> getAll ( 'object' ) ; if ( ! Any :: isArray ( $ objects ) ) { throw new NativeException ( 'Object configurations is not loaded: /Private/Config/Object.php' ) ; } // each all objects as service_name => service_instance() foreach ( $ objects as $ name => $ instance ) { // check if definition of object is exist and services list contains it or is null to auto build if ( property_exists ( get_called_class ( ) , $ name ) && $ instance instanceof \ Closure && ( isset ( $ this -> _services [ $ name ] ) || $ this -> _services === null ) ) { if ( $ this -> _services [ $ name ] === true || $ this -> _services === null ) { // initialize from configs self :: $ { $ name } = $ instance ( ) ; } elseif ( is_callable ( $ this -> _services [ $ name ] ) ) { // raw initialization from App::run() self :: $ { $ name } = $ this -> _services [ $ name ] ( ) ; } } elseif ( Str :: startsWith ( '_' , $ name ) ) { // just anonymous callback without entry-point @ call_user_func ( $ instance ) ; } } $ this -> stopMeasure ( __METHOD__ ) ; }
Prepare dynamic static links from object configurations as anonymous functions
@throws NativeException
Prepare dynamic static links from object configurations as anonymous functions