Skip to content

Commit

Permalink
update php code style
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 21, 2015
1 parent 96c3223 commit c45a48a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions library/PSX/Controller/Behaviour/RedirectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ protected function redirect($source, array $parameters = array(), $code = 307)

if ($code == 301) {
throw new StatusCode\MovedPermanentlyException($url);
} else if ($code == 302) {
} elseif ($code == 302) {
throw new StatusCode\FoundException($url);
} else if ($code == 307) {
} elseif ($code == 307) {
throw new StatusCode\TemporaryRedirectException($url);
} else {
throw new RuntimeException('Invalid redirect status code');
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Data/Schema/Visitor/ValidationVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ValidationVisitor implements VisitorInterface

/**
* Sets an optional validator which can validate each value through custom
* filters. This should only be used for filters which can not be defined
* filters. This should only be used for filters which can not be defined
* inside a JsonSchema like i.e. check whether a row exists in a database
*/
public function setValidator(ValidatorInterface $validator)
Expand Down
4 changes: 2 additions & 2 deletions library/PSX/Json/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

/**
* Comparator
*
*
* @author Christoph Kappestein <k42b3.x@gmail.com>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link http://phpsx.org
*/
class Comparator
{
/**
* Compares whether two values are equals. Uses the comparsion rules
* Compares whether two values are equals. Uses the comparsion rules
* described in the JSON patch RFC
*
* @see https://tools.ietf.org/html/rfc6902#section-4.6
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Json/Patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Class to apply patch operations on a json object. Based on the json-patch-php
* library but works with stdClass instead of associative arrays
*
*
* @author Christoph Kappestein <k42b3.x@gmail.com>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link http://phpsx.org
Expand Down
4 changes: 2 additions & 2 deletions library/PSX/Json/Pointer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/**
* Pointer
*
*
* @author Christoph Kappestein <k42b3.x@gmail.com>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link http://phpsx.org
Expand Down Expand Up @@ -84,7 +84,7 @@ private function parsePointer($path)
throw new InvalidArgumentException('Pointer must start with a /');
}

return array_map(function($value) {
return array_map(function ($value) {
return str_replace(['~1', '~0'], ['/', '~'], $value);
}, $parts);
}
Expand Down
8 changes: 4 additions & 4 deletions library/PSX/Sql/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public function add($column, $operator, $value, $conjunction = 'AND')

if ($operator == 'IN' && is_array($value)) {
$expr = new Condition\In($column, $value, $conjunction);
} elseif(($operator == '=' || $operator == 'IS') && $value === null) {
} elseif (($operator == '=' || $operator == 'IS') && $value === null) {
$expr = new Condition\Nil($column, $conjunction);
} elseif(($operator == '!=' || $operator == 'IS NOT') && $value === null) {
} elseif (($operator == '!=' || $operator == 'IS NOT') && $value === null) {
$expr = new Condition\NotNil($column, $conjunction);
} else {
$expr = new Condition\Basic($column, $operator, $value, $conjunction);
Expand Down Expand Up @@ -443,9 +443,9 @@ public function getArray()
foreach ($this->expressions as $expr) {
if ($expr instanceof Condition\In) {
$result[$expr->getColumn()] = $expr->getValues();
} elseif($expr instanceof Condition\Nil) {
} elseif ($expr instanceof Condition\Nil) {
$result[$expr->getColumn()] = null;
} elseif($expr instanceof Condition\Basic) {
} elseif ($expr instanceof Condition\Basic) {
$result[$expr->getColumn()] = current($expr->getValues());
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Validate/ValidatorAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function getPropertyValue(Property $property, $value, $key)
try {
$result = $this->validate->apply($value, $property->getType(), $property->getFilters(), $key, $property->isRequired());

// if we have no error and the value is not true the filter has
// if we have no error and the value is not true the filter has
// modified the value
if ($result !== true) {
return $result;
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Validate/ValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ValidatorInterface
const COLLECT_ERRORS = 2;

/**
* Goes through the data structure and calls for each property the
* Goes through the data structure and calls for each property the
* validateProperty method. Data must be an object structure
*
* @param mixed $data
Expand Down

0 comments on commit c45a48a

Please sign in to comment.