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

Breadcrumb

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

function YamlFileLoader::supports

Same name in this branch
  1. 11.1.x vendor/symfony/routing/Loader/YamlFileLoader.php \Symfony\Component\Routing\Loader\YamlFileLoader::supports()

File

vendor/symfony/dependency-injection/Loader/YamlFileLoader.php, line 189

Class

YamlFileLoader
YamlFileLoader loads YAML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

public function supports(mixed $resource, ?string $type = null) : bool {
    if (!\is_string($resource)) {
        return false;
    }
    if (null === $type && \in_array(pathinfo($resource, \PATHINFO_EXTENSION), [
        'yaml',
        'yml',
    ], true)) {
        return true;
    }
    return \in_array($type, [
        'yaml',
        'yml',
    ], true);
}

API Navigation

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