4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Finder\Expression;
14 @trigger_error('The '.__NAMESPACE__.'\Glob class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
16 use Symfony\Component\Finder\Glob as FinderGlob;
19 * @author Jean-François Simon <contact@jfsimon.fr>
21 class Glob implements ValueInterface
29 * @param string $pattern
31 public function __construct($pattern)
33 $this->pattern = $pattern;
39 public function render()
41 return $this->pattern;
47 public function renderPattern()
49 return $this->pattern;
55 public function getType()
57 return Expression::TYPE_GLOB;
63 public function isCaseSensitive()
71 public function prepend($expr)
73 $this->pattern = $expr.$this->pattern;
81 public function append($expr)
83 $this->pattern .= $expr;
89 * Tests if glob is expandable ("*.{a,b}" syntax).
93 public function isExpandable()
95 return false !== strpos($this->pattern, '{')
96 && false !== strpos($this->pattern, '}');
100 * @param bool $strictLeadingDot
101 * @param bool $strictWildcardSlash
105 public function toRegex($strictLeadingDot = true, $strictWildcardSlash = true)
107 $regex = FinderGlob::toRegex($this->pattern, $strictLeadingDot, $strictWildcardSlash, '');
109 return new Regex($regex);