@@ -20,14 +20,14 @@ 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 version control folders to ignore |
| 27 | 27 | * |
| 28 | 28 | * @var string[] |
| 29 | 29 | */ |
| 30 | - public static $vcsPatterns = array('.git', '.hg', '.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr'); |
|
| 30 | + public static $vcsPatterns = array('.git', '.hg', '.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr'); |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * A list of phrases to exclude from the search |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @param array $includes |
| 59 | 59 | * @param int|null $flags |
| 60 | 60 | */ |
| 61 | - public function __construct(\RecursiveIterator $iterator, array $excludes = array(), array $includes = array(), $flags = null) |
|
| 61 | + public function __construct (\RecursiveIterator $iterator, array $excludes = array(), array $includes = array(), $flags = null) |
|
| 62 | 62 | { |
| 63 | 63 | parent::__construct($iterator); |
| 64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | /** |
| 71 | 71 | * @return string |
| 72 | 72 | */ |
| 73 | - public function __toString() |
|
| 73 | + public function __toString () |
|
| 74 | 74 | { |
| 75 | 75 | return $this->current()->getFilename(); |
| 76 | 76 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @return SplFileInfo |
| 98 | 98 | */ |
| 99 | - public function current() |
|
| 99 | + public function current () |
|
| 100 | 100 | { |
| 101 | 101 | /** @var \SplFileInfo $current */ |
| 102 | 102 | $current = parent::current(); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | /** |
| 112 | 112 | * {@inheritdoc} |
| 113 | 113 | */ |
| 114 | - public function getChildren() |
|
| 114 | + public function getChildren () |
|
| 115 | 115 | { |
| 116 | 116 | return (new self( |
| 117 | 117 | $this->getInnerIterator()->getChildren(), |
@@ -82,11 +82,17 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $filePath = str_replace(getcwd() . '/', '', $this->current()->getPathname()); |
| 84 | 84 | |
| 85 | - if ($this->strpos_array($filePath, $this->includes)) { return true; } |
|
| 86 | - if ($this->flags & self::INCLUDE_ONLY_FILES) { return false; } |
|
| 85 | + if ($this->strpos_array($filePath, $this->includes)) |
|
| 86 | + { |
|
| 87 | +return true; } |
|
| 88 | + if ($this->flags & self::INCLUDE_ONLY_FILES) |
|
| 89 | + { |
|
| 90 | +return false; } |
|
| 87 | 91 | |
| 88 | 92 | if (!($this->flags & self::ALLOW_DOT_FILES) && |
| 89 | - preg_match('#(^|/)\..+(/|$)#', $filePath) === 1) { return false; } |
|
| 93 | + preg_match('#(^|/)\..+(/|$)#', $filePath) === 1) |
|
| 94 | + { |
|
| 95 | +return false; } |
|
| 90 | 96 | |
| 91 | 97 | return ($this->strpos_array($filePath, $this->excludes) === false); |
| 92 | 98 | } |
@@ -166,10 +172,13 @@ discard block |
||
| 166 | 172 | |
| 167 | 173 | foreach ($needle as $query) |
| 168 | 174 | { |
| 169 | - if (strpos($haystack, $query, $offset) !== false) // stop on first true result |
|
| 175 | + if (strpos($haystack, $query, $offset) !== false) |
|
| 176 | + { |
|
| 177 | + // stop on first true result |
|
| 170 | 178 | { |
| 171 | 179 | return true; |
| 172 | 180 | } |
| 181 | + } |
|
| 173 | 182 | } |
| 174 | 183 | |
| 175 | 184 | return false; |