-
Notifications
You must be signed in to change notification settings - Fork 71
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
VACMS-20371: Clean up extensions #20730
base: main
Are you sure you want to change the base?
Conversation
Checking composer.lock changes... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early, unrequested feedback...
@@ -74,14 +74,14 @@ public function processOne(string $key, mixed $item, array &$sandbox): string { | |||
} | |||
$number_only_extension = $this->replaceNonNumerals($original_extension); | |||
if ($original_extension === $number_only_extension) { | |||
return "No change to extension $original_extension in paragraph id $item"; | |||
return "No change to extension '$original_extension' in paragraph id $item"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Not sure how we both missed this. Alternatively, return "No change to extension {$original_extension} in paragraph id $item"
return []; | ||
} | ||
$first_extension = []; | ||
preg_match('/^\d+/', $dual_extension, $first_extension); | ||
$second_extension = []; | ||
preg_match('/\d+$/', $dual_extension, $second_extension); | ||
|
||
return [$first_extension[0], $second_extension[0]]; | ||
return [trim($first_extension[0]), trim($second_extension[0])]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHOULD:
At this point in the code there is no guarantee that index 0
is available for either string. You might want to return early if they are not set, or set them to defaults before accessing them in trim() here.
Checking composer.lock changes... |
Checking composer.lock changes... |
Checking composer.lock changes... |
Tugboat has finished building the preview for this pull request! Links:
Dashboard: |
Cypress Accessibility Violations
|
Description
Relates to #20371
Testing done
Screenshots
QA steps
What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?
As user uid with user_role
Definition of Done
Select Team for PR review
CMS Team
Public websites
Facilities
User support
Accelerated Publishing
Is this PR blocked by another PR?
DO NOT MERGE
Does this PR need review from a Product Owner
Needs PO review
CMS user-facing announcement
Is an announcement needed to let editors know of this change?