[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/third-party/Http/Discovery/ -> ClassDiscovery.php (summary)

Registry that based find results on class existence.

Author: David de Boer
Author: Márk Sági-Kazár
Author: Tobias Nyholm
File Size: 219 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  findOneByType()
  getFromCache()
  storeInCache()
  setStrategies()
  getStrategies()
  appendStrategy()
  prependStrategy()
  clearCache()
  evaluateCondition()
  instantiateClass()
  safeClassExists()

Functions
Functions that are not part of a class:

findOneByType($type)   X-Ref
Finds a class.

return: string|\Closure
param: string $type

getFromCache($type)   X-Ref
Get a value from cache.

return: string|null
param: string $type

storeInCache($type, $class)   X-Ref
Store a value in cache.

param: string $type
param: string $class

setStrategies(array $strategies)   X-Ref
Set new strategies and clear the cache.

param: string[] $strategies list of fully qualified class names that implement DiscoveryStrategy

getStrategies()   X-Ref
Returns the currently configured discovery strategies as fully qualified class names.

return: string[]

appendStrategy($strategy)   X-Ref
Append a strategy at the end of the strategy queue.

param: string $strategy Fully qualified class name of a DiscoveryStrategy

prependStrategy($strategy)   X-Ref
Prepend a strategy at the beginning of the strategy queue.

param: string $strategy Fully qualified class name to a DiscoveryStrategy

clearCache()   X-Ref
No description

evaluateCondition($condition)   X-Ref
Evaluates conditions to boolean.

return: bool

instantiateClass($class)   X-Ref
Get an instance of the $class.

return: object
param: string|\Closure $class a FQCN of a class or a closure that instantiate the class

safeClassExists($class)   X-Ref
We need a "safe" version of PHP's "class_exists" because Magento has a bug
(or they call it a "feature"). Magento is throwing an exception if you do class_exists()
on a class that ends with "Factory" and if that file does not exits.

This function catches all potential exceptions and makes sure to always return a boolean.

return: bool
param: string $class



Generated : Sat Jun 13 09:38:55 2026 Cross-referenced by PHPXref