-
Notifications
You must be signed in to change notification settings - Fork 43
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
Inflection #48
Inflection #48
Conversation
src/Model/Endpoint.php
Outdated
* | ||
* @return null|string | ||
*/ | ||
public function inflect($method = 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.
inflectionMethod
would be a better name. Currently the method name sounds as if it inflects string.
src/Model/Endpoint.php
Outdated
@@ -453,6 +464,22 @@ public function resourceClass($name = null) | |||
} | |||
|
|||
/** | |||
* Returns the inflect method or sets a new one | |||
* | |||
* @param null $method |
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.
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
============================================
- Coverage 72.92% 71.94% -0.98%
- Complexity 359 363 +4
============================================
Files 13 13
Lines 890 916 +26
============================================
+ Hits 649 659 +10
- Misses 241 257 +16
Continue to review full report at Codecov.
|
The requested changes have been made. |
src/Model/Endpoint.php
Outdated
* | ||
* @var string | ||
*/ | ||
protected $_inflection = 'underscore'; |
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.
$_inflectionMethod
please.
src/Model/Endpoint.php
Outdated
@@ -153,6 +160,9 @@ public function __construct(array $config = []) | |||
if (!empty($config['resourceClass'])) { | |||
$this->resourceClass($config['resourceClass']); | |||
} | |||
if (!empty($config['inflection'])) { |
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.
Keep the option name inflect
so that it's consistent with config name used in route builder.
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 for the clarification!
Wow, my first attempt at open-source contribution. Nice! thanks a lot!! |
Thank you for contributing. New release has been made which includes this change. |
This PR adds inflect option for generating endpoints.