Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
php: [7.4, 8.0, 8.1]
php: [8.0, 8.1]

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"minimum-stability": "RC",
"require": {
"php": "^7.4 | ^8.0",
"codeception/codeception": "^4.0"
"php": "^8.0",
"codeception/codeception": "^5.0"
},
"require-dev": {
"ext-memcache": "*",
Expand Down
23 changes: 6 additions & 17 deletions src/Codeception/Module/Memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@
*/
class Memcache extends Module
{
/**
* @var \Memcache|Memcached|null
*/
public $memcache = null;
public \Memcache|Memcached|null $memcache = null;

/**
* @var array<string, string|integer>
*/
protected $config = [
protected array $config = [
'host' => 'localhost',
'port' => 11211
];
Expand Down Expand Up @@ -99,10 +96,8 @@ public function _after(TestInterface $test): void
* <?php
* $users_count = $I->grabValueFromMemcached('users_count');
* ```
*
* @return mixed
*/
public function grabValueFromMemcached(string $key)
public function grabValueFromMemcached(string $key): mixed
{
$value = $this->memcache->get($key);
$this->debugSection("Value", $value);
Expand All @@ -123,10 +118,8 @@ public function grabValueFromMemcached(string $key)
* // Checks a 'users_count' exists and has the value 200
* $I->seeInMemcached('users_count', 200);
* ```
*
* @param mixed $value
*/
public function seeInMemcached(string $key, $value = null): void
public function seeInMemcached(string $key, mixed $value = null): void
{
$actual = $this->memcache->get($key);
$this->debugSection("Value", $actual);
Expand All @@ -151,10 +144,8 @@ public function seeInMemcached(string $key, $value = null): void
* // Checks a 'users_count' exists does not exist or its value is not the one provided
* $I->dontSeeInMemcached('users_count', 200);
* ```
*
* @param mixed $value
*/
public function dontSeeInMemcached(string $key, $value = null): void
public function dontSeeInMemcached(string $key, mixed $value = null): void
{
$actual = $this->memcache->get($key);
$this->debugSection("Value", $actual);
Expand All @@ -168,10 +159,8 @@ public function dontSeeInMemcached(string $key, $value = null): void

/**
* Stores an item `$value` with `$key` on the Memcached server.
*
* @param mixed $value
*/
public function haveInMemcached(string $key, $value, int $expiration = 0): void
public function haveInMemcached(string $key, mixed $value, int $expiration = 0): void
{
if (get_class($this->memcache) == 'Memcache') {
$this->assertTrue($this->memcache->set($key, $value, 0, $expiration));
Expand Down