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

TASK: Cosmetic followup for #3443 #3447

Open
wants to merge 5 commits into
base: 8.4
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Feb 13, 2025

During the review of #3443 I couldn't help to do a little cleaning myself :D 🧹

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

we don't make a distinction inside the service from development, testing or production
after reflecting each class we sort classReflectionData which can also not be done instead :D

but we still ensure that getAllClassNames returns all classes sorted.

For using `array_diff` to get the $newClassNames we dont need sorting
Copy link
Member

@kitsunet kitsunet left a comment

Choose a reason for hiding this comment

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

Fine by me, see one comment though


$propertyNames = [];
foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] as $propertyName => $propertyData) {
foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] ?? [] as $propertyName => $propertyData) {
Copy link
Member

Choose a reason for hiding this comment

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

Oh god, that is so much harder to read though, I wouldn't change that, shorter is not always better

Copy link
Member

Choose a reason for hiding this comment

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

I'd say this combines short code with readability:

Suggested change
foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] ?? [] as $propertyName => $propertyData) {
$classProperties = $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] ?? []
foreach ($classProperties as $propertyName => $propertyData) {


return array_keys($this->classReflectionData);
$classNames = array_keys($this->classReflectionData);
sort($classNames);
Copy link
Member

Choose a reason for hiding this comment

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

Why the sorting? Is that the central replacement for the removed sort calls later on?


$propertyNames = [];
foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] as $propertyName => $propertyData) {
foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] ?? [] as $propertyName => $propertyData) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd say this combines short code with readability:

Suggested change
foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] ?? [] as $propertyName => $propertyData) {
$classProperties = $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] ?? []
foreach ($classProperties as $propertyName => $propertyData) {

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

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

Please check the failure of aggregateRootAssignmentsInHierarchiesAreCorrect

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