WIP on PHP 8.4 conversion

This commit is contained in:
Daniel J. Summers 2024-12-05 18:23:11 -05:00
parent 9110643383
commit 3bb4be3127
16 changed files with 204 additions and 157 deletions

3
.gitignore vendored
View File

@ -5,3 +5,6 @@
# PHP ignore files # PHP ignore files
src/vendor src/vendor
src/.env src/.env
# databases
src/data/*.db

View File

@ -1,11 +1,10 @@
{ {
"name": "bit-badger/my-prayer-journal", "name": "bit-badger/my-prayer-journal",
"minimum-stability": "beta",
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"ext-pdo": "*", "ext-pdo": "*",
"ext-sqlite3": "*", "ext-sqlite3": "*",
"bit-badger/pdo-document": "^1", "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",

303
src/composer.lock generated
View File

@ -4,20 +4,20 @@
"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": "d03cca0e9df6892b1154d46aa43ddfe9", "content-hash": "bc1634b2de4b7620e11b44a3ab432290",
"packages": [ "packages": [
{ {
"name": "auth0/auth0-php", "name": "auth0/auth0-php",
"version": "8.11.1", "version": "8.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/auth0/auth0-PHP.git", "url": "https://github.com/auth0/auth0-PHP.git",
"reference": "5d132ad4b3b95c5d5d342d09088d469568bfa627" "reference": "3acf0f4d847f355eada5ac3f3336b175238c8ef1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/auth0/auth0-PHP/zipball/5d132ad4b3b95c5d5d342d09088d469568bfa627", "url": "https://api.github.com/repos/auth0/auth0-PHP/zipball/3acf0f4d847f355eada5ac3f3336b175238c8ef1",
"reference": "5d132ad4b3b95c5d5d342d09088d469568bfa627", "reference": "3acf0f4d847f355eada5ac3f3336b175238c8ef1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -32,19 +32,19 @@
"psr/http-message-implementation": "^1" "psr/http-message-implementation": "^1"
}, },
"require-dev": { "require-dev": {
"ergebnis/composer-normalize": "^2", "ergebnis/composer-normalize": "~2.43.0",
"friendsofphp/php-cs-fixer": "^3", "friendsofphp/php-cs-fixer": "~3.59.0",
"mockery/mockery": "^1", "mockery/mockery": "~1.6.0",
"pestphp/pest": "^2", "pestphp/pest": "~2.34.0",
"phpstan/phpstan": "^1", "phpstan/phpstan": "~1.11.0",
"phpstan/phpstan-strict-rules": "^1", "phpstan/phpstan-strict-rules": "~1.6.0",
"psr-mock/http": "^1", "psr-mock/http": "~1.0.0",
"rector/rector": "0.17.6", "rector/rector": "~0.17.0",
"spatie/ray": "^1", "spatie/ray": "~1.41.0",
"symfony/cache": "^4 || ^5 || ^6", "symfony/cache": "^4 || ^5 || ^6",
"symfony/event-dispatcher": "^4 || ^5 || ^6", "symfony/event-dispatcher": "^4 || ^5 || ^6",
"vimeo/psalm": "^5", "vimeo/psalm": "~5.25.0",
"wikimedia/composer-merge-plugin": "^2" "wikimedia/composer-merge-plugin": "~2.1.0"
}, },
"suggest": { "suggest": {
"psr/cache-implementation": "(PSR-6 Cache) Improve performance by avoiding making redundant network requests.", "psr/cache-implementation": "(PSR-6 Cache) Improve performance by avoiding making redundant network requests.",
@ -101,26 +101,72 @@
], ],
"support": { "support": {
"issues": "https://github.com/auth0/auth0-PHP/issues", "issues": "https://github.com/auth0/auth0-PHP/issues",
"source": "https://github.com/auth0/auth0-PHP/tree/8.11.1" "source": "https://github.com/auth0/auth0-PHP/tree/8.13.0"
}, },
"time": "2024-01-11T15:28:10+00:00" "time": "2024-11-15T11:08:53+00:00"
},
{
"name": "bit-badger/inspired-by-fsharp",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp",
"reference": "c61ff7a831f152f6f9d6cbd1d30604924fa5c83e"
},
"require": {
"php": ">=8.4"
},
"require-dev": {
"pestphp/pest": "^3.5",
"phpoption/phpoption": "^1"
},
"type": "library",
"autoload": {
"psr-4": {
"BitBadger\\InspiredByFSharp\\": "./src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel J. Summers",
"email": "daniel@bitbadger.solutions",
"homepage": "https://bitbadger.solutions",
"role": "Developer"
}
],
"description": "PHP utility classes whose functionality is inspired by their F# counterparts",
"keywords": [
"option",
"result"
],
"support": {
"email": "daniel@bitbadger.solutions",
"rss": "https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp.rss",
"source": "https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp"
},
"time": "2024-11-21T01:27:18+00:00"
}, },
{ {
"name": "bit-badger/pdo-document", "name": "bit-badger/pdo-document",
"version": "v1.0.0-beta5", "version": "v2.0.0",
"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": "1a37b009ea0fd5d5af5fee6b73c8f839484b4001" "reference": "85b461e44132894374265026d6cfe9923d1c17d9"
}, },
"require": { "require": {
"bit-badger/inspired-by-fsharp": "^2",
"ext-pdo": "*", "ext-pdo": "*",
"netresearch/jsonmapper": "^4", "netresearch/jsonmapper": "^4",
"php": ">=8.2", "php": ">=8.4"
"phpoption/phpoption": "^1.9"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^11", "pestphp/pest": "^3.2",
"phpstan/phpstan": "^1.12",
"square/pjson": "^0.5.0" "square/pjson": "^0.5.0"
}, },
"type": "library", "type": "library",
@ -152,32 +198,33 @@
"sqlite" "sqlite"
], ],
"support": { "support": {
"docs": "https://bitbadger.solutions/open-source/pdo-document/",
"email": "daniel@bitbadger.solutions", "email": "daniel@bitbadger.solutions",
"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-07-04T17:16:04+00:00" "time": "2024-11-21T03:45:17+00:00"
}, },
{ {
"name": "composer/semver", "name": "composer/semver",
"version": "3.4.2", "version": "3.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/semver.git", "url": "https://github.com/composer/semver.git",
"reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.2 || ^7.0 || ^8.0" "php": "^5.3.2 || ^7.0 || ^8.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.4", "phpstan/phpstan": "^1.11",
"symfony/phpunit-bridge": "^4.2 || ^5" "symfony/phpunit-bridge": "^3 || ^7"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -221,7 +268,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.2" "source": "https://github.com/composer/semver/tree/3.4.3"
}, },
"funding": [ "funding": [
{ {
@ -237,28 +284,28 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-12T11:35:52+00:00" "time": "2024-09-19T14:15:21+00:00"
}, },
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
"version": "v1.1.2", "version": "v1.1.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git", "url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" "reference": "3ba905c11371512af9d9bdd27d99b782216b6945"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945",
"reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", "reference": "3ba905c11371512af9d9bdd27d99b782216b6945",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.2" "phpoption/phpoption": "^1.9.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -287,7 +334,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues", "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2" "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3"
}, },
"funding": [ "funding": [
{ {
@ -299,20 +346,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-12T22:16:48+00:00" "time": "2024-07-20T21:45:45+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.9.0", "version": "7.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612" "reference": "d281ed313b989f213357e3be1a179f02196ac99b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/84ac2b2afc44e40d3e8e658a45d68d6d20437612", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
"reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612", "reference": "d281ed313b989f213357e3be1a179f02196ac99b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -409,7 +456,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.9.0" "source": "https://github.com/guzzle/guzzle/tree/7.9.2"
}, },
"funding": [ "funding": [
{ {
@ -425,20 +472,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-18T11:52:56+00:00" "time": "2024-07-24T11:22:20+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "2.0.3", "version": "2.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -492,7 +539,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.3" "source": "https://github.com/guzzle/promises/tree/2.0.4"
}, },
"funding": [ "funding": [
{ {
@ -508,7 +555,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-18T10:29:17+00:00" "time": "2024-10-17T10:06:22+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
@ -686,16 +733,16 @@
}, },
{ {
"name": "netresearch/jsonmapper", "name": "netresearch/jsonmapper",
"version": "v4.4.1", "version": "v4.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cweiske/jsonmapper.git", "url": "https://github.com/cweiske/jsonmapper.git",
"reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8e76efb98ee8b6afc54687045e1b8dba55ac76e5",
"reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -731,22 +778,22 @@
"support": { "support": {
"email": "cweiske@cweiske.de", "email": "cweiske@cweiske.de",
"issues": "https://github.com/cweiske/jsonmapper/issues", "issues": "https://github.com/cweiske/jsonmapper/issues",
"source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" "source": "https://github.com/cweiske/jsonmapper/tree/v4.5.0"
}, },
"time": "2024-01-31T06:18:54+00:00" "time": "2024-09-08T10:13:13+00:00"
}, },
{ {
"name": "php-http/discovery", "name": "php-http/discovery",
"version": "1.19.4", "version": "1.20.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-http/discovery.git", "url": "https://github.com/php-http/discovery.git",
"reference": "0700efda8d7526335132360167315fdab3aeb599" "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-http/discovery/zipball/0700efda8d7526335132360167315fdab3aeb599", "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d",
"reference": "0700efda8d7526335132360167315fdab3aeb599", "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -810,22 +857,22 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-http/discovery/issues", "issues": "https://github.com/php-http/discovery/issues",
"source": "https://github.com/php-http/discovery/tree/1.19.4" "source": "https://github.com/php-http/discovery/tree/1.20.0"
}, },
"time": "2024-03-29T13:00:05+00:00" "time": "2024-10-02T11:20:13+00:00"
}, },
{ {
"name": "php-http/multipart-stream-builder", "name": "php-http/multipart-stream-builder",
"version": "1.3.1", "version": "1.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-http/multipart-stream-builder.git", "url": "https://github.com/php-http/multipart-stream-builder.git",
"reference": "ed56da23b95949ae4747378bed8a5b61a2fdae24" "reference": "10086e6de6f53489cca5ecc45b6f468604d3460e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/ed56da23b95949ae4747378bed8a5b61a2fdae24", "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/10086e6de6f53489cca5ecc45b6f468604d3460e",
"reference": "ed56da23b95949ae4747378bed8a5b61a2fdae24", "reference": "10086e6de6f53489cca5ecc45b6f468604d3460e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -866,22 +913,22 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-http/multipart-stream-builder/issues", "issues": "https://github.com/php-http/multipart-stream-builder/issues",
"source": "https://github.com/php-http/multipart-stream-builder/tree/1.3.1" "source": "https://github.com/php-http/multipart-stream-builder/tree/1.4.2"
}, },
"time": "2024-06-10T14:51:55+00:00" "time": "2024-09-04T13:22:54+00:00"
}, },
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.2", "version": "1.9.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/schmittjoh/php-option.git", "url": "https://github.com/schmittjoh/php-option.git",
"reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54",
"reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -889,13 +936,13 @@
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"bamarni-bin": { "bamarni-bin": {
"bin-links": true, "bin-links": true,
"forward-command": true "forward-command": false
}, },
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.9-dev"
@ -931,7 +978,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/schmittjoh/php-option/issues", "issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.2" "source": "https://github.com/schmittjoh/php-option/tree/1.9.3"
}, },
"funding": [ "funding": [
{ {
@ -943,7 +990,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-12T21:59:55+00:00" "time": "2024-07-20T21:41:07+00:00"
}, },
{ {
"name": "psr-discovery/all", "name": "psr-discovery/all",
@ -1166,16 +1213,16 @@
}, },
{ {
"name": "psr-discovery/discovery", "name": "psr-discovery/discovery",
"version": "1.1.1", "version": "1.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/psr-discovery/discovery.git", "url": "https://github.com/psr-discovery/discovery.git",
"reference": "9fb31dca2030accd9d3de21fb8806478e9df5b2b" "reference": "f94a41c150efaffd6f4c23ef95e31cae7a83704f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/psr-discovery/discovery/zipball/9fb31dca2030accd9d3de21fb8806478e9df5b2b", "url": "https://api.github.com/repos/psr-discovery/discovery/zipball/f94a41c150efaffd6f4c23ef95e31cae7a83704f",
"reference": "9fb31dca2030accd9d3de21fb8806478e9df5b2b", "reference": "f94a41c150efaffd6f4c23ef95e31cae7a83704f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1237,9 +1284,9 @@
], ],
"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.1" "source": "https://github.com/psr-discovery/discovery/tree/1.1.2"
}, },
"time": "2024-03-04T21:26:05+00:00" "time": "2024-08-09T07:04:30+00:00"
}, },
{ {
"name": "psr-discovery/event-dispatcher-implementations", "name": "psr-discovery/event-dispatcher-implementations",
@ -1849,16 +1896,16 @@
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "3.0.0", "version": "3.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1893,9 +1940,9 @@
"psr-3" "psr-3"
], ],
"support": { "support": {
"source": "https://github.com/php-fig/log/tree/3.0.0" "source": "https://github.com/php-fig/log/tree/3.0.2"
}, },
"time": "2021-07-14T16:46:02+00:00" "time": "2024-09-11T13:17:53+00:00"
}, },
{ {
"name": "ralouphie/getallheaders", "name": "ralouphie/getallheaders",
@ -1943,16 +1990,16 @@
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
"version": "v3.5.0", "version": "v3.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git", "url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1990,7 +2037,7 @@
"description": "A generic function and convention to trigger deprecation notices", "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
}, },
"funding": [ "funding": [
{ {
@ -2006,24 +2053,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-04-18T09:32:20+00:00" "time": "2024-09-25T14:20:29+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540" "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540", "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"provide": { "provide": {
"ext-ctype": "*" "ext-ctype": "*"
@ -2069,7 +2116,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -2085,24 +2132,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T15:07:36+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"provide": { "provide": {
"ext-mbstring": "*" "ext-mbstring": "*"
@ -2149,7 +2196,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -2165,24 +2212,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-06-19T12:30:46+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-php80", "name": "symfony/polyfill-php80",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php80.git", "url": "https://github.com/symfony/polyfill-php80.git",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433" "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -2229,7 +2276,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -2245,27 +2292,27 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T15:07:36+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
"version": "v5.6.0", "version": "v5.6.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vlucas/phpdotenv.git", "url": "https://github.com/vlucas/phpdotenv.git",
"reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2",
"reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-pcre": "*", "ext-pcre": "*",
"graham-campbell/result-type": "^1.1.2", "graham-campbell/result-type": "^1.1.3",
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.2", "phpoption/phpoption": "^1.9.3",
"symfony/polyfill-ctype": "^1.24", "symfony/polyfill-ctype": "^1.24",
"symfony/polyfill-mbstring": "^1.24", "symfony/polyfill-mbstring": "^1.24",
"symfony/polyfill-php80": "^1.24" "symfony/polyfill-php80": "^1.24"
@ -2282,7 +2329,7 @@
"extra": { "extra": {
"bamarni-bin": { "bamarni-bin": {
"bin-links": true, "bin-links": true,
"forward-command": true "forward-command": false
}, },
"branch-alias": { "branch-alias": {
"dev-master": "5.6-dev" "dev-master": "5.6-dev"
@ -2317,7 +2364,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/vlucas/phpdotenv/issues", "issues": "https://github.com/vlucas/phpdotenv/issues",
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0" "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1"
}, },
"funding": [ "funding": [
{ {
@ -2329,17 +2376,17 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-12T22:43:29+00:00" "time": "2024-07-20T21:52:34+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
"aliases": [], "aliases": [],
"minimum-stability": "beta", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": [],
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=8.2", "php": ">=8.4",
"ext-pdo": "*", "ext-pdo": "*",
"ext-sqlite3": "*" "ext-sqlite3": "*"
}, },

View File

@ -10,14 +10,13 @@ require 'start.php';
echo 'Retrieving v3 requests...' . PHP_EOL; echo 'Retrieving v3 requests...' . PHP_EOL;
Configuration::resetPDO(); Configuration::resetPDO();
Configuration::$pdoDSN = 'pgsql:host=localhost;user=mpj;password=devpassword;dbname=mpj'; Configuration::useDSN('pgsql:host=localhost;user=mpj;password=devpassword;dbname=mpj');
$reqs = Custom::array('SELECT data FROM mpj.request', [], new ArrayMapper()); $reqs = Custom::array('SELECT data FROM mpj.request', [], new ArrayMapper());
echo 'Found ' . sizeof($reqs) . ' requests; migrating to v4...' . PHP_EOL; echo 'Found ' . sizeof($reqs) . ' requests; migrating to v4...' . PHP_EOL;
Configuration::resetPDO(); Configuration::resetPDO();
Configuration::$mode = Mode::SQLite; Configuration::useDSN('sqlite:./data/mpj.db');
Configuration::$pdoDSN = 'sqlite:./data/mpj.db';
Configuration::$autoId = AutoId::RandomString; Configuration::$autoId = AutoId::RandomString;
Configuration::$idStringLength = 12; Configuration::$idStringLength = 12;
@ -26,7 +25,7 @@ Definition::ensureTable(Table::REQUEST);
/** Convert dates to the same format */ /** Convert dates to the same format */
function convertDate(string $date): string function convertDate(string $date): string
{ {
return (new DateTimeImmutable($date))->format('c'); return new DateTimeImmutable($date)->format('c');
} }
foreach ($reqs as $reqJson) { foreach ($reqs as $reqJson) {

View File

@ -2,6 +2,7 @@
namespace MyPrayerJournal\Domain; namespace MyPrayerJournal\Domain;
use BitBadger\InspiredByFSharp\Option;
use BitBadger\PDODocument\DocumentException; use BitBadger\PDODocument\DocumentException;
/** /**
@ -24,7 +25,6 @@ class Note
*/ */
public static function byRequestId(string $id): array public static function byRequestId(string $id): array
{ {
$req = Request::byId($id); return Request::byId($id)->map(fn(Request $it) => Option::Some($it->notes))->getOrDefault([]);
return $req->isDefined() ? $req->get()->notes : [];
} }
} }

View File

@ -2,13 +2,13 @@
namespace MyPrayerJournal\Domain; namespace MyPrayerJournal\Domain;
use BitBadger\InspiredByFSharp\Option;
use BitBadger\PDODocument\{Custom, DocumentException, DocumentList, Find}; 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 JsonSerializable;
use MyPrayerJournal\Table; use MyPrayerJournal\Table;
use PhpOption\{None, Option};
/** /**
* A prayer request * A prayer request
@ -111,8 +111,8 @@ class Request implements JsonSerializable
*/ */
public static function byId(string $id): Option public static function byId(string $id): Option
{ {
$req = Find::byId(Table::REQUEST, $id, self::class); return Find::byId(Table::REQUEST, $id, self::class)
return ($req->getOrElse(new Request('x'))->userId == $_SESSION['user_id']) ? $req : None::create(); ->map(fn(Request $it) => $it->userId === $_SESSION['user_id'] ? Option::Some($it) : Option::None());
} }
/** /**
@ -187,7 +187,7 @@ class Request implements JsonSerializable
*/ */
public static function answered(): DocumentList public static function answered(): DocumentList
{ {
return self::forUser(false); return self::forUser(active: false);
} }
/** /**

View File

@ -8,5 +8,5 @@ namespace MyPrayerJournal;
class Table class Table
{ {
/** @var string The prayer request table used by myPrayerJournal */ /** @var string The prayer request table used by myPrayerJournal */
const REQUEST = 'request'; const string REQUEST = 'request';
} }

View File

@ -32,11 +32,11 @@ class Component
{ {
Layout::bareHead(); Layout::bareHead();
$reqs = Request::forJournal(); $reqs = Request::forJournal();
if ($reqs->hasItems()) { ?> if ($reqs->hasItems) { ?>
<section id=journalItems class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-3" hx-target=this <section id=journalItems class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-3" hx-target=this
hx-swap=outerHTML aria-label="Prayer Requests"><?php hx-swap=outerHTML aria-label="Prayer Requests"><?php
$spacer = '<span>&nbsp;</span>'; $spacer = '<span>&nbsp;</span>';
foreach ($reqs->items() as /** @var Request $req */ $req) { ?> foreach ($reqs->items as /** @var Request $req */ $req) { ?>
<div class=col> <div class=col>
<div class="card h-100"> <div class="card h-100">
<div class="card-header p-0 d-flex" role=toolbar> <div class="card-header p-0 d-flex" role=toolbar>
@ -169,7 +169,7 @@ class Component
public static function requestList(DocumentList $reqs): void public static function requestList(DocumentList $reqs): void
{ {
echo '<div class=list-group>'; echo '<div class=list-group>';
foreach ($reqs->items() as $req) self::requestItem($req); $reqs->iter(self::requestItem(...));
echo '</div>'; echo '</div>';
} }
} }

View File

@ -10,7 +10,7 @@ Layout::bareHead(); ?>
<form hx-patch="/request/snooze?id=<?=$req->id?>" hx-target=#journalItems hx-swap=outerHTML> <form hx-patch="/request/snooze?id=<?=$req->id?>" hx-target=#journalItems hx-swap=outerHTML>
<div class="form-floating pb-3"> <div class="form-floating pb-3">
<input type=date id=until name=until class=form-control <input type=date id=until name=until class=form-control
min="<?=(new DateTimeImmutable('now'))->format('Y-m-d')?>" required> min="<?=new DateTimeImmutable('now')->format('Y-m-d')?>" required>
<label for=until>Until</label> <label for=until>Until</label>
</div> </div>
<p class="text-end mb-0"><button type=submit class="btn btn-primary">Snooze</button> <p class="text-end mb-0"><button type=submit class="btn btn-primary">Snooze</button>

View File

@ -28,7 +28,7 @@ Layout::pageHead('Full Request');?>
<h6 class="card-subtitle text-muted mb-2"><?php <h6 class="card-subtitle text-muted mb-2"><?php
if (!is_null($answered)) { ?> if (!is_null($answered)) { ?>
Answered <?=$answered->format('F j, Y')?> Answered <?=$answered->format('F j, Y')?>
(<?= RelativeDate::between('now', $req->history[0]->asOf);?>) &bull;<?php (<?=RelativeDate::between('now', $req->history[0]->asOf);?>) &bull;<?php
} ?> } ?>
Prayed <?=number_format($prayed)?> times &bull; Open <?=number_format($daysOpen)?> days Prayed <?=number_format($prayed)?> times &bull; Open <?=number_format($daysOpen)?> days
</h6> </h6>

View File

@ -1,14 +1,14 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
use BitBadger\PDODocument\Patch; use BitBadger\PDODocument\Patch;
use MyPrayerJournal\Domain\Note;
use MyPrayerJournal\Table; use MyPrayerJournal\Table;
use MyPrayerJournal\Domain\Note;
require '../../start.php'; require '../../start.php';
$req = validate_request($_GET['id'], ['POST'], false); $req = validate_request($_GET['id'], ['POST'], false);
array_unshift($req->notes, new Note((new DateTimeImmutable('now'))->format('c'), $_POST['notes'])); array_unshift($req->notes, new Note(new DateTimeImmutable('now')->format('c'), $_POST['notes']));
Patch::byId(Table::REQUEST, $req->id, ['notes' => $req->notes]); Patch::byId(Table::REQUEST, $req->id, ['notes' => $req->notes]);
hide_modal('notes'); hide_modal('notes');

View File

@ -1,8 +1,8 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
use BitBadger\PDODocument\Patch; use BitBadger\PDODocument\Patch;
use MyPrayerJournal\Domain\{History, RecurrencePeriod, RequestAction};
use MyPrayerJournal\Table; use MyPrayerJournal\Table;
use MyPrayerJournal\Domain\{History, RecurrencePeriod, RequestAction};
use MyPrayerJournal\UI\Component; use MyPrayerJournal\UI\Component;
require '../../start.php'; require '../../start.php';

View File

@ -14,7 +14,7 @@ $reqs = Request::active();
Layout::pageHead('Active Requests'); ?> Layout::pageHead('Active Requests'); ?>
<article class="container mt-3"> <article class="container mt-3">
<h2 class=pb-3>Active Requests</h2><?php <h2 class=pb-3>Active Requests</h2><?php
if ($reqs->hasItems()) { if ($reqs->hasItems) {
Component::requestList($reqs); Component::requestList($reqs);
} else { } else {
Component::noResults('No Active Requests', '/journal', 'Return to your journal', Component::noResults('No Active Requests', '/journal', 'Return to your journal',

View File

@ -14,7 +14,7 @@ $reqs = Request::answered();
Layout::pageHead('Answered Requests'); ?> Layout::pageHead('Answered Requests'); ?>
<article class="container mt-3"> <article class="container mt-3">
<h2 class=pb-3>Answered Requests</h2><?php <h2 class=pb-3>Answered Requests</h2><?php
if ($reqs->hasItems()) { if ($reqs->hasItems) {
Component::requestList($reqs); Component::requestList($reqs);
} else { } else {
Component::noResults('No Answered Requests', '/journal', 'Return to your journal', <<<'TEXT' Component::noResults('No Answered Requests', '/journal', 'Return to your journal', <<<'TEXT'

View File

@ -14,7 +14,7 @@ $reqs = Request::snoozed();
Layout::pageHead('Snoozed Requests'); ?> Layout::pageHead('Snoozed Requests'); ?>
<article class="container mt-3"> <article class="container mt-3">
<h2 class=pb-3>Snoozed Requests</h2><?php <h2 class=pb-3>Snoozed Requests</h2><?php
if ($reqs->hasItems()) { if ($reqs->hasItems) {
Component::requestList($reqs); Component::requestList($reqs);
} else { } else {
Component::noResults('No Snoozed Requests', '/journal', 'Return to your journal', Component::noResults('No Snoozed Requests', '/journal', 'Return to your journal',

View File

@ -1,7 +1,7 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
use Auth0\SDK\Exception\ConfigurationException; use Auth0\SDK\Exception\ConfigurationException;
use BitBadger\PDODocument\{AutoId, Configuration, Definition, DocumentException, Mode}; use BitBadger\PDODocument\{AutoId, Configuration, Definition, DocumentException};
use Dotenv\Dotenv; use Dotenv\Dotenv;
use MyPrayerJournal\{Auth, Table}; use MyPrayerJournal\{Auth, Table};
use MyPrayerJournal\Domain\Request; use MyPrayerJournal\Domain\Request;
@ -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-alpha1'; const MPJ_VERSION = '4.0.0-beta1';
(Dotenv::createImmutable(__DIR__))->load(); (Dotenv::createImmutable(__DIR__))->load();
@ -24,8 +24,7 @@ if (php_sapi_name() != 'cli') {
$_REQUEST['time_zone'] = $_SERVER['HTTP_X_TIME_ZONE'] ?? 'Etc/UTC'; $_REQUEST['time_zone'] = $_SERVER['HTTP_X_TIME_ZONE'] ?? 'Etc/UTC';
} }
Configuration::$pdoDSN = 'sqlite:' . implode(DIRECTORY_SEPARATOR, [__DIR__, 'data', 'mpj.db']); Configuration::useDSN('sqlite:' . implode(DIRECTORY_SEPARATOR, [__DIR__, 'data', 'mpj.db']));
Configuration::$mode = Mode::SQLite;
Configuration::$autoId = AutoId::RandomString; Configuration::$autoId = AutoId::RandomString;
Configuration::$idStringLength = 12; Configuration::$idStringLength = 12;