Skip to content

Commit

Permalink
Fix PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Dec 4, 2023
1 parent 8b3687f commit 51fdff8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/Eccube/Service/CsvImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ public function __construct(\SplFileObject $file, $delimiter = ',', $enclosure =
*
* If a header row has been set, an associative array will be returned
*
* @return array
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
// If the CSV has no column headers just return the line
Expand Down Expand Up @@ -217,7 +218,10 @@ public function setHeaderRowNumber($rowNumber, $duplicates = null)
* If a header row has been set, the pointer is set just below the header
* row. That way, when you iterate over the rows, that header row is
* skipped.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->file->rewind();
Expand All @@ -229,6 +233,7 @@ public function rewind()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count()
{
if (null === $this->count) {
Expand All @@ -245,6 +250,7 @@ public function count()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->file->next();
Expand All @@ -253,6 +259,7 @@ public function next()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->file->valid();
Expand All @@ -261,6 +268,7 @@ public function valid()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->file->key();
Expand All @@ -269,6 +277,7 @@ public function key()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function seek($pointer)
{
$this->file->seek($pointer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function __construct(\SessionHandlerInterface $handler)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function open($savePath, $sessionName)
{
$this->sessionName = $sessionName;
Expand All @@ -68,6 +69,7 @@ protected function doRead($sessionId)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function updateTimestamp($sessionId, $data)
{
return $this->write($sessionId, $data);
Expand All @@ -86,6 +88,7 @@ protected function doWrite($sessionId, $data)
*
* @see https://github.com/symfony/symfony/blob/2adc85d49cbe14e346068fa7e9c2e1f08ab31de6/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php#L126-L167
*/
#[\ReturnTypeWillChange]
public function destroy($sessionId)
{
if (\PHP_VERSION_ID < 70000) {
Expand Down Expand Up @@ -152,14 +155,16 @@ protected function doDestroy($sessionId)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function close()
{
return $this->handler->close();
}

/**
* @return bool
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
return $this->handler->gc($maxlifetime);
Expand Down
17 changes: 17 additions & 0 deletions tests/Fixtures/session/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class TestSessionHandler extends SameSiteNoneCompatSessionHandler
{
private $handler;
private $data;
private $sessionId;

public function __construct(SessionHandlerInterface $handler)
{
Expand All @@ -112,6 +113,10 @@ public function open($path, $name)
return parent::open($path, $name);
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function validateId($sessionId)
{
echo __FUNCTION__, "\n";
Expand All @@ -122,6 +127,7 @@ public function validateId($sessionId)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function read($sessionId)
{
echo __FUNCTION__, "\n";
Expand All @@ -132,6 +138,7 @@ public function read($sessionId)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function updateTimestamp($sessionId, $data)
{
echo __FUNCTION__, "\n";
Expand All @@ -142,6 +149,7 @@ public function updateTimestamp($sessionId, $data)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function write($sessionId, $data)
{
echo __FUNCTION__, "\n";
Expand All @@ -152,20 +160,29 @@ public function write($sessionId, $data)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function destroy($sessionId)
{
echo __FUNCTION__, "\n";

return parent::destroy($sessionId);
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function close()
{
echo __FUNCTION__, "\n";

return true;
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function gc($maxLifetime)
{
echo __FUNCTION__, "\n";
Expand Down

0 comments on commit 51fdff8

Please sign in to comment.