Skip to content

Commit 106bf15

Browse files
author
Aidyn Makhataev
committed
2 parents 87c0a4f + 312212e commit 106bf15

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

config/tarantool-session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
'host' => env('TARANTOOL_SESSION_HOST'),
55
'user' => env('TARANTOOL_SESSION_USER'),
66
'password' => env('TARANTOOL_SESSION_PASSWORD'),
7-
'space' => env('TARANTOOL_SESSION_SPACE')
8-
];
7+
'space' => env('TARANTOOL_SESSION_SPACE'),
8+
];

src/SessionServiceProvider.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
use Illuminate\Support\ServiceProvider;
99

1010
/**
11-
* Class SessionServiceProvider
12-
* @package AidynMakhataev\Tarantool\Session
11+
* Class SessionServiceProvider.
1312
*/
1413
final class SessionServiceProvider extends ServiceProvider
1514
{
@@ -28,7 +27,6 @@ public function boot(): void
2827
], ['tarantool-session', 'tarantool-session-config']);
2928
}
3029

31-
3230
Session::extend('tarantool', static function ($app) {
3331
$options = $app['config']['tarantool-session'];
3432

@@ -40,4 +38,4 @@ public function boot(): void
4038
);
4139
});
4240
}
43-
}
41+
}

src/TarantoolSessionHandler.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,28 @@
88
use Tarantool\Client\Schema\Criteria;
99

1010
/**
11-
* Class TarantoolSessionHandler
12-
* @package AidynMakhataev\Tarantool\Session
11+
* Class TarantoolSessionHandler.
1312
*/
1413
final class TarantoolSessionHandler implements \SessionHandlerInterface
1514
{
16-
/** @var Client */
15+
/** @var Client */
1716
private $client;
1817

19-
/** @var \Tarantool\Client\Schema\Space */
18+
/** @var \Tarantool\Client\Schema\Space */
2019
private $space;
2120

2221
/** @var string */
2322
private $sessionKeyPrefix;
2423

25-
/** @var string */
24+
/** @var string */
2625
private $gcFunctionName = 'php_sessions.gc';
2726

2827
public function __construct(string $host, string $user, string $password, string $space)
2928
{
3029
$this->client = Client::fromOptions([
3130
'uri' => $host,
3231
'username' => $user,
33-
'password' => $password
32+
'password' => $password,
3433
]);
3534

3635
$this->space = $this->client->getSpace($space);
@@ -61,7 +60,7 @@ public function gc($maxlifetime): bool
6160

6261
public function open($save_path, $name): bool
6362
{
64-
$this->sessionKeyPrefix = $save_path . '^' . $name;
63+
$this->sessionKeyPrefix = $save_path.'^'.$name;
6564

6665
return true;
6766
}
@@ -89,4 +88,4 @@ private function makeKey($session_id): string
8988
{
9089
return $this->sessionKeyPrefix.'@'.$session_id;
9190
}
92-
}
91+
}

0 commit comments

Comments
 (0)