mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 11:03:17 +00:00
Coding standards
This commit is contained in:
@@ -67,8 +67,10 @@ return call_user_func(function()
|
||||
$app->get('/', function() use ($app)
|
||||
{
|
||||
if ($app['install'] === true)
|
||||
|
||||
return $app->redirect('/setup/installer/');
|
||||
if ($app['upgrade'] === true)
|
||||
|
||||
return $app->redirect('/setup/upgrader/');
|
||||
});
|
||||
|
||||
|
@@ -40,6 +40,7 @@ class ArrayCache extends DoctrineArray implements Cache
|
||||
{
|
||||
throw new Exception(sprintf('Unable to find key %s', $id));
|
||||
}
|
||||
|
||||
return $this->fetch($id);
|
||||
}
|
||||
|
||||
|
@@ -49,6 +49,7 @@ class Configuration
|
||||
{
|
||||
$specifications = new Configuration\ApplicationSpecification();
|
||||
}
|
||||
|
||||
return new self($specifications, $environment);
|
||||
}
|
||||
|
||||
|
@@ -134,12 +134,14 @@ class ApplicationSpecification implements Specification
|
||||
$this->getConfigurationsFile();
|
||||
$this->getConnexionsFile();
|
||||
$this->getServicesFile();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@ class StoryWZRepository extends EntityRepository
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($a < $b) ? -1 : 1;
|
||||
});
|
||||
|
||||
|
@@ -152,6 +152,7 @@ class API_OAuth2_Form_DevAppDesktop
|
||||
$metadata->addPropertyConstraint('description', new Constraints\NotBlank($blank));
|
||||
$metadata->addPropertyConstraint('urlwebsite', new Constraints\NotBlank($blank));
|
||||
$metadata->addPropertyConstraint('urlwebsite', new Constraints\Url($url));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -159,6 +159,7 @@ class API_OAuth2_Form_DevAppInternet
|
||||
$metadata->addPropertyConstraint('urlwebsite', new Constraints\Url($url));
|
||||
$metadata->addPropertyConstraint('urlcallback', new Constraints\NotBlank($blank));
|
||||
$metadata->addPropertyConstraint('urlcallback', new Constraints\Url($url));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -220,6 +220,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
);
|
||||
}
|
||||
$result->set_datas($ret);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@@ -377,6 +377,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
if (!$response->isOk())
|
||||
{
|
||||
if ($response->err_code === 3) //Already exists in photoset
|
||||
|
||||
return;
|
||||
throw new Bridge_Exception_ApiConnectorRequestFailed();
|
||||
}
|
||||
@@ -663,12 +664,15 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
{
|
||||
|
||||
if (!$this->registry->get('GV_flickr_api'))
|
||||
|
||||
return false;
|
||||
|
||||
if (trim($this->registry->get('GV_flickr_client_id')) === '')
|
||||
|
||||
return false;
|
||||
|
||||
if (trim($this->registry->get('GV_flickr_client_secret')) === '')
|
||||
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@@ -136,10 +136,12 @@ class appbox extends base
|
||||
$custom_path.= $collection->get_base_id();
|
||||
|
||||
if (is_null($pathfile))
|
||||
|
||||
return $this;
|
||||
|
||||
$datas = file_get_contents($pathfile->getPathname());
|
||||
if (is_null($datas))
|
||||
|
||||
return $this;
|
||||
|
||||
file_put_contents($file, $datas);
|
||||
@@ -191,10 +193,12 @@ class appbox extends base
|
||||
$custom_path.= $pic_type . '_' . $databox->get_sbas_id();
|
||||
|
||||
if (is_null($pathfile))
|
||||
|
||||
return $this;
|
||||
|
||||
$datas = file_get_contents($pathfile->getPathname());
|
||||
if (is_null($datas))
|
||||
|
||||
return $this;
|
||||
|
||||
file_put_contents($file, $datas);
|
||||
@@ -540,6 +544,7 @@ class appbox extends base
|
||||
public function get_databoxes()
|
||||
{
|
||||
if ($this->databoxes)
|
||||
|
||||
return $this->databoxes;
|
||||
|
||||
$ret = array();
|
||||
|
@@ -79,6 +79,7 @@ abstract class base implements cache_cacheableInterface
|
||||
public function get_schema()
|
||||
{
|
||||
if ($this->schema)
|
||||
|
||||
return $this->schema;
|
||||
|
||||
$this->load_schema();
|
||||
@@ -167,6 +168,7 @@ abstract class base implements cache_cacheableInterface
|
||||
{
|
||||
$this->cache = $this->Core->getCache();
|
||||
}
|
||||
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
@@ -232,6 +234,7 @@ abstract class base implements cache_cacheableInterface
|
||||
{
|
||||
|
||||
if ($this->version)
|
||||
|
||||
return $this->version;
|
||||
|
||||
$version = '0.0.0';
|
||||
@@ -260,8 +263,10 @@ abstract class base implements cache_cacheableInterface
|
||||
public function upgradeavailable()
|
||||
{
|
||||
if ($this->get_version())
|
||||
|
||||
return version_compare(\Alchemy\Phrasea\Core\Version::getNumber(), $this->get_version(), '>');
|
||||
else
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -399,6 +404,7 @@ abstract class base implements cache_cacheableInterface
|
||||
protected function load_schema()
|
||||
{
|
||||
if ($this->schema)
|
||||
|
||||
return $this;
|
||||
|
||||
$structure = simplexml_load_file(__DIR__ . "/../../lib/conf.d/bases_structure.xml");
|
||||
|
1
lib/classes/cache/databox.class.php
vendored
1
lib/classes/cache/databox.class.php
vendored
@@ -59,6 +59,7 @@ class cache_databox
|
||||
if ($date <= $last_update)
|
||||
{
|
||||
self::$refreshing = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -79,6 +79,7 @@ class gatekeeper
|
||||
$session = $appbox->get_session();
|
||||
|
||||
if (http_request::is_command_line())
|
||||
|
||||
return;
|
||||
|
||||
if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF']))
|
||||
@@ -131,6 +132,7 @@ class gatekeeper
|
||||
if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php'
|
||||
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php'
|
||||
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php')
|
||||
|
||||
return;
|
||||
phrasea::redirect('/login/?redirect=/thesaurus2');
|
||||
break;
|
||||
@@ -139,6 +141,7 @@ class gatekeeper
|
||||
break;
|
||||
case 'admin':
|
||||
if ($this->_script_name === 'runscheduler.php')
|
||||
|
||||
return;
|
||||
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
|
||||
break;
|
||||
@@ -158,6 +161,7 @@ class gatekeeper
|
||||
return;
|
||||
case 'setup':
|
||||
if ($appbox->upgradeavailable())
|
||||
|
||||
return;
|
||||
else
|
||||
phrasea::redirect('/login/');
|
||||
@@ -274,6 +278,7 @@ class gatekeeper
|
||||
$parm = $request->get_parms('LOG');
|
||||
|
||||
if (is_null($parm["LOG"]))
|
||||
|
||||
return $this;
|
||||
|
||||
try
|
||||
|
@@ -306,6 +306,7 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
$output->writeln(sprintf('<error>Miss required keys %s</error>', implode(', ', $required)));
|
||||
$this->errors++;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -447,6 +448,7 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
{
|
||||
$config = new \Doctrine\DBAL\Configuration();
|
||||
$conn = \Doctrine\DBAL\DriverManager::getConnection($connexion->all(), $config);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
|
@@ -300,6 +300,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
$output->writeln(sprintf('<error>Miss required keys %s</error>', implode(', ', $required)));
|
||||
$this->errors++;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -441,6 +442,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
{
|
||||
$config = new \Doctrine\DBAL\Configuration();
|
||||
$conn = \Doctrine\DBAL\DriverManager::getConnection($connexion->all(), $config);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
@@ -896,6 +898,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return $server === $Service->getDriver()->isServer();
|
||||
}
|
||||
|
||||
|
@@ -99,6 +99,7 @@ class sphinxrt
|
||||
$cl = new SphinxClient();
|
||||
|
||||
if ($cl->Status() === false)
|
||||
|
||||
return $this;
|
||||
|
||||
$cl->SetServer($registry->get('GV_sphinx_host'), (int) $registry->get('GV_sphinx_port'));
|
||||
|
@@ -35,6 +35,7 @@ $extractDateFields = function(\Alchemy\Phrasea\Core $Core) {
|
||||
$date_sort_fields[$date['fieldname']] = $date['fieldname'];
|
||||
}
|
||||
}
|
||||
|
||||
return $date_sort_fields;
|
||||
};
|
||||
|
||||
|
@@ -53,6 +53,7 @@
|
||||
{
|
||||
var val = $.trim($('#auto_order').val());
|
||||
if(val == '')
|
||||
|
||||
return;
|
||||
|
||||
var sorter = {};
|
||||
|
@@ -53,6 +53,7 @@
|
||||
{
|
||||
var val = $.trim($('#auto_order').val());
|
||||
if(val == '')
|
||||
|
||||
return;
|
||||
|
||||
var sorter = {};
|
||||
|
@@ -155,6 +155,7 @@
|
||||
humane.error(data.message);
|
||||
}
|
||||
$dialog.refresh();
|
||||
|
||||
return;
|
||||
},
|
||||
error: function(){
|
||||
|
@@ -292,6 +292,7 @@ phrasea::headers();
|
||||
},
|
||||
success: function(data){
|
||||
alert(data.message);
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user