Skip to content

Commit 433fd02

Browse files
committed
Apply PHP 7.4 syntax and typed property
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
1 parent 042ca1b commit 433fd02

File tree

6 files changed

+11
-23
lines changed

6 files changed

+11
-23
lines changed

src/Apcu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class Apcu extends AbstractAdapter implements
5959
*
6060
* @var null|int|float
6161
*/
62-
protected $totalSpace;
62+
private $totalSpace;
6363

6464
/**
6565
* Constructor
@@ -731,7 +731,7 @@ protected function internalGetCapabilities()
731731
);
732732

733733
// update namespace separator on change option
734-
$this->getEventManager()->attach('option', function ($event) use ($capabilities, $marker) {
734+
$this->getEventManager()->attach('option', static function ($event) use ($capabilities, $marker): void {
735735
$params = $event->getParams();
736736

737737
if (isset($params['namespace_separator'])) {

src/ApcuIterator.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Laminas\Cache\Storage\Adapter;
66

77
use APCUIterator as BaseApcuIterator;
8+
use Laminas\Cache\Storage\Adapter\Apcu;
89
use Laminas\Cache\Storage\IteratorInterface;
910
use ReturnTypeWillChange;
1011

@@ -15,32 +16,25 @@ final class ApcuIterator implements IteratorInterface
1516
{
1617
/**
1718
* The storage instance
18-
*
19-
* @var Apcu
2019
*/
21-
private $storage;
20+
private Apcu $storage;
2221

2322
/**
2423
* The iterator mode
2524
*
26-
* @var int
2725
* @psalm-var IteratorInterface::CURRENT_AS_*
2826
*/
29-
private $mode = IteratorInterface::CURRENT_AS_KEY;
27+
private int $mode = IteratorInterface::CURRENT_AS_KEY;
3028

3129
/**
3230
* The base APCIterator instance
33-
*
34-
* @var BaseApcuIterator
3531
*/
36-
private $baseIterator;
32+
private BaseApcuIterator $baseIterator;
3733

3834
/**
3935
* The length of the namespace prefix
40-
*
41-
* @var int
4236
*/
43-
private $prefixLength;
37+
private int $prefixLength;
4438

4539
public function __construct(Apcu $storage, BaseApcuIterator $baseIterator, string $prefix)
4640
{

test/integration/Psr/CacheItemPool/ApcuIntegrationTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ final class ApcuIntegrationTest extends AbstractCacheItemPoolIntegrationTest
1616
{
1717
/**
1818
* Restore 'apc.use_request_time'
19-
*
20-
* @var string
2119
*/
22-
protected $iniUseRequestTime;
20+
private string $iniUseRequestTime;
2321

2422
public function testApcUseRequestTimeThrowsException(): void
2523
{

test/unit/Apcu/ConfigProviderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
final class ConfigProviderTest extends TestCase
1313
{
14-
/** @var ConfigProvider */
15-
private $provider;
14+
private ConfigProvider $provider;
1615

1716
protected function setUp(): void
1817
{

test/unit/Apcu/ModuleTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
final class ModuleTest extends TestCase
1212
{
13-
/** @var Module */
14-
private $module;
13+
private Module $module;
1514

1615
protected function setUp(): void
1716
{

test/unit/ApcuTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ final class ApcuTest extends AbstractCommonAdapterTest
1515
{
1616
/**
1717
* Restore 'apc.use_request_time'
18-
*
19-
* @var string
2018
*/
21-
protected $iniUseRequestTime;
19+
private string $iniUseRequestTime;
2220

2321
public function setUp(): void
2422
{

0 commit comments

Comments
 (0)