Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for an invalid sniff code #344

Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4d5b0c4
Improve error message for an invalid sniff code
fredden Feb 16, 2024
8dd0102
Update src/Config.php
fredden Jan 10, 2025
995522f
Update src/Config.php
fredden Jan 10, 2025
792cf66
Report all errors, even if duplicates
fredden Jan 10, 2025
4ed5733
Filter out empty values sooner
fredden Jan 10, 2025
9850de4
Complain if nothing (or only commas) specified
fredden Jan 10, 2025
95d5955
Ignore case when removing duplicates from final list
fredden Jan 10, 2025
5c48598
Add missing `@covers` annotation
fredden Jan 10, 2025
d36d44a
Update src/Config.php
fredden Jan 10, 2025
c2aec40
Remove invalid assumption regarding valid characters
fredden Jan 10, 2025
d5f5fe0
Update test to reflect change via GitHub
fredden Jan 10, 2025
994bb1c
Update test: treat empty values as errors
fredden Jan 10, 2025
af962dc
Merge remote-tracking branch 'upstream/master' into feature/improve-s…
fredden Jan 10, 2025
0dcd4ef
Remove unused variable
fredden Jan 10, 2025
bccdffc
Update docblocks to match reality
fredden Jan 10, 2025
3421e00
Apply whitespace changes from phpcbf
fredden Jan 10, 2025
99753e8
Add more tests
fredden Jan 10, 2025
d1bfb0a
Apply whitespace changes from phpcbf
fredden Jan 10, 2025
b270da2
Move method further up the file
fredden Jan 23, 2025
d0e1cf8
Correct param type for $errors
fredden Jan 23, 2025
b127df4
Use phpstan-style return types
fredden Jan 23, 2025
5b5208b
Remove word 'sniffs' from method names
fredden Jan 23, 2025
f87a5e1
Use a different syntax for special comments
fredden Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove invalid assumption regarding valid characters
fredden committed Jan 10, 2025
commit c2aec40c6e5ea18a608ddd2b28b6823d9c042578
5 changes: 0 additions & 5 deletions src/Config.php
Original file line number Diff line number Diff line change
@@ -1663,11 +1663,6 @@ private function parseSniffCodes($input, $argument)
foreach ($possibleSniffs as $sniff) {
$sniff = trim($sniff);

if (preg_match('{[^A-Za-z0-9.]}', $sniff) === 1) {
$errors[] = 'Unsupported character detected: '.$sniff;
continue;
}

$partCount = substr_count($sniff, '.');
if ($partCount === 2) {
// Correct number of parts.