Skip to content

Commit d63bb12

Browse files
committed
Full PSR-12 compliance is now enforced by PHPCS
1 parent 0e9aab0 commit d63bb12

File tree

147 files changed

+245
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+245
-213
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
## 9.1.0
22
##### xx april 2022
3+
- __Core__
4+
- Deprecated `\Phpfastcache\Config\Config::class`
35
- __Drivers__
46
- **Added `Solr` driver support**
57
- __Cluster__
68
- Fixed #855 // ClusterReplication drivers are saving erroneous expiration date in low-level backends
79
- __Misc__
10+
- Full PSR-12 compliance is now enforced by PHPCS
811
- Multiple typo fixes (@mbiebl)
912
- Updated composer suggestions and CI builder dependencies
1013

lib/Phpfastcache/Api.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache;

lib/Phpfastcache/CacheContract.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache;

lib/Phpfastcache/CacheManager.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache;
@@ -32,10 +33,10 @@
3233
*/
3334
class CacheManager
3435
{
35-
public const CORE_DRIVER_NAMESPACE = 'Phpfastcache\Drivers\\';
36-
3736
use ClassNamespaceResolverTrait;
3837

38+
public const CORE_DRIVER_NAMESPACE = 'Phpfastcache\Drivers\\';
39+
3940
protected static ConfigurationOptionInterface $config;
4041

4142
protected static string $namespacePath;

lib/Phpfastcache/Cluster/AggregatablePoolInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;
@@ -19,5 +20,4 @@
1920

2021
interface AggregatablePoolInterface extends CacheItemPoolInterface
2122
{
22-
2323
}

lib/Phpfastcache/Cluster/AggregatorInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;
@@ -19,7 +20,6 @@
1920

2021
interface AggregatorInterface
2122
{
22-
2323
/**
2424
* Full replication mechanism
2525
*

lib/Phpfastcache/Cluster/ClusterAggregator.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;

lib/Phpfastcache/Cluster/ClusterPoolAbstract.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;
@@ -106,7 +107,7 @@ public function getClusterPools(): array
106107
/**
107108
* @inheritDoc
108109
*/
109-
public function getConfigs() : array
110+
public function getConfigs(): array
110111
{
111112
$configs = [];
112113

@@ -242,7 +243,7 @@ public function getStats(): DriverStatistic
242243
return $stats;
243244
}
244245

245-
public function getConfig() : ConfigurationOption
246+
public function getConfig(): ConfigurationOption
246247
{
247248
return $this->config;
248249
}

lib/Phpfastcache/Cluster/ClusterPoolInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;

lib/Phpfastcache/Cluster/ClusterPoolTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;
@@ -20,7 +21,6 @@
2021

2122
trait ClusterPoolTrait
2223
{
23-
2424
protected function driverCheck(): bool
2525
{
2626
return true;

lib/Phpfastcache/Cluster/Drivers/FullReplication/Driver.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\FullReplication;
@@ -44,7 +45,8 @@ public function getItem(string $key): ExtendedCacheItemInterface
4445
$itemData = $item->get();
4546
$poolItemData = $poolItem->get();
4647

47-
if (\is_object($itemData)
48+
if (
49+
\is_object($itemData)
4850
) {
4951
if ($item->get() != $poolItemData) {
5052
$poolsToResync[] = $driverPool;

lib/Phpfastcache/Cluster/Drivers/FullReplication/Item.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\FullReplication;

lib/Phpfastcache/Cluster/Drivers/MasterSlaveReplication/Driver.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\MasterSlaveReplication;

lib/Phpfastcache/Cluster/Drivers/MasterSlaveReplication/Item.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\MasterSlaveReplication;

lib/Phpfastcache/Cluster/Drivers/RandomReplication/Driver.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\RandomReplication;

lib/Phpfastcache/Cluster/Drivers/RandomReplication/Item.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\RandomReplication;

lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
*
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\SemiReplication;

lib/Phpfastcache/Cluster/Drivers/SemiReplication/Item.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster\Drivers\SemiReplication;

lib/Phpfastcache/Cluster/ItemAbstract.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Cluster;

lib/Phpfastcache/Config/AbstractConfigurationOption.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
*
45
* This file is part of Phpfastcache.
@@ -10,6 +11,7 @@
1011
* @author Georges.L (Geolim4) <contact@geolim4.com>
1112
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1213
*/
14+
1315
declare(strict_types=1);
1416

1517
namespace Phpfastcache\Config;
@@ -20,14 +22,11 @@
2022
abstract class AbstractConfigurationOption implements LockableConfigurationInterface
2123
{
2224
private bool $lockedObject = false;
23-
2425
private ExtendedCacheItemPoolInterface $locker;
25-
2626
public function lock(ExtendedCacheItemPoolInterface $poolInstance): static
2727
{
2828
$this->lockedObject = true;
2929
$this->locker = $poolInstance;
30-
3130
return $this;
3231
}
3332

@@ -52,13 +51,12 @@ protected function enforceLockedProperty(string $method): void
5251
if ($cause) {
5352
$moreInfo = \sprintf('Caused line %d in %s', $cause['line'], $cause['file']);
5453
}
55-
throw new PhpfastcacheLogicException(
56-
\sprintf(
57-
'You can no longer change the configuration "%s" as the cache pool instance is now running. %s',
58-
\lcfirst(\substr($method, 3)),
59-
$moreInfo ?? ''
60-
)
61-
);
54+
55+
throw new PhpfastcacheLogicException(\sprintf(
56+
'You can no longer change the configuration "%s" as the cache pool instance is now running. %s',
57+
\lcfirst(\substr($method, 3)),
58+
$moreInfo ?? ''
59+
));
6260
}
6361
}
6462
}

lib/Phpfastcache/Config/Config.php

+9
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Config;
1718

1819
\class_alias(ConfigurationOption::class, \Phpfastcache\Config\Config::class);
20+
\trigger_error(
21+
\sprintf(
22+
'%s class is deprecated and will be removed in v10, use %s instead.',
23+
\Phpfastcache\Config\Config::class,
24+
ConfigurationOption::class
25+
),
26+
\E_USER_DEPRECATED
27+
);

lib/Phpfastcache/Config/ConfigurationOption.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
*
45
* This file is part of Phpfastcache.

lib/Phpfastcache/Config/ConfigurationOptionInterface.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Config;
@@ -40,7 +41,7 @@ public function isValueSerializable(mixed $val): bool;
4041
* @return bool
4142
*/
4243
public function isValidOption(string $optionName): bool;
43-
44+
4445
/**
4546
* @param bool $itemDetailedDate
4647
* @return ConfigurationOption

lib/Phpfastcache/Config/IOConfigurationOptionInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Config;

lib/Phpfastcache/Config/IOConfigurationOptionTrait.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Config;

lib/Phpfastcache/Config/LockableConfigurationInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Config;

lib/Phpfastcache/Core/Item/CacheItemTrait.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Core\Item;

lib/Phpfastcache/Core/Item/ExtendedCacheItemInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Core\Item;
@@ -32,7 +33,6 @@ interface ExtendedCacheItemInterface extends
3233
JsonSerializable,
3334
TaggableCacheItemInterface
3435
{
35-
3636
/**
3737
* Returns the encoded key for the current cache item.
3838
* Is a MD5 (default),SHA1,SHA256 hash if "defaultKeyHashFunction" config option is configured

lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Core\Item;

lib/Phpfastcache/Core/Item/TaggableCacheItemInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Core\Item;

lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Core\Item;
@@ -20,6 +21,7 @@
2021
trait TaggableCacheItemTrait
2122
{
2223
use ExtendedCacheItemTrait;
24+
2325
/**
2426
* @var string[]
2527
*/

lib/Phpfastcache/Core/Pool/CacheItemPoolTrait.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @author Georges.L (Geolim4) <contact@geolim4.com>
1212
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
1313
*/
14+
1415
declare(strict_types=1);
1516

1617
namespace Phpfastcache\Core\Pool;

0 commit comments

Comments
 (0)