Return early · sebastianbergmann/php-file-iterator@5cea92d (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 5cea92d
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 2 additions & 6 deletions
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -85,17 +85,13 @@ private function acceptSubString(string filename,arrayfilename, array filename,arraysubStrings, int $type) | ||
85 | 85 | return true; |
86 | 86 | } |
87 | 87 | |
88 | -$matched = false; | |
89 | - | |
90 | 88 | foreach ($subStrings as $string) { |
91 | 89 | if (($type === self::PREFIX && str_starts_with($filename, $string)) | |
92 | 90 | ($type === self::SUFFIX && str_ends_with($filename, $string))) { |
93 | -$matched = true; | |
94 | - | |
95 | -break; | |
91 | +return true; | |
96 | 92 | } |
97 | 93 | } |
98 | 94 | |
99 | -return $matched; | |
95 | +return false; | |
100 | 96 | } |
101 | 97 | } |