From 18a2d0d7795f3aca3c832aa86fac19ee9981aa1f Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Thu, 1 Dec 2022 20:52:16 +0100 Subject: [PATCH] Restructure some packages --- composer.json | 2 +- composer.lock | Bin 77196 -> 77196 bytes package-lock.json | Bin 226174 -> 226174 bytes package.json | 2 +- src/main/api.php | 12 ++--- .../com/fwdekker/deathnotifier/Database.php | 2 +- .../fwdekker/deathnotifier/mailer/Email.php | 6 +-- .../deathnotifier/mediawiki/ArticleType.php | 23 ++++++++ .../{ => mediawiki}/Mediawiki.php | 51 +----------------- .../deathnotifier/mediawiki/QueryOutput.php | 40 ++++++++++++++ .../AddTrackingAction.php | 2 +- .../ListTrackingsAction.php | 2 +- .../NotifyArticleDeletedEmail.php | 2 +- .../NotifyArticleUndeletedEmail.php | 2 +- .../NotifyStatusChangedEmail.php | 2 +- .../{trackings => tracking}/PersonStatus.php | 2 +- .../RemoveTrackingAction.php | 2 +- .../TrackingManager.php | 6 +-- .../UpdateTrackingsCliAction.php | 2 +- .../deathnotifier/DatabaseTestCase.php | 2 +- 20 files changed, 89 insertions(+), 73 deletions(-) create mode 100644 src/main/php/com/fwdekker/deathnotifier/mediawiki/ArticleType.php rename src/main/php/com/fwdekker/deathnotifier/{ => mediawiki}/Mediawiki.php (88%) create mode 100644 src/main/php/com/fwdekker/deathnotifier/mediawiki/QueryOutput.php rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/AddTrackingAction.php (96%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/ListTrackingsAction.php (94%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/NotifyArticleDeletedEmail.php (97%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/NotifyArticleUndeletedEmail.php (97%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/NotifyStatusChangedEmail.php (97%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/PersonStatus.php (81%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/RemoveTrackingAction.php (95%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/TrackingManager.php (99%) rename src/main/php/com/fwdekker/deathnotifier/{trackings => tracking}/UpdateTrackingsCliAction.php (95%) diff --git a/composer.json b/composer.json index 1f6811d..a9d9e87 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "fwdekker/death-notifier", "description": "Get notified when a famous person dies.", - "version": "0.15.2", "_comment_version": "Also update version in `package.json`!", + "version": "0.15.3", "_comment_version": "Also update version in `package.json`!", "type": "project", "license": "MIT", "homepage": "https://git.fwdekker.com/tools/death-notifier", diff --git a/composer.lock b/composer.lock index 1a78606dbed3b934b0bcbb47556a16297ab8234a..d66640ae31ec86b6582f9a29f77abba50748c1f1 100644 GIT binary patch delta 51 zcmeCV&C+w5WrHxIf=RMjl8I%qabjAkftiJ+xuKb the results of the query, either raw from the API or processed in some way - */ - public readonly array $results; - /** - * @var array mapping of queried names to normalized/redirected names - */ - public readonly array $redirects; - /** - * @var string[] list of missing articles - */ - public readonly array $missing; - - - /** - * Constructs a new query output. - * - * @param array $results the results of the query, either raw from the API or processed in some way - * @param array $redirects mapping of queried names to normalized/redirected names - * @param string[] $missing list of missing articles - */ - public function __construct(array $results, array $redirects, array $missing) - { - $this->results = $results; - $this->redirects = $redirects; - $this->missing = $missing; - } -} - -/** - * The type of Wikipedia article. - */ -enum ArticleType -{ - case Person; - case Disambiguation; - case Other; -} - - /** * Recursively merges arrays, while overwriting other types. * diff --git a/src/main/php/com/fwdekker/deathnotifier/mediawiki/QueryOutput.php b/src/main/php/com/fwdekker/deathnotifier/mediawiki/QueryOutput.php new file mode 100644 index 0000000..409b1e7 --- /dev/null +++ b/src/main/php/com/fwdekker/deathnotifier/mediawiki/QueryOutput.php @@ -0,0 +1,40 @@ + the results of the query, either raw from the API or processed in some way + */ + public readonly array $results; + /** + * @var array mapping of queried names to normalized/redirected names + */ + public readonly array $redirects; + /** + * @var string[] list of missing articles + */ + public readonly array $missing; + + + /** + * Constructs a new query output. + * + * @param array $results the results of the query, either raw from the API or processed in some way + * @param array $redirects mapping of queried names to normalized/redirected names + * @param string[] $missing list of missing articles + */ + public function __construct(array $results, array $redirects, array $missing) + { + $this->results = $results; + $this->redirects = $redirects; + $this->missing = $missing; + } +} diff --git a/src/main/php/com/fwdekker/deathnotifier/trackings/AddTrackingAction.php b/src/main/php/com/fwdekker/deathnotifier/tracking/AddTrackingAction.php similarity index 96% rename from src/main/php/com/fwdekker/deathnotifier/trackings/AddTrackingAction.php rename to src/main/php/com/fwdekker/deathnotifier/tracking/AddTrackingAction.php index 6dcd50c..8615eb8 100644 --- a/src/main/php/com/fwdekker/deathnotifier/trackings/AddTrackingAction.php +++ b/src/main/php/com/fwdekker/deathnotifier/tracking/AddTrackingAction.php @@ -1,6 +1,6 @@