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

Breadcrumb

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

function NoCandidateFoundException::__construct

Parameters

string $strategy:

File

vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php, line 17

Class

NoCandidateFoundException
When we have used a strategy but no candidates provided by that strategy could be used.

Namespace

Http\Discovery\Exception

Code

public function __construct($strategy, array $candidates) {
    $classes = array_map(function ($a) {
        return $a['class'];
    }, $candidates);
    $message = sprintf('No valid candidate found using strategy "%s". We tested the following candidates: %s.', $strategy, implode(', ', array_map([
        $this,
        'stringify',
    ], $classes)));
    parent::__construct($message);
}

API Navigation

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