add( __CLASS__, $this ); // Register the reflection container to allow autowiring. $this->reflection_container = new WooReflectionContainer(); $this->delegate( $this->reflection_container ); } /** * Defines a class as shared while making it available via autowiring. In other words, the class will be resolved * whenever needed using autowiring, but only one shared instance will be created. * * @param string $class_name The name of the class to define as shared. */ public function defineAsSharedAutowired( string $class_name ) { $this->reflection_container->share( $class_name ); } }