-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update composer libs * Fix CachedItem * Fix CompositeCache * Fix InvalidArgumentException * Fix InMemoryCache * Re-format code in CompositeCacheTest * Re-format code in InMemoryCacheTest * Add Timer object * Add TimerFactory object * Use timer object in InMemoryCache * Add comments to InMemoryCacheTest * Use Timer mock in InMemoryCacheTest to avoid sleep() * Fix psalm settings * Remove infection exception related to InMemoryCache::__construct * Remove infection exception related to InMemoryCache * Add dependabot * Add opcache to docker container * Update phpunit to v10 * Update infection to v0.27 * Add php 8.2 to actions
- Loading branch information
Showing
19 changed files
with
541 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "composer" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
allow: | ||
- dependency-name: "psr/simple-cache" | ||
- dependency-name: "phpunit/phpunit" | ||
- dependency-name: "friendsofphp/php-cs-fixer" | ||
- dependency-name: "vimeo/psalm" | ||
- dependency-name: "infection/infection" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
colors="true" | ||
bootstrap="./vendor/autoload.php" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
> | ||
<coverage> | ||
<include> | ||
<directory>./src</directory> | ||
</include> | ||
</coverage> | ||
|
||
<testsuites> | ||
<testsuite name="InMemoryCache tests suit"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="./vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"> | ||
<coverage/> | ||
<testsuites> | ||
<testsuite name="InMemoryCache tests suit"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory>./src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Marvin255\InMemoryCache; | ||
|
||
/** | ||
* Object that provides timestamp. | ||
*/ | ||
interface Timer | ||
{ | ||
/** | ||
* Return current timestamp. | ||
*/ | ||
public function getCurrentTimestamp(): int; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Marvin255\InMemoryCache; | ||
|
||
/** | ||
* Factory that provides timer object. | ||
* | ||
* @psalm-api | ||
*/ | ||
final class TimerFactory | ||
{ | ||
private static ?Timer $timer = null; | ||
|
||
private function __construct() | ||
{ | ||
} | ||
|
||
/** | ||
* Return timer object. | ||
*/ | ||
public static function create(): Timer | ||
{ | ||
if (self::$timer === null) { | ||
self::$timer = new TimerInternal(); | ||
} | ||
|
||
return self::$timer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Marvin255\InMemoryCache; | ||
|
||
/** | ||
* Object that provides timestamp using php time() function. | ||
* | ||
* @internal | ||
*/ | ||
final class TimerInternal implements Timer | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getCurrentTimestamp(): int | ||
{ | ||
return time(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
/** | ||
* Base test case for all tests. | ||
* | ||
* @internal | ||
*/ | ||
abstract class BaseCase extends TestCase | ||
{ | ||
|
Oops, something went wrong.