Skip to content

Commit

Permalink
Full PSR-12 compliance is now enforced by PHPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolim4 committed Mar 31, 2022
1 parent 0e9aab0 commit d63bb12
Show file tree
Hide file tree
Showing 147 changed files with 245 additions and 213 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,10 +1,13 @@
## 9.1.0
##### xx april 2022
- __Core__
- Deprecated `\Phpfastcache\Config\Config::class`
- __Drivers__
- **Added `Solr` driver support**
- __Cluster__
- Fixed #855 // ClusterReplication drivers are saving erroneous expiration date in low-level backends
- __Misc__
- Full PSR-12 compliance is now enforced by PHPCS
- Multiple typo fixes (@mbiebl)
- Updated composer suggestions and CI builder dependencies

Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Api.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/CacheContract.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache;
Expand Down
5 changes: 3 additions & 2 deletions lib/Phpfastcache/CacheManager.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache;
Expand All @@ -32,10 +33,10 @@
*/
class CacheManager
{
public const CORE_DRIVER_NAMESPACE = 'Phpfastcache\Drivers\\';

use ClassNamespaceResolverTrait;

public const CORE_DRIVER_NAMESPACE = 'Phpfastcache\Drivers\\';

protected static ConfigurationOptionInterface $config;

protected static string $namespacePath;
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Cluster/AggregatablePoolInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand All @@ -19,5 +20,4 @@

interface AggregatablePoolInterface extends CacheItemPoolInterface
{

}
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Cluster/AggregatorInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand All @@ -19,7 +20,6 @@

interface AggregatorInterface
{

/**
* Full replication mechanism
*
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Cluster/ClusterAggregator.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand Down
5 changes: 3 additions & 2 deletions lib/Phpfastcache/Cluster/ClusterPoolAbstract.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand Down Expand Up @@ -106,7 +107,7 @@ public function getClusterPools(): array
/**
* @inheritDoc
*/
public function getConfigs() : array
public function getConfigs(): array
{
$configs = [];

Expand Down Expand Up @@ -242,7 +243,7 @@ public function getStats(): DriverStatistic
return $stats;
}

public function getConfig() : ConfigurationOption
public function getConfig(): ConfigurationOption
{
return $this->config;
}
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Cluster/ClusterPoolInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Cluster/ClusterPoolTrait.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand All @@ -20,7 +21,6 @@

trait ClusterPoolTrait
{

protected function driverCheck(): bool
{
return true;
Expand Down
4 changes: 3 additions & 1 deletion lib/Phpfastcache/Cluster/Drivers/FullReplication/Driver.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

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

if (\is_object($itemData)
if (
\is_object($itemData)
) {
if ($item->get() != $poolItemData) {
$poolsToResync[] = $driverPool;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Cluster/Drivers/FullReplication/Item.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\FullReplication;
Expand Down
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\MasterSlaveReplication;
Expand Down
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\MasterSlaveReplication;
Expand Down
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\RandomReplication;
Expand Down
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\RandomReplication;
Expand Down
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\SemiReplication;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Cluster/Drivers/SemiReplication/Item.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster\Drivers\SemiReplication;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Cluster/ItemAbstract.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Cluster;
Expand Down
18 changes: 8 additions & 10 deletions lib/Phpfastcache/Config/AbstractConfigurationOption.php
@@ -1,4 +1,5 @@
<?php

/**
*
* This file is part of Phpfastcache.
Expand All @@ -10,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Config;
Expand All @@ -20,14 +22,11 @@
abstract class AbstractConfigurationOption implements LockableConfigurationInterface
{
private bool $lockedObject = false;

private ExtendedCacheItemPoolInterface $locker;

public function lock(ExtendedCacheItemPoolInterface $poolInstance): static
{
$this->lockedObject = true;
$this->locker = $poolInstance;

return $this;
}

Expand All @@ -52,13 +51,12 @@ protected function enforceLockedProperty(string $method): void
if ($cause) {
$moreInfo = \sprintf('Caused line %d in %s', $cause['line'], $cause['file']);
}
throw new PhpfastcacheLogicException(
\sprintf(
'You can no longer change the configuration "%s" as the cache pool instance is now running. %s',
\lcfirst(\substr($method, 3)),
$moreInfo ?? ''
)
);

throw new PhpfastcacheLogicException(\sprintf(
'You can no longer change the configuration "%s" as the cache pool instance is now running. %s',
\lcfirst(\substr($method, 3)),
$moreInfo ?? ''
));
}
}
}
9 changes: 9 additions & 0 deletions lib/Phpfastcache/Config/Config.php
Expand Up @@ -11,8 +11,17 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Config;

\class_alias(ConfigurationOption::class, \Phpfastcache\Config\Config::class);
\trigger_error(
\sprintf(
'%s class is deprecated and will be removed in v10, use %s instead.',
\Phpfastcache\Config\Config::class,
ConfigurationOption::class
),
\E_USER_DEPRECATED
);
1 change: 1 addition & 0 deletions lib/Phpfastcache/Config/ConfigurationOption.php
@@ -1,4 +1,5 @@
<?php

/**
*
* This file is part of Phpfastcache.
Expand Down
3 changes: 2 additions & 1 deletion lib/Phpfastcache/Config/ConfigurationOptionInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Config;
Expand Down Expand Up @@ -40,7 +41,7 @@ public function isValueSerializable(mixed $val): bool;
* @return bool
*/
public function isValidOption(string $optionName): bool;

/**
* @param bool $itemDetailedDate
* @return ConfigurationOption
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Config/IOConfigurationOptionInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Config;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Config/IOConfigurationOptionTrait.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Config;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Config/LockableConfigurationInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Config;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Core/Item/CacheItemTrait.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Core\Item;
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Core/Item/ExtendedCacheItemInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Core\Item;
Expand All @@ -32,7 +33,6 @@ interface ExtendedCacheItemInterface extends
JsonSerializable,
TaggableCacheItemInterface
{

/**
* Returns the encoded key for the current cache item.
* Is a MD5 (default),SHA1,SHA256 hash if "defaultKeyHashFunction" config option is configured
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Core\Item;
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Core/Item/TaggableCacheItemInterface.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Core\Item;
Expand Down
2 changes: 2 additions & 0 deletions lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Core\Item;
Expand All @@ -20,6 +21,7 @@
trait TaggableCacheItemTrait
{
use ExtendedCacheItemTrait;

/**
* @var string[]
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Phpfastcache/Core/Pool/CacheItemPoolTrait.php
Expand Up @@ -11,6 +11,7 @@
* @author Georges.L (Geolim4) <contact@geolim4.com>
* @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
*/

declare(strict_types=1);

namespace Phpfastcache\Core\Pool;
Expand Down

0 comments on commit d63bb12

Please sign in to comment.