Skip to content

Commit 9174898

Browse files
author
Raluca Rietkerk
committed
Finetune renaming inflect method
1 parent 4131dd8 commit 9174898

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Model/Endpoint.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Endpoint implements RepositoryInterface, EventListenerInterface, EventDisp
113113
*
114114
* @var string
115115
*/
116-
protected $_inflection = 'underscore';
116+
protected $_inflectionMethod = 'underscore';
117117

118118
/**
119119
* Initializes a new instance
@@ -160,8 +160,8 @@ public function __construct(array $config = [])
160160
if (!empty($config['resourceClass'])) {
161161
$this->resourceClass($config['resourceClass']);
162162
}
163-
if (!empty($config['inflection'])) {
164-
$this->inflectionMethod($config['inflection']);
163+
if (!empty($config['inflect'])) {
164+
$this->inflectionMethod($config['inflect']);
165165
}
166166

167167
$this->_eventManager = $eventManager ?: new EventManager();
@@ -473,10 +473,10 @@ public function resourceClass($name = null)
473473
public function inflectionMethod($method = null)
474474
{
475475
if ($method === null) {
476-
return $this->_inflection;
476+
return $this->_inflectionMethod;
477477
}
478478

479-
return $this->_inflection = $method;
479+
return $this->_inflectionMethod = $method;
480480
}
481481

482482
/**

tests/TestCase/Model/EndpointTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testEndpoint()
4545
$endpoint = new Endpoint(['alias' => 'UserGroups']);
4646
$this->assertSame('user_groups', $endpoint->endpoint());
4747

48-
$endpoint = new Endpoint(['alias' => 'UserGroups', 'inflection' => 'dasherize']);
48+
$endpoint = new Endpoint(['alias' => 'UserGroups', 'inflect' => 'dasherize']);
4949
$this->assertSame('user-groups', $endpoint->endpoint());
5050
}
5151

0 commit comments

Comments
 (0)