Skip to content

Conversation

@ts-ag
Copy link

@ts-ag ts-ag commented Oct 2, 2025

These changes are against tag 10.3.0, which is used by the "Hubspot API" Drupal module version 3.
For reference, I've also opened a related issue here to address the module's own fix for nullable type deprecations.

Would you consider creating a dedicated branch for supporting this usage until the module adopts the latest version of hubspot-api-php? Given the number of changes in this pull request, you might want to make them yourselves on a proprietary branch instead of accepting this pull request.

The changes contained in this pull request were made with a regex search:
(?<=\s|\()(\w*)(?= \$\w* = null)
With substitution:
?$1
This turned implicit nullable type parameters like Type $param = null into explicit ones like ?Type $param = null.

LE: The regex was run in VS Code which, turns out, has issues with look-behind expressions when a row contains more than one match, so I reapplied it with a perl command instead: (also, I improved the regex because it wasn't quite on point)
find . -type f -name '*.php' -print0 | xargs -0 perl -pi -e 's/(?<=\s|\()([\\\w]+\w+)(?=\s+\$\w+\s*=\s*null)/?$1/gi'

ts.ag added 2 commits October 2, 2025 20:30
Changes were made with a regex search:
(?<=\s|\()(\w*)(?= \$\w* = null)
With substitution:
?$1
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.

1 participant