forked from GNUsocial/gnu-social
Minor PHP stylistic features and typing stuff
This commit is contained in:
parent
25e61916f9
commit
d289ccb7f2
@ -120,7 +120,7 @@ class Profile_prefs extends Managed_DataObject
|
|||||||
static function getConfigData(Profile $profile, $namespace, $topic) {
|
static function getConfigData(Profile $profile, $namespace, $topic) {
|
||||||
try {
|
try {
|
||||||
$data = self::getData($profile, $namespace, $topic);
|
$data = self::getData($profile, $namespace, $topic);
|
||||||
} catch (Exception $e) {
|
} catch (NoResultException $e) {
|
||||||
$data = common_config($namespace, $topic);
|
$data = common_config($namespace, $topic);
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
@ -160,7 +160,7 @@ class Profile_prefs extends Managed_DataObject
|
|||||||
$pref->topic = $topic;
|
$pref->topic = $topic;
|
||||||
$pref->data = $data;
|
$pref->data = $data;
|
||||||
|
|
||||||
if (!$pref->insert()) {
|
if ($pref->insert() === false) {
|
||||||
throw new ServerException('Could not save profile preference.');
|
throw new ServerException('Could not save profile preference.');
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -302,7 +302,7 @@ class HTMLOutputter extends XMLOutputter
|
|||||||
|
|
||||||
function hidden($id, $value, $name=null)
|
function hidden($id, $value, $name=null)
|
||||||
{
|
{
|
||||||
$this->element('input', array('name' => ($name) ? $name : $id,
|
$this->element('input', array('name' => $name ?: $id,
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'value' => $value));
|
'value' => $value));
|
||||||
@ -351,7 +351,7 @@ class HTMLOutputter extends XMLOutputter
|
|||||||
{
|
{
|
||||||
$this->element('input', array('type' => 'submit',
|
$this->element('input', array('type' => 'submit',
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'name' => ($name) ? $name : $id,
|
'name' => $name ?: $id,
|
||||||
'class' => $cls,
|
'class' => $cls,
|
||||||
'value' => $label,
|
'value' => $label,
|
||||||
'title' => $title));
|
'title' => $title));
|
||||||
|
Loading…
Reference in New Issue
Block a user