@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * A bitwise flag to have FileExplorer search files starting with a period as well |
| 22 | 22 | */ |
| 23 | - const ALLOW_DOT_FILES = 0x2; |
|
| 23 | + const ALLOW_DOT_FILES = 0x2; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * A list of common version control folders to ignore. |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @var string[] |
| 38 | 38 | */ |
| 39 | - public static $vcsPatterns = array('.git', '.hg', '.svn', '_svn'); |
|
| 39 | + public static $vcsPatterns = array('.git', '.hg', '.svn', '_svn'); |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * A list of phrases to exclude from the search |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @param array $includes |
| 68 | 68 | * @param int|null $flags |
| 69 | 69 | */ |
| 70 | - public function __construct(\RecursiveIterator $iterator, array $excludes = array(), array $includes = array(), $flags = null) |
|
| 70 | + public function __construct (\RecursiveIterator $iterator, array $excludes = array(), array $includes = array(), $flags = null) |
|
| 71 | 71 | { |
| 72 | 72 | parent::__construct($iterator); |
| 73 | 73 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * @return string |
| 81 | 81 | */ |
| 82 | - public function __toString() |
|
| 82 | + public function __toString () |
|
| 83 | 83 | { |
| 84 | 84 | return $this->current()->getFilename(); |
| 85 | 85 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @return SplFileInfo |
| 107 | 107 | */ |
| 108 | - public function current() |
|
| 108 | + public function current () |
|
| 109 | 109 | { |
| 110 | 110 | /** @var \SplFileInfo $current */ |
| 111 | 111 | $current = parent::current(); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * {@inheritdoc} |
| 122 | 122 | */ |
| 123 | - public function getChildren() |
|
| 123 | + public function getChildren () |
|
| 124 | 124 | { |
| 125 | 125 | return (new self( |
| 126 | 126 | $this->getInnerIterator()->getChildren(), |
@@ -91,11 +91,17 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $filePath = str_replace(getcwd() . '/', '', $this->current()->getPathname()); |
| 93 | 93 | |
| 94 | - if ($this->strpos_array($filePath, $this->includes)) { return true; } |
|
| 95 | - if (($this->flags & self::INCLUDE_ONLY_FILES) && !$this->current()->isDir()) { return false; } |
|
| 94 | + if ($this->strpos_array($filePath, $this->includes)) |
|
| 95 | + { |
|
| 96 | +return true; } |
|
| 97 | + if (($this->flags & self::INCLUDE_ONLY_FILES) && !$this->current()->isDir()) |
|
| 98 | + { |
|
| 99 | +return false; } |
|
| 96 | 100 | |
| 97 | 101 | if (!($this->flags & self::ALLOW_DOT_FILES) && |
| 98 | - preg_match('#(^|\/)\..+(\/|$)#', $filePath) === 1) { return false; } |
|
| 102 | + preg_match('#(^|\/)\..+(\/|$)#', $filePath) === 1) |
|
| 103 | + { |
|
| 104 | +return false; } |
|
| 99 | 105 | |
| 100 | 106 | return ($this->strpos_array($filePath, $this->excludes) === false); |
| 101 | 107 | } |
@@ -180,10 +186,13 @@ discard block |
||
| 180 | 186 | return true; |
| 181 | 187 | } |
| 182 | 188 | |
| 183 | - if (strpos($haystack, $query, $offset) !== false) // stop on first true result |
|
| 189 | + if (strpos($haystack, $query, $offset) !== false) |
|
| 190 | + { |
|
| 191 | + // stop on first true result |
|
| 184 | 192 | { |
| 185 | 193 | return true; |
| 186 | 194 | } |
| 195 | + } |
|
| 187 | 196 | } |
| 188 | 197 | |
| 189 | 198 | return false; |