diff --git a/.phan/config.php b/.phan/config.php index a4663fd197680..3557073cdff62 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -49,8 +49,8 @@ // // Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist. // (See `backward_compatibility_checks` for additional options) - // Automatically inferred from composer.json requirement for "php" of "^7.2.5" - 'target_php_version' => '7.2', + // Automatically inferred from composer.json requirement for "php" of "^8.1.0" + 'target_php_version' => '8.1', // If enabled, missing properties will be created when // they are first seen. If false, we'll report an diff --git a/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php index 06ea8e62e3f36..d8c59f78322b8 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php @@ -31,7 +31,7 @@ class FieldsListPlugin extends FieldsPlugin * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php index 0442101057f92..4aa87df598cfc 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php @@ -201,7 +201,7 @@ public function onCustomFieldsGetTypes() * @param \stdclass $item The item. * @param \stdclass $field The field. * - * @return string + * @return ?string * * @since 3.7.0 */ @@ -235,7 +235,7 @@ public function onCustomFieldsPrepareField($context, $item, $field) * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/libraries/src/Changelog/Changelog.php b/libraries/src/Changelog/Changelog.php index 93008a661b677..fd8c894bdcc0c 100644 --- a/libraries/src/Changelog/Changelog.php +++ b/libraries/src/Changelog/Changelog.php @@ -122,7 +122,7 @@ class Changelog /** * Resource handle for the XML Parser * - * @var resource + * @var \XMLParser * @since 4.0.0 */ protected $xmlParser; diff --git a/libraries/src/Image/Image.php b/libraries/src/Image/Image.php index 17c0ef861269e..5c29558261de3 100644 --- a/libraries/src/Image/Image.php +++ b/libraries/src/Image/Image.php @@ -137,7 +137,7 @@ public function __construct($source = null) /** * Get the image resource handle * - * @return resource + * @return \GdImage * * @since 3.8.0 * @throws \LogicException if an image has not been loaded into the instance diff --git a/libraries/src/Image/ImageFilter.php b/libraries/src/Image/ImageFilter.php index e16a990a5cc60..2d7d2f15bf57a 100644 --- a/libraries/src/Image/ImageFilter.php +++ b/libraries/src/Image/ImageFilter.php @@ -21,7 +21,7 @@ abstract class ImageFilter { /** - * @var resource The image resource handle. + * @var \GdImage The image resource handle. * @since 2.5.0 */ protected $handle; diff --git a/libraries/src/Updater/Update.php b/libraries/src/Updater/Update.php index 82df28b09dea1..76baad13cc1c9 100644 --- a/libraries/src/Updater/Update.php +++ b/libraries/src/Updater/Update.php @@ -176,7 +176,7 @@ class Update /** * Resource handle for the XML Parser * - * @var resource + * @var \XMLParser * @since 3.0.0 */ protected $xmlParser; diff --git a/libraries/src/Updater/UpdateAdapter.php b/libraries/src/Updater/UpdateAdapter.php index 009f5cf1ea010..293115c154053 100644 --- a/libraries/src/Updater/UpdateAdapter.php +++ b/libraries/src/Updater/UpdateAdapter.php @@ -32,7 +32,7 @@ abstract class UpdateAdapter extends AdapterInstance /** * Resource handle for the XML Parser * - * @var resource + * @var \XMLParser * @since 3.0.0 */ protected $xmlParser; diff --git a/plugins/actionlog/joomla/src/Extension/Joomla.php b/plugins/actionlog/joomla/src/Extension/Joomla.php index a5848c360e9f1..ce833fd2f1696 100644 --- a/plugins/actionlog/joomla/src/Extension/Joomla.php +++ b/plugins/actionlog/joomla/src/Extension/Joomla.php @@ -896,7 +896,7 @@ protected function checkLoggable($extension) * * Method is called after user request to remind their username. * - * @param array $user Holds the user data. + * @param object $user Holds the user data. * * @return void * @@ -1127,7 +1127,7 @@ public function onJoomlaAfterUpdate($oldVersion = null) * * @param string $context The context of the action log * - * @return \stdClass The params + * @return ?\stdClass The params * * @since 4.2.0 */ @@ -1147,7 +1147,7 @@ private function getActionLogParams($context): ?\stdClass * * Method is called after user request to reset their password. * - * @param array $user Holds the user data. + * @param object $user Holds the user data. * * @return void * @@ -1180,7 +1180,7 @@ public function onUserAfterResetRequest($user) * * Method is called after user complete the reset of their password. * - * @param array $user Holds the user data. + * @param object $user Holds the user data. * * @return void * diff --git a/plugins/api-authentication/token/src/Extension/Token.php b/plugins/api-authentication/token/src/Extension/Token.php index db551d519eee2..28127e66759e8 100644 --- a/plugins/api-authentication/token/src/Extension/Token.php +++ b/plugins/api-authentication/token/src/Extension/Token.php @@ -15,7 +15,6 @@ use Joomla\CMS\Event\User\AuthenticationEvent; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\User\UserFactoryAwareTrait; -use Joomla\Component\Plugins\Administrator\Model\PluginModel; use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\ParameterType; use Joomla\Event\DispatcherInterface; @@ -327,7 +326,7 @@ private function isTokenEnabledForUser(int $userId): bool */ private function getPluginParameter(string $folder, string $plugin, string $param, $default = null) { - /** @var PluginModel $model */ + /** @var \Joomla\Component\Plugins\Administrator\Model\PluginModel $model */ $model = $this->getApplication()->bootComponent('plugins') ->getMVCFactory()->createModel('Plugin', 'Administrator', ['ignore_request' => true]); diff --git a/plugins/behaviour/compat/src/Extension/Compat.php b/plugins/behaviour/compat/src/Extension/Compat.php index 3ce25b0b50873..7232a8866269a 100644 --- a/plugins/behaviour/compat/src/Extension/Compat.php +++ b/plugins/behaviour/compat/src/Extension/Compat.php @@ -13,7 +13,6 @@ use Joomla\CMS\Event\Application\AfterInitialiseDocumentEvent; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Event\DispatcherInterface; -use Joomla\Event\Event; use Joomla\Event\Priority; use Joomla\Event\SubscriberInterface; @@ -80,7 +79,7 @@ public function __construct(DispatcherInterface $dispatcher, array $config = []) /** * We run as early as possible, this should be the first event * - * @param Event $event + * @param AfterInitialiseDocumentEvent $event * @return void * * @since 5.0.0 diff --git a/plugins/editors/codemirror/layouts/editors/codemirror/codemirror.php b/plugins/editors/codemirror/layouts/editors/codemirror/codemirror.php index 2cb2f34430067..2b615336056a0 100644 --- a/plugins/editors/codemirror/layouts/editors/codemirror/codemirror.php +++ b/plugins/editors/codemirror/layouts/editors/codemirror/codemirror.php @@ -20,7 +20,7 @@ /** * Layout variables * - * @var array $options JS options for editor + * @var object $options JS options for editor * @var Registry $params Plugin parameters * @var string $id The id of the input * @var string $name The name of the input diff --git a/plugins/fields/calendar/src/Extension/Calendar.php b/plugins/fields/calendar/src/Extension/Calendar.php index 3c03b5f1e668f..4bf3c70b0098c 100644 --- a/plugins/fields/calendar/src/Extension/Calendar.php +++ b/plugins/fields/calendar/src/Extension/Calendar.php @@ -32,7 +32,7 @@ final class Calendar extends FieldsPlugin implements SubscriberInterface * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/fields/color/src/Extension/Color.php b/plugins/fields/color/src/Extension/Color.php index b112987367511..8585c30805655 100644 --- a/plugins/fields/color/src/Extension/Color.php +++ b/plugins/fields/color/src/Extension/Color.php @@ -32,7 +32,7 @@ final class Color extends FieldsPlugin implements SubscriberInterface * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/fields/editor/src/Extension/Editor.php b/plugins/fields/editor/src/Extension/Editor.php index 6391d9e3ab046..217db368ae8e9 100644 --- a/plugins/fields/editor/src/Extension/Editor.php +++ b/plugins/fields/editor/src/Extension/Editor.php @@ -32,7 +32,7 @@ final class Editor extends FieldsPlugin implements SubscriberInterface * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/fields/imagelist/src/Extension/Imagelist.php b/plugins/fields/imagelist/src/Extension/Imagelist.php index b48ab487fa80f..706dcf6f8d7fb 100644 --- a/plugins/fields/imagelist/src/Extension/Imagelist.php +++ b/plugins/fields/imagelist/src/Extension/Imagelist.php @@ -32,7 +32,7 @@ final class Imagelist extends FieldsPlugin implements SubscriberInterface * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/fields/list/src/Extension/ListPlugin.php b/plugins/fields/list/src/Extension/ListPlugin.php index 1af4330dad85e..2595c1250caf8 100644 --- a/plugins/fields/list/src/Extension/ListPlugin.php +++ b/plugins/fields/list/src/Extension/ListPlugin.php @@ -63,7 +63,7 @@ public function onCustomFieldsBeforePrepareField($context, $item, $field) * @param \stdclass $item The item. * @param \stdclass $field The field. * - * @return object + * @return ?string * * @since 3.9.2 */ diff --git a/plugins/fields/media/src/Extension/Media.php b/plugins/fields/media/src/Extension/Media.php index c7d5723dd45e3..07ad1c8f5877e 100644 --- a/plugins/fields/media/src/Extension/Media.php +++ b/plugins/fields/media/src/Extension/Media.php @@ -31,7 +31,7 @@ final class Media extends FieldsPlugin * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 4.0.0 */ diff --git a/plugins/fields/sql/src/Extension/SQL.php b/plugins/fields/sql/src/Extension/SQL.php index d09cb7f85cf4f..693064fe1cf71 100644 --- a/plugins/fields/sql/src/Extension/SQL.php +++ b/plugins/fields/sql/src/Extension/SQL.php @@ -32,7 +32,7 @@ final class SQL extends FieldsListPlugin * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/fields/subform/src/Extension/Subform.php b/plugins/fields/subform/src/Extension/Subform.php index 1815be6396ea1..193512c3f8738 100644 --- a/plugins/fields/subform/src/Extension/Subform.php +++ b/plugins/fields/subform/src/Extension/Subform.php @@ -140,7 +140,7 @@ public function onCustomFieldsBeforePrepareField($context, $item, $field) * @param object $item The item * @param \stdClass $field The field * - * @return string + * @return ?string * * @since 4.0.0 */ @@ -242,7 +242,7 @@ public function onCustomFieldsPrepareField($context, $item, $field) * @param \DOMElement $parent The original parent element * @param Form $form The form * - * @return \DOMElement + * @return ?\DOMElement * * @since 4.0.0 */ diff --git a/plugins/fields/url/src/Extension/Url.php b/plugins/fields/url/src/Extension/Url.php index 1b43a475904bc..e4126e0db2414 100644 --- a/plugins/fields/url/src/Extension/Url.php +++ b/plugins/fields/url/src/Extension/Url.php @@ -32,7 +32,7 @@ final class Url extends FieldsPlugin implements SubscriberInterface * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/fields/user/src/Extension/User.php b/plugins/fields/user/src/Extension/User.php index c0d6b15ef871d..ffd2c17d24c3b 100644 --- a/plugins/fields/user/src/Extension/User.php +++ b/plugins/fields/user/src/Extension/User.php @@ -35,7 +35,7 @@ final class User extends FieldsPlugin implements SubscriberInterface * @param \DOMElement $parent The field node parent. * @param Form $form The form. * - * @return \DOMElement + * @return ?\DOMElement * * @since 3.7.0 */ diff --git a/plugins/installer/packageinstaller/tmpl/default.php b/plugins/installer/packageinstaller/tmpl/default.php index 570673f76a950..60f75e7aee403 100644 --- a/plugins/installer/packageinstaller/tmpl/default.php +++ b/plugins/installer/packageinstaller/tmpl/default.php @@ -13,9 +13,8 @@ use Joomla\CMS\Filesystem\FilesystemHelper; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; -use Joomla\Plugin\Installer\Package\Extension\PackageInstaller; -/** @var PackageInstaller $this */ +/** @var \Joomla\Plugin\Installer\Package\Extension\PackageInstaller $this */ HTMLHelper::_('form.csrf'); diff --git a/plugins/installer/urlinstaller/tmpl/default.php b/plugins/installer/urlinstaller/tmpl/default.php index 2bc15d67302bc..a3552fb35e8dc 100644 --- a/plugins/installer/urlinstaller/tmpl/default.php +++ b/plugins/installer/urlinstaller/tmpl/default.php @@ -11,9 +11,8 @@ defined('_JEXEC') or die; use Joomla\CMS\Language\Text; -use Joomla\Plugin\Installer\Url\Extension\UrlInstaller; -/** @var UrlInstaller $this */ +/** @var \Joomla\Plugin\Installer\Url\Extension\UrlInstaller $this */ $this->getApplication()->getDocument()->getWebAssetManager() ->registerAndUseScript('plg_installer_urlinstaller.urlinstaller', 'plg_installer_urlinstaller/urlinstaller.js', [], ['defer' => true], ['core']); diff --git a/plugins/multifactorauth/webauthn/src/Helper/Credentials.php b/plugins/multifactorauth/webauthn/src/Helper/Credentials.php index e40d37c079631..b03628b25c410 100644 --- a/plugins/multifactorauth/webauthn/src/Helper/Credentials.php +++ b/plugins/multifactorauth/webauthn/src/Helper/Credentials.php @@ -20,7 +20,6 @@ use Joomla\Plugin\Multifactorauth\Webauthn\CredentialRepository; use Joomla\Session\SessionInterface; use Laminas\Diactoros\ServerRequestFactory; -use Webauthn\AttestedCredentialData; use Webauthn\AuthenticationExtensions\AuthenticationExtensionsClientInputs; use Webauthn\AuthenticatorSelectionCriteria; use Webauthn\PublicKeyCredentialCreationOptions; @@ -89,7 +88,7 @@ public static function requestAttestation(User $user): string * * @param string $data The JSON-encoded data returned by the browser during the authentication flow * - * @return AttestedCredentialData|null + * @return ?PublicKeyCredentialSource * @throws \Exception When something does not check out * @since 4.2.0 */ diff --git a/plugins/privacy/consents/src/Extension/Consents.php b/plugins/privacy/consents/src/Extension/Consents.php index 05ffe252cbbc7..8cbf133eead33 100644 --- a/plugins/privacy/consents/src/Extension/Consents.php +++ b/plugins/privacy/consents/src/Extension/Consents.php @@ -32,7 +32,7 @@ final class Consents extends PrivacyPlugin * This event will collect data for the core `#__privacy_consents` table * * @param RequestTable $request The request record being processed - * @param User $user The user account associated with this request if available + * @param ?User $user The user account associated with this request if available * * @return \Joomla\Component\Privacy\Administrator\Export\Domain[] * diff --git a/plugins/privacy/contact/src/Extension/Contact.php b/plugins/privacy/contact/src/Extension/Contact.php index 9ea1b6651d6fe..8f87bb5eb2022 100644 --- a/plugins/privacy/contact/src/Extension/Contact.php +++ b/plugins/privacy/contact/src/Extension/Contact.php @@ -34,7 +34,7 @@ final class Contact extends PrivacyPlugin * - Contact custom fields * * @param RequestTable $request The request record being processed - * @param User $user The user account associated with this request if available + * @param ?User $user The user account associated with this request if available * * @return \Joomla\Component\Privacy\Administrator\Export\Domain[] * diff --git a/plugins/privacy/content/src/Extension/Content.php b/plugins/privacy/content/src/Extension/Content.php index 55a02de203f19..ec5615b26491c 100644 --- a/plugins/privacy/content/src/Extension/Content.php +++ b/plugins/privacy/content/src/Extension/Content.php @@ -33,7 +33,7 @@ final class Content extends PrivacyPlugin * - Content custom fields * * @param RequestTable $request The request record being processed - * @param User $user The user account associated with this request if available + * @param ?User $user The user account associated with this request if available * * @return \Joomla\Component\Privacy\Administrator\Export\Domain[] * diff --git a/plugins/privacy/message/src/Extension/Message.php b/plugins/privacy/message/src/Extension/Message.php index 809805a25aa8a..e123260108d6f 100644 --- a/plugins/privacy/message/src/Extension/Message.php +++ b/plugins/privacy/message/src/Extension/Message.php @@ -32,7 +32,7 @@ final class Message extends PrivacyPlugin * This event will collect data for the message table * * @param RequestTable $request The request record being processed - * @param User $user The user account associated with this request if available + * @param ?User $user The user account associated with this request if available * * @return \Joomla\Component\Privacy\Administrator\Export\Domain[] * diff --git a/plugins/system/actionlogs/src/Extension/ActionLogs.php b/plugins/system/actionlogs/src/Extension/ActionLogs.php index 7ed0a7110399a..233f3ccf71a50 100644 --- a/plugins/system/actionlogs/src/Extension/ActionLogs.php +++ b/plugins/system/actionlogs/src/Extension/ActionLogs.php @@ -353,9 +353,9 @@ public static function renderActionlogsExtensions($extensions) * On Saving extensions logging method * Method is called when an extension is being saved * - * @param string $context The extension - * @param Table $table DataBase Table object - * @param boolean $isNew If the extension is new or not + * @param string $context The extension + * @param \Joomla\CMS\Table\Table $table DataBase Table object + * @param boolean $isNew If the extension is new or not * * @return void * diff --git a/plugins/system/fields/src/Extension/Fields.php b/plugins/system/fields/src/Extension/Fields.php index 3f75cf9f36526..d8d31434f4e5b 100644 --- a/plugins/system/fields/src/Extension/Fields.php +++ b/plugins/system/fields/src/Extension/Fields.php @@ -219,7 +219,7 @@ public function onContentAfterDelete($context, $item): void /** * The user delete event. * - * @param \stdClass $user The context + * @param array $user The context * @param boolean $success Is success * @param string $msg The message * diff --git a/plugins/system/webauthn/src/Authentication.php b/plugins/system/webauthn/src/Authentication.php index 0839fab8d895f..ca346706215d9 100644 --- a/plugins/system/webauthn/src/Authentication.php +++ b/plugins/system/webauthn/src/Authentication.php @@ -212,7 +212,7 @@ public function getPubKeyCreationOptions(User $user): PublicKeyCredentialCreatio * * @param User $user The Joomla user to get the PK request options for * - * @return PublicKeyCredentialRequestOptions + * @return ?PublicKeyCredentialRequestOptions * * @throws \Exception * @since 4.2.0 @@ -289,7 +289,7 @@ public function validateAssertionResponse(string $data, User $user): PublicKeyCr * * @param string $data The data * - * @return PublicKeyCredentialSource|null + * @return PublicKeyCredentialSource * * @throws \Exception * @since 4.2.0 diff --git a/plugins/webservices/users/src/Extension/Users.php b/plugins/webservices/users/src/Extension/Users.php index 28189cc7482cb..0f2ce1bb9d66a 100644 --- a/plugins/webservices/users/src/Extension/Users.php +++ b/plugins/webservices/users/src/Extension/Users.php @@ -12,6 +12,7 @@ use Joomla\CMS\Event\Application\BeforeApiRouteEvent; use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Router\ApiRouter; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects