Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ protected function initialiseApp($options = [])
*/
public function isHttpsForced($clientId = null)
{
$clientId = (int) ($clientId !== null ? $clientId : $this->getClientId());
$clientId = (int) ($clientId ?? $this->getClientId());
$forceSsl = (int) $this->get('force_ssl');

if ($clientId === 0 && $forceSsl === 2) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/HTML/Helpers/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public static function assetgrouplist($name, $selected, $attribs = null, $config
$name,
[
'id' => $config['id'] ?? 'assetgroups_' . (++$count),
'list.attr' => $attribs === null ? 'class="inputbox" size="3"' : $attribs,
'list.attr' => $attribs ?? 'class="inputbox" size="3"',
'list.select' => (int) $selected,
]
);
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/HTML/Helpers/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ public static function addTab($selector, $id, $title): string
{
static $tabLayout = null;

$tabLayout = $tabLayout === null ? new FileLayout('libraries.html.bootstrap.tab.addtab') : $tabLayout;
$tabLayout = $tabLayout ?? new FileLayout('libraries.html.bootstrap.tab.addtab');
$active = (static::$loaded[__CLASS__ . '::startTabSet'][$selector]['active'] == $id) ? ' active' : '';

return $tabLayout->render(['id' => preg_replace('/^[\.#]/', '', $id), 'active' => $active, 'title' => $title]);
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Image/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ protected function prepareDimensions($width, $height, $scaleMethod)
protected function sanitizeHeight($height, $width)
{
// If no height was given we will assume it is a square and use the width.
$height = ($height === null) ? $width : $height;
$height = $height ?? $width;

// If we were given a percentage, calculate the integer value.
if (preg_match('/^[0-9]+(\.[0-9]+)?\%$/', $height)) {
Expand Down Expand Up @@ -1119,7 +1119,7 @@ protected function sanitizeOffset($offset)
protected function sanitizeWidth($width, $height)
{
// If no width was given we will assume it is a square and use the height.
$width = ($width === null) ? $height : $width;
$width = $width ?? $height;

// If we were given a percentage, calculate the integer value.
if (preg_match('/^[0-9]+(\.[0-9]+)?\%$/', $width)) {
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/MVC/Model/AdminModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ public function publish(&$pks, $value = 1)
*/
$publishedColumnName = $table->getColumnAlias('published');

if (property_exists($table, $publishedColumnName) && (isset($table->$publishedColumnName) ? $table->$publishedColumnName : $value) == $value) {
if (property_exists($table, $publishedColumnName) && ($table->$publishedColumnName ?? $value) == $value) {
unset($pks[$i]);
}
}
Expand Down Expand Up @@ -1252,7 +1252,7 @@ public function save($data)
}

$key = $table->getKeyName();
$pk = (isset($data[$key])) ? $data[$key] : (int) $this->getState($this->getName() . '.id');
$pk = $data[$key] ?? (int) $this->getState($this->getName() . '.id');
$isNew = true;

// Include the plugins for the save events.
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Mail/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function addAttachment($path, $name = '', $encoding = 'base64', $type = '
}

foreach ($path as $key => $file) {
$result = parent::addAttachment($file, isset($name[$key]) ? $name[$key] : '', $encoding, $type, $disposition);
$result = parent::addAttachment($file, $name[$key] ?? '', $encoding, $type, $disposition);
}

// Check for boolean false return if exception handling is disabled
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Session/MetadataManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private function createSessionRecord(SessionInterface $session, User $user)
$sessionId = $session->getId();
$userIsGuest = $user->guest;
$userId = $user->id;
$username = $user->username === null ? '' : $user->username;
$username = $user->username ?? '';

$query->bind(':session_id', $sessionId)
->bind(':guest', $userIsGuest, ParameterType::INTEGER)
Expand Down Expand Up @@ -290,7 +290,7 @@ private function updateSessionRecord(SessionInterface $session, User $user)
$sessionId = $session->getId();
$userIsGuest = $user->guest;
$userId = $user->id;
$username = $user->username === null ? '' : $user->username;
$username = $user->username ?? '';

$query->bind(':session_id', $sessionId)
->bind(':guest', $userIsGuest, ParameterType::INTEGER)
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Table/MenuType.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function store($updateNulls = false)
public function delete($pk = null)
{
$k = $this->_tbl_key;
$pk = $pk === null ? $this->$k : $pk;
$pk = $pk ?? $this->$k;

// If no primary key is given, return false.
if ($pk !== null) {
Expand Down Expand Up @@ -316,6 +316,6 @@ protected function _getAssetParentId(?Table $table = null, $id = null)
$assetId = $asset->id;
}

return $assetId === null ? parent::_getAssetParentId($table, $id) : $assetId;
return $assetId ?? parent::_getAssetParentId($table, $id);
}
}
4 changes: 2 additions & 2 deletions libraries/src/Updater/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private function getUpdateObjectsForSite($updateSite, $minimumStability = self::
'element' => $current_update->element,
'type' => $current_update->type,
'client_id' => $current_update->client_id,
'folder' => isset($current_update->folder) ? $current_update->folder : '',
'folder' => $current_update->folder ?? '',
]
);

Expand All @@ -315,7 +315,7 @@ private function getUpdateObjectsForSite($updateSite, $minimumStability = self::
'element' => $current_update->element,
'type' => $current_update->type,
'client_id' => $current_update->client_id,
'folder' => isset($current_update->folder) ? $current_update->folder : '',
'folder' => $current_update->folder ?? '',
]
);

Expand Down