original_string: protected function loadResource($resource, $required)
      {
          foreach ($this->loaders as $loader) {
              if (!$loader->supports($resource)) {
                  continue;
              }
  
              try {
                  return $loader->load($resource);
              } catch (ResourceNotFoundException $e) {
                  if ($required) {
                      throw $e;
                  }
  
                  return [];
              }
          }
  
          throw new ResourceException(sprintf('There is no configuration loader available to load the resource "%s"', $resource));
      }
code: protected function loadResource($resource, $required)
      {
          foreach ($this->loaders as $loader) {
              if (!$loader->supports($resource)) {
                  continue;
              }
  
              try {
                  return $loader->load($resource);
              } catch (ResourceNotFoundException $e) {
                  if ($required) {
                      throw $e;
                  }
  
                  return [];
              }
          }
  
          throw new ResourceException(sprintf('There is no configuration loader available to load the resource "%s"', $resource));
      }
code_tokens: protected function loadResource ( $ resource , $ required ) { foreach ( $ this -> loaders as $ loader ) { if ( ! $ loader -> supports ( $ resource ) ) { continue ; } try { return $ loader -> load ( $ resource ) ; } catch ( ResourceNotFoundException $ e ) { if ( $ required ) { throw $ e ; } return [ ] ; } } throw new ResourceException ( sprintf ( 'There is no configuration loader available to load the resource "%s"' , $ resource ) ) ; }
docstring: Load a resource using a loader. The first loader that supports
  the resource will be used.
  
  @param mixed $resource
  @param bool  $required
  
  @throws ResourceException
  
  @return array
docstring_tokens: Load a resource using a loader . The first loader that supports the resource will be used .