Update deps; minor tweaks

This commit is contained in:
Daniel J. Summers 2024-07-19 08:25:08 -04:00
parent ff34bb9743
commit 9110643383
4 changed files with 42 additions and 41 deletions

71
src/composer.lock generated
View File

@ -107,11 +107,11 @@
}, },
{ {
"name": "bit-badger/pdo-document", "name": "bit-badger/pdo-document",
"version": "v1.0.0-beta2", "version": "v1.0.0-beta5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.bitbadger.solutions/bit-badger/pdo-document", "url": "https://git.bitbadger.solutions/bit-badger/pdo-document",
"reference": "50854275a8b39074966cf00370f30b3e68edc6e7" "reference": "1a37b009ea0fd5d5af5fee6b73c8f839484b4001"
}, },
"require": { "require": {
"ext-pdo": "*", "ext-pdo": "*",
@ -120,7 +120,8 @@
"phpoption/phpoption": "^1.9" "phpoption/phpoption": "^1.9"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^11" "phpunit/phpunit": "^11",
"square/pjson": "^0.5.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -155,20 +156,20 @@
"rss": "https://git.bitbadger.solutions/bit-badger/pdo-document.rss", "rss": "https://git.bitbadger.solutions/bit-badger/pdo-document.rss",
"source": "https://git.bitbadger.solutions/bit-badger/pdo-document" "source": "https://git.bitbadger.solutions/bit-badger/pdo-document"
}, },
"time": "2024-06-25T14:42:26+00:00" "time": "2024-07-04T17:16:04+00:00"
}, },
{ {
"name": "composer/semver", "name": "composer/semver",
"version": "3.4.0", "version": "3.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/semver.git", "url": "https://github.com/composer/semver.git",
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6",
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -220,7 +221,7 @@
"support": { "support": {
"irc": "ircs://irc.libera.chat:6697/composer", "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues", "issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.4.0" "source": "https://github.com/composer/semver/tree/3.4.2"
}, },
"funding": [ "funding": [
{ {
@ -236,7 +237,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-08-31T09:50:34+00:00" "time": "2024-07-12T11:35:52+00:00"
}, },
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
@ -302,22 +303,22 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.8.1", "version": "7.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "41042bc7ab002487b876a0683fc8dce04ddce104" "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/84ac2b2afc44e40d3e8e658a45d68d6d20437612",
"reference": "41042bc7ab002487b876a0683fc8dce04ddce104", "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"guzzlehttp/promises": "^1.5.3 || ^2.0.1", "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
"guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "guzzlehttp/psr7": "^2.7.0",
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0", "psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0" "symfony/deprecation-contracts": "^2.2 || ^3.0"
@ -328,9 +329,9 @@
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"ext-curl": "*", "ext-curl": "*",
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", "guzzle/client-integration-tests": "3.0.2",
"php-http/message-factory": "^1.1", "php-http/message-factory": "^1.1",
"phpunit/phpunit": "^8.5.36 || ^9.6.15", "phpunit/phpunit": "^8.5.39 || ^9.6.20",
"psr/log": "^1.1 || ^2.0 || ^3.0" "psr/log": "^1.1 || ^2.0 || ^3.0"
}, },
"suggest": { "suggest": {
@ -408,7 +409,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/guzzle/issues", "issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.8.1" "source": "https://github.com/guzzle/guzzle/tree/7.9.0"
}, },
"funding": [ "funding": [
{ {
@ -424,20 +425,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-12-03T20:35:24+00:00" "time": "2024-07-18T11:52:56+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "2.0.2", "version": "2.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8",
"reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -445,7 +446,7 @@
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.36 || ^9.6.15" "phpunit/phpunit": "^8.5.39 || ^9.6.20"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -491,7 +492,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/2.0.2" "source": "https://github.com/guzzle/promises/tree/2.0.3"
}, },
"funding": [ "funding": [
{ {
@ -507,20 +508,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-12-03T20:19:20+00:00" "time": "2024-07-18T10:29:17+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "2.6.2", "version": "2.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -535,8 +536,8 @@
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "^0.9", "http-interop/http-factory-tests": "0.9.0",
"phpunit/phpunit": "^8.5.36 || ^9.6.15" "phpunit/phpunit": "^8.5.39 || ^9.6.20"
}, },
"suggest": { "suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
@ -607,7 +608,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.6.2" "source": "https://github.com/guzzle/psr7/tree/2.7.0"
}, },
"funding": [ "funding": [
{ {
@ -623,7 +624,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-12-03T20:05:35+00:00" "time": "2024-07-18T11:15:46+00:00"
}, },
{ {
"name": "http-interop/http-factory-guzzle", "name": "http-interop/http-factory-guzzle",

View File

@ -60,7 +60,7 @@ class Request implements JsonSerializable
*/ */
public function isAnswered(): bool public function isAnswered(): bool
{ {
return $this->history[0]->action == RequestAction::Answered; return $this->history[0]->action === RequestAction::Answered;
} }
/** /**

View File

@ -29,15 +29,15 @@ switch ($_SERVER['REQUEST_METHOD']) {
$req = Request::byId($_PATCH['requestId'])->getOrCall(not_found(...)); $req = Request::byId($_PATCH['requestId'])->getOrCall(not_found(...));
$patch = []; $patch = [];
// update recurrence if changed // update recurrence if changed
if ($recurrence != $req->recurrence) { if ($recurrence !== $req->recurrence) {
$patch['recurrence'] = $recurrence; $patch['recurrence'] = $recurrence;
if ($recurrence->period == RecurrencePeriod::Immediate) { if ($recurrence->period === RecurrencePeriod::Immediate) {
RemoveFields::byId(Table::REQUEST, $req->id, ['showAfter']); RemoveFields::byId(Table::REQUEST, $req->id, ['showAfter']);
} }
} }
// append history // append history
$upd8Text = trim($_PATCH['requestText']); $upd8Text = trim($_PATCH['requestText']);
$text = $upd8Text == '' || $upd8Text == $req->currentText() ? null : $upd8Text; $text = empty($upd8Text) || $upd8Text === $req->currentText() ? null : $upd8Text;
array_unshift($req->history, new History($now->format('c'), RequestAction::from($_PATCH['status']), $text)); array_unshift($req->history, new History($now->format('c'), RequestAction::from($_PATCH['status']), $text));
$patch['history'] = $req->history; $patch['history'] = $req->history;
Patch::byId(Table::REQUEST, $req->id, $patch); Patch::byId(Table::REQUEST, $req->id, $patch);

View File

@ -33,7 +33,7 @@ Definition::ensureTable(Table::REQUEST);
Definition::ensureFieldIndex(Table::REQUEST, 'user', ['userId']); Definition::ensureFieldIndex(Table::REQUEST, 'user', ['userId']);
$_PATCH = []; $_PATCH = [];
if ($_SERVER['REQUEST_METHOD'] ?? '' == 'PATCH') parse_str(file_get_contents('php://input'), $_PATCH); if ($_SERVER['REQUEST_METHOD'] ?? '' === 'PATCH') parse_str(file_get_contents('php://input'), $_PATCH);
/** /**
* Return a 404 and exit * Return a 404 and exit
@ -78,7 +78,7 @@ function hide_modal(string $name): void
*/ */
function validate_request(string $id, array $methods, bool $redirect = true): Request function validate_request(string $id, array $methods, bool $redirect = true): Request
{ {
if (sizeof(array_filter($methods, fn($it) => $_SERVER['REQUEST_METHOD'] == $it)) == 0) not_found(); if (empty(array_filter($methods, fn($it) => $_SERVER['REQUEST_METHOD'] === $it))) not_found();
Auth::requireUser($redirect); Auth::requireUser($redirect);