Add type annotations to fix Intelephense type checking errors
This commit is contained in:
@@ -38,6 +38,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|||||||
if ($proofExpiry > 0 && time() > $proofExpiry) {
|
if ($proofExpiry > 0 && time() > $proofExpiry) {
|
||||||
unset($proofs[$code]);
|
unset($proofs[$code]);
|
||||||
[$fp, $allProofs] = read_json_locked($dbFile);
|
[$fp, $allProofs] = read_json_locked($dbFile);
|
||||||
|
/** @var array<string, mixed> $allProofs */
|
||||||
if (isset($allProofs[$code])) {
|
if (isset($allProofs[$code])) {
|
||||||
unset($allProofs[$code]);
|
unset($allProofs[$code]);
|
||||||
write_json_locked($fp, $allProofs);
|
write_json_locked($fp, $allProofs);
|
||||||
|
|||||||
1
s.php
1
s.php
@@ -38,6 +38,7 @@ if ($expiryTs > 0 && time() > $expiryTs) {
|
|||||||
require_once __DIR__ . '/api/_helpers.php';
|
require_once __DIR__ . '/api/_helpers.php';
|
||||||
// Delete expired URL
|
// Delete expired URL
|
||||||
[$fp, $urls] = read_json_locked(__DIR__ . '/data/urls.json');
|
[$fp, $urls] = read_json_locked(__DIR__ . '/data/urls.json');
|
||||||
|
/** @var array<string, mixed> $urls */
|
||||||
if (isset($urls[$code])) {
|
if (isset($urls[$code])) {
|
||||||
unset($urls[$code]);
|
unset($urls[$code]);
|
||||||
write_json_locked($fp, $urls);
|
write_json_locked($fp, $urls);
|
||||||
|
|||||||
Reference in New Issue
Block a user