Skip to content

Commit 18ab4a1

Browse files
committed
Updating codestyle
1 parent 373e1bd commit 18ab4a1

File tree

19 files changed

+32
-33
lines changed

19 files changed

+32
-33
lines changed

src/administrator/components/com_weblinks/script.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ private function addColumnsIfNeeded()
311311
$db = Factory::getDbo();
312312
$table = $db->getTableColumns('#__weblinks');
313313

314-
if (!array_key_exists('version', $table)) {
314+
if (!\array_key_exists('version', $table)) {
315315
$sql = 'ALTER TABLE ' . $db->quoteName('#__weblinks') . ' ADD COLUMN ' . $db->quoteName('version') . " int unsigned NOT NULL DEFAULT '1'";
316316
$db->setQuery($sql);
317317
$db->execute();
318318
}
319319

320-
if (!array_key_exists('images', $table)) {
320+
if (!\array_key_exists('images', $table)) {
321321
$sql = 'ALTER TABLE ' . $db->quoteName('#__weblinks') . ' ADD COLUMN ' . $db->quoteName('images') . ' text NOT NULL';
322322
$db->setQuery($sql);
323323
$db->execute();

src/administrator/components/com_weblinks/src/Extension/WeblinksComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getContexts(): array
122122
*
123123
* @since 4.0.0
124124
*/
125-
protected function getTableNameForSection(string $section = null)
125+
protected function getTableNameForSection(?string $section = null)
126126
{
127127
return ($section === 'category' ? 'categories' : 'weblinks');
128128
}
@@ -136,7 +136,7 @@ protected function getTableNameForSection(string $section = null)
136136
*
137137
* @since 4.0.0
138138
*/
139-
protected function getStateColumnForSection(string $section = null)
139+
protected function getStateColumnForSection(?string $section = null)
140140
{
141141
return 'state';
142142
}

src/administrator/components/com_weblinks/src/Field/Modal/WeblinkField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function getInput()
6060
// Script to proxy the select modal function to the modal-fields.js file.
6161
if ($allowSelect) {
6262
static $scriptSelect = null;
63-
if (is_null($scriptSelect)) {
63+
if (\is_null($scriptSelect)) {
6464
$scriptSelect = [];
6565
}
6666

src/administrator/components/com_weblinks/src/Helper/AssociationsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getType($typeName = '')
147147
$joins = [];
148148
$support = $this->getSupportTemplate();
149149
$title = '';
150-
if (in_array($typeName, $this->itemTypes)) {
150+
if (\in_array($typeName, $this->itemTypes)) {
151151
switch ($typeName) {
152152
case 'weblink':
153153
$support['state'] = true;

src/administrator/components/com_weblinks/src/Model/WeblinkModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
376376
if (Associations::isEnabled()) {
377377
$languages = LanguageHelper::getContentLanguages(false, false, null, 'ordering', 'asc');
378378

379-
if (count($languages) > 1) {
379+
if (\count($languages) > 1) {
380380
$addform = new \SimpleXMLElement('<form />');
381381
$fields = $addform->addChild('fields');
382382
$fields->addAttribute('name', 'associations');

src/administrator/components/com_weblinks/src/Model/WeblinksModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WeblinksModel extends ListModel
3737
* @see JControllerLegacy
3838
* @since 1.6
3939
*/
40-
public function __construct($config = [], MVCFactoryInterface $factory = null)
40+
public function __construct($config = [], ?MVCFactoryInterface $factory = null)
4141
{
4242
if (empty($config['filter_fields'])) {
4343
$config['filter_fields'] = [

src/administrator/components/com_weblinks/src/Service/HTML/AdministratorService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function association($weblinkid)
7777
$languages = LanguageHelper::getContentLanguages([0, 1]);
7878
$content_languages = array_column($languages, 'lang_code');
7979
foreach ($items as &$item) {
80-
if (in_array($item->lang_code, $content_languages)) {
80+
if (\in_array($item->lang_code, $content_languages)) {
8181
$text = $item->lang_code;
8282
$url = Route::_('index.php?option=com_weblinks&task=weblink.edit&id=' . (int) $item->id);
8383
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'

src/administrator/components/com_weblinks/src/View/Weblink/HtmlView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function display($tpl = null)
6868
$this->form = $model->getForm();
6969

7070
// Check for errors.
71-
if (count($errors = $model->getErrors())) {
71+
if (\count($errors = $model->getErrors())) {
7272
throw new GenericDataException(implode("\n", $errors), 500);
7373
}
7474

@@ -114,7 +114,7 @@ protected function addToolbar()
114114
// Build the actions for new and existing records.
115115
if ($isNew) {
116116
// For new records, check the create permission.
117-
if (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0) {
117+
if (\count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0) {
118118
ToolbarHelper::apply('weblink.apply');
119119

120120
ToolbarHelper::saveGroup(

src/administrator/components/com_weblinks/src/View/Weblinks/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function display($tpl = null)
8888
$this->activeFilters = $this->get('ActiveFilters');
8989

9090
// Check for errors.
91-
if (count($errors = $this->get('Errors'))) {
91+
if (\count($errors = $this->get('Errors'))) {
9292
throw new GenericDataException(implode("\n", $errors), 500);
9393
}
9494

src/components/com_weblinks/src/Controller/WeblinkController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function go()
269269

270270
// Check whether item access level allows access.
271271
$groups = $this->app->getIdentity()->getAuthorisedViewLevels();
272-
if (!in_array($link->access, $groups)) {
272+
if (!\in_array($link->access, $groups)) {
273273
throw new \Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403);
274274
}
275275

@@ -284,7 +284,7 @@ public function go()
284284
}
285285

286286
// Check whether item access level allows access.
287-
if (!in_array($category->access, $groups)) {
287+
if (!\in_array($category->access, $groups)) {
288288
throw new \Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403);
289289
}
290290

0 commit comments

Comments
 (0)