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

Breadcrumb

  1. Drupal Core 11.1.x

MockClientStrategy.php

Namespace

Http\Discovery\Strategy

File

vendor/php-http/discovery/src/Strategy/MockClientStrategy.php

View source
<?php

namespace Http\Discovery\Strategy;

use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Http\Mock\Client as Mock;

/**
 * Find the Mock client.
 *
 * @author Sam Rapaport <me@samrapdev.com>
 */
final class MockClientStrategy implements DiscoveryStrategy {
    public static function getCandidates($type) {
        if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) {
            return [
                [
                    'class' => Mock::class,
                    'condition' => Mock::class,
                ],
            ];
        }
        return [];
    }

}

Classes

Title Deprecated Summary
MockClientStrategy Find the Mock client.

API Navigation

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