Add curly braces

This commit is contained in:
Romain Neutron
2012-04-26 02:00:18 +02:00
parent 33b10d6746
commit adc74dc1d8
18 changed files with 64 additions and 29 deletions

View File

@@ -189,8 +189,9 @@ class ACL implements cache_cacheableInterface
$key = $record->get_serialize_key();
if (array_key_exists($key, $this->_rights_records_preview))
if (array_key_exists($key, $this->_rights_records_preview)) {
return true;
}
return false;
}

View File

@@ -610,8 +610,8 @@ class API_OAuth2_Adapter extends OAuth2
{
$token_param = $this->getAccessTokenParams();
if ($token_param === FALSE) { // Access token was not provided
// Access token was not provided
if ($token_param === false) {
return $exit_not_present ? $this->errorWWWAuthenticateResponseHeader(OAUTH2_HTTP_BAD_REQUEST, $realm, OAUTH2_ERROR_INVALID_REQUEST, 'The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.', NULL, $scope) : FALSE;
}

View File

@@ -637,6 +637,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
/**
* @todo Retieve thumb
*/
return new Bridge_Api_Dailymotion_Container($entry, $object, '');
break;
default:

View File

@@ -353,7 +353,8 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
$response = $this->_api->executeMethod('flickr.photosets.addPhoto', $params);
if ( ! $response->isOk()) {
if ($response->err_code === 3) { //Already exists in photoset
//Already exists in photoset
if ($response->err_code === 3) {
return;
}

View File

@@ -871,9 +871,10 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
protected function get_PlaylistEntry_from_Id($element_id)
{
foreach ($this->_api->getPlaylistListFeed('default') as $playlist_entry) {
if ($element_id == $playlist_entry->getPlaylistId()->getText())
if ($element_id == $playlist_entry->getPlaylistId()->getText()) {
return $playlist_entry;
}
}
return null;
}
@@ -891,9 +892,10 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
);
if ( ! is_null($this->locale)) {
$youtube_format_locale = str_replace('_', '-', $this->locale);
if (in_array(trim($youtube_format_locale), $youtube_available_locale))
if (in_array(trim($youtube_format_locale), $youtube_available_locale)) {
return $this->locale;
}
}
return "en-US";
}

View File

@@ -243,8 +243,10 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
*/
public function has_access(User_Adapter $user)
{
if ($this->get_collection() instanceof collection)
if ($this->get_collection() instanceof collection) {
return $user->ACL()->has_access_to_base($this->collection->get_base_id());
}
return true;
}
@@ -286,8 +288,9 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
*/
public function add_publisher(User_Adapter $user)
{
if (in_array($user->get_id(), array_keys($this->get_publishers())))
if (in_array($user->get_id(), array_keys($this->get_publishers()))) {
return $this;
}
Feed_Publisher_Adapter::create($this->appbox, $user, $this, false);
$this->publishers = null;
@@ -301,8 +304,9 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
*/
protected function load_publishers()
{
if (is_array($this->publishers))
if (is_array($this->publishers)) {
return $this->publishers;
}
$sql = 'SELECT id, usr_id, owner FROM feed_publishers
WHERE feed_id = :feed_id';
@@ -581,8 +585,10 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
*/
public function get_homepage_link(registryInterface $registry, $format, $page = null)
{
if ( ! $this->is_public())
if ( ! $this->is_public()) {
return null;
}
switch ($format) {
case self::FORMAT_ATOM:
return new Feed_Link(

View File

@@ -228,8 +228,10 @@ class Session_Handler
public function get_session_prefs($key)
{
$datas = $this->storage()->get('temp_prefs');
if (isset($datas[$key]))
if (isset($datas[$key])) {
return $datas[$key];
}
return null;
}
@@ -248,6 +250,7 @@ class Session_Handler
} elseif ($default_value !== null) {
return $default_value;
}
return null;
}

View File

@@ -486,6 +486,7 @@ class setup
</form>
<?php
return;
}

View File

@@ -850,8 +850,9 @@ class task_period_archive extends task_abstract
if ($depth == 0)
$iloop = 0;
if ($depth == 0 && ($node->getAttribute('temperature') == 'hot' || $node->getAttribute('cid') == '-1'))
if ($depth == 0 && ($node->getAttribute('temperature') == 'hot' || $node->getAttribute('cid') == '-1')) {
return;
}
$xpath = new DOMXPath($dom); // useful
@@ -984,8 +985,9 @@ class task_period_archive extends task_abstract
$ret = false;
if ($depth == 0 && $node->getAttribute('temperature') == 'hot') // if root of hotfolder if hot, die...
if ($depth == 0 && $node->getAttribute('temperature') == 'hot') { // if root of hotfolder if hot, die...
return($ret);
}
$nodesToDel = array();
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
@@ -1058,8 +1060,9 @@ class task_period_archive extends task_abstract
if ($depth == 0)
$iloop = 0;
if ($node->getAttribute('temperature') == 'hot')
if ($node->getAttribute('temperature') == 'hot') {
return;
}
$nodesToDel = array();
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
@@ -1125,8 +1128,9 @@ class task_period_archive extends task_abstract
if ($depth == 0)
$iloop = 0;
if ($node->getAttribute('temperature') == 'hot')
if ($node->getAttribute('temperature') == 'hot') {
return;
}
$ret = 0;
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
@@ -1186,8 +1190,9 @@ class task_period_archive extends task_abstract
$ret = false;
if ($depth == 0 && $node->getAttribute('temperature') == 'hot') // if root of hotfolder if hot, die...
if ($depth == 0 && $node->getAttribute('temperature') == 'hot') { // if root of hotfolder if hot, die...
return($ret);
}
//printf("%s : \n", __LINE__);
$nodesToDel = array();

View File

@@ -177,6 +177,7 @@ class task_period_cindexer extends task_abstract
parent.calccmd();
</script>
<?php
return("");
} else { // ... so we NEVER come here
// bad xml
@@ -243,6 +244,7 @@ class task_period_cindexer extends task_abstract
}
</script>
<?php
return;
}

View File

@@ -98,6 +98,7 @@ class task_period_ftp extends task_appboxAbstract
<?php echo $form ?>.period.value = "<?php echo p4string::MakeString($sxml->period, "js", '"') ?>";
</script>
<?php
return("");
} else { // ... so we NEVER come here
// bad xml
@@ -127,6 +128,7 @@ class task_period_ftp extends task_appboxAbstract
}
</script>
<?php
return;
}

View File

@@ -99,6 +99,7 @@ class task_period_ftpPull extends task_appboxAbstract
<?php echo $form ?>.passive.checked = <?php echo p4field::isyes($sxml->passive) ? "true" : 'false' ?>;
</script>
<?php
return("");
} else { // ... so we NEVER come here
// bad xml

View File

@@ -155,6 +155,7 @@ class task_period_outofdate extends task_abstract
parent.calcSQL();
</script>
<?php
return("");
}
else { // ... so we NEVER come here

View File

@@ -142,6 +142,7 @@ class task_period_subdef extends task_databoxAbstract
<?php echo $form ?>.maxmegs.value = "<?php echo p4string::MakeString($sxml->maxmegs, "js", '"') ?>";
</script>
<?php
return("");
}
else {

View File

@@ -118,6 +118,7 @@ class task_period_workflow01 extends task_databoxAbstract
parent.calccmd();
</script>
<?php
return("");
}
else { // ... so we NEVER come here

View File

@@ -112,6 +112,7 @@ class task_period_writemeta extends task_databoxAbstract
<?php echo $form ?>.maxmegs.value = "<?php echo p4string::MakeString($sxml->maxmegs, "js", '"') ?>";
</script>
<?php
return("");
}
else { // ... so we NEVER come here

View File

@@ -140,8 +140,11 @@ class patch_th_2_0_3
function fixIds(connection_pdo &$connbas, &$node)
{
global $debug;
if ($node->nodeType != XML_ELEMENT_NODE)
if ($node->nodeType != XML_ELEMENT_NODE) {
return;
}
if ($node->parentNode && $node->parentNode->nodeType == XML_ELEMENT_NODE) {
$pid = $node->parentNode->getAttribute("id");
if ($pid != "") {

View File

@@ -143,8 +143,11 @@ class patch_th_2_0_4
function fixIds(connection_pdo &$connbas, &$node)
{
global $debug;
if ($node->nodeType != XML_ELEMENT_NODE)
if ($node->nodeType != XML_ELEMENT_NODE) {
return;
}
if ($node->parentNode && $node->parentNode->nodeType == XML_ELEMENT_NODE) {
$pid = $node->parentNode->getAttribute("id");
if ($pid != "") {