-
Notifications
You must be signed in to change notification settings - Fork 10
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
ENHANCEMENT Register installed modules and files in composer.extra #3
Conversation
… that removal is respected Fixes silverstripe#2
Fixes issue found in silverstripe#1
e08413a
to
db40866
Compare
db40866
to
5fcff3b
Compare
Requesting review by @sminnee :D |
src/RecipeCommandBehaviour.php
Outdated
* no default | ||
* @return array | ||
*/ | ||
protected function loadComposer($path, $default = null) |
There was a problem hiding this comment.
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; | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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
This ensures that removed assets and modules (which were once inlined) don't get re-installed later.
Fixes #2