From c0f0b589f4f8b42e2527b747e3138be82af193a4 Mon Sep 17 00:00:00 2001 From: Raj Siva-Rajah <5361908+binaryfire@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:40:06 +0000 Subject: [PATCH] feat(session): add BackedEnum support for session keys Enable using BackedEnums as session keys across all session methods, leveraging the Str::from() and Str::fromAll() helpers for normalization. Methods updated: - get, put, pull, remove, forget - exists, missing, has, hasAny - remember, push, increment, decrement - flash, now - only, except - hasOldInput, getOldInput Includes 41 new tests covering single enums, arrays of enums, mixed arrays (enums + strings), and int-backed enum support. --- src/session/src/Contracts/Session.php | 15 +- src/session/src/Store.php | 53 +- tests/Session/SessionStoreBackedEnumTest.php | 608 +++++++++++++++++++ 3 files changed, 649 insertions(+), 27 deletions(-) create mode 100644 tests/Session/SessionStoreBackedEnumTest.php diff --git a/src/session/src/Contracts/Session.php b/src/session/src/Contracts/Session.php index 4717c1d53..51b0058e3 100644 --- a/src/session/src/Contracts/Session.php +++ b/src/session/src/Contracts/Session.php @@ -4,6 +4,7 @@ namespace Hypervel\Session\Contracts; +use BackedEnum; use SessionHandlerInterface; interface Session @@ -46,27 +47,27 @@ public function all(): array; /** * Checks if a key exists. */ - public function exists(array|string $key): bool; + public function exists(array|BackedEnum|string $key): bool; /** * Checks if a key is present and not null. */ - public function has(array|string $key): bool; + public function has(array|BackedEnum|string $key): bool; /** * Get an item from the session. */ - public function get(string $key, mixed $default = null): mixed; + public function get(BackedEnum|string $key, mixed $default = null): mixed; /** * Get the value of a given key and then forget it. */ - public function pull(string $key, mixed $default = null): mixed; + public function pull(BackedEnum|string $key, mixed $default = null): mixed; /** * Put a key / value pair or array of key / value pairs in the session. */ - public function put(array|string $key, mixed $value = null): void; + public function put(array|BackedEnum|string $key, mixed $value = null): void; /** * Get the CSRF token value. @@ -81,12 +82,12 @@ public function regenerateToken(): void; /** * Remove an item from the session, returning its value. */ - public function remove(string $key): mixed; + public function remove(BackedEnum|string $key): mixed; /** * Remove one or many items from the session. */ - public function forget(array|string $keys): void; + public function forget(array|BackedEnum|string $keys): void; /** * Remove all of the items from the session. diff --git a/src/session/src/Store.php b/src/session/src/Store.php index 10c7107e7..daf852599 100644 --- a/src/session/src/Store.php +++ b/src/session/src/Store.php @@ -4,15 +4,16 @@ namespace Hypervel\Session; +use BackedEnum; use Closure; use Hyperf\Collection\Arr; use Hyperf\Collection\Collection; use Hyperf\Context\Context; use Hyperf\Macroable\Macroable; -use Hyperf\Stringable\Str; use Hyperf\Support\MessageBag; use Hyperf\ViewEngine\ViewErrorBag; use Hypervel\Session\Contracts\Session; +use Hypervel\Support\Str; use SessionHandlerInterface; use stdClass; @@ -203,6 +204,7 @@ public function all(): array */ public function only(array $keys): array { + $keys = Str::fromAll($keys); $attributes = $this->getAttributes(); return Arr::only($attributes, $keys); @@ -213,6 +215,7 @@ public function only(array $keys): array */ public function except(array $keys): array { + $keys = Str::fromAll($keys); $attributes = $this->getAttributes(); return Arr::except($attributes, $keys); @@ -221,7 +224,7 @@ public function except(array $keys): array /** * Checks if a key exists. */ - public function exists(array|string $key): bool + public function exists(array|BackedEnum|string $key): bool { $placeholder = new stdClass(); @@ -233,7 +236,7 @@ public function exists(array|string $key): bool /** * Determine if the given key is missing from the session data. */ - public function missing(array|string $key): bool + public function missing(array|BackedEnum|string $key): bool { return ! $this->exists($key); } @@ -241,7 +244,7 @@ public function missing(array|string $key): bool /** * Determine if a key is present and not null. */ - public function has(array|string $key): bool + public function has(array|BackedEnum|string $key): bool { return ! (new Collection(is_array($key) ? $key : func_get_args()))->contains(function ($key) { return is_null($this->get($key)); @@ -251,7 +254,7 @@ public function has(array|string $key): bool /** * Determine if any of the given keys are present and not null. */ - public function hasAny(array|string $key): bool + public function hasAny(array|BackedEnum|string $key): bool { return (new Collection(is_array($key) ? $key : func_get_args()))->filter(function ($key) { return ! is_null($this->get($key)); @@ -261,8 +264,9 @@ public function hasAny(array|string $key): bool /** * Get an item from the session. */ - public function get(string $key, mixed $default = null): mixed + public function get(BackedEnum|string $key, mixed $default = null): mixed { + $key = Str::from($key); $attributes = $this->getAttributes(); return Arr::get($attributes, $key, $default); @@ -271,8 +275,9 @@ public function get(string $key, mixed $default = null): mixed /** * Get the value of a given key and then forget it. */ - public function pull(string $key, mixed $default = null): mixed + public function pull(BackedEnum|string $key, mixed $default = null): mixed { + $key = Str::from($key); $attributes = $this->getAttributes(); $result = Arr::pull($attributes, $key, $default); @@ -284,7 +289,7 @@ public function pull(string $key, mixed $default = null): mixed /** * Determine if the session contains old input. */ - public function hasOldInput(?string $key = null): bool + public function hasOldInput(BackedEnum|string|null $key = null): bool { $old = $this->getOldInput($key); @@ -294,8 +299,10 @@ public function hasOldInput(?string $key = null): bool /** * Get the requested item from the flashed input array. */ - public function getOldInput(?string $key = null, mixed $default = null): mixed + public function getOldInput(BackedEnum|string|null $key = null, mixed $default = null): mixed { + $key = $key === null ? null : Str::from($key); + return Arr::get($this->get('_old_input', []), $key, $default); } @@ -310,15 +317,15 @@ public function replace(array $attributes): void /** * Put a key / value pair or array of key / value pairs in the session. */ - public function put(array|string $key, mixed $value = null): void + public function put(array|BackedEnum|string $key, mixed $value = null): void { if (! is_array($key)) { - $key = [$key => $value]; + $key = [Str::from($key) => $value]; } $attributes = $this->getAttributes(); foreach ($key as $arrayKey => $arrayValue) { - Arr::set($attributes, $arrayKey, $arrayValue); + Arr::set($attributes, Str::from($arrayKey), $arrayValue); } $this->setAttributes($attributes); @@ -327,7 +334,7 @@ public function put(array|string $key, mixed $value = null): void /** * Get an item from the session, or store the default value. */ - public function remember(string $key, Closure $callback): mixed + public function remember(BackedEnum|string $key, Closure $callback): mixed { if (! is_null($value = $this->get($key))) { return $value; @@ -341,7 +348,7 @@ public function remember(string $key, Closure $callback): mixed /** * Push a value onto a session array. */ - public function push(string $key, mixed $value): void + public function push(BackedEnum|string $key, mixed $value): void { $array = $this->get($key, []); @@ -353,7 +360,7 @@ public function push(string $key, mixed $value): void /** * Increment the value of an item in the session. */ - public function increment(string $key, int $amount = 1): mixed + public function increment(BackedEnum|string $key, int $amount = 1): mixed { $this->put($key, $value = $this->get($key, 0) + $amount); @@ -363,7 +370,7 @@ public function increment(string $key, int $amount = 1): mixed /** * Decrement the value of an item in the session. */ - public function decrement(string $key, int $amount = 1): int + public function decrement(BackedEnum|string $key, int $amount = 1): int { return $this->increment($key, $amount * -1); } @@ -371,8 +378,10 @@ public function decrement(string $key, int $amount = 1): int /** * Flash a key / value pair to the session. */ - public function flash(string $key, mixed $value = true): void + public function flash(BackedEnum|string $key, mixed $value = true): void { + $key = Str::from($key); + $this->put($key, $value); $this->push('_flash.new', $key); @@ -383,8 +392,10 @@ public function flash(string $key, mixed $value = true): void /** * Flash a key / value pair to the session for immediate use. */ - public function now(string $key, mixed $value): void + public function now(BackedEnum|string $key, mixed $value): void { + $key = Str::from($key); + $this->put($key, $value); $this->push('_flash.old', $key); @@ -441,8 +452,9 @@ public function flashInput(array $value): void /** * Remove an item from the session, returning its value. */ - public function remove(string $key): mixed + public function remove(BackedEnum|string $key): mixed { + $key = Str::from($key); $attributes = $this->getAttributes(); $result = Arr::pull($attributes, $key); @@ -454,8 +466,9 @@ public function remove(string $key): mixed /** * Remove one or many items from the session. */ - public function forget(array|string $keys): void + public function forget(array|BackedEnum|string $keys): void { + $keys = is_array($keys) ? Str::fromAll($keys) : Str::from($keys); $attributes = $this->getAttributes(); Arr::forget($attributes, $keys); diff --git a/tests/Session/SessionStoreBackedEnumTest.php b/tests/Session/SessionStoreBackedEnumTest.php new file mode 100644 index 000000000..8b4d9511c --- /dev/null +++ b/tests/Session/SessionStoreBackedEnumTest.php @@ -0,0 +1,608 @@ +getSession(); + $session->put('user', 'john'); + + $this->assertSame('john', $session->get(SessionKey::User)); + } + + public function testGetWithIntBackedEnum(): void + { + $session = $this->getSession(); + $session->put('1', 'first-value'); + + $this->assertSame('first-value', $session->get(IntBackedKey::First)); + } + + public function testGetWithEnumReturnsDefault(): void + { + $session = $this->getSession(); + + $this->assertSame('default', $session->get(SessionKey::User, 'default')); + } + + // ========================================================================= + // put() tests + // ========================================================================= + + public function testPutWithSingleEnum(): void + { + $session = $this->getSession(); + $session->put(SessionKey::User, 'jane'); + + $this->assertSame('jane', $session->get('user')); + $this->assertSame('jane', $session->get(SessionKey::User)); + } + + public function testPutWithArrayOfStringKeys(): void + { + $session = $this->getSession(); + $session->put([ + SessionKey::User->value => 'john', + SessionKey::Token->value => 'abc123', + ]); + + $this->assertSame('john', $session->get(SessionKey::User)); + $this->assertSame('abc123', $session->get(SessionKey::Token)); + } + + /** + * Test that put() normalizes enum keys in arrays. + * Note: PHP auto-converts BackedEnums to their values when used as array keys, + * so by the time the array reaches put(), keys are already strings. + * This test verifies the overall behavior works correctly. + */ + public function testPutWithMixedArrayKeysUsingEnumValues(): void + { + $session = $this->getSession(); + $session->put([ + SessionKey::User->value => 'john', + 'legacy_key' => 'legacy_value', + SessionKey::Token->value => 'token123', + ]); + + $this->assertSame('john', $session->get('user')); + $this->assertSame('john', $session->get(SessionKey::User)); + $this->assertSame('legacy_value', $session->get('legacy_key')); + $this->assertSame('token123', $session->get('token')); + $this->assertSame('token123', $session->get(SessionKey::Token)); + } + + public function testPutWithIntBackedEnumKeyValues(): void + { + $session = $this->getSession(); + $session->put([ + (string) IntBackedKey::First->value => 'first-value', + (string) IntBackedKey::Second->value => 'second-value', + ]); + + $this->assertSame('first-value', $session->get('1')); + $this->assertSame('first-value', $session->get(IntBackedKey::First)); + $this->assertSame('second-value', $session->get('2')); + $this->assertSame('second-value', $session->get(IntBackedKey::Second)); + } + + // ========================================================================= + // exists() tests + // ========================================================================= + + public function testExistsWithSingleEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $this->assertTrue($session->exists(SessionKey::User)); + $this->assertFalse($session->exists(SessionKey::Token)); + } + + public function testExistsWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + + $this->assertTrue($session->exists([SessionKey::User, SessionKey::Token])); + $this->assertFalse($session->exists([SessionKey::User, SessionKey::Settings])); + } + + public function testExistsWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('legacy', 'value'); + + $this->assertTrue($session->exists([SessionKey::User, 'legacy'])); + $this->assertFalse($session->exists([SessionKey::User, 'nonexistent'])); + } + + // ========================================================================= + // missing() tests + // ========================================================================= + + public function testMissingWithSingleEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $this->assertFalse($session->missing(SessionKey::User)); + $this->assertTrue($session->missing(SessionKey::Token)); + } + + public function testMissingWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + + // All keys exist - missing returns false + $this->assertFalse($session->missing([SessionKey::User, SessionKey::Token])); + + // Some keys missing - missing returns true + $this->assertTrue($session->missing([SessionKey::Token, SessionKey::Settings])); + } + + public function testMissingWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + + $this->assertTrue($session->missing([SessionKey::User, 'legacy'])); + + $session->put('user', 'john'); + $session->put('legacy', 'value'); + + $this->assertFalse($session->missing([SessionKey::User, 'legacy'])); + } + + // ========================================================================= + // has() tests + // ========================================================================= + + public function testHasWithSingleEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', null); + + $this->assertTrue($session->has(SessionKey::User)); + $this->assertFalse($session->has(SessionKey::Token)); // null value + $this->assertFalse($session->has(SessionKey::Settings)); // doesn't exist + } + + public function testHasWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + + $this->assertTrue($session->has([SessionKey::User, SessionKey::Token])); + $this->assertFalse($session->has([SessionKey::User, SessionKey::Settings])); + } + + public function testHasWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('legacy', 'value'); + + $this->assertTrue($session->has([SessionKey::User, 'legacy'])); + $this->assertFalse($session->has([SessionKey::User, 'nonexistent'])); + } + + // ========================================================================= + // hasAny() tests + // ========================================================================= + + public function testHasAnyWithSingleEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $this->assertTrue($session->hasAny(SessionKey::User)); + $this->assertFalse($session->hasAny(SessionKey::Token)); + } + + public function testHasAnyWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $this->assertTrue($session->hasAny([SessionKey::User, SessionKey::Token])); + $this->assertFalse($session->hasAny([SessionKey::Token, SessionKey::Settings])); + } + + public function testHasAnyWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $this->assertTrue($session->hasAny([SessionKey::Token, 'user'])); + $this->assertTrue($session->hasAny(['nonexistent', SessionKey::User])); + $this->assertFalse($session->hasAny([SessionKey::Token, 'nonexistent'])); + } + + // ========================================================================= + // pull() tests + // ========================================================================= + + public function testPullWithEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $this->assertSame('john', $session->pull(SessionKey::User)); + $this->assertFalse($session->has('user')); + } + + public function testPullWithEnumReturnsDefault(): void + { + $session = $this->getSession(); + + $this->assertSame('default', $session->pull(SessionKey::User, 'default')); + } + + // ========================================================================= + // forget() tests + // ========================================================================= + + public function testForgetWithSingleEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + + $session->forget(SessionKey::User); + + $this->assertFalse($session->has('user')); + $this->assertTrue($session->has('token')); + } + + public function testForgetWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + $session->put('settings', ['dark' => true]); + + $session->forget([SessionKey::User, SessionKey::Token]); + + $this->assertFalse($session->has('user')); + $this->assertFalse($session->has('token')); + $this->assertTrue($session->has('settings')); + } + + public function testForgetWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('legacy', 'value'); + $session->put('token', 'abc'); + + $session->forget([SessionKey::User, 'legacy']); + + $this->assertFalse($session->has('user')); + $this->assertFalse($session->has('legacy')); + $this->assertTrue($session->has('token')); + } + + // ========================================================================= + // only() tests + // ========================================================================= + + public function testOnlyWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + $session->put('settings', ['dark' => true]); + + $result = $session->only([SessionKey::User, SessionKey::Token]); + + $this->assertSame(['user' => 'john', 'token' => 'abc'], $result); + } + + public function testOnlyWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('legacy', 'value'); + $session->put('token', 'abc'); + + $result = $session->only([SessionKey::User, 'legacy']); + + $this->assertSame(['user' => 'john', 'legacy' => 'value'], $result); + } + + public function testOnlyWithIntBackedEnums(): void + { + $session = $this->getSession(); + $session->put('1', 'first'); + $session->put('2', 'second'); + $session->put('3', 'third'); + + $result = $session->only([IntBackedKey::First, IntBackedKey::Second]); + + $this->assertSame(['1' => 'first', '2' => 'second'], $result); + } + + // ========================================================================= + // except() tests + // ========================================================================= + + public function testExceptWithArrayOfEnums(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('token', 'abc'); + $session->put('settings', ['dark' => true]); + + $result = $session->except([SessionKey::User, SessionKey::Token]); + + $this->assertSame(['settings' => ['dark' => true]], $result); + } + + public function testExceptWithMixedArrayEnumsAndStrings(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + $session->put('legacy', 'value'); + $session->put('token', 'abc'); + + $result = $session->except([SessionKey::User, 'legacy']); + + $this->assertSame(['token' => 'abc'], $result); + } + + // ========================================================================= + // remove() tests + // ========================================================================= + + public function testRemoveWithEnum(): void + { + $session = $this->getSession(); + $session->put('user', 'john'); + + $value = $session->remove(SessionKey::User); + + $this->assertSame('john', $value); + $this->assertFalse($session->has('user')); + } + + // ========================================================================= + // remember() tests + // ========================================================================= + + public function testRememberWithEnum(): void + { + $session = $this->getSession(); + + $result = $session->remember(SessionKey::User, fn () => 'computed'); + + $this->assertSame('computed', $result); + $this->assertSame('computed', $session->get(SessionKey::User)); + + // Second call should return cached value + $result2 = $session->remember(SessionKey::User, fn () => 'different'); + $this->assertSame('computed', $result2); + } + + // ========================================================================= + // push() tests + // ========================================================================= + + public function testPushWithEnum(): void + { + $session = $this->getSession(); + + $session->push(SessionKey::Items, 'item1'); + $session->push(SessionKey::Items, 'item2'); + + $this->assertSame(['item1', 'item2'], $session->get(SessionKey::Items)); + } + + // ========================================================================= + // increment() / decrement() tests + // ========================================================================= + + public function testIncrementWithEnum(): void + { + $session = $this->getSession(); + + $session->increment(SessionKey::Counter); + $this->assertSame(1, $session->get(SessionKey::Counter)); + + $session->increment(SessionKey::Counter, 5); + $this->assertSame(6, $session->get(SessionKey::Counter)); + } + + public function testDecrementWithEnum(): void + { + $session = $this->getSession(); + $session->put(SessionKey::Counter, 10); + + $session->decrement(SessionKey::Counter); + $this->assertSame(9, $session->get(SessionKey::Counter)); + + $session->decrement(SessionKey::Counter, 4); + $this->assertSame(5, $session->get(SessionKey::Counter)); + } + + // ========================================================================= + // flash() tests + // ========================================================================= + + public function testFlashWithEnum(): void + { + $session = $this->getSession(); + $session->getHandler()->shouldReceive('read')->once()->andReturn(serialize([])); + $session->start(); + + $session->flash(SessionKey::User, 'flash-value'); + + $this->assertTrue($session->has(SessionKey::User)); + $this->assertSame('flash-value', $session->get(SessionKey::User)); + + // Verify key is stored as string in _flash.new + $flashNew = $session->get('_flash.new'); + $this->assertContains('user', $flashNew); + } + + public function testFlashWithEnumIsProperlyAged(): void + { + $session = $this->getSession(); + $session->getHandler()->shouldReceive('read')->once()->andReturn(serialize([])); + $session->start(); + + $session->flash(SessionKey::User, 'flash-value'); + $session->ageFlashData(); + + // After aging, key should be in _flash.old + $this->assertContains('user', $session->get('_flash.old', [])); + $this->assertNotContains('user', $session->get('_flash.new', [])); + + // Value should still exist + $this->assertTrue($session->has(SessionKey::User)); + + // Age again - should be removed + $session->ageFlashData(); + $this->assertFalse($session->has(SessionKey::User)); + } + + // ========================================================================= + // now() tests + // ========================================================================= + + public function testNowWithEnum(): void + { + $session = $this->getSession(); + $session->getHandler()->shouldReceive('read')->once()->andReturn(serialize([])); + $session->start(); + + $session->now(SessionKey::User, 'now-value'); + + $this->assertTrue($session->has(SessionKey::User)); + $this->assertSame('now-value', $session->get(SessionKey::User)); + + // Verify key is stored as string in _flash.old (immediate expiry) + $flashOld = $session->get('_flash.old'); + $this->assertContains('user', $flashOld); + } + + // ========================================================================= + // hasOldInput() / getOldInput() tests + // ========================================================================= + + public function testHasOldInputWithEnum(): void + { + $session = $this->getSession(); + $session->put('_old_input', ['user' => 'john', 'email' => 'john@example.com']); + + $this->assertTrue($session->hasOldInput(SessionKey::User)); + $this->assertFalse($session->hasOldInput(SessionKey::Token)); + } + + public function testGetOldInputWithEnum(): void + { + $session = $this->getSession(); + $session->put('_old_input', ['user' => 'john', 'email' => 'john@example.com']); + + $this->assertSame('john', $session->getOldInput(SessionKey::User)); + $this->assertNull($session->getOldInput(SessionKey::Token)); + $this->assertSame('default', $session->getOldInput(SessionKey::Token, 'default')); + } + + // ========================================================================= + // Interoperability tests - enum and string access same data + // ========================================================================= + + public function testEnumAndStringAccessSameData(): void + { + $session = $this->getSession(); + + // Set with enum, get with string + $session->put(SessionKey::User, 'value1'); + $this->assertSame('value1', $session->get('user')); + + // Set with string, get with enum + $session->put('token', 'value2'); + $this->assertSame('value2', $session->get(SessionKey::Token)); + + // Verify both work together + $this->assertTrue($session->has('user')); + $this->assertTrue($session->has(SessionKey::User)); + $this->assertTrue($session->exists(['user', SessionKey::Token])); + } + + public function testIntBackedEnumInteroperability(): void + { + $session = $this->getSession(); + + $session->put(IntBackedKey::First, 'enum-value'); + $this->assertSame('enum-value', $session->get('1')); + + $session->put('2', 'string-value'); + $this->assertSame('string-value', $session->get(IntBackedKey::Second)); + } + + // ========================================================================= + // Helper methods + // ========================================================================= + + protected function getSession(string $serialization = 'php'): Store + { + $store = new Store( + 'test-session', + m::mock(SessionHandlerInterface::class), + $serialization + ); + + $store->setId('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + + return $store; + } +}