芝麻web文件管理V1.00
编辑当前文件:/home/paymbalq/www/wp-content/plugins/woocommerce/packages/email-editor/src/class-container.php
services[ $name ] = $callback; } /** * Method for getting a registered service * * @template T * @param class-string
$name The name of the service. * @return T * @throws \Exception If the service is not found. */ public function get( $name ) { // Check if the service is already instantiated. if ( isset( $this->instances[ $name ] ) ) { return $this->instances[ $name ]; } // Check if the service is registered. if ( ! isset( $this->services[ $name ] ) ) { throw new \Exception( esc_html( "Service not found: $name" ) ); } $this->instances[ $name ] = $this->services[ $name ]( $this ); return $this->instances[ $name ]; } }