From 41250ea97d799ef91228ca6fbdf027b655907c06 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sat, 24 Jun 2023 18:37:25 +0200 Subject: [PATCH] Add stubs for gpodder (maybe it'll be useless) --- .php-cs-fixer.dist.php | 11 ++++- composer.json | 6 +++ composer.lock | 12 ++--- lib/AppInfo/Application.php | 3 +- lib/Controller/PageController.php | 3 +- psalm.xml | 1 + src/App.vue | 2 +- .../Core/EpisodeAction/EpisodeAction.php | 31 ++++++++++++ .../EpisodeAction/EpisodeActionReader.php | 17 +++++++ .../Core/EpisodeAction/EpisodeActionSaver.php | 10 ++++ .../Core/PodcastData/PodcastActionCounts.php | 22 +++++++++ .../Core/PodcastData/PodcastData.php | 47 +++++++++++++++++++ .../Core/PodcastData/PodcastDataReader.php | 16 +++++++ .../Core/PodcastData/PodcastMetrics.php | 28 +++++++++++ .../Core/PodcastData/PodcastMetricsReader.php | 15 ++++++ .../SubscriptionChange/SubscriptionChange.php | 14 ++++++ .../SubscriptionChangeRequestParser.php | 13 +++++ .../SubscriptionChangeSaver.php | 10 ++++ .../SubscriptionChangesReader.php | 13 +++++ 19 files changed, 264 insertions(+), 10 deletions(-) create mode 100644 stubs/OCA/GPodderSync/Core/EpisodeAction/EpisodeAction.php create mode 100644 stubs/OCA/GPodderSync/Core/EpisodeAction/EpisodeActionReader.php create mode 100644 stubs/OCA/GPodderSync/Core/EpisodeAction/EpisodeActionSaver.php create mode 100644 stubs/OCA/GPodderSync/Core/PodcastData/PodcastActionCounts.php create mode 100644 stubs/OCA/GPodderSync/Core/PodcastData/PodcastData.php create mode 100644 stubs/OCA/GPodderSync/Core/PodcastData/PodcastDataReader.php create mode 100644 stubs/OCA/GPodderSync/Core/PodcastData/PodcastMetrics.php create mode 100644 stubs/OCA/GPodderSync/Core/PodcastData/PodcastMetricsReader.php create mode 100644 stubs/OCA/GPodderSync/Core/SubscriptionChange/SubscriptionChange.php create mode 100644 stubs/OCA/GPodderSync/Core/SubscriptionChange/SubscriptionChangeRequestParser.php create mode 100644 stubs/OCA/GPodderSync/Core/SubscriptionChange/SubscriptionChangeSaver.php create mode 100644 stubs/OCA/GPodderSync/Core/SubscriptionChange/SubscriptionChangesReader.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index f7bbdd8..3087b82 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,7 +6,16 @@ require_once './vendor/autoload.php'; use Nextcloud\CodingStandard\Config; -$config = new Config(); +class MyConfig extends Config { + public function getRules(): array + { + $rules = parent::getRules(); + $rules['curly_braces_position']['classes_opening_brace'] = 'next_line_unless_newline_at_signature_end'; + return $rules; + } +} + +$config = new MyConfig(); $config ->getFinder() ->ignoreVCSIgnored(true) diff --git a/composer.json b/composer.json index eec5845..3bb2907 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,12 @@ "psalm:check": "psalm.phar --threads=1 --no-cache --show-info=true", "psalm:fix": "psalm.phar --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType" }, + "autoload": { + "psr-4": { + "OCA\\RePod\\": "lib/", + "OCA\\GPodderSync\\": "stubs/OCA/GPodderSync/" + } + }, "config": { "platform": { "php": "8.0" diff --git a/composer.lock b/composer.lock index f9caed9..8a55e84 100644 --- a/composer.lock +++ b/composer.lock @@ -94,16 +94,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.18.0", + "version": "v3.19.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "a517e03dd0727336e502e071cc08e406ac878dba" + "reference": "80586ec0e69fb4216edf4e8f830869a3e28d962d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/a517e03dd0727336e502e071cc08e406ac878dba", - "reference": "a517e03dd0727336e502e071cc08e406ac878dba", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/80586ec0e69fb4216edf4e8f830869a3e28d962d", + "reference": "80586ec0e69fb4216edf4e8f830869a3e28d962d", "shasum": "" }, "require": { @@ -140,9 +140,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.18.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.19.0" }, - "time": "2023-06-18T22:26:36+00:00" + "time": "2023-06-24T11:07:33+00:00" }, { "name": "psalm/phar", diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index e3713ad..cbf10a1 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -6,7 +6,8 @@ namespace OCA\RePod\AppInfo; use OCP\AppFramework\App; -class Application extends App { +class Application extends App +{ public const APP_ID = 'repod'; public function __construct() { diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index d95623d..5dcce06 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -10,7 +10,8 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\IRequest; use OCP\Util; -class PageController extends Controller { +class PageController extends Controller +{ public function __construct(IRequest $request) { parent::__construct(Application::APP_ID, $request); } diff --git a/psalm.xml b/psalm.xml index 1005f1b..6584df1 100644 --- a/psalm.xml +++ b/psalm.xml @@ -10,6 +10,7 @@ > + diff --git a/src/App.vue b/src/App.vue index 29a328d..e0501e9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@