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

Hunt down invalid doc blocks #10476

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Jan 28, 2023

It is OK to ignore some of the errors we get, but not this one.

@greg0ire greg0ire requested review from SenseException and derrabus and removed request for SenseException January 28, 2023 11:47
@greg0ire greg0ire marked this pull request as draft January 28, 2023 11:50
@greg0ire
Copy link
Member Author

🤔 there are some more occurrences of InvalidDocBlock in the baseline. I'm going to try to remove them.

@greg0ire greg0ire removed the request for review from derrabus January 28, 2023 11:51
@greg0ire greg0ire force-pushed the remove-duplicate-phpdoc branch from 715eeec to 3283adb Compare January 28, 2023 12:42
@greg0ire greg0ire changed the title Remove duplicate phpdoc Hunt down invalid doc blocks Jan 28, 2023
@greg0ire greg0ire marked this pull request as ready for review January 28, 2023 13:46
@greg0ire greg0ire force-pushed the remove-duplicate-phpdoc branch from 3283adb to 00b0e25 Compare January 29, 2023 17:17
@greg0ire
Copy link
Member Author

ping @derrabus 🙂

@@ -922,6 +922,8 @@ private function cacheToArray(array $cacheMapping): array
$usage = (int) constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage);
}

assert($usage !== '0' && $usage !== '');
Copy link
Member

Choose a reason for hiding this comment

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

Can we be sure? I think we should either map all falsy values to null or make sure falsy values other than null also trigger an InvalidArgumentException.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you're right, but let's maybe not do this in a patch release?

Copy link
Member

Choose a reason for hiding this comment

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

Is a suddenly failing assert() better in a patch release? 😬

Copy link
Member Author

Choose a reason for hiding this comment

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

Provided assertions are not enabled in production, I'd say yes.

Copy link
Member

Choose a reason for hiding this comment

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

Not a doc block (as the title suggests) though, but in comparison it screams at dev runtime when something's wrong. :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I'll remove that line and ignore whatever SA errors come up then.

@greg0ire greg0ire force-pushed the remove-duplicate-phpdoc branch from 00b0e25 to bafd023 Compare January 31, 2023 08:40
It is OK to ignore some of the errors we get, but not this one.
@greg0ire greg0ire force-pushed the remove-duplicate-phpdoc branch from bafd023 to 271d399 Compare January 31, 2023 08:43
@derrabus derrabus added this to the 2.14.2 milestone Jan 31, 2023
@derrabus derrabus merged commit 8ff7938 into doctrine:2.14.x Jan 31, 2023
@greg0ire greg0ire deleted the remove-duplicate-phpdoc branch January 31, 2023 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants