-
Notifications
You must be signed in to change notification settings - Fork 158
Feature/modules from user #444
Feature/modules from user #444
Conversation
I have changed |
'options' => [ | ||
'route' => '/user/:owner', | ||
'constrains' => [ | ||
'owner' => '[a-zA-Z][a-zA-Z0-9_-]*', |
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 bit restrictive IMO. Not sure what github's username limitations are
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.
mm I don't find a github's username restriction
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.
Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen
so we would end up like this ^^ ^(?!.*--.*)([a-zA-Z0-9][a-zA-Z0-9-]+?[a-zA-Z0-9])$|(^[a-zA-Z0-9]+$)
🐠
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.
😕
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.
The second match is not really needed ( see http://regexper.com/#%2F^%28%3F!.*--.*%29%28[a-zA-Z0-9][a-zA-Z0-9-]%2B%3F[a-zA-Z0-9]%29%24|%28^[a-zA-Z0-9]%2B%24%29%2F )
This is sufficient: /^(?!.*--.*)([a-zA-Z0-9][a-zA-Z0-9-]+?[a-zA-Z0-9])$/
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.
without the second match group you wouldn't catch usernames with les then 3 characters 😃
@localheinz have you feedback for this feature? :) Thanks |
Going to look into this tomorrow, ok? I've had one 🍸 too many to review now! |
'query' => $query, | ||
]); | ||
|
||
return $viewModel; |
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.
could be inlined
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.
I run CSFIX after all feedback :D
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.
Does the CSFIX thing automatically inline the variable, as in
return new ViewModel([
'modules' => $modules,
'query' => $query,
]);
?
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.
aaah ok sorry :)
Thank you for implementing the changes! Other than #444 (comment) I wouldn't want to complain about anything. Happy to help with tests, but don't want to steal anything. |
@localheinz @Ocramius sorry for |
I'm in war with " :P Thanks |
Reference to #431