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

Commit

Permalink
Merge branch 'hotfix/2878'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Nov 16, 2012
151 parents 98a3cf5 + b6d0c88 + 7edee62 + 60ea64c + a08bcca + b40ec3e + 63172ed + 448f428 + 92a516a + 5ecbc99 + a2df21b + 4de87f2 + 7c259ec + a22bdcb + 084ad9f + 9414e5a + 489be93 + cb39e7e + 54a28dc + c9c769e + dda791d + 70d382a + 8bbad0e + 9321185 + 7ab35a6 + b93694e + 3ea7087 + 0fe3d3a + bd5e189 + d1cba17 + 8d75392 + 3fb5b55 + 6cb0ccb + 30aa565 + 8409977 + 8074ba0 + 8f92486 + 94860d1 + 05d33c4 + 425826b + f0e91f0 + e31468f + 7d2af87 + 2e4dc80 + 19d128f + 1b9e4b2 + 1c46483 + fdda3f2 + 595fcd1 + 213395c + 8e514a8 + 2f30186 + bb4ed65 + 132d5b6 + 030ff33 + f2f20f3 + a50e133 + 4c554ee + dbfb1b8 + ccab83f + 00b350f + 78945d0 + f0e5f4b + ceb7d8c + 9e124d1 + 3de5912 + b6a974a + 10a6438 + cb6c1e7 + 18afd6c + 3baf1bd + c800904 + f52dcb8 + 126ccb2 + e7d6206 + e2d24ab + ec1abfc + 290ea90 + 9f4ca1b + edaa760 + c4c0c95 + d21f055 + 5b18029 + e6b97af + 010fb36 + 64c7b8d + 636523e + 4cc2cd6 + e34098a + 16367cd + 943c77f + 8226e5b + 0b47726 + 3cd8a03 + cc4782c + 9c653a6 + 656dbe5 + 9bce1ba + 7dc18ca + 861130d + 2d2ffbd + 4f413a5 + 2e1067a + 1d082e4 + e8aeb79 + b562091 + ff2fdc3 + 4aa72c0 + 1bb67ac + cd015c8 + 5e89910 + 0c21258 + dd54faf + 57f9063 + b88ce2e + af68643 + 06cd3b4 + 2c71b71 + ee02c35 + 9456314 + 5a77a7b + e98a077 + 738f2e6 + cb1e63c + 736df07 + d0a0154 + 990523c + 78687de + a5b6e79 + 6e9dfe9 + e201a1c + d9b45ef + 76222ad + 16d67da + 1ab2258 + b81d711 + ed2e9bc + 61efe82 + f353ea5 + 1f02519 + 58c1fe8 + ed502d9 + 2defba6 + 4885013 + 06a8384 + 17d9eed + 3b21b5d + c62101c + 909ef34 + 13d376a + f52633c commit 8a75367
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/ArrayUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public static function merge(array $a, array $b)
if (is_int($key)) {
$a[] = $value;
} elseif (is_array($value) && is_array($a[$key])) {
$a[$key] = self::merge($a[$key], $value);
$a[$key] = static::merge($a[$key], $value);
} else {
$a[$key] = $value;
}
Expand Down
20 changes: 10 additions & 10 deletions src/CallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ protected function registerCallback($callback)
throw new Exception\InvalidCallbackException('Invalid callback provided; not callable');
}

if (null === self::$hasWeakRefExtension) {
self::$hasWeakRefExtension = class_exists('WeakRef');
if (null === static::$hasWeakRefExtension) {
static::$hasWeakRefExtension = class_exists('WeakRef');
}

// If pecl/weakref is not installed, simply store the callback and return
if (!self::$hasWeakRefExtension) {
if (!static::$hasWeakRefExtension) {
$this->callback = $callback;
return;
}
Expand Down Expand Up @@ -172,13 +172,13 @@ public function call(array $args = array())
}

// Minor performance tweak, if the callback gets called more than once
if (!isset(self::$isPhp54)) {
self::$isPhp54 = version_compare(PHP_VERSION, '5.4.0rc1', '>=');
if (!isset(static::$isPhp54)) {
static::$isPhp54 = version_compare(PHP_VERSION, '5.4.0rc1', '>=');
}

$argCount = count($args);

if (self::$isPhp54 && is_string($callback)) {
if (static::$isPhp54 && is_string($callback)) {
$result = $this->validateStringCallbackFor54($callback);

if ($result !== true && $argCount <= 3) {
Expand All @@ -193,27 +193,27 @@ public function call(array $args = array())
// reached
switch ($argCount) {
case 0:
if (self::$isPhp54) {
if (static::$isPhp54) {
return $callback();
}
return call_user_func($callback);
case 1:
if (self::$isPhp54) {
if (static::$isPhp54) {
return $callback(array_shift($args));
}
return call_user_func($callback, array_shift($args));
case 2:
$arg1 = array_shift($args);
$arg2 = array_shift($args);
if (self::$isPhp54) {
if (static::$isPhp54) {
return $callback($arg1, $arg2);
}
return call_user_func($callback, $arg1, $arg2);
case 3:
$arg1 = array_shift($args);
$arg2 = array_shift($args);
$arg3 = array_shift($args);
if (self::$isPhp54) {
if (static::$isPhp54) {
return $callback($arg1, $arg2, $arg3);
}
return call_user_func($callback, $arg1, $arg2, $arg3);
Expand Down
20 changes: 10 additions & 10 deletions src/Glob.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ abstract class Glob
public static function glob($pattern, $flags, $forceFallback = false)
{
if (!defined('GLOB_BRACE') || $forceFallback) {
return self::fallbackGlob($pattern, $flags);
return static::fallbackGlob($pattern, $flags);
} else {
return self::systemGlob($pattern, $flags);
return static::systemGlob($pattern, $flags);
}
}

Expand Down Expand Up @@ -92,7 +92,7 @@ protected static function systemGlob($pattern, $flags)
protected static function fallbackGlob($pattern, $flags)
{
if (!$flags & self::GLOB_BRACE) {
return self::systemGlob($pattern, $flags);
return static::systemGlob($pattern, $flags);
}

$flags &= ~self::GLOB_BRACE;
Expand All @@ -119,22 +119,22 @@ protected static function fallbackGlob($pattern, $flags)
}

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

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

if ($next === null) {
return self::systemGlob($pattern, $flags);
return static::systemGlob($pattern, $flags);
}

$rest = $next;

while ($pattern[$rest] !== '}') {
$rest = self::nextBraceSub($pattern, $rest + 1, $flags);
$rest = static::nextBraceSub($pattern, $rest + 1, $flags);

if ($rest === null) {
return self::systemGlob($pattern, $flags);
return static::systemGlob($pattern, $flags);
}
}

Expand All @@ -145,7 +145,7 @@ protected static function fallbackGlob($pattern, $flags)
. substr($pattern, $p, $next - $p)
. substr($pattern, $rest + 1);

$result = self::fallbackGlob($subPattern, $flags | self::GLOB_BRACE);
$result = static::fallbackGlob($subPattern, $flags | self::GLOB_BRACE);

if ($result) {
$paths = array_merge($paths, $result);
Expand All @@ -156,7 +156,7 @@ protected static function fallbackGlob($pattern, $flags)
}

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

return array_unique($paths);
Expand Down
6 changes: 3 additions & 3 deletions src/Hydrator/Reflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ protected static function getReflProperties($input)
throw new Exception\InvalidArgumentException('Input must be a string or an object.');
}

if (!isset(self::$reflProperties[$input])) {
if (!isset(static::$reflProperties[$input])) {
$reflClass = new ReflectionClass($input);
$reflProperties = $reflClass->getProperties();

foreach ($reflProperties as $property) {
$property->setAccessible(true);
self::$reflProperties[$input][$property->getName()] = $property;
static::$reflProperties[$input][$property->getName()] = $property;
}
}

return self::$reflProperties[$input];
return static::$reflProperties[$input];
}
}

0 comments on commit 8a75367

Please sign in to comment.