Skip to content

Commit 8b2d904

Browse files
committed
Refactored method name from 'pull' to 'take' across multiple files
1 parent f78037d commit 8b2d904

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Handlers/ArrayHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function forget(string $class, string $property, ?string $context = null)
4747
$this->forgetStored($class, $property, $context);
4848
}
4949

50-
public function pull(string $class, string $property, ?string $context = null): mixed
50+
public function take(string $class, string $property, ?string $context = null): mixed
5151
{
5252
$value = $this->get($class, $property, $context);
5353

src/Handlers/BaseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function forget(string $class, string $property, ?string $context = null)
6060
*
6161
* @throws RuntimeException
6262
*/
63-
public function pull(string $class, string $property, ?string $context = null)
63+
public function take(string $class, string $property, ?string $context = null)
6464
{
6565
throw new RuntimeException('Pull method not implemented for current Settings handler.');
6666
}

src/Handlers/DatabaseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function forget(string $class, string $property, ?string $context = null)
146146
*
147147
* @return mixed|null
148148
*/
149-
public function pull(string $class, string $property, ?string $context = null): mixed
149+
public function take(string $class, string $property, ?string $context = null): mixed
150150
{
151151
$value = $this->get($class, $property, $context);
152152

src/Settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ public function forget(string $key, ?string $context = null)
106106
*
107107
* @return mixed
108108
*/
109-
public function pull(string $key, ?string $context = null)
109+
public function take(string $key, ?string $context = null)
110110
{
111111
[$class, $property] = $this->prepareClassAndProperty($key);
112112

113113
foreach ($this->getWriteHandlers() as $handler) {
114-
return $handler->pull($class, $property, $context);
114+
return $handler->take($class, $property, $context);
115115
}
116116
}
117117

tests/DatabaseHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function testPullSuccess()
221221
'updated_at' => Time::now()->toDateTimeString(),
222222
]);
223223

224-
$value = $this->settings->pull('Example.siteName');
224+
$value = $this->settings->take('Example.siteName');
225225

226226
$this->dontSeeInDatabase($this->table, [
227227
'class' => 'Tests\Support\Config\Example',

tests/SettingsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testPullWithContext()
7575
{
7676
$this->settings->set('Example.siteName', 'Amnesia', 'category:disease');
7777

78-
$value = $this->settings->pull('Example.siteName', 'category:disease');
78+
$value = $this->settings->take('Example.siteName', 'category:disease');
7979

8080
$this->assertSame('Amnesia', $value);
8181
$this->assertSame('Settings Test', $this->settings->get('Example.siteName', 'category:disease'));
@@ -85,7 +85,7 @@ public function testPullWithoutContext()
8585
{
8686
$this->settings->set('Example.siteName', 'NoContext');
8787

88-
$value = $this->settings->pull('Example.siteName');
88+
$value = $this->settings->take('Example.siteName');
8989

9090
$this->assertSame('NoContext', $value);
9191
$this->assertSame('Settings Test', $this->settings->get('Example.siteName'));

0 commit comments

Comments
 (0)