Skip to content

Commit a79bb14

Browse files
authored
Cleanup of controller based on Intellij highlighting (#28315)
1 parent 5b11e3e commit a79bb14

File tree

61 files changed

+118
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+118
-97
lines changed

administrator/components/com_associations/src/Controller/AssociationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AssociationController extends FormController
3030
* @param string $urlVar The name of the URL variable if different from the primary key
3131
* (sometimes required to avoid router collisions).
3232
*
33-
* @return boolean True if access level check and checkout passes, false otherwise.
33+
* @return FormController|boolean True if access level check and checkout passes, false otherwise.
3434
*
3535
* @since 3.7.0
3636
*/

administrator/components/com_banners/src/Controller/BannersController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Joomla\CMS\Language\Text;
1616
use Joomla\CMS\MVC\Controller\AdminController;
1717
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
18+
use Joomla\Input\Input;
1819
use Joomla\Utilities\ArrayHelper;
1920

2021
/**
@@ -38,7 +39,7 @@ class BannersController extends AdminController
3839
* @param array $config An optional associative array of configuration settings.
3940
* @param MVCFactoryInterface $factory The factory.
4041
* @param CmsApplication $app The JApplication for the dispatcher
41-
* @param \JInput $input Input
42+
* @param Input $input Input
4243
*
4344
* @since 3.0
4445
*/

administrator/components/com_cache/src/Controller/DisplayController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getQuickiconContent()
5454

5555
// Number bytes are returned in format xxx.xx MB
5656
$bytes = HTMLHelper::_('number.bytes', $size, 'MB', 1);
57-
57+
5858
if (!empty($bytes))
5959
{
6060
$result['amount'] = $bytes;
@@ -114,7 +114,7 @@ public function deleteAll()
114114
// Check for request forgeries
115115
$this->checkToken();
116116

117-
$app = $this->app;
117+
/** @var \Joomla\Component\Cache\Administrator\Model\CacheModel $model */
118118
$model = $this->getModel('cache');
119119
$allCleared = true;
120120

@@ -124,7 +124,7 @@ public function deleteAll()
124124
{
125125
if ($mCache->clean($cache->group) === false)
126126
{
127-
$app->enqueueMessage(
127+
$this->app->enqueueMessage(
128128
Text::sprintf(
129129
'COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', Text::_('JADMINISTRATOR') . ' > ' . $cache->group
130130
), 'error'
@@ -135,14 +135,14 @@ public function deleteAll()
135135

136136
if ($allCleared)
137137
{
138-
$app->enqueueMessage(Text::_('COM_CACHE_MSG_ALL_CACHE_GROUPS_CLEARED'), 'message');
138+
$this->app->enqueueMessage(Text::_('COM_CACHE_MSG_ALL_CACHE_GROUPS_CLEARED'), 'message');
139139
}
140140
else
141141
{
142-
$app->enqueueMessage(Text::_('COM_CACHE_MSG_SOME_CACHE_GROUPS_CLEARED'), 'warning');
142+
$this->app->enqueueMessage(Text::_('COM_CACHE_MSG_SOME_CACHE_GROUPS_CLEARED'), 'warning');
143143
}
144144

145-
$app->triggerEvent('onAfterPurge', array());
145+
$this->app->triggerEvent('onAfterPurge', array());
146146
$this->setRedirect('index.php?option=com_cache&view=cache');
147147
}
148148

administrator/components/com_categories/src/Controller/CategoriesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public function getModel($name = 'Category', $prefix = 'Administrator', $config
4040
}
4141

4242
/**
43-
* Method to get the number of content categories
43+
* Outputs the JSON-encoded amount of published content categories
4444
*
45-
* @return string The JSON-encoded amount of published content categories
45+
* @return void
4646
*
4747
* @since 4.0
4848
*/

administrator/components/com_categories/src/Controller/CategoryController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function batch($model = null)
127127
{
128128
$this->checkToken();
129129

130-
// Set the model
131130
/** @var \Joomla\Component\Categories\Administrator\Model\CategoryModel $model */
132131
$model = $this->getModel('Category');
133132

administrator/components/com_categories/src/Controller/DisplayController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
6868
* @param boolean $cachable If true, the view output will be cached
6969
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
7070
*
71-
* @return static This object to support chaining.
71+
* @return static|boolean This object to support chaining.
7272
*
7373
* @since 1.5
7474
*/

administrator/components/com_checkin/src/Controller/DisplayController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public function checkin()
7878
* @return void
7979
*
8080
* @since 4.0.0
81+
* @throws \Exception
8182
*/
8283
public function getMenuBadgeData()
8384
{
@@ -99,6 +100,7 @@ public function getMenuBadgeData()
99100
* @return void
100101
*
101102
* @since 4.0
103+
* @throws \Exception
102104
*/
103105
public function getQuickiconContent()
104106
{

administrator/components/com_config/src/Controller/ApplicationController.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function cancel()
6363
/**
6464
* Saves the form
6565
*
66-
* @return mixed
66+
* @return void|boolean Void on success. Boolean false on fail.
6767
*
6868
* @since 4.0.0
6969
*/
@@ -205,7 +205,7 @@ public function save()
205205
/**
206206
* Method to remove root in global configuration.
207207
*
208-
* @return boolean True on success.
208+
* @return boolean
209209
*
210210
* @since 3.2
211211
*/
@@ -247,12 +247,14 @@ public function removeroot()
247247

248248
// Set the redirect based on the task.
249249
$this->setRedirect(Route::_('index.php'), Text::_('COM_CONFIG_SAVE_SUCCESS'));
250+
251+
return true;
250252
}
251253

252254
/**
253255
* Method to send the test mail.
254256
*
255-
* @return string
257+
* @return void
256258
*
257259
* @since 3.5
258260
*/
@@ -290,7 +292,7 @@ public function sendtestmail()
290292
/**
291293
* Method to GET permission value and give it to the model for storing in the database.
292294
*
293-
* @return boolean true on success, false when failed
295+
* @return void
294296
*
295297
* @since 3.5
296298
*/

administrator/components/com_config/src/Controller/ComponentController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
defined('_JEXEC') or die;
1313

14+
use Joomla\CMS\Application\CMSApplication;
1415
use Joomla\CMS\Client\ClientHelper;
1516
use Joomla\CMS\Language\Text;
1617
use Joomla\CMS\MVC\Controller\BaseController;
1718
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
1819
use Joomla\CMS\Router\Route;
1920
use Joomla\CMS\Session\Session;
2021
use Joomla\CMS\Uri\Uri;
22+
use Joomla\Input\Input;
2123

2224
/**
2325
* Note: this view is intended only to be opened in a popup
@@ -34,7 +36,7 @@ class ComponentController extends BaseController
3436
* 'view_path' (this list is not meant to be comprehensive).
3537
* @param MVCFactoryInterface $factory The factory.
3638
* @param CMSApplication $app The JApplication for the dispatcher
37-
* @param \JInput $input Input
39+
* @param Input $input Input
3840
*
3941
* @since 3.0
4042
*/

administrator/components/com_config/src/Controller/RequestController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RequestController extends BaseController
2424
/**
2525
* Execute the controller.
2626
*
27-
* @return mixed A rendered view or true
27+
* @return mixed A rendered view or false
2828
*
2929
* @since 3.2
3030
*/
@@ -62,7 +62,7 @@ public function getJson()
6262
{
6363
$this->app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
6464

65-
return;
65+
return false;
6666
}
6767

6868
try

0 commit comments

Comments
 (0)