updated composer

This commit is contained in:
2021-05-18 13:47:03 +00:00
parent e248cd036c
commit ba92152daa
1187 changed files with 20804 additions and 22320 deletions

View File

@@ -39,14 +39,14 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, callable $usageReporter = null)
{
$this->storage = $storage ?: new NativeSessionStorage();
$this->storage = $storage ?? new NativeSessionStorage();
$this->usageReporter = $usageReporter;
$attributes = $attributes ?: new AttributeBag();
$attributes = $attributes ?? new AttributeBag();
$this->attributeName = $attributes->getName();
$this->registerBag($attributes);
$flashes = $flashes ?: new FlashBag();
$flashes = $flashes ?? new FlashBag();
$this->flashName = $flashes->getName();
$this->registerBag($flashes);
}

View File

@@ -28,7 +28,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function open($savePath, $name)
{
@@ -36,7 +36,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function close()
{
@@ -44,7 +44,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function destroy($sessionId)
{
@@ -52,7 +52,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function gc($maxlifetime)
{
@@ -60,7 +60,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return string
*/
public function read($sessionId)
{
@@ -68,7 +68,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function write($sessionId, $data)
{
@@ -83,7 +83,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function validateId($sessionId)
{
@@ -91,7 +91,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
}
/**
* {@inheritdoc}
* @return bool
*/
public function updateTimestamp($sessionId, $data)
{

View File

@@ -51,7 +51,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler
}
$this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400;
$this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s';
$this->prefix = $options['prefix'] ?? 'sf2s';
}
/**

View File

@@ -185,15 +185,15 @@ class PdoSessionHandler extends AbstractSessionHandler
$this->dsn = $pdoOrDsn;
}
$this->table = isset($options['db_table']) ? $options['db_table'] : $this->table;
$this->idCol = isset($options['db_id_col']) ? $options['db_id_col'] : $this->idCol;
$this->dataCol = isset($options['db_data_col']) ? $options['db_data_col'] : $this->dataCol;
$this->lifetimeCol = isset($options['db_lifetime_col']) ? $options['db_lifetime_col'] : $this->lifetimeCol;
$this->timeCol = isset($options['db_time_col']) ? $options['db_time_col'] : $this->timeCol;
$this->username = isset($options['db_username']) ? $options['db_username'] : $this->username;
$this->password = isset($options['db_password']) ? $options['db_password'] : $this->password;
$this->connectionOptions = isset($options['db_connection_options']) ? $options['db_connection_options'] : $this->connectionOptions;
$this->lockMode = isset($options['lock_mode']) ? $options['lock_mode'] : $this->lockMode;
$this->table = $options['db_table'] ?? $this->table;
$this->idCol = $options['db_id_col'] ?? $this->idCol;
$this->dataCol = $options['db_data_col'] ?? $this->dataCol;
$this->lifetimeCol = $options['db_lifetime_col'] ?? $this->lifetimeCol;
$this->timeCol = $options['db_time_col'] ?? $this->timeCol;
$this->username = $options['db_username'] ?? $this->username;
$this->password = $options['db_password'] ?? $this->password;
$this->connectionOptions = $options['db_connection_options'] ?? $this->connectionOptions;
$this->lockMode = $options['lock_mode'] ?? $this->lockMode;
}
/**
@@ -479,7 +479,7 @@ class PdoSessionHandler extends AbstractSessionHandler
'sqlite3' => 'sqlite',
];
$driver = isset($driverAliasMap[$params['scheme']]) ? $driverAliasMap[$params['scheme']] : $params['scheme'];
$driver = $driverAliasMap[$params['scheme']] ?? $params['scheme'];
// Doctrine DBAL supports passing its internal pdo_* driver names directly too (allowing both dashes and underscores). This allows supporting the same here.
if (0 === strpos($driver, 'pdo_') || 0 === strpos($driver, 'pdo-')) {

View File

@@ -242,7 +242,7 @@ class MockArraySessionStorage implements SessionStorageInterface
foreach ($bags as $bag) {
$key = $bag->getStorageKey();
$this->data[$key] = isset($this->data[$key]) ? $this->data[$key] : [];
$this->data[$key] = $this->data[$key] ?? [];
$bag->initialize($this->data[$key]);
}

View File

@@ -102,7 +102,10 @@ class MockFileSessionStorage extends MockArraySessionStorage
try {
if ($data) {
file_put_contents($this->getFilePath(), serialize($data));
$path = $this->getFilePath();
$tmp = $path.bin2hex(random_bytes(6));
file_put_contents($tmp, serialize($data));
rename($tmp, $path);
} else {
$this->destroy();
}
@@ -110,9 +113,8 @@ class MockFileSessionStorage extends MockArraySessionStorage
$this->data = $data;
}
// this is needed for Silex, where the session object is re-used across requests
// in functional tests. In Symfony, the container is rebooted, so we don't have
// this issue
// this is needed when the session object is re-used across multiple requests
// in functional tests.
$this->started = false;
}
@@ -122,8 +124,11 @@ class MockFileSessionStorage extends MockArraySessionStorage
*/
private function destroy(): void
{
if (is_file($this->getFilePath())) {
set_error_handler(static function () {});
try {
unlink($this->getFilePath());
} finally {
restore_error_handler();
}
}
@@ -140,8 +145,14 @@ class MockFileSessionStorage extends MockArraySessionStorage
*/
private function read(): void
{
$filePath = $this->getFilePath();
$this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : [];
set_error_handler(static function () {});
try {
$data = file_get_contents($this->getFilePath());
} finally {
restore_error_handler();
}
$this->data = $data ? unserialize($data) : [];
$this->loadSession();
}

View File

@@ -389,6 +389,9 @@ class NativeSessionStorage implements SessionStorageInterface
$this->emulateSameSite = $value;
continue;
}
if ('cookie_secure' === $key && 'auto' === $value) {
continue;
}
ini_set('url_rewriter.tags' !== $key ? 'session.'.$key : $key, $value);
}
}