mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
Fix coding standards
This commit is contained in:
@@ -94,12 +94,12 @@ class databox_cgu
|
||||
$terms = array();
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
|
||||
|
||||
if(!$home)
|
||||
{
|
||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
}
|
||||
|
||||
|
||||
foreach ($appbox->get_databoxes() as $databox)
|
||||
{
|
||||
try
|
||||
|
@@ -94,7 +94,7 @@ class databox_descriptionStructure implements IteratorAggregate
|
||||
public function get_element_by_name($name)
|
||||
{
|
||||
$name = databox_field::generateName($name);
|
||||
|
||||
|
||||
if (isset($this->cache_name_id[$name]))
|
||||
|
||||
return $this->elements[$this->cache_name_id[$name]];
|
||||
|
@@ -667,7 +667,7 @@ class databox_field implements cache_cacheableInterface
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -875,14 +875,14 @@ class databox_field implements cache_cacheableInterface
|
||||
|
||||
return self::get_instance($databox, $id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static function generateName($name)
|
||||
{
|
||||
$unicode_processor = new unicode();
|
||||
|
||||
$name = $unicode_processor->remove_nonazAZ09($name, false, false);
|
||||
|
||||
|
||||
return $unicode_processor->remove_first_digits($name);
|
||||
}
|
||||
|
||||
|
@@ -479,7 +479,7 @@ class databox_status
|
||||
$conn = connection::getPDOConnection();
|
||||
|
||||
$status = '0';
|
||||
|
||||
|
||||
if(substr($stat1, 0, 2) === '0x')
|
||||
{
|
||||
$stat1 = self::hex2bin(substr($stat1, 2));
|
||||
@@ -518,7 +518,7 @@ class databox_status
|
||||
{
|
||||
$stat2 = self::hex2bin(substr($stat2, 2));
|
||||
}
|
||||
|
||||
|
||||
$sql = 'select bin(0b' . trim($stat1) . ' & ~0b' . trim($stat2) . ') as result';
|
||||
|
||||
$stmt = $conn->prepare($sql);
|
||||
@@ -548,7 +548,7 @@ class databox_status
|
||||
{
|
||||
$stat2 = self::hex2bin(substr($stat2, 2));
|
||||
}
|
||||
|
||||
|
||||
$sql = 'select bin(0b' . trim($stat1) . ' | 0b' . trim($stat2) . ') as result';
|
||||
|
||||
$stmt = $conn->prepare($sql);
|
||||
@@ -567,12 +567,12 @@ class databox_status
|
||||
public static function dec2bin($status)
|
||||
{
|
||||
$status = (string) $status;
|
||||
|
||||
|
||||
if(!ctype_digit($status))
|
||||
{
|
||||
throw new \Exception('Non-decimal value');
|
||||
}
|
||||
|
||||
|
||||
$conn = connection::getPDOConnection();
|
||||
|
||||
$sql = 'select bin(' . $status . ') as result';
|
||||
@@ -583,7 +583,7 @@ class databox_status
|
||||
$stmt->closeCursor();
|
||||
|
||||
$status = '0';
|
||||
|
||||
|
||||
if ($row)
|
||||
{
|
||||
$status = $row['result'];
|
||||
@@ -599,12 +599,12 @@ class databox_status
|
||||
{
|
||||
$status = substr($status, 2);
|
||||
}
|
||||
|
||||
|
||||
if(!ctype_xdigit($status))
|
||||
{
|
||||
throw new \Exception('Non-hexadecimal value');
|
||||
}
|
||||
|
||||
|
||||
$conn = connection::getPDOConnection();
|
||||
|
||||
$sql = 'select BIN( CAST( 0x'.trim($status).' AS UNSIGNED ) ) as result';
|
||||
@@ -615,7 +615,7 @@ class databox_status
|
||||
$stmt->closeCursor();
|
||||
|
||||
$status = '0';
|
||||
|
||||
|
||||
if ($row)
|
||||
{
|
||||
$status = $row['result'];
|
||||
|
Reference in New Issue
Block a user