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

Breadcrumb

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

class CurlClient

Hierarchy

  • class \OpenTelemetry\SDK\Common\Http\Psr\Client\Discovery\CurlClient implements \OpenTelemetry\SDK\Common\Http\Psr\Client\Discovery\DiscoveryInterface

Expanded class hierarchy of CurlClient

1 file declares its use of CurlClient
Discovery.php in vendor/open-telemetry/sdk/Common/Http/Psr/Client/Discovery.php

File

vendor/open-telemetry/sdk/Common/Http/Psr/Client/Discovery/CurlClient.php, line 10

Namespace

OpenTelemetry\SDK\Common\Http\Psr\Client\Discovery
View source
class CurlClient implements DiscoveryInterface {
    
    /**
     * @phan-suppress PhanUndeclaredClassReference
     */
    public function available() : bool {
        return extension_loaded('curl') && class_exists(Client::class);
    }
    
    /**
     * @phan-suppress PhanUndeclaredClassReference,PhanTypeMismatchReturn,PhanUndeclaredClassMethod
     * @psalm-suppress UndefinedClass,InvalidReturnType,InvalidReturnStatement
     */
    public function create(mixed $options) : ClientInterface {
        $options = [
            \CURLOPT_TIMEOUT => $options['timeout'] ?? null,
        ];
        
        /** @phpstan-ignore-next-line  */
        return new Client(options: array_filter($options));
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
CurlClient::available public function @phan-suppress PhanUndeclaredClassReference Overrides DiscoveryInterface::available
CurlClient::create public function @phan-suppress PhanUndeclaredClassReference,PhanTypeMismatchReturn,PhanUndeclaredClassMethod
@psalm-suppress UndefinedClass,InvalidReturnType,InvalidReturnStatement
Overrides DiscoveryInterface::create

API Navigation

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