Could another folder already occupy the same alias?
Is there a usecase for this? Why would the validation fail and we still want to force create it?
This allows to search for a user using an alias to a shared folder the user owns?
Why must this be the first after UuidIntKeyTrait?
This check here is to prevent the same alias added twice to the folder. Answering the question... we apply the same rules as to users, see validateAlias() below. So, the same alias can be assigned to many folders in a custom domain.
I'm not sure. It was copy-pasted from the existing user:add-alias command.
I guess sometimes you might just have an email address of someone/something. So, it makes sense, but probably a rare case.
Both traits register "creating" event handler, and EmailPropertyTrait's handler needs the $id property to be set (which is set by the other trait). See bootEmailPropertyTrait().