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

ENHANCEMENT Register installed modules and files in composer.extra #3

Merged

Conversation

tractorcow
Copy link

This ensures that removed assets and modules (which were once inlined) don't get re-installed later.

Fixes #2

@tractorcow tractorcow force-pushed the pulls/1.0/removable-resources branch from e08413a to db40866 Compare July 17, 2017 06:03
@tractorcow
Copy link
Author

Requesting review by @sminnee :D

* no default
* @return array
*/
protected function loadComposer($path, $default = null)
Copy link
Author

Choose a reason for hiding this comment

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

Note: I've replaced this with core composer library API.

}
if ($result) {
$composerData = $result;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this the same as if (!$result) { return; }? as it would be the same (except for the $this->resetComposer(); call) if any other falsey value was returned by $callable

Copy link
Author

Choose a reason for hiding this comment

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

A result can be empty and non-false. A non-return would default to null, and imply that the data was modified by ref instead of being returned, hence the following assignment. This is different to an explicit false return which the phpdoc states is to short circuit the write.

Copy link
Contributor

@flamerohr flamerohr left a comment

Choose a reason for hiding this comment

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

Sounds good, it's a bit weird to me to have both return and modify by ref :) but anyway, that makes sense

@flamerohr flamerohr merged commit 0592e33 into silverstripe:master Jul 24, 2017
@flamerohr flamerohr deleted the pulls/1.0/removable-resources branch July 24, 2017 03:02
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.

2 participants