Skip to content

Commit f90df5c

Browse files
Update QA Utilities
1 parent e7ffa50 commit f90df5c

9 files changed

Lines changed: 368 additions & 340 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
*.webp binary
1212
*.bmp binary
1313
*.ttf binary
14+
*.blp binary
15+
*.db2 binary
1416

1517
# Ignoring files for distribution archieves
1618
.github/ export-ignore
1719
etc/ci/ export-ignore
20+
etc/dev-app/ export-ignore
1821
etc/qa/ export-ignore
1922
examples/ export-ignore
2023
tests/ export-ignore

.github/renovate.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"github>WyriHaximus/renovate-config:php-package"
5-
]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"github>WyriHaximus/renovate-config:php-package"
5+
],
6+
"constraints": {
7+
"php": "8.4.x",
8+
"composer": "2.x"
9+
}
610
}

Makefile

Lines changed: 80 additions & 29 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"react/promise": "^3.2"
1717
},
1818
"require-dev": {
19-
"wyrihaximus/async-test-utilities": "^12.0.0",
20-
"wyrihaximus/makefiles": "^0.7.15"
19+
"wyrihaximus/async-test-utilities": "^12.1.0",
20+
"wyrihaximus/makefiles": "^0.10.4"
2121
},
2222
"autoload": {
2323
"psr-4": {

composer.lock

Lines changed: 261 additions & 254 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/qa/infection.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"timeout": 120,
33
"source": {
44
"directories": [
5-
"src"
5+
"../../src"
66
]
77
},
88
"logs": {

src/Redis.php

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,69 +24,52 @@
2424
private const string DEFAULT_PREFIX = 'react:cache:';
2525
private const int DEFAULT_TTL = 0;
2626

27-
/** @phpstan-ignore-next-line */
2827
public function __construct(private Client $client, private string $prefix = self::DEFAULT_PREFIX, private int $ttl = self::DEFAULT_TTL)
2928
{
3029
}
3130

32-
/**
33-
* @inheritDoc
34-
* @phpstan-ignore-next-line
35-
*/
31+
/** @inheritDoc */
3632
public function get($key, $default = null): PromiseInterface
3733
{
3834
return $this->has($key)->then(function (mixed $result) use ($key): PromiseInterface {
3935
if ($result === false) {
4036
return resolve(null);
4137
}
4238

43-
/** @phpstan-ignore-next-line */
4439
return $this->client->get($this->prefix . $key);
4540
});
4641
}
4742

48-
/**
49-
* @inheritDoc
50-
* @phpstan-ignore-next-line
51-
*/
43+
/** @inheritDoc */
5244
public function set($key, $value, $ttl = null): PromiseInterface
5345
{
5446
if ($this->ttl === 0 && $ttl === null) {
55-
/** @phpstan-ignore-next-line */
5647
return $this->client->set($this->prefix . $key, (string) $value)->then(
5748
static fn (): PromiseInterface => resolve(true),
5849
static fn (): PromiseInterface => resolve(false),
5950
);
6051
}
6152

62-
/** @phpstan-ignore-next-line */
6353
return $this->client->psetex(
6454
$this->prefix . $key,
6555
(string) ((float) ($this->ttl > 0 ? $this->ttl : $ttl) * 1000),
66-
(string) $value, /** @phpstan-ignore-line */
56+
(string) $value,
6757
)->then(
6858
static fn (): PromiseInterface => resolve(true),
6959
static fn (): PromiseInterface => resolve(false),
7060
);
7161
}
7262

73-
/**
74-
* @inheritDoc
75-
* @phpstan-ignore-next-line
76-
*/
63+
/** @inheritDoc */
7764
public function delete($key): PromiseInterface
7865
{
79-
/** @phpstan-ignore-next-line */
8066
return $this->client->del($this->prefix . $key)->then(
8167
static fn (): PromiseInterface => resolve(true),
8268
static fn (): PromiseInterface => resolve(false),
8369
);
8470
}
8571

86-
/**
87-
* @inheritDoc
88-
* @phpstan-ignore-next-line
89-
*/
72+
/** @inheritDoc */
9073
public function getMultiple(array $keys, $default = null)
9174
{
9275
$promises = [];
@@ -97,10 +80,7 @@ public function getMultiple(array $keys, $default = null)
9780
return all($promises);
9881
}
9982

100-
/**
101-
* @inheritDoc
102-
* @phpstan-ignore-next-line
103-
*/
83+
/** @inheritDoc */
10484
public function setMultiple(array $values, $ttl = null)
10585
{
10686
$promises = [];
@@ -112,37 +92,27 @@ public function setMultiple(array $values, $ttl = null)
11292
return all($promises)->then(static fn (array $bools): bool => array_all($bools, static fn (bool $bool): bool => $bool));
11393
}
11494

115-
/**
116-
* @inheritDoc
117-
* @phpstan-ignore-next-line
118-
*/
95+
/** @inheritDoc */
11996
public function deleteMultiple(array $keys)
12097
{
12198
foreach ($keys as $index => $key) {
12299
$keys[$index] = $this->prefix . $key;
123100
}
124101

125-
return $this->client->del(...$keys)->then( /** @phpstan-ignore-line */
102+
return $this->client->del(...$keys)->then(
126103
static fn (): PromiseInterface => resolve(true),
127104
static fn (): PromiseInterface => resolve(false),
128105
);
129106
}
130107

131-
/**
132-
* @inheritDoc
133-
* @phpstan-ignore-next-line
134-
*/
108+
/** @inheritDoc */
135109
public function clear()
136110
{
137-
return $this->client->keys($this->prefix . '*')->then( /** @phpstan-ignore-line */
111+
return $this->client->keys($this->prefix . '*')->then(
138112
function (array $keys): PromiseInterface {
139-
/**
140-
* @var array<string> $matchedKeys
141-
* @phpstan-ignore-next-line
142-
*/
113+
/** @var array<string> $matchedKeys */
143114
$matchedKeys = preg_replace('|^' . preg_quote($this->prefix) . '|', '', $keys);
144115
if (preg_last_error() !== PREG_NO_ERROR) {
145-
/** @phpstan-ignore-next-line */
146116
throw new RuntimeException(preg_last_error_msg());
147117
}
148118

@@ -151,13 +121,9 @@ function (array $keys): PromiseInterface {
151121
);
152122
}
153123

154-
/**
155-
* @inheritDoc
156-
* @phpstan-ignore-next-line
157-
*/
124+
/** @inheritDoc */
158125
public function has($key)
159126
{
160-
/** @phpstan-ignore-next-line */
161127
return $this->client->exists($this->prefix . $key);
162128
}
163129
}

tests/ClientStub.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010

1111
use function React\Promise\resolve;
1212

13-
/** @phpstan-ignore-next-line */
1413
class ClientStub implements Client
1514
{
1615
use EventEmitterTrait;
1716

18-
/** @phpstan-ignore-next-line */
1917
public function __call($name, $args) //phpcs:disabled
2018
{
2119
return resolve(null);
@@ -80,7 +78,6 @@ public function keys(string $keys): PromiseInterface
8078
}
8179

8280
/**
83-
* @phpstan-ignore-next-line
8481
*/
8582
public function isBusy(): bool //phpcs:disabled
8683
{

tests/RedisTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function setMultiple(): void
169169
$value = 'value';
170170
$ttl = 123;
171171
$client->expects('psetex')->with($prefix . $key, $ttl * 1000, $value)->once()->andReturn(resolve(true));
172-
self::assertSame(true, await(new Redis($client, $prefix)->setMultiple([$key => $value], $ttl))); /** @phpstan-ignore-line */
172+
self::assertSame(true, await(new Redis($client, $prefix)->setMultiple([$key => $value], $ttl)));
173173
}
174174

175175
#[Test]

0 commit comments

Comments
 (0)