Restructure some packages

This commit is contained in:
Florine W. Dekker 2022-12-01 20:52:16 +01:00
parent 560c50e027
commit 18a2d0d779
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
20 changed files with 89 additions and 73 deletions

View File

@ -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",

BIN
composer.lock generated

Binary file not shown.

BIN
package-lock.json generated

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "death-notifier",
"version": "0.15.2", "_comment_version": "Also update version in `composer.json`!",
"version": "0.15.3", "_comment_version": "Also update version in `composer.json`!",
"description": "Get notified when a famous person dies.",
"author": "Florine W. Dekker",
"browser": "dist/bundle.js",

View File

@ -6,14 +6,14 @@ use com\fwdekker\deathnotifier\Database;
use com\fwdekker\deathnotifier\EmulateCronCliAction;
use com\fwdekker\deathnotifier\mailer\Mailer;
use com\fwdekker\deathnotifier\mailer\ProcessEmailQueueCliAction;
use com\fwdekker\deathnotifier\Mediawiki;
use com\fwdekker\deathnotifier\mediawiki\Mediawiki;
use com\fwdekker\deathnotifier\Response;
use com\fwdekker\deathnotifier\StartSessionAction;
use com\fwdekker\deathnotifier\trackings\AddTrackingAction;
use com\fwdekker\deathnotifier\trackings\ListTrackingsAction;
use com\fwdekker\deathnotifier\trackings\RemoveTrackingAction;
use com\fwdekker\deathnotifier\trackings\TrackingManager;
use com\fwdekker\deathnotifier\trackings\UpdateTrackingsCliAction;
use com\fwdekker\deathnotifier\tracking\AddTrackingAction;
use com\fwdekker\deathnotifier\tracking\ListTrackingsAction;
use com\fwdekker\deathnotifier\tracking\RemoveTrackingAction;
use com\fwdekker\deathnotifier\tracking\TrackingManager;
use com\fwdekker\deathnotifier\tracking\UpdateTrackingsCliAction;
use com\fwdekker\deathnotifier\user\GetUserDataAction;
use com\fwdekker\deathnotifier\user\LoginAction;
use com\fwdekker\deathnotifier\user\LogoutAction;

View File

@ -3,7 +3,7 @@
namespace com\fwdekker\deathnotifier;
use com\fwdekker\deathnotifier\mailer\Mailer;
use com\fwdekker\deathnotifier\trackings\TrackingManager;
use com\fwdekker\deathnotifier\tracking\TrackingManager;
use com\fwdekker\deathnotifier\user\UserManager;
use Composer\Semver\Comparator;
use Monolog\Logger;

View File

@ -2,9 +2,9 @@
namespace com\fwdekker\deathnotifier\mailer;
use com\fwdekker\deathnotifier\trackings\NotifyArticleDeletedEmail;
use com\fwdekker\deathnotifier\trackings\NotifyArticleUndeletedEmail;
use com\fwdekker\deathnotifier\trackings\NotifyStatusChangedEmail;
use com\fwdekker\deathnotifier\tracking\NotifyArticleDeletedEmail;
use com\fwdekker\deathnotifier\tracking\NotifyArticleUndeletedEmail;
use com\fwdekker\deathnotifier\tracking\NotifyStatusChangedEmail;
use com\fwdekker\deathnotifier\user\ChangedEmailEmail;
use com\fwdekker\deathnotifier\user\ChangedPasswordEmail;
use com\fwdekker\deathnotifier\user\RegisterEmail;

View File

@ -0,0 +1,23 @@
<?php
namespace com\fwdekker\deathnotifier\mediawiki;
/**
* The type of Wikipedia article.
*/
enum ArticleType
{
/**
* A page about a real-life person.
*/
case Person;
/**
* A disambiguation page.
*/
case Disambiguation;
/**
* A page that is not one of the other types.
*/
case Other;
}

View File

@ -1,8 +1,8 @@
<?php
namespace com\fwdekker\deathnotifier;
namespace com\fwdekker\deathnotifier\mediawiki;
use com\fwdekker\deathnotifier\trackings\PersonStatus;
use com\fwdekker\deathnotifier\tracking\PersonStatus;
use Exception;
use Monolog\Logger;
@ -232,53 +232,6 @@ class Mediawiki
}
/**
* Output of a query request sent to Wikipedia's API.
*
* @template T the result type that is returned
*/
class QueryOutput
{
/**
* @var array<string, T> the results of the query, either raw from the API or processed in some way
*/
public readonly array $results;
/**
* @var array<string, string> 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<string, T> $results the results of the query, either raw from the API or processed in some way
* @param array<string, string> $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.
*

View File

@ -0,0 +1,40 @@
<?php
namespace com\fwdekker\deathnotifier\mediawiki;
/**
* Output of a query request sent to Wikipedia's API.
*
* @template T the result type that is returned
*/
class QueryOutput
{
/**
* @var array<string, T> the results of the query, either raw from the API or processed in some way
*/
public readonly array $results;
/**
* @var array<string, string> 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<string, T> $results the results of the query, either raw from the API or processed in some way
* @param array<string, string> $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;
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\Action;
use com\fwdekker\deathnotifier\ActionException;

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\Action;
use com\fwdekker\deathnotifier\ActionException;

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\mailer\Email;

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\mailer\Email;

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\mailer\Email;

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
/**

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\Action;
use com\fwdekker\deathnotifier\ActionException;

View File

@ -1,11 +1,11 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\ArticleType;
use com\fwdekker\deathnotifier\Database;
use com\fwdekker\deathnotifier\mailer\Mailer;
use com\fwdekker\deathnotifier\Mediawiki;
use com\fwdekker\deathnotifier\mediawiki\ArticleType;
use com\fwdekker\deathnotifier\mediawiki\Mediawiki;
use com\fwdekker\deathnotifier\Response;
use Exception;
use Monolog\Logger;

View File

@ -1,6 +1,6 @@
<?php
namespace com\fwdekker\deathnotifier\trackings;
namespace com\fwdekker\deathnotifier\tracking;
use com\fwdekker\deathnotifier\CliAction;

View File

@ -3,7 +3,7 @@
namespace com\fwdekker\deathnotifier;
use com\fwdekker\deathnotifier\mailer\Mailer;
use com\fwdekker\deathnotifier\trackings\TrackingManager;
use com\fwdekker\deathnotifier\tracking\TrackingManager;
use com\fwdekker\deathnotifier\user\UserManager;
use Exception;
use Monolog\Logger;