mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
Coding standards
This commit is contained in:
@@ -27,6 +27,7 @@ $finder
|
|||||||
->files()
|
->files()
|
||||||
->name('*.md')
|
->name('*.md')
|
||||||
->name('*.php')
|
->name('*.php')
|
||||||
|
->name('*.inc')
|
||||||
->name('*.php.dist')
|
->name('*.php.dist')
|
||||||
->name('*.twig')
|
->name('*.twig')
|
||||||
->name('*.xml')
|
->name('*.xml')
|
||||||
|
@@ -333,6 +333,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
$element = new Bridge_Api_Apitest_Element();
|
$element = new Bridge_Api_Apitest_Element();
|
||||||
$element->id = $element_id;
|
$element->id = $element_id;
|
||||||
$element->type = $object;
|
$element->type = $object;
|
||||||
|
|
||||||
return $element;
|
return $element;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,6 +342,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
$container = new Bridge_Api_Apitest_Containers();
|
$container = new Bridge_Api_Apitest_Containers();
|
||||||
$container->id = $element_id;
|
$container->id = $element_id;
|
||||||
$container->type = $object;
|
$container->type = $object;
|
||||||
|
|
||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,6 +370,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
$element_collection->add_element(new Bridge_Api_Apitest_Element());
|
$element_collection->add_element(new Bridge_Api_Apitest_Element());
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $element_collection;
|
return $element_collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,6 +383,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
$container_collection->add_element(new Bridge_Api_Apitest_Containers());
|
$container_collection->add_element(new Bridge_Api_Apitest_Containers());
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $container_collection;
|
return $container_collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,6 +429,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
return $func;
|
return $func;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,8 +468,10 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
if (self::$hasError)
|
if (self::$hasError)
|
||||||
{
|
{
|
||||||
self::$hasError = false;
|
self::$hasError = false;
|
||||||
|
|
||||||
return array('title' => 'too long');
|
return array('title' => 'too long');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,6 +500,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
elseif (self::$hasError)
|
elseif (self::$hasError)
|
||||||
{
|
{
|
||||||
self::$hasError = false;
|
self::$hasError = false;
|
||||||
|
|
||||||
return array('title' => 'too long');
|
return array('title' => 'too long');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -88,6 +88,7 @@ class W3CFeedUrlValidator extends W3CFeedValidator
|
|||||||
{
|
{
|
||||||
throw new W3CFeedValidatorException("Unable to request W3C API");
|
throw new W3CFeedValidatorException("Unable to request W3C API");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new W3CFeedValidatorResponse($response);
|
return new W3CFeedValidatorResponse($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,6 +152,7 @@ class W3CFeedRawValidator extends W3CFeedValidator
|
|||||||
{
|
{
|
||||||
throw new W3CFeedValidatorException("Unable to request W3C API");
|
throw new W3CFeedValidatorException("Unable to request W3C API");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new W3CFeedValidatorResponse($response);
|
return new W3CFeedValidatorResponse($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,6 +211,7 @@ class W3CFeedValidatorResponse
|
|||||||
$string .= $name . "=>" . $detail . "\n";
|
$string .= $name . "=>" . $detail . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,6 +222,7 @@ class W3CFeedValidatorResponse
|
|||||||
public function isValid()
|
public function isValid()
|
||||||
{
|
{
|
||||||
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:validity";
|
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:validity";
|
||||||
|
|
||||||
return $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== "false";
|
return $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,6 +233,7 @@ class W3CFeedValidatorResponse
|
|||||||
public function hasError()
|
public function hasError()
|
||||||
{
|
{
|
||||||
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:errors/m:errorcount";
|
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:errors/m:errorcount";
|
||||||
|
|
||||||
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
|
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +244,7 @@ class W3CFeedValidatorResponse
|
|||||||
public function hasWarning()
|
public function hasWarning()
|
||||||
{
|
{
|
||||||
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:warnings/m:warningcount";
|
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:warnings/m:warningcount";
|
||||||
|
|
||||||
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
|
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,6 +292,7 @@ class W3CFeedValidatorResponse
|
|||||||
$warnings[] = $this->domNodeToArray($warning);
|
$warnings[] = $this->domNodeToArray($warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $warnings;
|
return $warnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,6 +312,7 @@ class W3CFeedValidatorResponse
|
|||||||
$errors[] = $this->domNodeToArray($error);
|
$errors[] = $this->domNodeToArray($error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1172,6 +1172,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
|||||||
self::$generated_subdefs['a23'] = true;
|
self::$generated_subdefs['a23'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
function getRawEditorData($paramName) {
|
function getRawEditorData($paramName) {
|
||||||
if ($paramName) {
|
if ($paramName) {
|
||||||
if (isset($_POST[$paramName])) {
|
if (isset($_POST[$paramName])) {
|
||||||
return $_POST[$paramName];
|
return $_POST[$paramName];
|
||||||
} else if (isset($_GET[$paramName])) {
|
} else if (isset($_GET[$paramName])) {
|
||||||
return $_GET[$paramName];
|
return $_GET[$paramName];
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
function getRawData($paramName) {
|
function getRawData($paramName) {
|
||||||
if ($paramName) {
|
if ($paramName) {
|
||||||
if (isset($_POST[$paramName])) {
|
if (isset($_POST[$paramName])) {
|
||||||
return $_POST[$paramName];
|
return $_POST[$paramName];
|
||||||
} else if (isset($_GET[$paramName])) {
|
} else if (isset($_GET[$paramName])) {
|
||||||
return $_GET[$paramName];
|
return $_GET[$paramName];
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user