@return bool True if the class with the supplied name can be resolved with 'get'. */ public function has( string $class_name ): bool { $class_name = trim( $class_name, '\\' ); return $this->is_class_allowed( $class_name ) || isset( $this->resolved_cache[ $class_name ] ); } /** * Checks to see whether a class is allowed to be registered. * * @param string $class_name The class to check. * * @return bool True if the class is allowed to be registered, false otherwise. */ protected function is_class_allowed( string $class_name ): bool { return StringUtil::starts_with( $class_name, self::WOOCOMMERCE_NAMESPACE, false ); } }