Last active
February 18, 2016 13:56
-
-
Save damiankloip/ac12f568924c69462279 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains \Drupal\Component\Discovery\YamlDirectoryIterator. | |
*/ | |
namespace Drupal\Component\Discovery; | |
class YamlDirectoryIterator extends \FilterIterator { | |
/** | |
* YamlDirectoryIterator constructor. | |
* | |
* @param string $path | |
*/ | |
public function __construct($path) { | |
$iterator = new \FileSystemIterator($path); | |
parent::__construct($iterator); | |
} | |
/** | |
* Implements \FilterIterator::accept(). | |
*/ | |
public function accept() { | |
/** @var \SplFileInfo $file_info */ | |
$file_info = $this->getInnerIterator()->current(); | |
return $file_info->isFile() && ($file_info->getExtension() === 'yml'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment