Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
[PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_space…
Browse files Browse the repository at this point in the history
…s,linefeed

Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed
  • Loading branch information
Maks3w committed Jul 12, 2012
1 parent e201a1c commit dda791d
Show file tree
Hide file tree
Showing 25 changed files with 163 additions and 165 deletions.
6 changes: 3 additions & 3 deletions src/ArraySerializableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ interface ArraySerializableInterface
{
/**
* Exchange internal values from provided array
*
* @param array $array
*
* @param array $array
* @return void
*/
public function exchangeArray(array $array);

/**
* Return an array representation of the object
*
*
* @return array
*/
public function getArrayCopy();
Expand Down
4 changes: 2 additions & 2 deletions src/ArrayStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class ArrayStack extends ArrayObject
/**
* Retrieve iterator
*
* Retrieve an array copy of the object, reverse its order, and return an
* Retrieve an array copy of the object, reverse its order, and return an
* ArrayIterator with that reversed array.
*
*
* @return ArrayIterator
*/
public function getIterator()
Expand Down
16 changes: 8 additions & 8 deletions src/ArrayUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function hasStringKeys($value, $allowEmpty = false)
{
if (!is_array($value)) {
return false;
}
}

if (!$value) {
return $allowEmpty;
Expand All @@ -53,7 +53,7 @@ public static function hasIntegerKeys($value, $allowEmpty = false)
{
if (!is_array($value)) {
return false;
}
}

if (!$value) {
return $allowEmpty;
Expand All @@ -80,8 +80,8 @@ public static function hasNumericKeys($value, $allowEmpty = false)
{
if (!is_array($value)) {
return false;
}
}

if (!$value) {
return $allowEmpty;
}
Expand Down Expand Up @@ -113,8 +113,8 @@ public static function isList($value, $allowEmpty = false)
{
if (!is_array($value)) {
return false;
}
}

if (!$value) {
return $allowEmpty;
}
Expand Down Expand Up @@ -155,8 +155,8 @@ public static function isHashTable($value, $allowEmpty = false)
{
if (!is_array($value)) {
return false;
}
}

if (!$value) {
return $allowEmpty;
}
Expand Down
34 changes: 17 additions & 17 deletions src/CallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class CallbackHandler

/**
* Constructor
*
*
* @param string $event Event to which slot is subscribed
* @param string|array|object $callback PHP callback
* @param string|array|object $callback PHP callback
* @param array $options Options used by the callback handler (e.g., priority)
* @return void
*/
Expand All @@ -54,14 +54,14 @@ public function __construct($callback, array $metadata = array())
/**
* Registers the callback provided in the constructor
*
* If you have pecl/weakref {@see http://pecl.php.net/weakref} installed,
* If you have pecl/weakref {@see http://pecl.php.net/weakref} installed,
* this method provides additional behavior.
*
* If a callback is a functor, or an array callback composing an object
* If a callback is a functor, or an array callback composing an object
* instance, this method will pass the object to a WeakRef instance prior
* to registering the callback.
*
* @param callback $callback
*
* @param callback $callback
* @return void
*/
protected function registerCallback($callback)
Expand Down Expand Up @@ -93,7 +93,7 @@ protected function registerCallback($callback)

list($target, $method) = $callback;

// If we have an array callback, and the first argument is not an
// If we have an array callback, and the first argument is not an
// object, register as-is
if (!is_object($target)) {
$this->callback = $callback;
Expand All @@ -108,7 +108,7 @@ protected function registerCallback($callback)

/**
* Retrieve registered callback
*
*
* @return Callback
*/
public function getCallback()
Expand All @@ -130,7 +130,7 @@ public function getCallback()
return $callback;
}

// Array callback with WeakRef object -- retrieve the object first, and
// Array callback with WeakRef object -- retrieve the object first, and
// then return
list($target, $method) = $callback;
if ($target instanceof WeakRef) {
Expand All @@ -143,7 +143,7 @@ public function getCallback()

/**
* Invoke handler
*
*
* @param array $args Arguments to pass to callback
* @return mixed
*/
Expand All @@ -162,7 +162,7 @@ public function call(array $args = array())
$this->validateStringCallbackFor54($callback);
}

// Minor performance tweak; use call_user_func() until > 3 arguments
// Minor performance tweak; use call_user_func() until > 3 arguments
// reached
switch (count($args)) {
case 0:
Expand Down Expand Up @@ -197,7 +197,7 @@ public function call(array $args = array())

/**
* Invoke as functor
*
*
* @return mixed
*/
public function __invoke()
Expand All @@ -207,7 +207,7 @@ public function __invoke()

/**
* Get all callback metadata
*
*
* @return array
*/
public function getMetadata()
Expand All @@ -217,8 +217,8 @@ public function getMetadata()

/**
* Retrieve a single metadatum
*
* @param string $name
*
* @param string $name
* @return mixed
*/
public function getMetadatum($name)
Expand All @@ -233,8 +233,8 @@ public function getMetadatum($name)
* Validate a static method call
*
* Validates that a static method call in PHP 5.4 will actually work
*
* @param string $callback
*
* @param string $callback
* @return true
* @throws Exception\InvalidCallbackException if invalid
*/
Expand Down
44 changes: 22 additions & 22 deletions src/Glob.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ abstract class Glob
const GLOB_ONLYDIR = 0x20;
const GLOB_ERR = 0x30;
/**#@-*/

/**
* Find pathnames matching a pattern.
*
*
* @see http://docs.php.net/glob
* @param string $pattern
* @param integer $flags
Expand All @@ -47,10 +47,10 @@ public static function glob($pattern, $flags, $forceFallback = false)
return self::systemGlob($pattern, $flags);
}
}

/**
* Use the glob function provided by the system.
*
*
* @param string $pattern
* @param integer $flags
* @return array|false
Expand Down Expand Up @@ -81,10 +81,10 @@ protected static function systemGlob($pattern, $flags)

return glob($pattern, $globFlags);
}

/**
* Expand braces manually, then use the system glob.
*
*
* @param string $pattern
* @param integer $flags
* @return array|false
Expand All @@ -94,34 +94,34 @@ protected static function fallbackGlob($pattern, $flags)
if (!$flags & self::GLOB_BRACE) {
return self::systemGlob($pattern, $flags);
}

$flags &= ~self::GLOB_BRACE;
$length = strlen($pattern);
$paths = array();

if ($flags & self::GLOB_NOESCAPE) {
$begin = strpos($pattern, '{');
} else {
$begin = 0;

while (true) {
if ($begin === $length) {
$begin = false;
break;
} else if ($pattern[$begin] === '\\' && ($begin + 1) < $length) {
} elseif ($pattern[$begin] === '\\' && ($begin + 1) < $length) {
$begin++;
} else if ($pattern[$begin] === '{') {
} elseif ($pattern[$begin] === '{') {
break;
}

$begin++;
}
}

if ($begin === false) {
return self::systemGlob($pattern, $flags);
}

$next = self::nextBraceSub($pattern, $begin + 1, $flags);

if ($next === null) {
Expand All @@ -140,7 +140,7 @@ protected static function fallbackGlob($pattern, $flags)

$p = $begin + 1;

while (true) {
while (true) {
$subPattern = substr($pattern, 0, $begin)
. substr($pattern, $p, $next - $p)
. substr($pattern, $rest + 1);
Expand All @@ -150,25 +150,25 @@ protected static function fallbackGlob($pattern, $flags)
if ($result) {
$paths = array_merge($paths, $result);
}

if ($pattern[$next] === '}') {
break;
}

$p = $next + 1;
$next = self::nextBraceSub($pattern, $p, $flags);
}

return array_unique($paths);
}

/**
* Find the end of the sub-pattern in a brace expression.
*
*
* @param string $pattern
* @param integer $begin
* @param integer $flags
* @return integer|null
* @return integer|null
*/
protected static function nextBraceSub($pattern, $begin, $flags)
{
Expand All @@ -181,12 +181,12 @@ protected static function nextBraceSub($pattern, $begin, $flags)
if (++$current === $length) {
break;
}

$current++;
} else {
} else {
if (($pattern[$current] === '}' && $depth-- === 0) || ($pattern[$current] === ',' && $depth === 0)) {
break;
} else if ($pattern[$current++] === '{') {
} elseif ($pattern[$current++] === '{') {
$depth++;
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/Hydrator/ArraySerializable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class ArraySerializable implements HydratorInterface
{
/**
* Extract values from the provided object
*
*
* Extracts values via the object's getArrayCopy() method.
*
* @param object $object
*
* @param object $object
* @return array
* @throws Exception\BadMethodCallException for an $object not implementing getArrayCopy()
*/
Expand All @@ -42,19 +42,19 @@ public function extract($object)
/**
* Hydrate an object
*
* Hydrates an object by passing $data to either its exchangeArray() or
* Hydrates an object by passing $data to either its exchangeArray() or
* populate() method.
*
* @param array $data
* @param object $object
*
* @param array $data
* @param object $object
* @return object
* @throws Exception\BadMethodCallException for an $object not implementing exchangeArray() or populate()
*/
public function hydrate(array $data, $object)
{
if (is_callable(array($object, 'exchangeArray'))) {
$object->exchangeArray($data);
} else if (is_callable(array($object, 'populate'))) {
} elseif (is_callable(array($object, 'populate'))) {
$object->populate($data);
} else {
throw new Exception\BadMethodCallException(sprintf(
Expand Down
Loading

0 comments on commit dda791d

Please sign in to comment.