Skip to content
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

Merged
merged 5 commits into from
Nov 3, 2017
Merged

Inflection #48

merged 5 commits into from
Nov 3, 2017

Conversation

RaluApostol
Copy link

This PR adds inflect option for generating endpoints.

*
* @return null|string
*/
public function inflect($method = null)
Copy link
Member

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.

@@ -453,6 +464,22 @@ public function resourceClass($name = null)
}

/**
* Returns the inflect method or sets a new one
*
* @param null $method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov
Copy link

codecov bot commented Nov 3, 2017

Codecov Report

Merging #48 into master will decrease coverage by 0.97%.
The diff coverage is 100%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
src/Model/Endpoint.php 70.79% <100%> (-1.17%) 136 <2> (+3)
src/Marshaller.php 43.15% <0%> (-2.4%) 47% <0%> (ø)
src/Model/EndpointRegistry.php 62.16% <0%> (-1.73%) 13% <0%> (ø)
src/Query.php 99.25% <0%> (-0.75%) 50% <0%> (+1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d91ae04...9174898. Read the comment docs.

@RaluApostol
Copy link
Author

The requested changes have been made.

*
* @var string
*/
protected $_inflection = 'underscore';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$_inflectionMethod please.

@@ -153,6 +160,9 @@ public function __construct(array $config = [])
if (!empty($config['resourceClass'])) {
$this->resourceClass($config['resourceClass']);
}
if (!empty($config['inflection'])) {
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the clarification!

@ADmad ADmad merged commit 4b5da39 into UseMuffin:master Nov 3, 2017
@RaluApostol
Copy link
Author

Wow, my first attempt at open-source contribution. Nice! thanks a lot!!

@ADmad
Copy link
Member

ADmad commented Nov 3, 2017

Thank you for contributing. New release has been made which includes this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants