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