Skip to content

Prevent the use of a not set id value in the AbstractASTType and AbstractASTCallable#637

Merged
ravage84 merged 2 commits intopdepend:masterfrom
tvbeek:use_getId_function_and_not_id_variable_to_prevent_null
Feb 10, 2023
Merged

Prevent the use of a not set id value in the AbstractASTType and AbstractASTCallable#637
ravage84 merged 2 commits intopdepend:masterfrom
tvbeek:use_getId_function_and_not_id_variable_to_prevent_null

Conversation

@tvbeek
Copy link
Member

@tvbeek tvbeek commented Nov 30, 2022

Prevent the use of a not set id value in the AbstractASTType and AbstractASTCallable

This prevent deprecated warning if null is passed to the storage driver.

Type: bugfix / refactoring
Issue: #.. the corresponding issue for this PR (if exist)
Breaking change: yes/no (if yes explain why)

I got the error:
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /[project]/vendor/pdepend/pdepend/src/main/php/PDepend/Util/Cache/Driver/File/FileCacheDirectory.php on line 111

While debugging I found out that it was from a call to the storage with null because the id wasn't set. By using the getId() function the id will be set if not yet done and it prevents errors more downstream the application.

…ractASTCallable.

This prevent deprecated warning if null is passed to the storage driver.
@tvbeek tvbeek self-assigned this Nov 30, 2022
kylekatarnls
kylekatarnls previously approved these changes Nov 30, 2022
Copy link
Member

@ravage84 ravage84 left a comment

Choose a reason for hiding this comment

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

LGTM

@ravage84 ravage84 merged commit 3d0f8d3 into pdepend:master Feb 10, 2023
@tvbeek tvbeek deleted the use_getId_function_and_not_id_variable_to_prevent_null branch February 28, 2023 21:03
@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants