Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] PHPStan: Adding type hints for $this to all backend component layouts #42923

Merged
merged 2 commits into from Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions administrator/components/com_admin/tmpl/help/langforum.php
Expand Up @@ -13,6 +13,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;

/** @var \Joomla\Component\Admin\Administrator\View\Help\HtmlView $this */

$this->getLanguage()->load('mod_menu', JPATH_ADMINISTRATOR);

$forumId = (int) Text::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
Expand Down
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\CMS\Layout\FileLayout $this */

$data = $displayData;

// Receive overridable options
Expand Down
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Router\Route;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;

/** @var Joomla\Component\Associations\Administrator\View\Associations\HtmlView $this */

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_associations.admin-associations-default')
Expand Down
Expand Up @@ -18,6 +18,8 @@
use Joomla\CMS\Session\Session;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;

/** @var Joomla\Component\Associations\Administrator\View\Associations\HtmlView $this */

$app = Factory::getApplication();

if ($app->isClient('site')) {
Expand Down
Expand Up @@ -12,6 +12,8 @@

use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */

$displayData = [
'textPrefix' => 'COM_BANNERS',
'formURL' => 'index.php?option=com_banners&view=banners',
Expand Down
Expand Up @@ -12,6 +12,8 @@

use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Banners\Administrator\View\Clients\HtmlView $this */

$displayData = [
'textPrefix' => 'COM_BANNERS_CLIENT',
'formURL' => 'index.php?option=com_banners&view=clients',
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_banners/tmpl/tracks/default.php
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

/** @var \Joomla\Component\Banners\Administrator\View\Tracks\HtmlView $this */

/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns');
Expand Down
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;

/** @var \Joomla\CMS\Layout\FileLayout $this */

extract($displayData);

/**
Expand Down
Expand Up @@ -13,6 +13,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;

/** @var \Joomla\CMS\Layout\FileLayout $this */

extract($displayData);

/**
Expand Down
Expand Up @@ -18,6 +18,8 @@
use Joomla\CMS\Session\Session;
use Joomla\String\Inflector;

/** @var \Joomla\Component\Categories\Administrator\View\Categories\HtmlView $this */

/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns')
Expand Down
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Categories\Administrator\View\Categories\HtmlView $this */

$published = (int) $this->state->get('filter.published');
$extension = $this->escape($this->state->get('filter.extension'));

Expand Down
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Categories\Administrator\View\Categories\HtmlView $this */

$extension = $this->state->get('filter.extension');
$component = $this->state->get('filter.component');
$section = $this->state->get('filter.section');
Expand Down
Expand Up @@ -19,6 +19,8 @@
use Joomla\CMS\Session\Session;
use Joomla\Component\Content\Site\Helper\RouteHelper;

/** @var \Joomla\Component\Categories\Administrator\View\Categories\HtmlView $this */

$app = Factory::getApplication();

if ($app->isClient('site')) {
Expand Down
Expand Up @@ -18,6 +18,8 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\Workflow\WorkflowServiceInterface;

/** @var \Joomla\Component\Categories\Administrator\View\Category\HtmlView $this */

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
Expand Down
Expand Up @@ -9,6 +9,9 @@
*/

defined('_JEXEC') or die;

/** @var \Joomla\Component\Categories\Administrator\View\Category\HtmlView $this */

?>
<div class="subhead noshadow mb-3">
<?php echo $this->document->getToolbar('toolbar')->render(); ?>
Expand Down
Expand Up @@ -12,6 +12,8 @@

use Joomla\Component\Content\Site\Helper\RouteHelper;

/** @var \Joomla\Component\Categories\Administrator\View\Category\HtmlView $this */

$icon = 'icon-check';
$title = $this->item ? $this->item->title : '';
$content = $this->item ? $this->item->alias : '';
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_checkin/tmpl/checkin/default.php
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

/** @var \Joomla\Component\Checkin\Administrator\View\Checkin\HtmlView $this */

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('multiselect');
Expand Down
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_CACHE_SETTINGS');
$this->fieldsname = 'cache';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_COOKIE_SETTINGS');
$this->fieldsname = 'cookie';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_DATABASE_SETTINGS');
$this->fieldsname = 'database';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_DEBUG_SETTINGS');
$this->fieldsname = 'debug';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_TEXT_FILTER_SETTINGS');
$this->fieldsname = 'filters';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_LOCATION_SETTINGS');
$this->fieldsname = 'locale';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_LOGGING_SETTINGS');
$this->fieldsname = 'logging';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_LOGGING_CUSTOM_SETTINGS');
$this->fieldsname = 'logging_custom';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -15,6 +15,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

HTMLHelper::_('form.csrf');
$this->document->getWebAssetManager()
->useScript('webcomponent.field-send-test-mail');
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_METADATA_SETTINGS');
$this->fieldsname = 'metadata';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -11,6 +11,8 @@
use Joomla\CMS\Language\Text;

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */
?>
<ul class="nav flex-column">
<?php if ($this->userIsSuperAdmin) : ?>
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_PERMISSION_SETTINGS');
$this->description = '';
$this->fieldsname = 'permissions';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_PROXY_SETTINGS');
$this->fieldsname = 'proxy';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_SEO_SETTINGS');
$this->fieldsname = 'seo';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_SERVER_SETTINGS');
$this->fieldsname = 'server';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_SESSION_SETTINGS');
$this->fieldsname = 'session';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_SITE_SETTINGS');
$this->fieldsname = 'site';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -13,6 +13,8 @@

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */

$this->name = Text::_('COM_CONFIG_WEBSERVICES_SETTINGS');
$this->fieldsname = 'webservices';
$this->formclass = 'options-form';
Expand Down
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/** @var \Joomla\Component\Config\Administrator\View\Component\HtmlView $this */

$app = Factory::getApplication();
$template = $app->getTemplate();

Expand Down
Expand Up @@ -11,6 +11,8 @@
use Joomla\CMS\Language\Text;

defined('_JEXEC') or die;

/** @var \Joomla\Component\Config\Administrator\View\Component\HtmlView $this */
?>
<ul class="nav flex-column">
<?php if ($this->userIsSuperAdmin) : ?>
Expand Down
Expand Up @@ -13,6 +13,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;

/** @var \Joomla\CMS\Layout\FileLayout $this */

extract($displayData);

/**
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_contact/tmpl/contact/edit.php
Expand Up @@ -17,6 +17,8 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

/** @var \Joomla\Component\Contact\Administrator\View\Contact\HtmlView $this */

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_contact/tmpl/contact/modal.php
Expand Up @@ -9,6 +9,8 @@
*/

defined('_JEXEC') or die;

/** @var \Joomla\Component\Contact\Administrator\View\Contact\HtmlView $this */
?>
<div class="subhead noshadow mb-3">
<?php echo $this->document->getToolbar('toolbar')->render(); ?>
Expand Down
Expand Up @@ -12,6 +12,8 @@

use Joomla\Component\Contact\Site\Helper\RouteHelper;

/** @var \Joomla\Component\Contact\Administrator\View\Contact\HtmlView $this */

$icon = 'icon-check';
$title = $this->item ? $this->item->name : '';
$content = $this->item ? $this->item->alias : '';
Expand Down
Expand Up @@ -18,6 +18,8 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;

/** @var \Joomla\Component\Contact\Administrator\View\Contacts\HtmlView $this */

/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns')
Expand Down
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Contact\Administrator\View\Contacts\HtmlView $this */

$published = (int) $this->state->get('filter.published');
$noUser = true;
?>
Expand Down