Permalink
Browse files

Merge pull request #2369 branch 'hotfix/remove-unused-vars'

  • Loading branch information...
Maks3w committed Sep 15, 2012
2 parents a265997 + 32da576 commit b09b5cf65df0d8ef4d1db973a0724ba3a9dc9de6
@@ -257,7 +257,7 @@ public function authenticate()
/* Iterate through each server and try to authenticate the supplied
* credentials against it.
*/
- foreach ($this->options as $name => $options) {
+ foreach ($this->options as $options) {
if (!is_array($options)) {
throw new Exception\InvalidArgumentException('Adapter options array not an array');
@@ -143,7 +143,6 @@ public function getIterator()
$options = $this->getOptions();
$prefix = $options->getNamespace() . $options->getNamespaceSeparator();
$pattern = '/^' . preg_quote($prefix, '/') . '/';
- $format = 0;
$baseIt = new BaseApcIterator('user', $pattern, 0, 1, \APC_LIST_ACTIVE);
return new ApcIterator($this, $baseIt, $prefix);
@@ -193,8 +193,6 @@ public function clearByNamespace($namespace)
. str_repeat(\DIRECTORY_SEPARATOR . $nsPrefix . '*', $options->getDirLevel())
. \DIRECTORY_SEPARATOR . $nsPrefix . '*';
$glob = new GlobIterator($path, $flags);
- $time = time();
- $ttl = $options->getTtl();
ErrorHandler::start();
foreach ($glob as $pathname) {
@@ -227,8 +225,6 @@ public function clearByPrefix($prefix)
. str_repeat(\DIRECTORY_SEPARATOR . $nsPrefix . '*', $options->getDirLevel())
. \DIRECTORY_SEPARATOR . $nsPrefix . $prefix . '*';
$glob = new GlobIterator($path, $flags);
- $time = time();
- $ttl = $options->getTtl();
ErrorHandler::start();
foreach ($glob as $pathname) {
@@ -317,8 +313,6 @@ public function clearByTags(array $tags, $disjunction = false)
. str_repeat(\DIRECTORY_SEPARATOR . $prefix . '*', $options->getDirLevel())
. \DIRECTORY_SEPARATOR . $prefix . '*.tag';
$glob = new GlobIterator($path, $flags);
- $time = time();
- $ttl = $options->getTtl();
foreach ($glob as $pathname) {
$diff = array_diff($tags, explode("\n", $this->getFileContent($pathname)));
@@ -884,7 +878,6 @@ public function replaceItems(array $keyValuePairs)
*/
protected function internalSetItem(& $normalizedKey, & $value)
{
- $options = $this->getOptions();
$filespec = $this->getFileSpec($normalizedKey);
$this->prepareDirectoryStructure($filespec);
@@ -903,7 +896,6 @@ protected function internalSetItem(& $normalizedKey, & $value)
*/
protected function internalSetItems(array & $normalizedKeyValuePairs)
{
- $baseOptions = $this->getOptions();
$oldUmask = null;
// create an associated array of files and contents to write
@@ -302,7 +302,7 @@ protected function internalGetMetadatas(array & $normalizedKeys)
throw $this->getExceptionByResultCode($this->memcached->getResultCode());
}
- foreach ($result as $key => & $value) {
+ foreach ($result as & $value) {
$value = array();
}
@@ -218,7 +218,6 @@ public function onIncrementItemsPre(Event $event)
}
$failedKeys = $storage->setItems($keyValuePairs);
- $result = array();
foreach ($failedKeys as $failedKey) {
unset($keyValuePairs[$failedKey]);
}
@@ -74,7 +74,6 @@ public function sendHeaders()
}
if (!$httpCodeSent) {
header('HTTP/1.1 ' . $this->statusCode);
- $httpCodeSent = true;
}
}
@@ -583,7 +583,7 @@ public function isValid($files = null)
$translator = $this->getTranslator();
$this->messages = array();
$break = false;
- foreach ($check as $key => $content) {
+ foreach ($check as $content) {
if (array_key_exists('validators', $content) &&
in_array('Zend\Validator\File\Count', $content['validators'])) {
$validator = $this->validators['Zend\Validator\File\Count'];
@@ -416,7 +416,7 @@ public function decrypt($value)
throw new Exception\RuntimeException('Please give an envelope key for decryption with Openssl');
}
- foreach ($this->keys['private'] as $key => $cert) {
+ foreach ($this->keys['private'] as $cert) {
$keys = openssl_pkey_get_private($cert, $this->getPassphrase());
}
@@ -1136,7 +1136,7 @@ protected function prepareBody()
}
// Encode files
- foreach ($this->getRequest()->getFiles()->toArray() as $key => $file) {
+ foreach ($this->getRequest()->getFiles()->toArray() as $file) {
$fhead = array('Content-Type' => $file['ctype']);
$body .= $this->encodeFormData($boundary, $file['formname'], $file['data'], $file['filename'], $fhead);
}
@@ -286,8 +286,6 @@ public function advance($id = null)
*/
protected function getNextToken()
{
- $token = array();
-
while ($this->string[$this->currentPos] === ' ' || $this->string[$this->currentPos] === "\t") {
$this->currentPos++;
}
@@ -466,7 +466,7 @@ protected function _getSmdMethods()
if (null === $this->smdMethods) {
$this->smdMethods = array();
$methods = get_class_methods('Zend\\Json\\Server\\Smd');
- foreach ($methods as $key => $method) {
+ foreach ($methods as $method) {
if (!preg_match('/^(set|get)/', $method)) {
continue;
}
@@ -393,7 +393,6 @@ public function getReturn()
*/
public function toArray()
{
- $name = $this->getName();
$envelope = $this->getEnvelope();
$target = $this->getTarget();
$transport = $this->getTransport();
@@ -379,7 +379,7 @@ public function escapeString($string)
public function escapeList($list)
{
$result = array();
- foreach ($list as $k => $v) {
+ foreach ($list as $v) {
if (!is_array($v)) {
// $result[] = $this->escapeString($v);
$result[] = $v;
@@ -166,7 +166,7 @@ public function onLoadModulesPost(ModuleEvent $e)
// Merge all of the collected configs
$this->mergedConfig = $this->getOptions()->getExtraConfig() ?: array();
- foreach ($this->configs as $key => $config) {
+ foreach ($this->configs as $config) {
$this->mergedConfig = ArrayUtils::merge($this->mergedConfig, $config);
}
@@ -839,7 +839,7 @@ protected function roleDFSVisitAllPrivileges(Role\RoleInterface $role, Resource\
}
$dfs['visited'][$role->getRoleId()] = true;
- foreach ($this->getRoleRegistry()->getParents($role) as $roleParentId => $roleParent) {
+ foreach ($this->getRoleRegistry()->getParents($role) as $roleParent) {
$dfs['stack'][] = $roleParent;
}
@@ -925,7 +925,7 @@ protected function roleDFSVisitOnePrivilege(Role\RoleInterface $role, Resource\R
}
$dfs['visited'][$role->getRoleId()] = true;
- foreach ($this->getRoleRegistry()->getParents($role) as $roleParentId => $roleParent) {
+ foreach ($this->getRoleRegistry()->getParents($role) as $roleParent) {
$dfs['stack'][] = $roleParent;
}
@@ -201,7 +201,7 @@ public function setHashFunction($hashFunction)
{
$hashFunction = (string) $hashFunction;
$validHashFunctions = $this->getHashFunctions();
- if (!in_array($hashFunction, $this->getHashFunctions(), true)) {
+ if (!in_array($hashFunction, $validHashFunctions, true)) {
throw new Exception\InvalidArgumentException('Invalid hash function provided');
}
@@ -349,7 +349,7 @@ public function getSoapVersion()
*/
public function setClassmap(array $classmap)
{
- foreach ($classmap as $type => $class) {
+ foreach ($classmap as $class) {
if (!class_exists($class)) {
throw new Exception\InvalidArgumentException('Invalid class in class map');
}
@@ -385,7 +385,7 @@ public function setClassmap($classmap)
if (!is_array($classmap)) {
throw new Exception\InvalidArgumentException('Classmap must be an array');
}
- foreach ($classmap as $type => $class) {
+ foreach ($classmap as $class) {
if (!class_exists($class)) {
throw new Exception\InvalidArgumentException('Invalid class in class map');
}
@@ -51,8 +51,6 @@ public function addComplexType($type)
$this->getContext()->addType($type, $soapType);
- $defaultProperties = $class->getDefaultProperties();
-
$defaultProperties = $class->getDefaultProperties();
$complexType = $dom->createElement('xsd:complexType');
@@ -80,7 +80,7 @@ protected static function getReflProperties($input)
$reflClass = new ReflectionClass($input);
$reflProperties = $reflClass->getProperties();
- foreach ($reflProperties as $key => $property) {
+ foreach ($reflProperties as $property) {
$property->setAccessible(true);
self::$reflProperties[$input][$property->getName()] = $property;
}
@@ -57,7 +57,6 @@ public function __construct(\Exception $e)
$this->exception = $e;
$code = 404;
$message = 'Unknown error';
- $exceptionClass = get_class($e);
foreach (array_keys(self::$faultExceptionClasses) as $class) {
if ($e instanceof $class) {

0 comments on commit b09b5cf

Please sign in to comment.