private static function popInvocation(WikiaMockProxyInvocation $invocation) { if (empty($invocation->uuid)) { return; } $stackInfo = $invocation->uuid; $index = $stackInfo['index']; // no match, something stupid happened if (count(self::$invocationStack) <= $index || $stackInfo !== $invocation->uuid) { // todo: log it Wikia::log(__METHOD__, false, "could not pop invocation: " . (string) $invocation); return; } self::$invocationStack = array_slice(self::$invocationStack, 0, $index); }