Restructure some packages
This commit is contained in:
parent
560c50e027
commit
18a2d0d779
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "fwdekker/death-notifier",
|
"name": "fwdekker/death-notifier",
|
||||||
"description": "Get notified when a famous person dies.",
|
"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",
|
"type": "project",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://git.fwdekker.com/tools/death-notifier",
|
"homepage": "https://git.fwdekker.com/tools/death-notifier",
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "death-notifier",
|
"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.",
|
"description": "Get notified when a famous person dies.",
|
||||||
"author": "Florine W. Dekker",
|
"author": "Florine W. Dekker",
|
||||||
"browser": "dist/bundle.js",
|
"browser": "dist/bundle.js",
|
||||||
|
|
|
@ -6,14 +6,14 @@ use com\fwdekker\deathnotifier\Database;
|
||||||
use com\fwdekker\deathnotifier\EmulateCronCliAction;
|
use com\fwdekker\deathnotifier\EmulateCronCliAction;
|
||||||
use com\fwdekker\deathnotifier\mailer\Mailer;
|
use com\fwdekker\deathnotifier\mailer\Mailer;
|
||||||
use com\fwdekker\deathnotifier\mailer\ProcessEmailQueueCliAction;
|
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\Response;
|
||||||
use com\fwdekker\deathnotifier\StartSessionAction;
|
use com\fwdekker\deathnotifier\StartSessionAction;
|
||||||
use com\fwdekker\deathnotifier\trackings\AddTrackingAction;
|
use com\fwdekker\deathnotifier\tracking\AddTrackingAction;
|
||||||
use com\fwdekker\deathnotifier\trackings\ListTrackingsAction;
|
use com\fwdekker\deathnotifier\tracking\ListTrackingsAction;
|
||||||
use com\fwdekker\deathnotifier\trackings\RemoveTrackingAction;
|
use com\fwdekker\deathnotifier\tracking\RemoveTrackingAction;
|
||||||
use com\fwdekker\deathnotifier\trackings\TrackingManager;
|
use com\fwdekker\deathnotifier\tracking\TrackingManager;
|
||||||
use com\fwdekker\deathnotifier\trackings\UpdateTrackingsCliAction;
|
use com\fwdekker\deathnotifier\tracking\UpdateTrackingsCliAction;
|
||||||
use com\fwdekker\deathnotifier\user\GetUserDataAction;
|
use com\fwdekker\deathnotifier\user\GetUserDataAction;
|
||||||
use com\fwdekker\deathnotifier\user\LoginAction;
|
use com\fwdekker\deathnotifier\user\LoginAction;
|
||||||
use com\fwdekker\deathnotifier\user\LogoutAction;
|
use com\fwdekker\deathnotifier\user\LogoutAction;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace com\fwdekker\deathnotifier;
|
namespace com\fwdekker\deathnotifier;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\mailer\Mailer;
|
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 com\fwdekker\deathnotifier\user\UserManager;
|
||||||
use Composer\Semver\Comparator;
|
use Composer\Semver\Comparator;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\mailer;
|
namespace com\fwdekker\deathnotifier\mailer;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\trackings\NotifyArticleDeletedEmail;
|
use com\fwdekker\deathnotifier\tracking\NotifyArticleDeletedEmail;
|
||||||
use com\fwdekker\deathnotifier\trackings\NotifyArticleUndeletedEmail;
|
use com\fwdekker\deathnotifier\tracking\NotifyArticleUndeletedEmail;
|
||||||
use com\fwdekker\deathnotifier\trackings\NotifyStatusChangedEmail;
|
use com\fwdekker\deathnotifier\tracking\NotifyStatusChangedEmail;
|
||||||
use com\fwdekker\deathnotifier\user\ChangedEmailEmail;
|
use com\fwdekker\deathnotifier\user\ChangedEmailEmail;
|
||||||
use com\fwdekker\deathnotifier\user\ChangedPasswordEmail;
|
use com\fwdekker\deathnotifier\user\ChangedPasswordEmail;
|
||||||
use com\fwdekker\deathnotifier\user\RegisterEmail;
|
use com\fwdekker\deathnotifier\user\RegisterEmail;
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?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 Exception;
|
||||||
use Monolog\Logger;
|
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.
|
* Recursively merges arrays, while overwriting other types.
|
||||||
*
|
*
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\Action;
|
use com\fwdekker\deathnotifier\Action;
|
||||||
use com\fwdekker\deathnotifier\ActionException;
|
use com\fwdekker\deathnotifier\ActionException;
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\Action;
|
use com\fwdekker\deathnotifier\Action;
|
||||||
use com\fwdekker\deathnotifier\ActionException;
|
use com\fwdekker\deathnotifier\ActionException;
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\mailer\Email;
|
use com\fwdekker\deathnotifier\mailer\Email;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\mailer\Email;
|
use com\fwdekker\deathnotifier\mailer\Email;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\mailer\Email;
|
use com\fwdekker\deathnotifier\mailer\Email;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\Action;
|
use com\fwdekker\deathnotifier\Action;
|
||||||
use com\fwdekker\deathnotifier\ActionException;
|
use com\fwdekker\deathnotifier\ActionException;
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?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\Database;
|
||||||
use com\fwdekker\deathnotifier\mailer\Mailer;
|
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 com\fwdekker\deathnotifier\Response;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace com\fwdekker\deathnotifier\trackings;
|
namespace com\fwdekker\deathnotifier\tracking;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\CliAction;
|
use com\fwdekker\deathnotifier\CliAction;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace com\fwdekker\deathnotifier;
|
namespace com\fwdekker\deathnotifier;
|
||||||
|
|
||||||
use com\fwdekker\deathnotifier\mailer\Mailer;
|
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 com\fwdekker\deathnotifier\user\UserManager;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
|
Loading…
Reference in New Issue