Compare commits

..

No commits in common. "version4" and "4.0.0-alpha1" have entirely different histories.

4 changed files with 41 additions and 42 deletions

71
src/composer.lock generated
View File

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

View File

@ -60,7 +60,7 @@ class Request implements JsonSerializable
*/
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(...));
$patch = [];
// update recurrence if changed
if ($recurrence !== $req->recurrence) {
if ($recurrence != $req->recurrence) {
$patch['recurrence'] = $recurrence;
if ($recurrence->period === RecurrencePeriod::Immediate) {
if ($recurrence->period == RecurrencePeriod::Immediate) {
RemoveFields::byId(Table::REQUEST, $req->id, ['showAfter']);
}
}
// append history
$upd8Text = trim($_PATCH['requestText']);
$text = empty($upd8Text) || $upd8Text === $req->currentText() ? null : $upd8Text;
$text = $upd8Text == '' || $upd8Text == $req->currentText() ? null : $upd8Text;
array_unshift($req->history, new History($now->format('c'), RequestAction::from($_PATCH['status']), $text));
$patch['history'] = $req->history;
Patch::byId(Table::REQUEST, $req->id, $patch);

View File

@ -33,7 +33,7 @@ Definition::ensureTable(Table::REQUEST);
Definition::ensureFieldIndex(Table::REQUEST, 'user', ['userId']);
$_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
@ -78,7 +78,7 @@ function hide_modal(string $name): void
*/
function validate_request(string $id, array $methods, bool $redirect = true): Request
{
if (empty(array_filter($methods, fn($it) => $_SERVER['REQUEST_METHOD'] === $it))) not_found();
if (sizeof(array_filter($methods, fn($it) => $_SERVER['REQUEST_METHOD'] == $it)) == 0) not_found();
Auth::requireUser($redirect);