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

refactor: Apply code quality level 24 for Rector #9264

Conversation

samsonasik
Copy link
Member

Description

Applied SimplifyRegexPatternRector to simplify regex pattern to known ranges

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@samsonasik
Copy link
Member Author

Ready to merge 👍

@samsonasik
Copy link
Member Author

Thank you @michalsn for the review, let's merge ;)

@samsonasik samsonasik merged commit 9b6de62 into codeigniter4:develop Nov 12, 2024
39 checks passed
@samsonasik samsonasik deleted the refactor-apply-code-quality-level-24-for-rector branch November 12, 2024 08:44
@@ -58,7 +58,7 @@ public function testGetFieldDataDefault(): void
$fields = $this->db->getFieldData($this->table);

$idDefault = $this->getFieldMetaData('id', $this->table)->default;
$this->assertMatchesRegularExpression('/"ORACLE"."ISEQ\$\$_[0-9]+".nextval/', $idDefault);
$this->assertMatchesRegularExpression('/"ORACLE"."ISEQ\$\$_\d+".nextval/', $idDefault);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\d means a digit, but [0-9] means 0 to 9 (ASCII Arabic number). They are not the same.
Without u option, the result may be the exactly same, but the code implies different things.
So I don' t like this refactoring.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't have /u so should be safe, also, this is test so not apply to end user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants