WIP on option / PJson integration
This commit is contained in:
parent
3bb4be3127
commit
52ec3f819c
@ -4,11 +4,12 @@
|
|||||||
"php": ">=8.4",
|
"php": ">=8.4",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"ext-sqlite3": "*",
|
"ext-sqlite3": "*",
|
||||||
|
"auth0/auth0-php": "^8.11",
|
||||||
"bit-badger/pdo-document": "^2",
|
"bit-badger/pdo-document": "^2",
|
||||||
"guzzlehttp/guzzle": "^7.8",
|
"guzzlehttp/guzzle": "^7.8",
|
||||||
"guzzlehttp/psr7": "^2.6",
|
"guzzlehttp/psr7": "^2.6",
|
||||||
"http-interop/http-factory-guzzle": "^1.2",
|
"http-interop/http-factory-guzzle": "^1.2",
|
||||||
"auth0/auth0-php": "^8.11",
|
"square/pjson": "^0.5",
|
||||||
"vlucas/phpdotenv": "^5.6"
|
"vlucas/phpdotenv": "^5.6"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
238
src/composer.lock
generated
238
src/composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "bc1634b2de4b7620e11b44a3ab432290",
|
"content-hash": "b84c4d74a4f4681747b73de459e232c7",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "auth0/auth0-php",
|
"name": "auth0/auth0-php",
|
||||||
@ -994,40 +994,40 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/all",
|
"name": "psr-discovery/all",
|
||||||
"version": "1.0.1",
|
"version": "1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/all.git",
|
"url": "https://github.com/psr-discovery/all.git",
|
||||||
"reference": "e353ca0cac46b2e954f4a3ee3a13f0de8be7b87b"
|
"reference": "840bc0cde7d56e9296606f7a6f0cfc8301fda57d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/all/zipball/e353ca0cac46b2e954f4a3ee3a13f0de8be7b87b",
|
"url": "https://api.github.com/repos/psr-discovery/all/zipball/840bc0cde7d56e9296606f7a6f0cfc8301fda57d",
|
||||||
"reference": "e353ca0cac46b2e954f4a3ee3a13f0de8be7b87b",
|
"reference": "840bc0cde7d56e9296606f7a6f0cfc8301fda57d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/cache-implementations": "^1.0",
|
"psr-discovery/cache-implementations": "^1",
|
||||||
"psr-discovery/container-implementations": "^1.0",
|
"psr-discovery/container-implementations": "^1",
|
||||||
"psr-discovery/event-dispatcher-implementations": "^1.0",
|
"psr-discovery/event-dispatcher-implementations": "^1",
|
||||||
"psr-discovery/http-client-implementations": "^1.0",
|
"psr-discovery/http-client-implementations": "^1",
|
||||||
"psr-discovery/http-factory-implementations": "^1.0",
|
"psr-discovery/http-factory-implementations": "^1",
|
||||||
"psr-discovery/log-implementations": "^1.0"
|
"psr-discovery/log-implementations": "^1"
|
||||||
},
|
},
|
||||||
"type": "metapackage",
|
"type": "metapackage",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1059,26 +1059,26 @@
|
|||||||
"psr-6"
|
"psr-6"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/psr-discovery/all/tree/1.0.1"
|
"source": "https://github.com/psr-discovery/all/tree/1.2.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-04T21:20:17+00:00"
|
"time": "2024-12-05T17:59:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/cache-implementations",
|
"name": "psr-discovery/cache-implementations",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/cache-implementations.git",
|
"url": "https://github.com/psr-discovery/cache-implementations.git",
|
||||||
"reference": "ebede0af34a7fd3c5564809e659ee69c0ab85ff6"
|
"reference": "ba247db9da1289b5880bf1b28c4280c16370ea3e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/cache-implementations/zipball/ebede0af34a7fd3c5564809e659ee69c0ab85ff6",
|
"url": "https://api.github.com/repos/psr-discovery/cache-implementations/zipball/ba247db9da1289b5880bf1b28c4280c16370ea3e",
|
||||||
"reference": "ebede0af34a7fd3c5564809e659ee69c0ab85ff6",
|
"reference": "ba247db9da1289b5880bf1b28c4280c16370ea3e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/discovery": "^1.0",
|
"psr-discovery/discovery": "^1.0",
|
||||||
"psr/cache": "^1.0 | ^2.0 | ^3.0"
|
"psr/cache": "^1.0 | ^2.0 | ^3.0"
|
||||||
},
|
},
|
||||||
@ -1095,16 +1095,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1134,26 +1134,26 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/cache-implementations/issues",
|
"issues": "https://github.com/psr-discovery/cache-implementations/issues",
|
||||||
"source": "https://github.com/psr-discovery/cache-implementations/tree/1.1.1"
|
"source": "https://github.com/psr-discovery/cache-implementations/tree/1.2.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-04T21:22:36+00:00"
|
"time": "2024-12-05T17:55:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/container-implementations",
|
"name": "psr-discovery/container-implementations",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/container-implementations.git",
|
"url": "https://github.com/psr-discovery/container-implementations.git",
|
||||||
"reference": "728a452b32b0bb60c4bac43b18db2e3105bb8d7e"
|
"reference": "451bb93b473f194a2984c3e7ae0b162e44c55ba1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/container-implementations/zipball/728a452b32b0bb60c4bac43b18db2e3105bb8d7e",
|
"url": "https://api.github.com/repos/psr-discovery/container-implementations/zipball/451bb93b473f194a2984c3e7ae0b162e44c55ba1",
|
||||||
"reference": "728a452b32b0bb60c4bac43b18db2e3105bb8d7e",
|
"reference": "451bb93b473f194a2984c3e7ae0b162e44c55ba1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/discovery": "^1.0",
|
"psr-discovery/discovery": "^1.0",
|
||||||
"psr/container": "^1.0 | ^2.0"
|
"psr/container": "^1.0 | ^2.0"
|
||||||
},
|
},
|
||||||
@ -1170,16 +1170,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1207,27 +1207,27 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/container-implementations/issues",
|
"issues": "https://github.com/psr-discovery/container-implementations/issues",
|
||||||
"source": "https://github.com/psr-discovery/container-implementations/tree/1.1.1"
|
"source": "https://github.com/psr-discovery/container-implementations/tree/1.2.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-04T21:24:05+00:00"
|
"time": "2024-12-05T17:42:15+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/discovery",
|
"name": "psr-discovery/discovery",
|
||||||
"version": "1.1.2",
|
"version": "1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/discovery.git",
|
"url": "https://github.com/psr-discovery/discovery.git",
|
||||||
"reference": "f94a41c150efaffd6f4c23ef95e31cae7a83704f"
|
"reference": "636f67406eadd33a66a7e65b9f0e26abfd7614ac"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/discovery/zipball/f94a41c150efaffd6f4c23ef95e31cae7a83704f",
|
"url": "https://api.github.com/repos/psr-discovery/discovery/zipball/636f67406eadd33a66a7e65b9f0e26abfd7614ac",
|
||||||
"reference": "f94a41c150efaffd6f4c23ef95e31cae7a83704f",
|
"reference": "636f67406eadd33a66a7e65b9f0e26abfd7614ac",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"composer/semver": "^3.0",
|
"composer/semver": "^3.0",
|
||||||
"php": "^8.1"
|
"php": "^8.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "^3.14",
|
"friendsofphp/php-cs-fixer": "^3.14",
|
||||||
@ -1242,16 +1242,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1284,26 +1284,26 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/discovery/issues",
|
"issues": "https://github.com/psr-discovery/discovery/issues",
|
||||||
"source": "https://github.com/psr-discovery/discovery/tree/1.1.2"
|
"source": "https://github.com/psr-discovery/discovery/tree/1.2.0"
|
||||||
},
|
},
|
||||||
"time": "2024-08-09T07:04:30+00:00"
|
"time": "2024-12-05T16:59:22+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/event-dispatcher-implementations",
|
"name": "psr-discovery/event-dispatcher-implementations",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/event-dispatcher-implementations.git",
|
"url": "https://github.com/psr-discovery/event-dispatcher-implementations.git",
|
||||||
"reference": "9033bb984613703e4c4f795ef0657184dc1c70eb"
|
"reference": "8ccb36eca9c7a685d91316d1f64cff6253e38825"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/event-dispatcher-implementations/zipball/9033bb984613703e4c4f795ef0657184dc1c70eb",
|
"url": "https://api.github.com/repos/psr-discovery/event-dispatcher-implementations/zipball/8ccb36eca9c7a685d91316d1f64cff6253e38825",
|
||||||
"reference": "9033bb984613703e4c4f795ef0657184dc1c70eb",
|
"reference": "8ccb36eca9c7a685d91316d1f64cff6253e38825",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/discovery": "^1.0",
|
"psr-discovery/discovery": "^1.0",
|
||||||
"psr/event-dispatcher": "^1.0"
|
"psr/event-dispatcher": "^1.0"
|
||||||
},
|
},
|
||||||
@ -1320,16 +1320,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1357,26 +1357,26 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/event-dispatcher-implementations/issues",
|
"issues": "https://github.com/psr-discovery/event-dispatcher-implementations/issues",
|
||||||
"source": "https://github.com/psr-discovery/event-dispatcher-implementations/tree/1.1.1"
|
"source": "https://github.com/psr-discovery/event-dispatcher-implementations/tree/1.2.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-04T21:27:10+00:00"
|
"time": "2024-12-05T17:29:26+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/http-client-implementations",
|
"name": "psr-discovery/http-client-implementations",
|
||||||
"version": "1.2.0",
|
"version": "1.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/http-client-implementations.git",
|
"url": "https://github.com/psr-discovery/http-client-implementations.git",
|
||||||
"reference": "a05c54087d13504d8e48c27395fbab638fb0a114"
|
"reference": "3999d98e4fcbf099efeda07df82c59134f932ad8"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/http-client-implementations/zipball/a05c54087d13504d8e48c27395fbab638fb0a114",
|
"url": "https://api.github.com/repos/psr-discovery/http-client-implementations/zipball/3999d98e4fcbf099efeda07df82c59134f932ad8",
|
||||||
"reference": "a05c54087d13504d8e48c27395fbab638fb0a114",
|
"reference": "3999d98e4fcbf099efeda07df82c59134f932ad8",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/discovery": "^1.0",
|
"psr-discovery/discovery": "^1.0",
|
||||||
"psr/http-client": "^1.0"
|
"psr/http-client": "^1.0"
|
||||||
},
|
},
|
||||||
@ -1393,16 +1393,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1430,26 +1430,26 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/http-client-implementations/issues",
|
"issues": "https://github.com/psr-discovery/http-client-implementations/issues",
|
||||||
"source": "https://github.com/psr-discovery/http-client-implementations/tree/1.2.0"
|
"source": "https://github.com/psr-discovery/http-client-implementations/tree/1.4.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-16T05:29:47+00:00"
|
"time": "2024-12-05T18:08:01+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/http-factory-implementations",
|
"name": "psr-discovery/http-factory-implementations",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/http-factory-implementations.git",
|
"url": "https://github.com/psr-discovery/http-factory-implementations.git",
|
||||||
"reference": "4ee07ae795b794e61578db32b5422a780b01b833"
|
"reference": "3979e3d9a95bedd91c13e1de12c6e99a74c449d3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/http-factory-implementations/zipball/4ee07ae795b794e61578db32b5422a780b01b833",
|
"url": "https://api.github.com/repos/psr-discovery/http-factory-implementations/zipball/3979e3d9a95bedd91c13e1de12c6e99a74c449d3",
|
||||||
"reference": "4ee07ae795b794e61578db32b5422a780b01b833",
|
"reference": "3979e3d9a95bedd91c13e1de12c6e99a74c449d3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/discovery": "^1.1",
|
"psr-discovery/discovery": "^1.1",
|
||||||
"psr/http-factory": "^1.0"
|
"psr/http-factory": "^1.0"
|
||||||
},
|
},
|
||||||
@ -1466,16 +1466,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1503,26 +1503,26 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/http-factory-implementations/issues",
|
"issues": "https://github.com/psr-discovery/http-factory-implementations/issues",
|
||||||
"source": "https://github.com/psr-discovery/http-factory-implementations/tree/1.1.1"
|
"source": "https://github.com/psr-discovery/http-factory-implementations/tree/1.2.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-04T21:31:16+00:00"
|
"time": "2024-12-05T17:18:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr-discovery/log-implementations",
|
"name": "psr-discovery/log-implementations",
|
||||||
"version": "1.0.1",
|
"version": "1.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/psr-discovery/log-implementations.git",
|
"url": "https://github.com/psr-discovery/log-implementations.git",
|
||||||
"reference": "384894384663fa5e1b2186112fb8ffe3f81a0b22"
|
"reference": "8cc55fcaa6b7481244e491a005263459fdfc6cba"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/psr-discovery/log-implementations/zipball/384894384663fa5e1b2186112fb8ffe3f81a0b22",
|
"url": "https://api.github.com/repos/psr-discovery/log-implementations/zipball/8cc55fcaa6b7481244e491a005263459fdfc6cba",
|
||||||
"reference": "384894384663fa5e1b2186112fb8ffe3f81a0b22",
|
"reference": "8cc55fcaa6b7481244e491a005263459fdfc6cba",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"psr-discovery/discovery": "^1.0",
|
"psr-discovery/discovery": "^1.0",
|
||||||
"psr/log": "^1.0 | ^2.0 | ^3.0"
|
"psr/log": "^1.0 | ^2.0 | ^3.0"
|
||||||
},
|
},
|
||||||
@ -1539,16 +1539,16 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"merge-plugin": {
|
"merge-plugin": {
|
||||||
"ignore-duplicates": false,
|
|
||||||
"include": [
|
"include": [
|
||||||
"composer.local.json"
|
"composer.local.json"
|
||||||
],
|
],
|
||||||
|
"recurse": true,
|
||||||
|
"replace": true,
|
||||||
"merge-dev": true,
|
"merge-dev": true,
|
||||||
"merge-extra": false,
|
"merge-extra": false,
|
||||||
"merge-extra-deep": false,
|
|
||||||
"merge-scripts": false,
|
"merge-scripts": false,
|
||||||
"recurse": true,
|
"merge-extra-deep": false,
|
||||||
"replace": true
|
"ignore-duplicates": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1578,9 +1578,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/psr-discovery/log-implementations/issues",
|
"issues": "https://github.com/psr-discovery/log-implementations/issues",
|
||||||
"source": "https://github.com/psr-discovery/log-implementations/tree/1.0.1"
|
"source": "https://github.com/psr-discovery/log-implementations/tree/1.1.0"
|
||||||
},
|
},
|
||||||
"time": "2024-03-04T21:32:27+00:00"
|
"time": "2024-12-05T17:06:04+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/cache",
|
"name": "psr/cache",
|
||||||
@ -1988,6 +1988,54 @@
|
|||||||
},
|
},
|
||||||
"time": "2019-03-08T08:55:37+00:00"
|
"time": "2019-03-08T08:55:37+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "square/pjson",
|
||||||
|
"version": "v0.5.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/square/pjson.git",
|
||||||
|
"reference": "cf9f9a7810ad7287b30658f60c0bbbba80217319"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/square/pjson/zipball/cf9f9a7810ad7287b30658f60c0bbbba80217319",
|
||||||
|
"reference": "cf9f9a7810ad7287b30658f60c0bbbba80217319",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"orchestra/testbench": "^7.11",
|
||||||
|
"phpstan/phpstan": "^1.8",
|
||||||
|
"phpunit/phpunit": "^9.5",
|
||||||
|
"squizlabs/php_codesniffer": "^3.7",
|
||||||
|
"symfony/var-dumper": "^6.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Square\\Pjson\\": "src/",
|
||||||
|
"Square\\Pjson\\Tests\\": "tests/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Apache-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Seb",
|
||||||
|
"email": "sebastien@squareup.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Library for JSON <=> PHP model serialization / deserialization. Deserialize JSON directly into your object model PHP classes.",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/square/pjson/issues",
|
||||||
|
"source": "https://github.com/square/pjson/tree/v0.5.0"
|
||||||
|
},
|
||||||
|
"time": "2024-03-15T18:19:22+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v3.5.1",
|
"version": "v3.5.1",
|
||||||
|
@ -2,24 +2,46 @@
|
|||||||
|
|
||||||
namespace MyPrayerJournal\Domain;
|
namespace MyPrayerJournal\Domain;
|
||||||
|
|
||||||
use JsonSerializable;
|
use BitBadger\InspiredByFSharp\Option;
|
||||||
|
use Square\Pjson\{Json, JsonSerialize};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A record of an action taken on a request
|
* A record of an action taken on a request
|
||||||
*/
|
*/
|
||||||
class History implements JsonSerializable
|
class History
|
||||||
{
|
{
|
||||||
|
use JsonSerialize;
|
||||||
|
|
||||||
|
/** @var string The date/time this entry was made */
|
||||||
|
#[Json]
|
||||||
|
public string $asOf = '';
|
||||||
|
|
||||||
|
/** @var RequestAction The action taken for this history entry */
|
||||||
|
#[Json]
|
||||||
|
public RequestAction $action;
|
||||||
|
|
||||||
|
/** @var string|null The text for this history entry (optional) */
|
||||||
|
#[Json('text', omit_empty: true)]
|
||||||
|
private ?string $dbText {
|
||||||
|
get => $this->text->unwrap();
|
||||||
|
set { $this->text = Option::of($value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var Option<string> The text for this history entry */
|
||||||
|
public Option $text {
|
||||||
|
get => $this->text ?? Option::None();
|
||||||
|
set { $this->text = $value; }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $asOf The date/time this entry was made
|
* @param string $asOf The date/time this entry was made
|
||||||
* @param RequestAction $action The action taken for this history entry
|
* @param RequestAction $action The action taken for this history entry
|
||||||
* @param string|null $text The text for this history entry (optional)
|
* @param string|null $text The text for this history entry (optional)
|
||||||
*/
|
*/
|
||||||
public function __construct(public string $asOf, public RequestAction $action, public ?string $text = null) { }
|
public function __construct(string $asOf, RequestAction $action, ?string $text = null)
|
||||||
|
|
||||||
public function jsonSerialize(): mixed
|
|
||||||
{
|
{
|
||||||
$values = ['asOf' => $this->asOf, 'action' => $this->action->value];
|
$this->asOf = $asOf;
|
||||||
if (isset($this->text)) $values['text'] = $this->text;
|
$this->action = $action;
|
||||||
return $values;
|
$this->dbText = $text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,20 @@ namespace MyPrayerJournal\Domain;
|
|||||||
|
|
||||||
use BitBadger\InspiredByFSharp\Option;
|
use BitBadger\InspiredByFSharp\Option;
|
||||||
use BitBadger\PDODocument\DocumentException;
|
use BitBadger\PDODocument\DocumentException;
|
||||||
|
use Square\Pjson\{Json, JsonSerialize};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A note entered on a prayer request
|
* A note entered on a prayer request
|
||||||
*/
|
*/
|
||||||
class Note
|
class Note
|
||||||
{
|
{
|
||||||
|
use JsonSerialize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $asOf The date/time this note was recorded
|
* @param string $asOf The date/time this note was recorded
|
||||||
* @param string $text The text of the note
|
* @param string $text The text of the note
|
||||||
*/
|
*/
|
||||||
public function __construct(public string $asOf, public string $text) { }
|
public function __construct(#[Json] public string $asOf, #[Json] public string $text) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve notes for a given request
|
* Retrieve notes for a given request
|
||||||
|
@ -2,19 +2,46 @@
|
|||||||
|
|
||||||
namespace MyPrayerJournal\Domain;
|
namespace MyPrayerJournal\Domain;
|
||||||
|
|
||||||
|
use BitBadger\InspiredByFSharp\Option;
|
||||||
use DateInterval;
|
use DateInterval;
|
||||||
use JsonSerializable;
|
use Square\Pjson\{Json, JsonSerialize};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The recurrence for a prayer request
|
* The recurrence for a prayer request
|
||||||
*/
|
*/
|
||||||
class Recurrence implements JsonSerializable
|
class Recurrence
|
||||||
{
|
{
|
||||||
|
use JsonSerialize;
|
||||||
|
|
||||||
|
/** @var RecurrencePeriod The recurrence period */
|
||||||
|
#[Json]
|
||||||
|
public RecurrencePeriod $period {
|
||||||
|
get => $this->period ?? RecurrencePeriod::Immediate;
|
||||||
|
set { $this->period = $value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var int|null How many of the periods will pass before the request is visible again */
|
||||||
|
#[Json('interval', omit_empty: true)]
|
||||||
|
private ?int $dbInterval {
|
||||||
|
get => $this->interval->unwrap();
|
||||||
|
set { $this->interval = Option::of($value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var Option<int> How many of the periods will pass before the request is visible again */
|
||||||
|
public Option $interval {
|
||||||
|
get => $this->interval ?? Option::None();
|
||||||
|
set { $this->interval = $value; }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param RecurrencePeriod $period The recurrence period
|
* @param RecurrencePeriod $period The recurrence period
|
||||||
* @param int|null $interval How many of the periods will pass before the request is visible again
|
* @param int|null $interval How many of the periods will pass before the request is visible again
|
||||||
*/
|
*/
|
||||||
public function __construct(public RecurrencePeriod $period, public ?int $interval = null) { }
|
public function __construct(RecurrencePeriod $period, ?int $interval = null)
|
||||||
|
{
|
||||||
|
$this->period = $period;
|
||||||
|
$this->dbInterval = $interval;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the date/time interval for this recurrence
|
* Get the date/time interval for this recurrence
|
||||||
@ -25,17 +52,10 @@ class Recurrence implements JsonSerializable
|
|||||||
{
|
{
|
||||||
$period = match ($this->period) {
|
$period = match ($this->period) {
|
||||||
RecurrencePeriod::Immediate => 'T0S',
|
RecurrencePeriod::Immediate => 'T0S',
|
||||||
RecurrencePeriod::Hours => "T{$this->interval}H",
|
RecurrencePeriod::Hours => "T{$this->interval->value}H",
|
||||||
RecurrencePeriod::Days => "{$this->interval}D",
|
RecurrencePeriod::Days => "{$this->interval->value}D",
|
||||||
RecurrencePeriod::Weeks => ($this->interval * 7) . 'D'
|
RecurrencePeriod::Weeks => ($this->interval->value * 7) . 'D'
|
||||||
};
|
};
|
||||||
return new DateInterval("P$period");
|
return new DateInterval("P$period");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize(): mixed
|
|
||||||
{
|
|
||||||
$values = ['period' => $this->period->value];
|
|
||||||
if (isset($this->interval)) $values['interval'] = $this->interval;
|
|
||||||
return $values;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,71 +7,82 @@ use BitBadger\PDODocument\{Custom, DocumentException, DocumentList, Find};
|
|||||||
use BitBadger\PDODocument\Mapper\DocumentMapper;
|
use BitBadger\PDODocument\Mapper\DocumentMapper;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Exception;
|
use Exception;
|
||||||
use JsonSerializable;
|
|
||||||
use MyPrayerJournal\Table;
|
use MyPrayerJournal\Table;
|
||||||
|
use Square\Pjson\{Json, JsonSerialize};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A prayer request
|
* A prayer request
|
||||||
*/
|
*/
|
||||||
class Request implements JsonSerializable
|
class Request
|
||||||
{
|
{
|
||||||
/**
|
use JsonSerialize;
|
||||||
* @param string $id The ID for the request
|
|
||||||
* @param string $enteredOn The date/time this request was originally entered
|
|
||||||
* @param string $userId The ID of the user to whom this request belongs
|
|
||||||
* @param string|null $snoozedUntil The date/time the snooze expires for this request (null = not snoozed)
|
|
||||||
* @param string|null $showAfter The date/time the current recurrence period is over (null = immediate)
|
|
||||||
* @param Recurrence $recurrence The recurrence for this request
|
|
||||||
* @param History[] $history The history of this request
|
|
||||||
* @param Note[] $notes Notes regarding this request
|
|
||||||
* @throws Exception If the ID generation fails
|
|
||||||
*/
|
|
||||||
public function __construct(public string $id = '', public string $enteredOn = '', public string $userId = '',
|
|
||||||
public ?string $snoozedUntil = null, public ?string $showAfter = null,
|
|
||||||
public Recurrence $recurrence = new Recurrence(RecurrencePeriod::Immediate),
|
|
||||||
public array $history = [], public array $notes = []) { }
|
|
||||||
|
|
||||||
/**
|
/** @var string The ID for the request */
|
||||||
* Get the current text for this request
|
#[Json]
|
||||||
*
|
public string $id = '';
|
||||||
* @return string The most recent text for the request
|
|
||||||
*/
|
/** @var string The date/time this request was originally entered */
|
||||||
public function currentText(): string
|
#[Json]
|
||||||
{
|
public string $enteredOn = '';
|
||||||
foreach ($this->history as $hist) if (isset($hist->text)) return $hist->text;
|
|
||||||
return '';
|
/** @var string The ID of the user to whom this request belongs */
|
||||||
|
#[Json]
|
||||||
|
public string $userId = '';
|
||||||
|
|
||||||
|
/** @var string|null The date/time the snooze expires for this request (null = not snoozed) */
|
||||||
|
#[Json('snoozedUntil', omit_empty: true)]
|
||||||
|
private ?string $dbSnoozedUntil {
|
||||||
|
get => $this->snoozedUntil->unwrap();
|
||||||
|
set { $this->snoozedUntil = Option::of($value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @var Option<string> The date/time the snooze expires for this request (None = not snoozed) */
|
||||||
* Get the date/time this request was last marked as prayed
|
public Option $snoozedUntil {
|
||||||
*
|
get => $this->snoozedUntil ?? Option::None();
|
||||||
* @return string|null The date/time this request was last marked as prayed
|
set { $this->snoozedUntil = $value; }
|
||||||
*/
|
|
||||||
public function lastPrayed(): ?string
|
|
||||||
{
|
|
||||||
foreach ($this->history as $hist) if ($hist->action == RequestAction::Prayed) return $hist->asOf;
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @var string|null The date/time the current recurrence period is over (null = immediate) */
|
||||||
* Has this request been answered?
|
#[Json(omit_empty: true)]
|
||||||
*
|
public ?string $showAfter = null;
|
||||||
* @return bool True if the request is answered, false if not
|
|
||||||
*/
|
/** @var Recurrence The recurrence for this request */
|
||||||
public function isAnswered(): bool
|
#[Json]
|
||||||
{
|
public Recurrence $recurrence {
|
||||||
return $this->history[0]->action === RequestAction::Answered;
|
get => $this->recurrence ?? new Recurrence(RecurrencePeriod::Immediate);
|
||||||
|
set => $this->recurrence = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @var History[] The history of this request */
|
||||||
* Is this request currently snoozed?
|
#[Json(type: History::class)]
|
||||||
*
|
public array $history = [];
|
||||||
* @return bool True if the request is snoozed, false if not
|
|
||||||
* @throws Exception If the snoozed until date/time is not valid
|
/** @param Note[] $notes Notes regarding this request */
|
||||||
*/
|
#[Json(type: Note::class)]
|
||||||
public function isSnoozed(): bool
|
public array $notes = [];
|
||||||
{
|
|
||||||
return isset($this->snoozedUntil) && new DateTimeImmutable($this->snoozedUntil) > new DateTimeImmutable('now');
|
/** The current text for this request */
|
||||||
|
public string $currentText {
|
||||||
|
get => Option::of(array_find($this->history, fn(History $it) => $it->text->isSome))
|
||||||
|
->map(fn(History $it) => $it->text->value)
|
||||||
|
->getOrDefault('');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var Option<string> The date/time this request was last marked as prayed */
|
||||||
|
public Option $lastPrayed {
|
||||||
|
get => Option::of(array_find($this->history, fn(History $it) => $it->action === RequestAction::Prayed))
|
||||||
|
->map(fn(History $it) => $it->asOf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Has this request been answered? */
|
||||||
|
public bool $isAnswered {
|
||||||
|
get => $this->history[0]->action === RequestAction::Answered;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Is this request currently snoozed? */
|
||||||
|
public bool $isSnoozed {
|
||||||
|
get => $this->snoozedUntil->isSome
|
||||||
|
&& new DateTimeImmutable($this->snoozedUntil->value) > new DateTimeImmutable('now');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,28 +91,12 @@ class Request implements JsonSerializable
|
|||||||
* @return bool True if the request is pending, false if not
|
* @return bool True if the request is pending, false if not
|
||||||
* @throws Exception If the snoozed or show-after date/times are not valid
|
* @throws Exception If the snoozed or show-after date/times are not valid
|
||||||
*/
|
*/
|
||||||
public function isPending(): bool
|
public bool $isPending {
|
||||||
{
|
get => !$this->isSnoozed
|
||||||
return !$this->isSnoozed()
|
|
||||||
&& isset($this->showAfter)
|
&& isset($this->showAfter)
|
||||||
&& new DateTimeImmutable($this->showAfter) > new DateTimeImmutable('now');
|
&& new DateTimeImmutable($this->showAfter) > new DateTimeImmutable('now');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize(): mixed
|
|
||||||
{
|
|
||||||
$values = [
|
|
||||||
'id' => $this->id,
|
|
||||||
'enteredOn' => $this->enteredOn,
|
|
||||||
'userId' => $this->userId,
|
|
||||||
'recurrence' => $this->recurrence,
|
|
||||||
'history' => $this->history,
|
|
||||||
'notes' => $this->notes
|
|
||||||
];
|
|
||||||
if (isset($this->snoozedUntil)) $values['snoozedUntil'] = $this->snoozedUntil;
|
|
||||||
if (isset($this->showAfter)) $values['showAfter'] = $this->showAfter;
|
|
||||||
return $values;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a request by its ID
|
* Find a request by its ID
|
||||||
*
|
*
|
||||||
@ -112,7 +107,7 @@ class Request implements JsonSerializable
|
|||||||
public static function byId(string $id): Option
|
public static function byId(string $id): Option
|
||||||
{
|
{
|
||||||
return Find::byId(Table::REQUEST, $id, self::class)
|
return Find::byId(Table::REQUEST, $id, self::class)
|
||||||
->map(fn(Request $it) => $it->userId === $_SESSION['user_id'] ? Option::Some($it) : Option::None());
|
->map(fn(Request $it) => $it->userId === $_SESSION['user_id'] ? $it : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,13 +55,13 @@ class Component
|
|||||||
title="Mark as Prayed"><?=self::icon('done');?></button>
|
title="Mark as Prayed"><?=self::icon('done');?></button>
|
||||||
</div>
|
</div>
|
||||||
<div class=card-body>
|
<div class=card-body>
|
||||||
<p class=request-text><?=htmlentities($req->currentText());?>
|
<p class=request-text><?=htmlentities($req->currentText);?>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer text-end text-muted px-1 py-0">
|
<div class="card-footer text-end text-muted px-1 py-0">
|
||||||
<em><?php
|
<em><?php
|
||||||
$lastPrayed = $req->lastPrayed();
|
$lastPrayed = $req->lastPrayed;
|
||||||
echo 'last ' . (is_null($lastPrayed) ? 'activity': 'prayed') . ' '
|
echo 'last ' . $lastPrayed->map(fn() => 'prayed')->getOrDefault('activity') . ' '
|
||||||
. self::relativeDate($lastPrayed ?? $req->history[0]->asOf); ?>
|
. self::relativeDate($lastPrayed->getOrDefault($req->history[0]->asOf)); ?>
|
||||||
</em>
|
</em>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -135,26 +135,24 @@ class Component
|
|||||||
<div class="list-group-item px-0 d-flex flex-row align-items-start" id=req-<?=$req->id?>><?php
|
<div class="list-group-item px-0 d-flex flex-row align-items-start" id=req-<?=$req->id?>><?php
|
||||||
echo self::pageLink("/request/full?id=$req->id", self::icon('description'),
|
echo self::pageLink("/request/full?id=$req->id", self::icon('description'),
|
||||||
['class' => $btnClass, 'title' => 'View Full Request']);
|
['class' => $btnClass, 'title' => 'View Full Request']);
|
||||||
if (!$req->isAnswered()) {
|
if (!$req->isAnswered) {
|
||||||
echo self::pageLink("/request/edit?id=$req->id", self::icon('edit'),
|
echo self::pageLink("/request/edit?id=$req->id", self::icon('edit'),
|
||||||
['class' => $btnClass, 'title' => 'Edit Request']);
|
['class' => $btnClass, 'title' => 'Edit Request']);
|
||||||
}
|
}
|
||||||
if ($req->isSnoozed()) {
|
if ($req->isSnoozed) {
|
||||||
echo $restoreBtn($req->id, 'cancel-snooze', 'Cancel Snooze');
|
echo $restoreBtn($req->id, 'cancel-snooze', 'Cancel Snooze');
|
||||||
} elseif ($req->isPending()) {
|
} elseif ($req->isPending) {
|
||||||
echo $restoreBtn($req->id, 'show', 'Show Now');
|
echo $restoreBtn($req->id, 'show', 'Show Now');
|
||||||
}
|
}
|
||||||
echo '<p class="request-text mb-0">' . $req->currentText();
|
echo '<p class="request-text mb-0">' . htmlentities($req->currentText);
|
||||||
if ($req->isSnoozed() || $req->isPending() || $req->isAnswered()) { ?>
|
if ($req->isSnoozed || $req->isPending || $req->isAnswered) { ?>
|
||||||
<br>
|
<br>
|
||||||
<small class=text-muted><em><?php
|
<small class=text-muted><em><?php
|
||||||
if ($req->isSnoozed()) {
|
echo match (true) {
|
||||||
echo 'Snooze expires ' . self::relativeDate($req->snoozedUntil);
|
$req->isSnoozed => 'Snooze expires ' . self::relativeDate($req->snoozedUntil->value),
|
||||||
} elseif ($req->isPending()) {
|
$req->isPending => 'Request appears next ' . self::relativeDate($req->showAfter),
|
||||||
echo 'Request appears next ' . self::relativeDate($req->showAfter);
|
default => 'Answered ' . self::relativeDate($req->history[0]->asOf)
|
||||||
} else {
|
};?>
|
||||||
echo 'Answered ' . self::relativeDate($req->history[0]->asOf);
|
|
||||||
} ?>
|
|
||||||
</em></small><?php
|
</em></small><?php
|
||||||
} ?>
|
} ?>
|
||||||
</div><?php
|
</div><?php
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use BitBadger\InspiredByFSharp\Option;
|
||||||
use BitBadger\PDODocument\RemoveFields;
|
use BitBadger\PDODocument\RemoveFields;
|
||||||
use MyPrayerJournal\Table;
|
use MyPrayerJournal\Table;
|
||||||
use MyPrayerJournal\UI\{Component, Layout};
|
use MyPrayerJournal\UI\{Component, Layout};
|
||||||
@ -9,7 +10,7 @@ require '../../start.php';
|
|||||||
$req = validate_request($_GET['id'], ['PATCH'], false);
|
$req = validate_request($_GET['id'], ['PATCH'], false);
|
||||||
|
|
||||||
RemoveFields::byId(Table::REQUEST, $req->id, ['snoozedUntil']);
|
RemoveFields::byId(Table::REQUEST, $req->id, ['snoozedUntil']);
|
||||||
$req->snoozedUntil = null;
|
$req->snoozedUntil = Option::None();
|
||||||
|
|
||||||
// TODO: message
|
// TODO: message
|
||||||
Layout::bareHead();
|
Layout::bareHead();
|
||||||
|
@ -31,7 +31,7 @@ Layout::pageHead("$action Prayer Request");?>
|
|||||||
<input type=hidden name=returnTo value=<?=$cancelLink?>>
|
<input type=hidden name=returnTo value=<?=$cancelLink?>>
|
||||||
<div class="form-floating pb-3">
|
<div class="form-floating pb-3">
|
||||||
<textarea id=requestText name=requestText class=form-control style="min-height: 8rem;"
|
<textarea id=requestText name=requestText class=form-control style="min-height: 8rem;"
|
||||||
placeholder="Enter the text of the request" autofocus required><?=$req->currentText()?></textarea>
|
placeholder="Enter the text of the request" autofocus required><?=$req->currentText?></textarea>
|
||||||
<label for=requestText>Prayer Request</label>
|
<label for=requestText>Prayer Request</label>
|
||||||
</div><br><?php
|
</div><br><?php
|
||||||
if (!$isNew) { ?>
|
if (!$isNew) { ?>
|
||||||
@ -72,23 +72,23 @@ Layout::pageHead("$action Prayer Request");?>
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-floating mx-2">
|
<div class="form-floating mx-2">
|
||||||
<input type=number class=form-control id=recurCount name=recurCount placeholder=0 required
|
<input type=number class=form-control id=recurCount name=recurCount placeholder=0 required
|
||||||
value=<?=$req->recurrence->interval ?? 0?> style="width:6rem;"<?php
|
value=<?=$req->recurrence->interval->getOrDefault(0)?> style="width:6rem;"<?php
|
||||||
if ($req->recurrence->period == RecurrencePeriod::Immediate) echo ' disabled'; ?>>
|
if ($req->recurrence->period === RecurrencePeriod::Immediate) echo ' disabled'; ?>>
|
||||||
<label for=recurCount>Count</label>
|
<label for=recurCount>Count</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating mx-2">
|
<div class="form-floating mx-2">
|
||||||
<select class=form-control id=recurInterval name=recurInterval style="width:6rem;" required<?php
|
<select class=form-control id=recurInterval name=recurInterval style="width:6rem;" required<?php
|
||||||
if ($req->recurrence->period == RecurrencePeriod::Immediate) echo ' disabled'; ?>>
|
if ($req->recurrence->period === RecurrencePeriod::Immediate) echo ' disabled'; ?>>
|
||||||
<option value=<?=RecurrencePeriod::Hours->value?><?php
|
<option value=<?=RecurrencePeriod::Hours->value?><?php
|
||||||
if ($req->recurrence->period == RecurrencePeriod::Hours) echo ' selected'; ?>>
|
if ($req->recurrence->period === RecurrencePeriod::Hours) echo ' selected'; ?>>
|
||||||
hours
|
hours
|
||||||
</option>
|
</option>
|
||||||
<option value=<?=RecurrencePeriod::Days->value?><?php
|
<option value=<?=RecurrencePeriod::Days->value?><?php
|
||||||
if ($req->recurrence->period == RecurrencePeriod::Days) echo ' selected'; ?>>
|
if ($req->recurrence->period === RecurrencePeriod::Days) echo ' selected'; ?>>
|
||||||
days
|
days
|
||||||
</option>
|
</option>
|
||||||
<option value=<?=RecurrencePeriod::Weeks->value?><?php
|
<option value=<?=RecurrencePeriod::Weeks->value?><?php
|
||||||
if ($req->recurrence->period == RecurrencePeriod::Weeks) echo ' selected'; ?>>
|
if ($req->recurrence->period === RecurrencePeriod::Weeks) echo ' selected'; ?>>
|
||||||
weeks
|
weeks
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
@ -7,7 +7,7 @@ require '../../start.php';
|
|||||||
|
|
||||||
$req = validate_request($_GET['id'], ['GET']);
|
$req = validate_request($_GET['id'], ['GET']);
|
||||||
|
|
||||||
$answered = $req->isAnswered() ? new DateTimeImmutable($req->history[0]->asOf) : null;
|
$answered = $req->isAnswered ? new DateTimeImmutable($req->history[0]->asOf) : null;
|
||||||
$prayed = sizeof(array_filter($req->history, fn(History $hist) => $hist->action == RequestAction::Prayed));
|
$prayed = sizeof(array_filter($req->history, fn(History $hist) => $hist->action == RequestAction::Prayed));
|
||||||
$daysOpen =
|
$daysOpen =
|
||||||
(($answered ?? new DateTimeImmutable('now'))->getTimestamp()
|
(($answered ?? new DateTimeImmutable('now'))->getTimestamp()
|
||||||
@ -15,10 +15,10 @@ $daysOpen =
|
|||||||
|
|
||||||
$logs = array_merge(
|
$logs = array_merge(
|
||||||
array_map(fn(Note $note) => [new DateTimeImmutable($note->asOf), 'Notes', $note->text], $req->notes),
|
array_map(fn(Note $note) => [new DateTimeImmutable($note->asOf), 'Notes', $note->text], $req->notes),
|
||||||
array_map(fn(History $hist) => [new DateTimeImmutable($hist->asOf), $hist->action->value, $hist->text ?? ''],
|
array_map(fn(History $hist) => [new DateTimeImmutable($hist->asOf), $hist->action->value, $hist->text->getOrDefault('')],
|
||||||
$req->history));
|
$req->history));
|
||||||
usort($logs, fn($a, $b) => $a[0] > $b[0] ? -1 : 1);
|
usort($logs, fn($a, $b) => $a[0] > $b[0] ? -1 : 1);
|
||||||
if ($req->isAnswered()) array_shift($logs);
|
if ($req->isAnswered) array_shift($logs);
|
||||||
|
|
||||||
Layout::pageHead('Full Request');?>
|
Layout::pageHead('Full Request');?>
|
||||||
<article class="container mt-3">
|
<article class="container mt-3">
|
||||||
@ -32,7 +32,7 @@ Layout::pageHead('Full Request');?>
|
|||||||
} ?>
|
} ?>
|
||||||
Prayed <?=number_format($prayed)?> times • Open <?=number_format($daysOpen)?> days
|
Prayed <?=number_format($prayed)?> times • Open <?=number_format($daysOpen)?> days
|
||||||
</h6>
|
</h6>
|
||||||
<p class=card-text><?=htmlentities($req->currentText())?>
|
<p class=card-text><?=htmlentities($req->currentText)?>
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group list-group-flush"><?php
|
<ul class="list-group list-group-flush"><?php
|
||||||
foreach ($logs as $log) { ?>
|
foreach ($logs as $log) { ?>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use BitBadger\InspiredByFSharp\Option;
|
||||||
use BitBadger\PDODocument\{Document, Patch, RemoveFields};
|
use BitBadger\PDODocument\{Document, Patch, RemoveFields};
|
||||||
use MyPrayerJournal\{Auth, Table};
|
use MyPrayerJournal\{Auth, Table};
|
||||||
use MyPrayerJournal\Domain\{History, Recurrence, RecurrencePeriod, Request, RequestAction};
|
use MyPrayerJournal\Domain\{History, Recurrence, RecurrencePeriod, Request, RequestAction};
|
||||||
@ -12,16 +13,17 @@ Auth::requireUser(false);
|
|||||||
$now = new DateTimeImmutable('now');
|
$now = new DateTimeImmutable('now');
|
||||||
$recurrence = new Recurrence(RecurrencePeriod::from($_POST['recurType'] ?? $_PATCH['recurType']));
|
$recurrence = new Recurrence(RecurrencePeriod::from($_POST['recurType'] ?? $_PATCH['recurType']));
|
||||||
if ($recurrence->period <> RecurrencePeriod::Immediate) {
|
if ($recurrence->period <> RecurrencePeriod::Immediate) {
|
||||||
$recurrence->interval = (int)($_POST['recurCount'] ?? $_PATCH['recurCount']);
|
$recurrence->interval = Option::of((int)($_POST['recurCount'] ?? $_PATCH['recurCount']));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($_SERVER['REQUEST_METHOD']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
case 'POST':
|
case 'POST':
|
||||||
Document::insert(Table::REQUEST, new Request(
|
$req = new Request();
|
||||||
enteredOn: $now->format('c'),
|
$req->enteredOn = $now->format('c');
|
||||||
userId: $_SESSION['user_id'],
|
$req->userId = $_SESSION['user_id'];
|
||||||
recurrence: $recurrence,
|
$req->recurrence = $recurrence;
|
||||||
history: [new History($now->format('c'), RequestAction::Created, $_POST['requestText'])]));
|
$req->history = [new History($now->format('c'), RequestAction::Created, $_POST['requestText'])];
|
||||||
|
Document::insert(Table::REQUEST, $req);
|
||||||
//Messages.pushSuccess ctx "Added prayer request" "/journal"
|
//Messages.pushSuccess ctx "Added prayer request" "/journal"
|
||||||
see_other('/journal');
|
see_other('/journal');
|
||||||
|
|
||||||
@ -37,7 +39,7 @@ switch ($_SERVER['REQUEST_METHOD']) {
|
|||||||
}
|
}
|
||||||
// append history
|
// append history
|
||||||
$upd8Text = trim($_PATCH['requestText']);
|
$upd8Text = trim($_PATCH['requestText']);
|
||||||
$text = empty($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);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use MyPrayerJournal\Auth;
|
use MyPrayerJournal\Auth;
|
||||||
|
|
||||||
require '../../start.php';
|
require '../../../start.php';
|
||||||
if ($_SERVER['REQUEST_METHOD'] <> 'GET') not_found();
|
if ($_SERVER['REQUEST_METHOD'] <> 'GET') not_found();
|
||||||
|
|
||||||
Auth::logOn();
|
Auth::logOn();
|
@ -9,7 +9,7 @@ use MyPrayerJournal\Domain\Request;
|
|||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
/** The version of this application */
|
/** The version of this application */
|
||||||
const MPJ_VERSION = '4.0.0-beta1';
|
const MPJ_VERSION = '4.0.0-beta2';
|
||||||
|
|
||||||
(Dotenv::createImmutable(__DIR__))->load();
|
(Dotenv::createImmutable(__DIR__))->load();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user