Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpAsyncClientDiscovery.php

class HttpAsyncClientDiscovery

Finds an HTTP Asynchronous Client.

@author Joel Wurtz <joel.wurtz@gmail.com>

Hierarchy

  • class \Http\Discovery\ClassDiscovery
    • class \Http\Discovery\HttpAsyncClientDiscovery extends \Http\Discovery\ClassDiscovery

Expanded class hierarchy of HttpAsyncClientDiscovery

1 file declares its use of HttpAsyncClientDiscovery
HttpPlugClientResolver.php in vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/HttpPlugClientResolver.php

File

vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php, line 13

Namespace

Http\Discovery
View source
final class HttpAsyncClientDiscovery extends ClassDiscovery {
    
    /**
     * Finds an HTTP Async Client.
     *
     * @return HttpAsyncClient
     *
     * @throws Exception\NotFoundException
     */
    public static function find() {
        try {
            $asyncClient = static::findOneByType(HttpAsyncClient::class);
        } catch (DiscoveryFailedException $e) {
            throw new NotFoundException('No HTTPlug async clients found. Make sure to install a package providing "php-http/async-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e);
        }
        return static::instantiateClass($asyncClient);
    }

}

Members

Title Sort descending Modifiers Object type Summary
ClassDiscovery::$cache private static property Discovery cache to make the second time we use discovery faster.
ClassDiscovery::$deprecatedStrategies private static property
ClassDiscovery::$strategies private static property A list of strategies to find classes.
ClassDiscovery::appendStrategy public static function Append a strategy at the end of the strategy queue.
ClassDiscovery::clearCache public static function
ClassDiscovery::evaluateCondition protected static function Evaluates conditions to boolean.
ClassDiscovery::findOneByType protected static function Finds a class.
ClassDiscovery::getFromCache private static function Get a value from cache.
ClassDiscovery::getStrategies public static function Returns the currently configured discovery strategies as fully qualified class names.
ClassDiscovery::instantiateClass protected static function Get an instance of the $class.
ClassDiscovery::prependStrategy public static function Prepend a strategy at the beginning of the strategy queue.
ClassDiscovery::safeClassExists public static function We need a &quot;safe&quot; version of PHP&#039;s &quot;class_exists&quot; because Magento has a bug
(or they call it a &quot;feature&quot;). Magento is throwing an exception if you do class_exists()
on a class that ends with &quot;Factory&quot; and if…
ClassDiscovery::setStrategies public static function Set new strategies and clear the cache.
ClassDiscovery::storeInCache private static function Store a value in cache.
HttpAsyncClientDiscovery::find public static function Finds an HTTP Async Client.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal