From be729e39e85090aa63ee9d0e3377033945aa49eb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Sep 2015 13:17:06 +0200 Subject: [PATCH] [Finder] removed obsolete code --- .../Finder/Expression/Expression.php | 148 -------- .../Component/Finder/Expression/Glob.php | 111 ------ .../Component/Finder/Expression/Regex.php | 323 ------------------ .../Finder/Expression/ValueInterface.php | 62 ---- .../Tests/Expression/ExpressionTest.php | 71 ---- .../Finder/Tests/Expression/GlobTest.php | 50 --- .../Finder/Tests/Expression/RegexTest.php | 146 -------- .../Finder/Tests/FakeAdapter/DummyAdapter.php | 57 ---- .../Tests/FakeAdapter/FailingAdapter.php | 45 --- .../Finder/Tests/FakeAdapter/NamedAdapter.php | 57 ---- .../Tests/FakeAdapter/UnsupportedAdapter.php | 44 --- 11 files changed, 1114 deletions(-) delete mode 100644 src/Symfony/Component/Finder/Expression/Expression.php delete mode 100644 src/Symfony/Component/Finder/Expression/Glob.php delete mode 100644 src/Symfony/Component/Finder/Expression/Regex.php delete mode 100644 src/Symfony/Component/Finder/Expression/ValueInterface.php delete mode 100644 src/Symfony/Component/Finder/Tests/Expression/ExpressionTest.php delete mode 100644 src/Symfony/Component/Finder/Tests/Expression/GlobTest.php delete mode 100644 src/Symfony/Component/Finder/Tests/Expression/RegexTest.php delete mode 100644 src/Symfony/Component/Finder/Tests/FakeAdapter/DummyAdapter.php delete mode 100644 src/Symfony/Component/Finder/Tests/FakeAdapter/FailingAdapter.php delete mode 100644 src/Symfony/Component/Finder/Tests/FakeAdapter/NamedAdapter.php delete mode 100644 src/Symfony/Component/Finder/Tests/FakeAdapter/UnsupportedAdapter.php diff --git a/src/Symfony/Component/Finder/Expression/Expression.php b/src/Symfony/Component/Finder/Expression/Expression.php deleted file mode 100644 index d2fc7390f3..0000000000 --- a/src/Symfony/Component/Finder/Expression/Expression.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Expression; - -@trigger_error('The '.__NAMESPACE__.'\Expression class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); - -/** - * @author Jean-François Simon - */ -class Expression implements ValueInterface -{ - const TYPE_REGEX = 1; - const TYPE_GLOB = 2; - - /** - * @var ValueInterface - */ - private $value; - - /** - * @param string $expr - * - * @return Expression - */ - public static function create($expr) - { - return new self($expr); - } - - /** - * @param string $expr - */ - public function __construct($expr) - { - try { - $this->value = Regex::create($expr); - } catch (\InvalidArgumentException $e) { - $this->value = new Glob($expr); - } - } - - /** - * @return string - */ - public function __toString() - { - return $this->render(); - } - - /** - * {@inheritdoc} - */ - public function render() - { - return $this->value->render(); - } - - /** - * {@inheritdoc} - */ - public function renderPattern() - { - return $this->value->renderPattern(); - } - - /** - * @return bool - */ - public function isCaseSensitive() - { - return $this->value->isCaseSensitive(); - } - - /** - * @return int - */ - public function getType() - { - return $this->value->getType(); - } - - /** - * {@inheritdoc} - */ - public function prepend($expr) - { - $this->value->prepend($expr); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function append($expr) - { - $this->value->append($expr); - - return $this; - } - - /** - * @return bool - */ - public function isRegex() - { - return self::TYPE_REGEX === $this->value->getType(); - } - - /** - * @return bool - */ - public function isGlob() - { - return self::TYPE_GLOB === $this->value->getType(); - } - - /** - * @throws \LogicException - * - * @return Glob - */ - public function getGlob() - { - if (self::TYPE_GLOB !== $this->value->getType()) { - throw new \LogicException('Regex can\'t be transformed to glob.'); - } - - return $this->value; - } - - /** - * @return Regex - */ - public function getRegex() - { - return self::TYPE_REGEX === $this->value->getType() ? $this->value : $this->value->toRegex(); - } -} diff --git a/src/Symfony/Component/Finder/Expression/Glob.php b/src/Symfony/Component/Finder/Expression/Glob.php deleted file mode 100644 index 9382d9169b..0000000000 --- a/src/Symfony/Component/Finder/Expression/Glob.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Expression; - -@trigger_error('The '.__NAMESPACE__.'\Glob class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); - -use Symfony\Component\Finder\Glob as FinderGlob; - -/** - * @author Jean-François Simon - */ -class Glob implements ValueInterface -{ - /** - * @var string - */ - private $pattern; - - /** - * @param string $pattern - */ - public function __construct($pattern) - { - $this->pattern = $pattern; - } - - /** - * {@inheritdoc} - */ - public function render() - { - return $this->pattern; - } - - /** - * {@inheritdoc} - */ - public function renderPattern() - { - return $this->pattern; - } - - /** - * {@inheritdoc} - */ - public function getType() - { - return Expression::TYPE_GLOB; - } - - /** - * {@inheritdoc} - */ - public function isCaseSensitive() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function prepend($expr) - { - $this->pattern = $expr.$this->pattern; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function append($expr) - { - $this->pattern .= $expr; - - return $this; - } - - /** - * Tests if glob is expandable ("*.{a,b}" syntax). - * - * @return bool - */ - public function isExpandable() - { - return false !== strpos($this->pattern, '{') - && false !== strpos($this->pattern, '}'); - } - - /** - * @param bool $strictLeadingDot - * @param bool $strictWildcardSlash - * - * @return Regex - */ - public function toRegex($strictLeadingDot = true, $strictWildcardSlash = true) - { - $regex = FinderGlob::toRegex($this->pattern, $strictLeadingDot, $strictWildcardSlash, ''); - - return new Regex($regex); - } -} diff --git a/src/Symfony/Component/Finder/Expression/Regex.php b/src/Symfony/Component/Finder/Expression/Regex.php deleted file mode 100644 index 4305196674..0000000000 --- a/src/Symfony/Component/Finder/Expression/Regex.php +++ /dev/null @@ -1,323 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Expression; - -@trigger_error('The '.__NAMESPACE__.'\Regex class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); - -/** - * @author Jean-François Simon - */ -class Regex implements ValueInterface -{ - const START_FLAG = '^'; - const END_FLAG = '$'; - const BOUNDARY = '~'; - const JOKER = '.*'; - const ESCAPING = '\\'; - - /** - * @var string - */ - private $pattern; - - /** - * @var array - */ - private $options; - - /** - * @var bool - */ - private $startFlag; - - /** - * @var bool - */ - private $endFlag; - - /** - * @var bool - */ - private $startJoker; - - /** - * @var bool - */ - private $endJoker; - - /** - * @param string $expr - * - * @return Regex - * - * @throws \InvalidArgumentException - */ - public static function create($expr) - { - if (preg_match('/^(.{3,}?)([imsxuADU]*)$/', $expr, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ( - ($start === $end && !preg_match('/[*?[:alnum:] \\\\]/', $start)) - || ($start === '{' && $end === '}') - || ($start === '(' && $end === ')') - ) { - return new self(substr($m[1], 1, -1), $m[2], $end); - } - } - - throw new \InvalidArgumentException('Given expression is not a regex.'); - } - - /** - * @param string $pattern - * @param string $options - * @param string $delimiter - */ - public function __construct($pattern, $options = '', $delimiter = null) - { - if (null !== $delimiter) { - // removes delimiter escaping - $pattern = str_replace('\\'.$delimiter, $delimiter, $pattern); - } - - $this->parsePattern($pattern); - $this->options = $options; - } - - /** - * @return string - */ - public function __toString() - { - return $this->render(); - } - - /** - * {@inheritdoc} - */ - public function render() - { - return self::BOUNDARY - .$this->renderPattern() - .self::BOUNDARY - .$this->options; - } - - /** - * {@inheritdoc} - */ - public function renderPattern() - { - return ($this->startFlag ? self::START_FLAG : '') - .($this->startJoker ? self::JOKER : '') - .str_replace(self::BOUNDARY, '\\'.self::BOUNDARY, $this->pattern) - .($this->endJoker ? self::JOKER : '') - .($this->endFlag ? self::END_FLAG : ''); - } - - /** - * {@inheritdoc} - */ - public function isCaseSensitive() - { - return !$this->hasOption('i'); - } - - /** - * {@inheritdoc} - */ - public function getType() - { - return Expression::TYPE_REGEX; - } - - /** - * {@inheritdoc} - */ - public function prepend($expr) - { - $this->pattern = $expr.$this->pattern; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function append($expr) - { - $this->pattern .= $expr; - - return $this; - } - - /** - * @param string $option - * - * @return bool - */ - public function hasOption($option) - { - return false !== strpos($this->options, $option); - } - - /** - * @param string $option - * - * @return Regex - */ - public function addOption($option) - { - if (!$this->hasOption($option)) { - $this->options .= $option; - } - - return $this; - } - - /** - * @param string $option - * - * @return Regex - */ - public function removeOption($option) - { - $this->options = str_replace($option, '', $this->options); - - return $this; - } - - /** - * @param bool $startFlag - * - * @return Regex - */ - public function setStartFlag($startFlag) - { - $this->startFlag = $startFlag; - - return $this; - } - - /** - * @return bool - */ - public function hasStartFlag() - { - return $this->startFlag; - } - - /** - * @param bool $endFlag - * - * @return Regex - */ - public function setEndFlag($endFlag) - { - $this->endFlag = (bool) $endFlag; - - return $this; - } - - /** - * @return bool - */ - public function hasEndFlag() - { - return $this->endFlag; - } - - /** - * @param bool $startJoker - * - * @return Regex - */ - public function setStartJoker($startJoker) - { - $this->startJoker = $startJoker; - - return $this; - } - - /** - * @return bool - */ - public function hasStartJoker() - { - return $this->startJoker; - } - - /** - * @param bool $endJoker - * - * @return Regex - */ - public function setEndJoker($endJoker) - { - $this->endJoker = (bool) $endJoker; - - return $this; - } - - /** - * @return bool - */ - public function hasEndJoker() - { - return $this->endJoker; - } - - /** - * @param array $replacement - * - * @return Regex - */ - public function replaceJokers($replacement) - { - $replace = function ($subject) use ($replacement) { - $subject = $subject[0]; - $replace = 0 === substr_count($subject, '\\') % 2; - - return $replace ? str_replace('.', $replacement, $subject) : $subject; - }; - - $this->pattern = preg_replace_callback('~[\\\\]*\\.~', $replace, $this->pattern); - - return $this; - } - - /** - * @param string $pattern - */ - private function parsePattern($pattern) - { - if ($this->startFlag = self::START_FLAG === substr($pattern, 0, 1)) { - $pattern = substr($pattern, 1); - } - - if ($this->startJoker = self::JOKER === substr($pattern, 0, 2)) { - $pattern = substr($pattern, 2); - } - - if ($this->endFlag = (self::END_FLAG === substr($pattern, -1) && self::ESCAPING !== substr($pattern, -2, -1))) { - $pattern = substr($pattern, 0, -1); - } - - if ($this->endJoker = (self::JOKER === substr($pattern, -2) && self::ESCAPING !== substr($pattern, -3, -2))) { - $pattern = substr($pattern, 0, -2); - } - - $this->pattern = $pattern; - } -} diff --git a/src/Symfony/Component/Finder/Expression/ValueInterface.php b/src/Symfony/Component/Finder/Expression/ValueInterface.php deleted file mode 100644 index fdc7098384..0000000000 --- a/src/Symfony/Component/Finder/Expression/ValueInterface.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Expression; - -@trigger_error('The '.__NAMESPACE__.'\ValueInterface interface is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); - -/** - * @author Jean-François Simon - */ -interface ValueInterface -{ - /** - * Renders string representation of expression. - * - * @return string - */ - public function render(); - - /** - * Renders string representation of pattern. - * - * @return string - */ - public function renderPattern(); - - /** - * Returns value case sensitivity. - * - * @return bool - */ - public function isCaseSensitive(); - - /** - * Returns expression type. - * - * @return int - */ - public function getType(); - - /** - * @param string $expr - * - * @return ValueInterface - */ - public function prepend($expr); - - /** - * @param string $expr - * - * @return ValueInterface - */ - public function append($expr); -} diff --git a/src/Symfony/Component/Finder/Tests/Expression/ExpressionTest.php b/src/Symfony/Component/Finder/Tests/Expression/ExpressionTest.php deleted file mode 100644 index 399b01c4bf..0000000000 --- a/src/Symfony/Component/Finder/Tests/Expression/ExpressionTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\Expression; - -use Symfony\Component\Finder\Expression\Expression; - -/** - * @group legacy - */ -class ExpressionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getTypeGuesserData - */ - public function testTypeGuesser($expr, $type) - { - $this->assertEquals($type, Expression::create($expr)->getType()); - } - - /** - * @dataProvider getCaseSensitiveData - */ - public function testCaseSensitive($expr, $isCaseSensitive) - { - $this->assertEquals($isCaseSensitive, Expression::create($expr)->isCaseSensitive()); - } - - /** - * @dataProvider getRegexRenderingData - */ - public function testRegexRendering($expr, $body) - { - $this->assertEquals($body, Expression::create($expr)->renderPattern()); - } - - public function getTypeGuesserData() - { - return array( - array('{foo}', Expression::TYPE_REGEX), - array('/foo/', Expression::TYPE_REGEX), - array('foo', Expression::TYPE_GLOB), - array('foo*', Expression::TYPE_GLOB), - ); - } - - public function getCaseSensitiveData() - { - return array( - array('{foo}m', true), - array('/foo/i', false), - array('foo*', true), - ); - } - - public function getRegexRenderingData() - { - return array( - array('{foo}m', 'foo'), - array('/foo/i', 'foo'), - ); - } -} diff --git a/src/Symfony/Component/Finder/Tests/Expression/GlobTest.php b/src/Symfony/Component/Finder/Tests/Expression/GlobTest.php deleted file mode 100644 index 97190d5c7b..0000000000 --- a/src/Symfony/Component/Finder/Tests/Expression/GlobTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\Expression; - -use Symfony\Component\Finder\Expression\Expression; - -/** - * @group legacy - */ -class GlobTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getToRegexData - */ - public function testGlobToRegex($glob, $match, $noMatch) - { - foreach ($match as $m) { - $this->assertRegExp(Expression::create($glob)->getRegex()->render(), $m, '::toRegex() converts a glob to a regexp'); - } - - foreach ($noMatch as $m) { - $this->assertNotRegExp(Expression::create($glob)->getRegex()->render(), $m, '::toRegex() converts a glob to a regexp'); - } - } - - public function getToRegexData() - { - return array( - array('', array(''), array('f', '/')), - array('*', array('foo'), array('foo/', '/foo')), - array('foo.*', array('foo.php', 'foo.a', 'foo.'), array('fooo.php', 'foo.php/foo')), - array('fo?', array('foo', 'fot'), array('fooo', 'ffoo', 'fo/')), - array('fo{o,t}', array('foo', 'fot'), array('fob', 'fo/')), - array('foo(bar|foo)', array('foo(bar|foo)'), array('foobar', 'foofoo')), - array('foo,bar', array('foo,bar'), array('foo', 'bar')), - array('fo{o,\\,}', array('foo', 'fo,'), array()), - array('fo{o,\\\\}', array('foo', 'fo\\'), array()), - array('/foo', array('/foo'), array('foo')), - ); - } -} diff --git a/src/Symfony/Component/Finder/Tests/Expression/RegexTest.php b/src/Symfony/Component/Finder/Tests/Expression/RegexTest.php deleted file mode 100644 index 972444ca0c..0000000000 --- a/src/Symfony/Component/Finder/Tests/Expression/RegexTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\Expression; - -use Symfony\Component\Finder\Expression\Expression; - -/** - * @group legacy - */ -class RegexTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getHasFlagsData - */ - public function testHasFlags($regex, $start, $end) - { - $expr = new Expression($regex); - - $this->assertEquals($start, $expr->getRegex()->hasStartFlag()); - $this->assertEquals($end, $expr->getRegex()->hasEndFlag()); - } - - /** - * @dataProvider getHasJokersData - */ - public function testHasJokers($regex, $start, $end) - { - $expr = new Expression($regex); - - $this->assertEquals($start, $expr->getRegex()->hasStartJoker()); - $this->assertEquals($end, $expr->getRegex()->hasEndJoker()); - } - - /** - * @dataProvider getSetFlagsData - */ - public function testSetFlags($regex, $start, $end, $expected) - { - $expr = new Expression($regex); - $expr->getRegex()->setStartFlag($start)->setEndFlag($end); - - $this->assertEquals($expected, $expr->render()); - } - - /** - * @dataProvider getSetJokersData - */ - public function testSetJokers($regex, $start, $end, $expected) - { - $expr = new Expression($regex); - $expr->getRegex()->setStartJoker($start)->setEndJoker($end); - - $this->assertEquals($expected, $expr->render()); - } - - public function testOptions() - { - $expr = new Expression('~abc~is'); - $expr->getRegex()->removeOption('i')->addOption('m'); - - $this->assertEquals('~abc~sm', $expr->render()); - } - - public function testMixFlagsAndJokers() - { - $expr = new Expression('~^.*abc.*$~is'); - - $expr->getRegex()->setStartFlag(false)->setEndFlag(false)->setStartJoker(false)->setEndJoker(false); - $this->assertEquals('~abc~is', $expr->render()); - - $expr->getRegex()->setStartFlag(true)->setEndFlag(true)->setStartJoker(true)->setEndJoker(true); - $this->assertEquals('~^.*abc.*$~is', $expr->render()); - } - - /** - * @dataProvider getReplaceJokersTestData - */ - public function testReplaceJokers($regex, $expected) - { - $expr = new Expression($regex); - $expr = $expr->getRegex()->replaceJokers('@'); - - $this->assertEquals($expected, $expr->renderPattern()); - } - - public function getHasFlagsData() - { - return array( - array('~^abc~', true, false), - array('~abc$~', false, true), - array('~abc~', false, false), - array('~^abc$~', true, true), - array('~^abc\\$~', true, false), - ); - } - - public function getHasJokersData() - { - return array( - array('~.*abc~', true, false), - array('~abc.*~', false, true), - array('~abc~', false, false), - array('~.*abc.*~', true, true), - array('~.*abc\\.*~', true, false), - ); - } - - public function getSetFlagsData() - { - return array( - array('~abc~', true, false, '~^abc~'), - array('~abc~', false, true, '~abc$~'), - array('~abc~', false, false, '~abc~'), - array('~abc~', true, true, '~^abc$~'), - ); - } - - public function getSetJokersData() - { - return array( - array('~abc~', true, false, '~.*abc~'), - array('~abc~', false, true, '~abc.*~'), - array('~abc~', false, false, '~abc~'), - array('~abc~', true, true, '~.*abc.*~'), - ); - } - - public function getReplaceJokersTestData() - { - return array( - array('~.abc~', '@abc'), - array('~\\.abc~', '\\.abc'), - array('~\\\\.abc~', '\\\\@abc'), - array('~\\\\\\.abc~', '\\\\\\.abc'), - ); - } -} diff --git a/src/Symfony/Component/Finder/Tests/FakeAdapter/DummyAdapter.php b/src/Symfony/Component/Finder/Tests/FakeAdapter/DummyAdapter.php deleted file mode 100644 index 0cbae14b88..0000000000 --- a/src/Symfony/Component/Finder/Tests/FakeAdapter/DummyAdapter.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\FakeAdapter; - -use Symfony\Component\Finder\Adapter\AbstractAdapter; - -/** - * @author Jean-François Simon - */ -class DummyAdapter extends AbstractAdapter -{ - /** - * @var \Iterator - */ - private $iterator; - - /** - * @param \Iterator $iterator - */ - public function __construct(\Iterator $iterator) - { - $this->iterator = $iterator; - } - - /** - * {@inheritdoc} - */ - public function searchInDirectory($dir) - { - return $this->iterator; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'yes'; - } - - /** - * {@inheritdoc} - */ - protected function canBeUsed() - { - return true; - } -} diff --git a/src/Symfony/Component/Finder/Tests/FakeAdapter/FailingAdapter.php b/src/Symfony/Component/Finder/Tests/FakeAdapter/FailingAdapter.php deleted file mode 100644 index 6e6ed24b61..0000000000 --- a/src/Symfony/Component/Finder/Tests/FakeAdapter/FailingAdapter.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\FakeAdapter; - -use Symfony\Component\Finder\Adapter\AbstractAdapter; -use Symfony\Component\Finder\Exception\AdapterFailureException; - -/** - * @author Jean-François Simon - */ -class FailingAdapter extends AbstractAdapter -{ - /** - * {@inheritdoc} - */ - public function searchInDirectory($dir) - { - throw new AdapterFailureException($this); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'failing'; - } - - /** - * {@inheritdoc} - */ - protected function canBeUsed() - { - return true; - } -} diff --git a/src/Symfony/Component/Finder/Tests/FakeAdapter/NamedAdapter.php b/src/Symfony/Component/Finder/Tests/FakeAdapter/NamedAdapter.php deleted file mode 100644 index 5a260b0dfc..0000000000 --- a/src/Symfony/Component/Finder/Tests/FakeAdapter/NamedAdapter.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\FakeAdapter; - -use Symfony\Component\Finder\Adapter\AbstractAdapter; - -/** - * @author Jean-François Simon - */ -class NamedAdapter extends AbstractAdapter -{ - /** - * @var string - */ - private $name; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * {@inheritdoc} - */ - public function searchInDirectory($dir) - { - return new \ArrayIterator(array()); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - protected function canBeUsed() - { - return true; - } -} diff --git a/src/Symfony/Component/Finder/Tests/FakeAdapter/UnsupportedAdapter.php b/src/Symfony/Component/Finder/Tests/FakeAdapter/UnsupportedAdapter.php deleted file mode 100644 index 1f91b98a60..0000000000 --- a/src/Symfony/Component/Finder/Tests/FakeAdapter/UnsupportedAdapter.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Tests\FakeAdapter; - -use Symfony\Component\Finder\Adapter\AbstractAdapter; - -/** - * @author Jean-François Simon - */ -class UnsupportedAdapter extends AbstractAdapter -{ - /** - * {@inheritdoc} - */ - public function searchInDirectory($dir) - { - return new \ArrayIterator(array()); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'unsupported'; - } - - /** - * {@inheritdoc} - */ - protected function canBeUsed() - { - return false; - } -}