-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Repo jacking protection and cleanups #1411
Conversation
…cked repos from updating further
composer.lockPackage changes
Dev Package changes
Settings · Docs · Powered by Private Packagist |
@@ -33,6 +33,13 @@ | |||
use Composer\Util\HttpDownloader; | |||
use DateTimeInterface; | |||
|
|||
enum PackageFreezeReason: string |
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.
why defining it inline instead of making it autoloadable ?
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.
Because it belongs together with the class, and is much more readable to me than having tiny enum files lingering around, and there is no reason to use it without package instance, so the package class will be loaded when you need it.
|
||
public function translationKey(): string | ||
{ | ||
return 'freezing_reasons.' . $this->value; |
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.
if you want to make those translations extractable, a solution would be to make a method returning a TranslatableMessage object (that you would still use in Twig by passing it to the trans
filter), using a match()
statement instead of concatenation (as dynamic keys cannot be extracted by the tooling)
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.
Thanks that's good to know but I don't really care about extractability here.
</div> | ||
{% if package.isFrozen() %} |
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.
should this be displayed only for package maintainers and admins (as done right now by being inside the {% if has_actions %}
) or to all users ?
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.
Maybe we should open it to everyone, I don't expect this to be too frequent anyway.. And it'd be valuable to see the warning for the gone
packages.
Replaces #1402