issue 2662 coding convention

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12220 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-11-14 09:59:39 +00:00
parent f9ca200edf
commit 15fa10dc39
11 changed files with 697 additions and 522 deletions

View file

@ -4,9 +4,8 @@
*
* @author NHN (developers@xpressengine.com)
*/
class Object {
class Object
{
/**
* Error code. If `0`, it is not an error.
* @var int
@ -39,7 +38,8 @@ class Object {
* @param string $message Error message
* @return void
*/
function Object($error = 0, $message = 'success') {
function Object($error = 0, $message = 'success')
{
$this->setError($error);
$this->setMessage($message);
}
@ -51,7 +51,8 @@ class Object {
* @param int $error error code
* @return void
*/
function setError($error = 0) {
function setError($error = 0)
{
$this->error = $error;
}
@ -60,7 +61,8 @@ class Object {
*
* @return int Returns an error code
*/
function getError() {
function getError()
{
return $this->error;
}
@ -91,7 +93,8 @@ class Object {
* @param string $message Error message
* @return bool Alaways returns true.
*/
function setMessage($message = 'success') {
function setMessage($message = 'success')
{
if(Context::getLang($message)) $message = Context::getLang($message);
$this->message = $message;
@ -104,7 +107,8 @@ class Object {
*
* @return string Returns message
*/
function getMessage() {
function getMessage()
{
return $this->message;
}
@ -115,7 +119,8 @@ class Object {
* @param mixed $val A value for the variable
* @return void
*/
function add($key, $val) {
function add($key, $val)
{
$this->variables[$key] = $val;
}
@ -144,7 +149,8 @@ class Object {
* @param string $key
* @return string Returns value to a given key
*/
function get($key) {
function get($key)
{
return $this->variables[$key];
}
@ -154,10 +160,12 @@ class Object {
*
* @return Object Returns an object containing key/value pairs
*/
function gets() {
function gets()
{
$num_args = func_num_args();
$args_list = func_get_args();
for($i=0;$i<$num_args;$i++) {
for($i=0;$i<$num_args;$i++)
{
$key = $args_list[$i];
$output->{$key} = $this->get($key);
}
@ -169,7 +177,8 @@ class Object {
*
* @return array
*/
function getVariables() {
function getVariables()
{
return $this->variables;
}
@ -178,7 +187,8 @@ class Object {
*
* @return Object
*/
function getObjectVars() {
function getObjectVars()
{
foreach($this->variables as $key => $val) $output->{$key} = $val;
return $output;
}
@ -188,7 +198,8 @@ class Object {
*
* @return bool Retruns true : error isn't 0 or false : otherwise.
*/
function toBool() {
function toBool()
{
// TODO This method is misleading in that it returns true if error is 0, which should be true in boolean representation.
return $this->error==0?true:false;
}
@ -199,8 +210,9 @@ class Object {
*
* @return bool
*/
function toBoolean() {
return $this->toBool();
function toBoolean()
{
return $this->toBool();
}
}