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

NEW: Code cleanup (tests, linting). #54

Merged
merged 2 commits into from
Mar 25, 2022
Merged

Conversation

mfendeksilverstripe
Copy link
Collaborator

@mfendeksilverstripe mfendeksilverstripe commented Mar 22, 2022

NEW: Code cleanup (tests, linting).

  • Travis automated tests run setup
  • Composer configuration update to cover the needed dependencies to run tests
  • Linting fixes
  • Fixed two tests which were broken before this change-set
  • No functional or behavioural changes
  • PHP 8 compatibility fixes

Out of scope of this PR

These will be covered separate change-sets

Related issues

#51

@mfendeksilverstripe mfendeksilverstripe marked this pull request as draft March 22, 2022 01:19
@mfendeksilverstripe mfendeksilverstripe marked this pull request as ready for review March 23, 2022 01:37
@mfendeksilverstripe mfendeksilverstripe added the enhancement New feature or request label Mar 23, 2022
Copy link
Collaborator

@blueo blueo left a comment

Choose a reason for hiding this comment

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

Just commenting as I didn't test it locally. It looks to be 99% linting/format updates or adding explicit table names which are all good. I've left a couple of comments.

composer.json Show resolved Hide resolved
src/Handler/Elemental/PageSaveHandler.php Show resolved Hide resolved
src/Snapshot.php Outdated
'ObjectHash' => $this->OriginHash,
])->first();
$item = $this->Items()
->filter([
Copy link
Collaborator

Choose a reason for hiding this comment

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

could this be a find call?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, good find 👍 , I'll make the change.

}

/**
* @return RelationDiffer[]
* @todo Memoise / cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nitpick] memoise is a thing: https://en.wikipedia.org/wiki/Memoization

{
list($a1, $a2, $a1Block1, $a1Block2, $a2Block1, $gallery1, $gallery2) = $this->buildState();
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it necessary to destructure all the array items even thought you only use $a1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I left this intact but I might need to clean this one up as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants