Skip to content

Commit 4dd5143

Browse files
committed
Update dependencies, fix issues reported by latest PHPStan
1 parent ee9034a commit 4dd5143

File tree

11 files changed

+73
-68
lines changed

11 files changed

+73
-68
lines changed

composer.lock

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

src/Toolkit/Core/Legacy/IntrospectionClass.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,6 @@ function (int $a, int $b) use ($parents, $properties) {
613613
if (!in_array($property, $this->NormalisedKeys, true)) {
614614
continue;
615615
}
616-
if (!is_a($target, Relatable::class, true)) {
617-
continue;
618-
}
619616
switch ($type) {
620617
case Relatable::ONE_TO_ONE:
621618
$this->OneToOneRelationships[$property] = $target;

src/Toolkit/Core/Reflection/ClassReflection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,10 @@ public function getPropertyRelationships(): array
608608
[$this->getChildrenProperty(), Relatable::ONE_TO_MANY],
609609
] as [$property, $type]) {
610610
$name = $normaliser
611+
// @phpstan-ignore argument.type (PHPStan regression)
611612
? $normaliser($property, false)
612613
: $property;
614+
// @phpstan-ignore argument.type (PHPStan regression)
613615
$relationships[$name] = new PropertyRelationship($property, $type, $target);
614616
}
615617
$relationships = array_intersect_key($relationships, $declared);

src/Toolkit/Curler/Curler.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ static function ($handle, string $data) use (&$bodyIn): int {
12091209
self::$Handle = $handle;
12101210
$resetHandle = false;
12111211
} else {
1212+
$handle = self::$Handle;
12121213
$opt[\CURLOPT_URL] = (string) $uri;
12131214
$resetHandle = true;
12141215
}
@@ -1291,32 +1292,32 @@ static function ($handle, string $data) use (&$bodyIn): int {
12911292

12921293
if ($resetHandle || !$transfer) {
12931294
if ($resetHandle) {
1294-
curl_reset(self::$Handle);
1295+
curl_reset($handle);
12951296
$resetHandle = false;
12961297
}
12971298
$opt[\CURLOPT_HTTPHEADER] = $headers->getLines('%s: %s', '%s;');
1298-
curl_setopt_array(self::$Handle, $opt);
1299+
curl_setopt_array($handle, $opt);
12991300

13001301
if ($this->CookiesCacheKey !== null) {
13011302
// "If the name is an empty string, no cookies are loaded,
13021303
// but cookie handling is still enabled"
1303-
curl_setopt(self::$Handle, \CURLOPT_COOKIEFILE, '');
1304+
curl_setopt($handle, \CURLOPT_COOKIEFILE, '');
13041305
/** @var non-empty-string[] */
13051306
$cookies = $this->getCacheInstance()->getArray($this->CookiesCacheKey);
13061307
if ($cookies) {
13071308
foreach ($cookies as $cookie) {
1308-
curl_setopt(self::$Handle, \CURLOPT_COOKIELIST, $cookie);
1309+
curl_setopt($handle, \CURLOPT_COOKIELIST, $cookie);
13091310
}
13101311
}
13111312
}
13121313
}
13131314

13141315
$transfer++;
13151316

1316-
Event::dispatch(new CurlRequestEvent($this, self::$Handle, $request));
1317-
$result = curl_exec(self::$Handle);
1317+
Event::dispatch(new CurlRequestEvent($this, $handle, $request));
1318+
$result = curl_exec($handle);
13181319
if ($result === false) {
1319-
throw new CurlErrorException(curl_errno(self::$Handle), $request, $this->getCurlInfo());
1320+
throw new CurlErrorException(curl_errno($handle), $request, $this->getCurlInfo());
13201321
}
13211322

13221323
if (
@@ -1336,12 +1337,12 @@ static function ($handle, string $data) use (&$bodyIn): int {
13361337
$code = (int) $split[1];
13371338
$reason = $split[2] ?? null;
13381339
$response = new Response($code, $bodyIn, $headersIn, $reason, $version);
1339-
Event::dispatch(new CurlResponseEvent($this, self::$Handle, $request, $response));
1340+
Event::dispatch(new CurlResponseEvent($this, $handle, $request, $response));
13401341

13411342
if ($this->CookiesCacheKey !== null) {
13421343
$this->getCacheInstance()->set(
13431344
$this->CookiesCacheKey,
1344-
curl_getinfo(self::$Handle, \CURLINFO_COOKIELIST)
1345+
curl_getinfo($handle, \CURLINFO_COOKIELIST)
13451346
);
13461347
}
13471348

@@ -1397,7 +1398,7 @@ static function ($handle, string $data) use (&$bodyIn): int {
13971398
$resetHandle = true;
13981399
} else {
13991400
curl_setopt(
1400-
self::$Handle,
1401+
$handle,
14011402
\CURLOPT_URL,
14021403
// @phpstan-ignore argument.type
14031404
$opt[\CURLOPT_URL] = (string) $uri,

src/Toolkit/PHPDoc/Tag/AbstractTag.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ final protected function filterString(?string $value, string $name): ?string
265265
*/
266266
final protected function throw(string $message, ...$args): void
267267
{
268+
// @phpstan-ignore isset.initializedProperty (constructor may be overridden)
268269
if (isset($this->Tag)) {
269270
$message .= ' for @%s';
270271
$args[] = $this->Tag;

src/Toolkit/Sync/Command/CheckSyncProviderHeartbeat.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class CheckSyncProviderHeartbeat extends AbstractSyncCommand
1717
{
1818
/** @var string[] */
1919
private array $ProviderBasename = [];
20-
/** @var array<class-string<SyncProviderInterface>> */
20+
/** @var class-string[] */
2121
private array $Provider = [];
2222
private int $Ttl = 0;
2323
private bool $FailEarly = false;
@@ -105,12 +105,13 @@ protected function run(string ...$args)
105105
),
106106
));
107107
} else {
108+
/** @var SyncProviderInterface[] */
108109
$providers = array_values(array_map(
109110
function (string $providerClass) {
110111
if (is_a(
111112
$this->App->getClass($providerClass),
112113
SyncProviderInterface::class,
113-
true
114+
true,
114115
)) {
115116
if (!$this->App->has($providerClass)) {
116117
$this->App->singleton($providerClass);

0 commit comments

Comments
 (0)