Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Obey PSR-2 #3130

Closed
wants to merge 3 commits into from

3 participants

Andreas Möller Maks3w Matthew Weier O'Phinney
Andreas Möller

As I understood it, ZF2 has adopted PSR-2.

Maks3w Maks3w was assigned
Maks3w
Collaborator

@localheinz Can you rebase the PR?

Maks3w
Collaborator
git fetch upstream
git rebase -f upstream/master
git add ....
git rebase --continue
git push -f origin ...

This process can be dangerous if is your first time. So just merge the most recent version of master branch into your PR branch.

Andreas Möller

Thanks a lot, @Maks3w!

Matthew Weier O'Phinney weierophinney referenced this pull request from a commit
Matthew Weier O'Phinney weierophinney Merge branch 'hotfix/3130' into develop
Forward port #3130

Conflicts:
	README.md
	library/Zend/Version/Version.php
129b628
Matthew Weier O'Phinney weierophinney was assigned
Deleted user Unknown referenced this pull request from a commit
Matthew Weier O'Phinney weierophinney Merge branch 'hotfix/3130'
Close #3130
ac294e2
Deleted user Unknown referenced this pull request from a commit
Matthew Weier O'Phinney weierophinney Merge branch 'hotfix/3130' into develop
Forward port #3130

Conflicts:
	README.md
	library/Zend/Version/Version.php
a5be9a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 2, 2012
  1. Andreas Möller

    Obey PSR-2

    localheinz authored
  2. Andreas Möller
Commits on Dec 3, 2012
  1. Andreas Möller
This page is out of date. Refresh to see the latest.
Showing with 142 additions and 118 deletions.
  1. +2 −2 library/Zend/Code/Scanner/ClassScanner.php
  2. +3 −3 library/Zend/Code/Scanner/MethodScanner.php
  3. +5 −5 library/Zend/Code/Scanner/TokenArrayScanner.php
  4. +2 −2 library/Zend/Config/Reader/Ini.php
  5. +2 −2 library/Zend/Config/Reader/Xml.php
  6. +1 −1  library/Zend/Config/Writer/AbstractWriter.php
  7. +1 −1  library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
  8. +1 −1  library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
  9. +1 −1  library/Zend/Form/View/Helper/FormElementErrors.php
  10. +6 −4 library/Zend/Http/Header/AbstractAccept.php
  11. +1 −1  library/Zend/Http/Header/SetCookie.php
  12. +3 −1 library/Zend/Loader/ClassMapAutoloader.php
  13. +1 −1  library/Zend/Log/Logger.php
  14. +1 −1  library/Zend/Mail/Transport/FileOptions.php
  15. +1 −1  library/Zend/Mvc/Controller/AbstractController.php
  16. +6 −2 library/Zend/Mvc/Router/Console/Simple.php
  17. +3 −3 library/Zend/Mvc/Service/ViewHelperManagerFactory.php
  18. +1 −1  library/Zend/Navigation/View/HelperConfig.php
  19. +1 −1  library/Zend/Session/SessionManager.php
  20. +1 −1  library/Zend/Stdlib/AbstractOptions.php
  21. +2 −2 library/Zend/Stdlib/Hydrator/ArraySerializable.php
  22. +2 −2 library/Zend/Stdlib/Hydrator/ClassMethods.php
  23. +1 −1  library/Zend/Stdlib/Hydrator/ObjectProperty.php
  24. +2 −2 library/Zend/Stdlib/PriorityQueue.php
  25. +1 −1  library/Zend/Uri/Uri.php
  26. +2 −2 library/Zend/Version/Version.php
  27. +1 −1  library/Zend/View/View.php
  28. +3 −3 tests/ZendTest/Di/ServiceLocatorTest.php
  29. +26 −10 tests/ZendTest/EventManager/EventManagerTest.php
  30. +5 −5 tests/ZendTest/EventManager/FilterChainTest.php
  31. +9 −9 tests/ZendTest/EventManager/StaticEventManagerTest.php
  32. +2 −2 tests/ZendTest/Filter/FilterChainTest.php
  33. +2 −2 tests/ZendTest/I18n/Validator/PostCodeTest.php
  34. +2 −2 tests/ZendTest/InputFilter/BaseInputFilterTest.php
  35. +1 −1  tests/ZendTest/Mail/Transport/FileOptionsTest.php
  36. +1 −1  tests/ZendTest/Mail/Transport/SendmailTest.php
  37. +1 −1  tests/ZendTest/ModuleManager/Listener/LocatorRegistrationListenerTest.php
  38. +1 −1  tests/ZendTest/ModuleManager/Listener/ServiceListenerTest.php
  39. +14 −14 tests/ZendTest/Mvc/ApplicationTest.php
  40. +5 −5 tests/ZendTest/Mvc/Controller/ActionControllerTest.php
  41. +3 −3 tests/ZendTest/Mvc/Controller/Plugin/ForwardTest.php
  42. +5 −5 tests/ZendTest/Mvc/Controller/RestfulControllerTest.php
  43. +2 −2 tests/ZendTest/Navigation/ServiceFactoryTest.php
  44. +2 −2 tests/ZendTest/ServiceManager/ServiceManagerTest.php
  45. +2 −2 tests/ZendTest/Validator/CallbackTest.php
  46. +1 −1  tests/ZendTest/View/Helper/Navigation/AbstractTest.php
  47. +1 −1  tests/ZendTest/View/PhpRendererTest.php
4 library/Zend/Code/Scanner/ClassScanner.php
View
@@ -474,7 +474,7 @@ protected function scan()
/*
* MACRO creation
*/
- $MACRO_TOKEN_ADVANCE = function() use (&$tokens, &$tokenIndex, &$token, &$tokenType, &$tokenContent, &$tokenLine) {
+ $MACRO_TOKEN_ADVANCE = function () use (&$tokens, &$tokenIndex, &$token, &$tokenType, &$tokenContent, &$tokenLine) {
static $lastTokenArray = null;
$tokenIndex = ($tokenIndex === null) ? 0 : $tokenIndex + 1;
if (!isset($tokens[$tokenIndex])) {
@@ -496,7 +496,7 @@ protected function scan()
}
return $tokenIndex;
};
- $MACRO_INFO_ADVANCE = function() use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
+ $MACRO_INFO_ADVANCE = function () use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
$infos[$infoIndex]['tokenEnd'] = $tokenIndex;
$infos[$infoIndex]['lineEnd'] = $tokenLine;
$infoIndex++;
6 library/Zend/Code/Scanner/MethodScanner.php
View
@@ -233,7 +233,7 @@ protected function scan()
/*
* MACRO creation
*/
- $MACRO_TOKEN_ADVANCE = function() use (&$tokens, &$tokenIndex, &$token, &$tokenType, &$tokenContent, &$tokenLine) {
+ $MACRO_TOKEN_ADVANCE = function () use (&$tokens, &$tokenIndex, &$token, &$tokenType, &$tokenContent, &$tokenLine) {
static $lastTokenArray = null;
$tokenIndex = ($tokenIndex === null) ? 0 : $tokenIndex + 1;
if (!isset($tokens[$tokenIndex])) {
@@ -254,7 +254,7 @@ protected function scan()
}
return $tokenIndex;
};
- $MACRO_INFO_START = function() use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
+ $MACRO_INFO_START = function () use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
$infos[$infoIndex] = array(
'type' => 'parameter',
'tokenStart' => $tokenIndex,
@@ -265,7 +265,7 @@ protected function scan()
'position' => $infoIndex + 1, // position is +1 of infoIndex
);
};
- $MACRO_INFO_ADVANCE = function() use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
+ $MACRO_INFO_ADVANCE = function () use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
$infos[$infoIndex]['tokenEnd'] = $tokenIndex;
$infos[$infoIndex]['lineEnd'] = $tokenLine;
$infoIndex++;
10 library/Zend/Code/Scanner/TokenArrayScanner.php
View
@@ -295,7 +295,7 @@ protected function scan()
/*
* MACRO creation
*/
- $MACRO_TOKEN_ADVANCE = function() use (&$tokens, &$tokenIndex, &$token, &$tokenType, &$tokenContent, &$tokenLine) {
+ $MACRO_TOKEN_ADVANCE = function () use (&$tokens, &$tokenIndex, &$token, &$tokenType, &$tokenContent, &$tokenLine) {
$tokenIndex = ($tokenIndex === null) ? 0 : $tokenIndex + 1;
if (!isset($tokens[$tokenIndex])) {
$token = false;
@@ -318,14 +318,14 @@ protected function scan()
}
return $tokenIndex;
};
- $MACRO_TOKEN_LOGICAL_START_INDEX = function() use (&$tokenIndex, &$docCommentIndex) {
+ $MACRO_TOKEN_LOGICAL_START_INDEX = function () use (&$tokenIndex, &$docCommentIndex) {
return ($docCommentIndex === false) ? $tokenIndex : $docCommentIndex;
};
- $MACRO_DOC_COMMENT_START = function() use (&$tokenIndex, &$docCommentIndex) {
+ $MACRO_DOC_COMMENT_START = function () use (&$tokenIndex, &$docCommentIndex) {
$docCommentIndex = $tokenIndex;
return $docCommentIndex;
};
- $MACRO_DOC_COMMENT_VALIDATE = function() use (&$tokenType, &$docCommentIndex) {
+ $MACRO_DOC_COMMENT_VALIDATE = function () use (&$tokenType, &$docCommentIndex) {
static $validTrailingTokens = null;
if ($validTrailingTokens === null) {
$validTrailingTokens = array(T_WHITESPACE, T_FINAL, T_ABSTRACT, T_INTERFACE, T_CLASS, T_FUNCTION);
@@ -335,7 +335,7 @@ protected function scan()
}
return $docCommentIndex;
};
- $MACRO_INFO_ADVANCE = function() use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
+ $MACRO_INFO_ADVANCE = function () use (&$infoIndex, &$infos, &$tokenIndex, &$tokenLine) {
$infos[$infoIndex]['tokenEnd'] = $tokenIndex;
$infos[$infoIndex]['lineEnd'] = $tokenLine;
$infoIndex++;
4 library/Zend/Config/Reader/Ini.php
View
@@ -77,7 +77,7 @@ public function fromFile($filename)
$this->directory = dirname($filename);
set_error_handler(
- function($error, $message = '', $file = '', $line = 0) use ($filename) {
+ function ($error, $message = '', $file = '', $line = 0) use ($filename) {
throw new Exception\RuntimeException(sprintf(
'Error reading INI file "%s": %s',
$filename, $message
@@ -105,7 +105,7 @@ public function fromString($string)
$this->directory = null;
set_error_handler(
- function($error, $message = '', $file = '', $line = 0) {
+ function ($error, $message = '', $file = '', $line = 0) {
throw new Exception\RuntimeException(sprintf(
'Error reading INI string: %s',
$message
4 library/Zend/Config/Reader/Xml.php
View
@@ -71,7 +71,7 @@ public function fromFile($filename)
$this->directory = dirname($filename);
set_error_handler(
- function($error, $message = '', $file = '', $line = 0) use ($filename) {
+ function ($error, $message = '', $file = '', $line = 0) use ($filename) {
throw new Exception\RuntimeException(sprintf(
'Error reading XML file "%s": %s',
$filename, $message
@@ -104,7 +104,7 @@ public function fromString($string)
$this->directory = null;
set_error_handler(
- function($error, $message = '', $file = '', $line = 0) {
+ function ($error, $message = '', $file = '', $line = 0) {
throw new Exception\RuntimeException(sprintf(
'Error reading XML string: %s',
$message
2  library/Zend/Config/Writer/AbstractWriter.php
View
@@ -45,7 +45,7 @@ public function toFile($filename, $config, $exclusiveLock = true)
}
set_error_handler(
- function($error, $message = '', $file = '', $line = 0) use ($filename) {
+ function ($error, $message = '', $file = '', $line = 0) use ($filename) {
throw new Exception\RuntimeException(sprintf(
'Error writing to "%s": %s',
$filename, $message
2  library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
View
@@ -150,7 +150,7 @@ public function connect()
$p = $this->connectionParameters;
// given a list of key names, test for existence in $p
- $findParameterValue = function(array $names) use ($p) {
+ $findParameterValue = function (array $names) use ($p) {
foreach ($names as $name) {
if (isset($p[$name])) {
return $p[$name];
2  library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
View
@@ -138,7 +138,7 @@ public function connect()
$p = $this->connectionParameters;
// given a list of key names, test for existence in $p
- $findParameterValue = function(array $names) use ($p) {
+ $findParameterValue = function (array $names) use ($p) {
foreach ($names as $name) {
if (isset($p[$name])) {
return $p[$name];
2  library/Zend/Form/View/Helper/FormElementErrors.php
View
@@ -154,7 +154,7 @@ public function render(ElementInterface $element, array $attributes = array())
// Flatten message array
$escapeHtml = $this->getEscapeHtmlHelper();
$messagesToPrint = array();
- array_walk_recursive($messages, function($item) use (&$messagesToPrint, $escapeHtml) {
+ array_walk_recursive($messages, function ($item) use (&$messagesToPrint, $escapeHtml) {
$messagesToPrint[] = $escapeHtml($item);
});
10 library/Zend/Http/Header/AbstractAccept.php
View
@@ -220,9 +220,11 @@ protected function assembleAcceptParam(&$value, $key)
'/', '[', ']', '?', '=', '{', '}', ' ', "\t");
$escaped = preg_replace_callback('/[[:cntrl:]"\\\\]/', // escape cntrl, ", \
- function($v) { return '\\' . $v[0]; },
- $value
- );
+ function ($v) {
+ return '\\' . $v[0];
+ },
+ $value
+ );
if ($escaped == $value && !array_intersect(str_split($value), $separators)) {
$value = $key . '=' . $value;
@@ -405,7 +407,7 @@ protected function addFieldValuePartToQueue($value)
*/
protected function sortFieldValueParts()
{
- $sort = function($a, $b) { // If A has higher prio than B, return -1.
+ $sort = function ($a, $b) { // If A has higher prio than B, return -1.
if ($a->priority > $b->priority) {
return -1;
} elseif ($a->priority < $b->priority) {
2  library/Zend/Http/Header/SetCookie.php
View
@@ -95,7 +95,7 @@ public static function fromString($headerLine, $bypassHeaderFieldName = false)
if ($setCookieProcessor === null) {
$setCookieClass = get_called_class();
- $setCookieProcessor = function($headerLine) use ($setCookieClass) {
+ $setCookieProcessor = function ($headerLine) use ($setCookieClass) {
$header = new $setCookieClass;
$keyValuePairs = preg_split('#;\s*#', $headerLine);
foreach ($keyValuePairs as $keyValue) {
4 library/Zend/Loader/ClassMapAutoloader.php
View
@@ -206,7 +206,9 @@ public static function realPharPath($path)
}
$parts = explode('/', str_replace(array('/','\\'), '/', substr($path, 8)));
- $parts = array_values(array_filter($parts, function($p) { return ($p !== '' && $p !== '.'); }));
+ $parts = array_values(array_filter($parts, function ($p) {
+ return ($p !== '' && $p !== '.');
+ }));
array_walk($parts, function ($value, $key) use(&$parts) {
if ($value === '..') {
2  library/Zend/Log/Logger.php
View
@@ -377,7 +377,7 @@ public static function registerErrorHandler(Logger $logger)
E_USER_DEPRECATED => self::DEBUG
);
- set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) use ($errorHandlerMap, $logger) {
+ set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) use ($errorHandlerMap, $logger) {
$errorLevel = error_reporting();
if ($errorLevel & $errno) {
2  library/Zend/Mail/Transport/FileOptions.php
View
@@ -93,7 +93,7 @@ public function setCallback($callback)
public function getCallback()
{
if (null === $this->callback) {
- $this->setCallback(function($transport) {
+ $this->setCallback(function ($transport) {
return 'ZendMail_' . time() . '_' . mt_rand() . '.tmp';
});
}
2  library/Zend/Mvc/Controller/AbstractController.php
View
@@ -102,7 +102,7 @@ public function dispatch(Request $request, Response $response = null)
->setResponse($response)
->setTarget($this);
- $result = $this->getEventManager()->trigger(MvcEvent::EVENT_DISPATCH, $e, function($test) {
+ $result = $this->getEventManager()->trigger(MvcEvent::EVENT_DISPATCH, $e, function ($test) {
return ($test instanceof Response);
});
8 library/Zend/Mvc/Router/Console/Simple.php
View
@@ -375,7 +375,9 @@ protected function parseRouteDefinition($def)
array_unique($options);
// remove prefix
- array_walk($options, function(&$val, $key) {$val = ltrim($val, '-');});
+ array_walk($options, function (&$val, $key) {
+ $val = ltrim($val, '-');
+ });
// prepare item
$item = array(
@@ -416,7 +418,9 @@ protected function parseRouteDefinition($def)
array_unique($options);
// remove prefix
- array_walk($options, function(&$val, $key) {$val = ltrim($val, '-');});
+ array_walk($options, function (&$val, $key) {
+ $val = ltrim($val, '-');
+ });
// prepare item
$item = array(
6 library/Zend/Mvc/Service/ViewHelperManagerFactory.php
View
@@ -66,7 +66,7 @@ public function createService(ServiceLocatorInterface $serviceLocator)
}
// Configure URL view helper with router
- $plugins->setFactory('url', function($sm) use($serviceLocator) {
+ $plugins->setFactory('url', function ($sm) use($serviceLocator) {
$helper = new ViewHelper\Url;
$router = Console::isConsole() ? 'HttpRouter' : 'Router';
$helper->setRouter($serviceLocator->get($router));
@@ -83,7 +83,7 @@ public function createService(ServiceLocatorInterface $serviceLocator)
return $helper;
});
- $plugins->setFactory('basepath', function($sm) use($serviceLocator) {
+ $plugins->setFactory('basepath', function ($sm) use($serviceLocator) {
$config = $serviceLocator->get('Config');
$basePathHelper = new ViewHelper\BasePath;
if (isset($config['view_manager']) && isset($config['view_manager']['base_path'])) {
@@ -101,7 +101,7 @@ public function createService(ServiceLocatorInterface $serviceLocator)
* Other view helpers depend on this to decide which spec to generate their tags
* based on. This is why it must be set early instead of later in the layout phtml.
*/
- $plugins->setFactory('doctype', function($sm) use($serviceLocator) {
+ $plugins->setFactory('doctype', function ($sm) use($serviceLocator) {
$config = $serviceLocator->get('Config');
$config = $config['view_manager'];
$doctypeHelper = new ViewHelper\Doctype;
2  library/Zend/Navigation/View/HelperConfig.php
View
@@ -35,7 +35,7 @@ class HelperConfig implements ConfigInterface
*/
public function configureServiceManager(ServiceManager $serviceManager)
{
- $serviceManager->setFactory('navigation', function(HelperPluginManager $pm) {
+ $serviceManager->setFactory('navigation', function (HelperPluginManager $pm) {
$helper = new \Zend\View\Helper\Navigation;
$helper->setServiceLocator($pm->getServiceLocator());
return $helper;
2  library/Zend/Session/SessionManager.php
View
@@ -319,7 +319,7 @@ public function getValidatorChain()
public function isValid()
{
$validator = $this->getValidatorChain();
- $responses = $validator->triggerUntil('session.validate', $this, array($this), function($test) {
+ $responses = $validator->triggerUntil('session.validate', $this, array($this), function ($test) {
return !$test;
});
if ($responses->stopped()) {
2  library/Zend/Stdlib/AbstractOptions.php
View
@@ -65,7 +65,7 @@ public function setFromArray($options)
public function toArray()
{
$array = array();
- $transform = function($letters) {
+ $transform = function ($letters) {
$letter = array_shift($letters);
return '_' . strtolower($letter);
};
4 library/Zend/Stdlib/Hydrator/ArraySerializable.php
View
@@ -39,7 +39,7 @@ public function extract($object)
$self = $this;
$data = $object->getArrayCopy();
- array_walk($data, function(&$value, $name) use ($self) {
+ array_walk($data, function (&$value, $name) use ($self) {
$value = $self->extractValue($name, $value);
});
return $data;
@@ -59,7 +59,7 @@ public function extract($object)
public function hydrate(array $data, $object)
{
$self = $this;
- array_walk($data, function(&$value, $name) use ($self) {
+ array_walk($data, function (&$value, $name) use ($self) {
$value = $self->hydrateValue($name, $value);
});
4 library/Zend/Stdlib/Hydrator/ClassMethods.php
View
@@ -52,7 +52,7 @@ public function extract($object)
));
}
- $transform = function($letters) {
+ $transform = function ($letters) {
$letter = array_shift($letters);
return '_' . strtolower($letter);
};
@@ -97,7 +97,7 @@ public function hydrate(array $data, $object)
));
}
- $transform = function($letters) {
+ $transform = function ($letters) {
$letter = substr(array_shift($letters), 1, 1);
return ucfirst($letter);
};
2  library/Zend/Stdlib/Hydrator/ObjectProperty.php
View
@@ -38,7 +38,7 @@ public function extract($object)
$self = $this;
$data = get_object_vars($object);
- array_walk($data, function(&$value, $name) use ($self) {
+ array_walk($data, function (&$value, $name) use ($self) {
$value = $self->extractValue($name, $value);
});
return $data;
4 library/Zend/Stdlib/PriorityQueue.php
View
@@ -211,12 +211,12 @@ public function toArray($flag = self::EXTR_DATA)
return $this->items;
break;
case self::EXTR_PRIORITY:
- return array_map(function($item) {
+ return array_map(function ($item) {
return $item['priority'];
}, $this->items);
case self::EXTR_DATA:
default:
- return array_map(function($item) {
+ return array_map(function ($item) {
return $item['data'];
}, $this->items);
}
2  library/Zend/Uri/Uri.php
View
@@ -1322,7 +1322,7 @@ protected static function normalizeFragment($fragment)
*/
protected static function decodeUrlEncodedChars($input, $allowed = '')
{
- $decodeCb = function($match) use ($allowed) {
+ $decodeCb = function ($match) use ($allowed) {
$char = rawurldecode($match[0]);
if (preg_match($allowed, $char)) {
return $char;
4 library/Zend/Version/Version.php
View
@@ -87,12 +87,12 @@ public static function getLatest($service = self::VERSION_SERVICE_GITHUB)
$apiResponse = Json::decode(file_get_contents($url), Json::TYPE_ARRAY);
// Simplify the API response into a simple array of version numbers
- $tags = array_map(function($tag) {
+ $tags = array_map(function ($tag) {
return substr($tag['ref'], 18); // Reliable because we're filtering on 'refs/tags/release-'
}, $apiResponse);
// Fetch the latest version number from the array
- static::$latestVersion = array_reduce($tags, function($a, $b) {
+ static::$latestVersion = array_reduce($tags, function ($a, $b) {
return version_compare($a, $b, '>') ? $a : $b;
});
} elseif($service == self::VERSION_SERVICE_ZEND) {
2  library/Zend/View/View.php
View
@@ -175,7 +175,7 @@ public function render(Model $model)
$event = $this->getEvent();
$event->setModel($model);
$events = $this->getEventManager();
- $results = $events->trigger(ViewEvent::EVENT_RENDERER, $event, function($result) {
+ $results = $events->trigger(ViewEvent::EVENT_RENDERER, $event, function ($result) {
return ($result instanceof Renderer);
});
$renderer = $results->last();
6 tests/ZendTest/Di/ServiceLocatorTest.php
View
@@ -56,7 +56,7 @@ public function testRetrievingAServiceMultipleTimesReturnsSameInstance()
public function testRegisteringCallbacksReturnsReturnValueWhenServiceRequested()
{
- $this->services->set('foo', function() {
+ $this->services->set('foo', function () {
$object = new \stdClass();
$object->foo = 'FOO';
return $object;
@@ -68,7 +68,7 @@ public function testRegisteringCallbacksReturnsReturnValueWhenServiceRequested()
public function testReturnValueOfCallbackIsCachedBetweenRequestsToService()
{
- $this->services->set('foo', function() {
+ $this->services->set('foo', function () {
$object = new \stdClass();
$object->foo = 'FOO';
return $object;
@@ -81,7 +81,7 @@ public function testReturnValueOfCallbackIsCachedBetweenRequestsToService()
public function testParametersArePassedToCallbacks()
{
- $this->services->set('foo', function() {
+ $this->services->set('foo', function () {
$object = new \stdClass();
$object->params = func_get_args();
return $object;
36 tests/ZendTest/EventManager/EventManagerTest.php
View
@@ -277,10 +277,18 @@ public function testAttachAggregateReturnsAttachOfListenerAggregate()
public function testCanDetachListenerAggregates()
{
// setup some other event listeners, to ensure appropriate items are detached
- $listenerFooBar1 = $this->events->attach('foo.bar', function() { return true; });
- $listenerFooBar2 = $this->events->attach('foo.bar', function() { return true; });
- $listenerFooBaz1 = $this->events->attach('foo.baz', function() { return true; });
- $listenerOther = $this->events->attach('other', function() { return true; });
+ $listenerFooBar1 = $this->events->attach('foo.bar', function () {
+ return true;
+ });
+ $listenerFooBar2 = $this->events->attach('foo.bar', function () {
+ return true;
+ });
+ $listenerFooBaz1 = $this->events->attach('foo.baz', function () {
+ return true;
+ });
+ $listenerOther = $this->events->attach('other', function () {
+ return true;
+ });
$aggregate = new TestAsset\MockAggregate();
$this->events->attachAggregate($aggregate);
@@ -307,10 +315,18 @@ public function testCanDetachListenerAggregates()
public function testCanDetachListenerAggregatesViaDetach()
{
// setup some other event listeners, to ensure appropriate items are detached
- $listenerFooBar1 = $this->events->attach('foo.bar', function() { return true; });
- $listenerFooBar2 = $this->events->attach('foo.bar', function() { return true; });
- $listenerFooBaz1 = $this->events->attach('foo.baz', function() { return true; });
- $listenerOther = $this->events->attach('other', function() { return true; });
+ $listenerFooBar1 = $this->events->attach('foo.bar', function () {
+ return true;
+ });
+ $listenerFooBar2 = $this->events->attach('foo.bar', function () {
+ return true;
+ });
+ $listenerFooBaz1 = $this->events->attach('foo.baz', function () {
+ return true;
+ });
+ $listenerOther = $this->events->attach('other', function () {
+ return true;
+ });
$aggregate = new TestAsset\MockAggregate();
$this->events->attach($aggregate);
@@ -593,7 +609,7 @@ public function testListenersAttachedWithWildcardAreTriggeredForAllEvents()
{
$test = new stdClass;
$test->events = array();
- $callback = function($e) use ($test) {
+ $callback = function ($e) use ($test) {
$test->events[] = $e->getName();
};
@@ -618,7 +634,7 @@ public function testSharedEventManagerAttachReturnsCallbackHandler()
$callbackHandler = $shared->attach(
'foo',
'bar',
- function($e) {
+ function ($e) {
return true;
}
);
10 tests/ZendTest/EventManager/FilterChainTest.php
View
@@ -74,14 +74,14 @@ public function testRetrievingAttachedFiltersShouldReturnEmptyArrayWhenNoFilters
public function testFilterChainShouldReturnLastResponse()
{
- $this->filterchain->attach(function($context, $params, $chain) {
+ $this->filterchain->attach(function ($context, $params, $chain) {
if (isset($params['string'])) {
$params['string'] = trim($params['string']);
}
$return = $chain->next($context, $params, $chain);
return $return;
});
- $this->filterchain->attach(function($context, array $params) {
+ $this->filterchain->attach(function ($context, array $params) {
$string = isset($params['string']) ? $params['string'] : '';
return str_rot13($string);
});
@@ -107,17 +107,17 @@ public function testInterceptingFilterShouldReceiveChain()
public function testFilteringStopsAsSoonAsAFilterFailsToCallNext()
{
- $this->filterchain->attach(function($context, $params, $chain) {
+ $this->filterchain->attach(function ($context, $params, $chain) {
if (isset($params['string'])) {
$params['string'] = trim($params['string']);
}
return $chain->next($context, $params, $chain);
}, 10000);
- $this->filterchain->attach(function($context, array $params) {
+ $this->filterchain->attach(function ($context, array $params) {
$string = isset($params['string']) ? $params['string'] : '';
return str_rot13($string);
}, 1000);
- $this->filterchain->attach(function($context, $params, $chain) {
+ $this->filterchain->attach(function ($context, $params, $chain) {
$string = isset($params['string']) ? $params['string'] : '';
return hash('md5', $string);
}, 100);
18 tests/ZendTest/EventManager/StaticEventManagerTest.php
View
@@ -144,7 +144,7 @@ public function testListenersAttachedUsingWildcardEventWillBeTriggeredByResource
{
$test = new stdClass;
$test->events = array();
- $callback = function($e) use ($test) {
+ $callback = function ($e) use ($test) {
$test->events[] = $e->getName();
};
@@ -252,10 +252,10 @@ public function testListenersAttachedToAnyIdentifierProvidedToEventManagerWillBe
$test = new \stdClass;
$test->triggered = 0;
- $events->attach('foo', 'bar', function($e) use ($test) {
+ $events->attach('foo', 'bar', function ($e) use ($test) {
$test->triggered++;
});
- $events->attach('bar', 'bar', function($e) use ($test) {
+ $events->attach('bar', 'bar', function ($e) use ($test) {
$test->triggered++;
});
$manager->trigger('bar', $this, array());
@@ -271,11 +271,11 @@ public function testListenersAttachedToWildcardsWillBeTriggered()
$test = new \stdClass;
$test->triggered = 0;
- $events->attach('*', 'bar', function($e) use ($test) {
+ $events->attach('*', 'bar', function ($e) use ($test) {
$test->triggered++;
});
//Tests one can have multiple wildcards attached
- $events->attach('*', 'bar', function($e) use ($test) {
+ $events->attach('*', 'bar', function ($e) use ($test) {
$test->triggered++;
});
$manager->trigger('bar', $this, array());
@@ -291,17 +291,17 @@ public function testListenersAttachedToAnyIdentifierProvidedToEventManagerOrWild
$test = new \stdClass;
$test->triggered = 0;
- $events->attach('foo', 'bar', function($e) use ($test) {
+ $events->attach('foo', 'bar', function ($e) use ($test) {
$test->triggered++;
});
- $events->attach('bar', 'bar', function($e) use ($test) {
+ $events->attach('bar', 'bar', function ($e) use ($test) {
$test->triggered++;
});
- $events->attach('*', 'bar', function($e) use ($test) {
+ $events->attach('*', 'bar', function ($e) use ($test) {
$test->triggered++;
});
//Tests one can have multiple wildcards attached
- $events->attach('*', 'bar', function($e) use ($test) {
+ $events->attach('*', 'bar', function ($e) use ($test) {
$test->triggered++;
});
$manager->trigger('bar', $this, array());
4 tests/ZendTest/Filter/FilterChainTest.php
View
@@ -51,7 +51,7 @@ public function testFiltersAreExecutedAccordingToPriority()
public function testAllowsConnectingArbitraryCallbacks()
{
$chain = new FilterChain();
- $chain->attach(function($value) {
+ $chain->attach(function ($value) {
return strtolower($value);
});
$value = 'AbC';
@@ -118,7 +118,7 @@ protected function getChainConfig()
return array(
'callbacks' => array(
array('callback' => __CLASS__ . '::staticUcaseFilter'),
- array('priority' => 10000, 'callback' => function($value) {
+ array('priority' => 10000, 'callback' => function ($value) {
return trim($value);
}),
),
4 tests/ZendTest/I18n/Validator/PostCodeTest.php
View
@@ -142,12 +142,12 @@ public function testServiceClass()
'serviceFalse' => null,
);
- $serviceTrue = function($value) use ($params) {
+ $serviceTrue = function ($value) use ($params) {
$params->serviceTrue = $value;
return true;
};
- $serviceFalse = function($value) use ($params) {
+ $serviceFalse = function ($value) use ($params) {
$params->serviceFalse = $value;
return false;
};
4 tests/ZendTest/InputFilter/BaseInputFilterTest.php
View
@@ -342,7 +342,7 @@ public function testValidationCanUseContext()
$store = new stdClass;
$foo = new Input();
- $foo->getValidatorChain()->addValidator(new Validator\Callback(function($value, $context) use ($store) {
+ $foo->getValidatorChain()->addValidator(new Validator\Callback(function ($value, $context) use ($store) {
$store->value = $value;
$store->context = $context;
return true;
@@ -372,7 +372,7 @@ public function testInputBreakOnFailureFlagIsHonoredWhenValidating()
$store = new stdClass;
$foo = new Input();
- $foo->getValidatorChain()->addValidator(new Validator\Callback(function($value, $context) use ($store) {
+ $foo->getValidatorChain()->addValidator(new Validator\Callback(function ($value, $context) use ($store) {
$store->value = $value;
$store->context = $context;
return true;
2  tests/ZendTest/Mail/Transport/FileOptionsTest.php
View
@@ -50,7 +50,7 @@ public function testPathIsMutable()
public function testCallbackIsMutable()
{
$original = $this->options->getCallback();
- $new = function($transport) {};
+ $new = function ($transport) {};
$this->options->setCallback($new);
$test = $this->options->getCallback();
$this->assertNotSame($original, $test);
2  tests/ZendTest/Mail/Transport/SendmailTest.php
View
@@ -32,7 +32,7 @@ public function setUp()
{
$this->transport = new Sendmail();
$self = $this;
- $this->transport->setCallable(function($to, $subject, $message, $additional_headers, $additional_parameters = null) use ($self) {
+ $this->transport->setCallable(function ($to, $subject, $message, $additional_headers, $additional_parameters = null) use ($self) {
$self->to = $to;
$self->subject = $subject;
$self->message = $message;
2  tests/ZendTest/ModuleManager/Listener/LocatorRegistrationListenerTest.php
View
@@ -84,7 +84,7 @@ public function tearDown()
public function testModuleClassIsRegisteredWithDiAndInjectedWithSharedInstances()
{
$locator = $this->serviceManager;
- $locator->setFactory('Foo\Bar', function($s) {
+ $locator->setFactory('Foo\Bar', function ($s) {
$module = $s->get('ListenerTestModule\Module');
$manager = $s->get('Zend\ModuleManager\ModuleManager');
$instance = new \Foo\Bar($module, $manager);
2  tests/ZendTest/ModuleManager/Listener/ServiceListenerTest.php
View
@@ -69,7 +69,7 @@ public function getServiceConfig()
return array(
'invokables' => array(__CLASS__ => __CLASS__),
'factories' => array(
- 'foo' => function($sm) { },
+ 'foo' => function ($sm) { },
),
'abstract_factories' => array(
new \Zend\ServiceManager\Di\DiAbstractServiceFactory(new \Zend\Di\Di()),
28 tests/ZendTest/Mvc/ApplicationTest.php
View
@@ -48,7 +48,7 @@ public function setUp()
'module_paths' => array(),
),
);
- $config = function($s) {
+ $config = function ($s) {
return new Config(array(
/*
'controller' => array(
@@ -231,7 +231,7 @@ public function setupPathController($addService = true)
if ($addService) {
$controllerLoader = $this->serviceManager->get('ControllerLoader');
- $controllerLoader->setFactory('path', function() {
+ $controllerLoader->setFactory('path', function () {
return new TestAsset\PathController;
});
}
@@ -255,7 +255,7 @@ public function setupActionController()
$router->addRoute('sample', $route);
$controllerLoader = $this->serviceManager->get('ControllerLoader');
- $controllerLoader->setFactory('sample', function() {
+ $controllerLoader->setFactory('sample', function () {
return new Controller\TestAsset\SampleController;
});
$this->application->bootstrap();
@@ -279,7 +279,7 @@ public function setupBadController($addService = true)
if ($addService) {
$controllerLoader = $this->serviceManager->get('ControllerLoader');
- $controllerLoader->setFactory('bad', function() {
+ $controllerLoader->setFactory('bad', function () {
return new Controller\TestAsset\BadController;
});
}
@@ -291,7 +291,7 @@ public function testRoutingIsExecutedDuringRun()
$this->setupPathController();
$log = array();
- $this->application->getEventManager()->attach(MvcEvent::EVENT_ROUTE, function($e) use (&$log) {
+ $this->application->getEventManager()->attach(MvcEvent::EVENT_ROUTE, function ($e) use (&$log) {
$match = $e->getRouteMatch();
if (!$match) {
return;
@@ -309,7 +309,7 @@ public function testAllowsReturningEarlyFromRouting()
$this->setupPathController();
$response = new Response();
- $this->application->getEventManager()->attach(MvcEvent::EVENT_ROUTE, function($e) use ($response) {
+ $this->application->getEventManager()->attach(MvcEvent::EVENT_ROUTE, function ($e) use ($response) {
return $response;
});
@@ -350,7 +350,7 @@ public function testDispatchingInjectsLocatorInLocatorAwareControllers()
public function testFinishEventIsTriggeredAfterDispatching()
{
$this->setupActionController();
- $this->application->getEventManager()->attach(MvcEvent::EVENT_FINISH, function($e) {
+ $this->application->getEventManager()->attach(MvcEvent::EVENT_FINISH, function ($e) {
return $e->getResponse()->setContent($e->getResponse()->getBody() . 'foobar');
});
$this->assertContains('foobar', $this->application->run()->getBody(), 'The "finish" event was not triggered ("foobar" not in response)');
@@ -423,7 +423,7 @@ public function testInvalidControllerTypeShouldTriggerDispatchError()
$this->serviceManager->get('ControllerLoader');
$this->setupBadController(false);
$controllerLoader = $this->serviceManager->get('ControllerLoader');
- $controllerLoader->setFactory('bad', function() {
+ $controllerLoader->setFactory('bad', function () {
return new stdClass;
});
$response = $this->application->getResponse();
@@ -472,7 +472,7 @@ public function testLocatorExceptionShouldTriggerDispatchError()
$this->setupPathController(false);
$controllerLoader = $this->serviceManager->get('ControllerLoader');
$response = new Response();
- $this->application->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, function($e) use ($response) {
+ $this->application->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, function ($e) use ($response) {
return $response;
});
@@ -511,12 +511,12 @@ public function testFinishShouldRunEvenIfRouteEventReturnsResponse()
$this->application->bootstrap();
$response = $this->application->getResponse();
$events = $this->application->getEventManager();
- $events->attach(MvcEvent::EVENT_ROUTE, function($e) use ($response) {
+ $events->attach(MvcEvent::EVENT_ROUTE, function ($e) use ($response) {
return $response;
}, 100);
$token = new stdClass;
- $events->attach(MvcEvent::EVENT_FINISH, function($e) use ($token) {
+ $events->attach(MvcEvent::EVENT_FINISH, function ($e) use ($token) {
$token->foo = 'bar';
});
@@ -534,12 +534,12 @@ public function testFinishShouldRunEvenIfDispatchEventReturnsResponse()
$response = $this->application->getResponse();
$events = $this->application->getEventManager();
$events->clearListeners(MvcEvent::EVENT_ROUTE);
- $events->attach(MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach(MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 100);
$token = new stdClass;
- $events->attach(MvcEvent::EVENT_FINISH, function($e) use ($token) {
+ $events->attach(MvcEvent::EVENT_FINISH, function ($e) use ($token) {
$token->foo = 'bar';
});
@@ -568,7 +568,7 @@ public function testOnDispatchErrorEventPassedToTriggersShouldBeTheOriginalOne()
$this->setupPathController(false);
$controllerLoader = $this->serviceManager->get('ControllerLoader');
$model = $this->getMock('Zend\View\Model\ViewModel');
- $this->application->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, function($e) use ($model) {
+ $this->application->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, function ($e) use ($model) {
$e->setResult($model);
});
10 tests/ZendTest/Mvc/Controller/ActionControllerTest.php
View
@@ -80,7 +80,7 @@ public function testShortCircuitsBeforeActionIfPreDispatchReturnsAResponse()
{
$response = new Response();
$response->setContent('short circuited!');
- $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 100);
$result = $this->controller->dispatch($this->request, $this->response);
@@ -91,7 +91,7 @@ public function testPostDispatchEventAllowsReplacingResponse()
{
$response = new Response();
$response->setContent('short circuited!');
- $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, -10);
$result = $this->controller->dispatch($this->request, $this->response);
@@ -103,7 +103,7 @@ public function testEventManagerListensOnDispatchableInterfaceByDefault()
$response = new Response();
$response->setContent('short circuited!');
$events = new SharedEventManager();
- $events->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$this->controller->getEventManager()->setSharedManager($events);
@@ -116,7 +116,7 @@ public function testEventManagerListensOnActionControllerClassByDefault()
$response = new Response();
$response->setContent('short circuited!');
$events = new SharedEventManager();
- $events->attach('Zend\Mvc\Controller\AbstractActionController', MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach('Zend\Mvc\Controller\AbstractActionController', MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$this->controller->getEventManager()->setSharedManager($events);
@@ -129,7 +129,7 @@ public function testEventManagerListensOnClassNameByDefault()
$response = new Response();
$response->setContent('short circuited!');
$events = new SharedEventManager();
- $events->attach(get_class($this->controller), MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach(get_class($this->controller), MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$this->controller->getEventManager()->setSharedManager($events);
6 tests/ZendTest/Mvc/Controller/Plugin/ForwardTest.php
View
@@ -47,7 +47,7 @@ public function setUp()
$event->setRouteMatch($routeMatch);
$locator = new Locator;
- $locator->add('forward', function() {
+ $locator->add('forward', function () {
return new ForwardController();
});
@@ -93,7 +93,7 @@ public function testPluginWithoutControllerLocatorRaisesDomainException()
public function testDispatchRaisesDomainExceptionIfDiscoveredControllerIsNotDispatchable()
{
$locator = $this->controller->getServiceLocator();
- $locator->add('bogus', function() {
+ $locator->add('bogus', function () {
return new stdClass;
});
$this->setExpectedException('Zend\Mvc\Exception\DomainException', 'DispatchableInterface');
@@ -104,7 +104,7 @@ public function testDispatchRaisesDomainExceptionIfCircular()
{
$this->setExpectedException('Zend\Mvc\Exception\DomainException', 'Circular forwarding');
$sampleController = $this->controller;
- $sampleController->getServiceLocator()->add('sample', function() use ($sampleController) {
+ $sampleController->getServiceLocator()->add('sample', function () use ($sampleController) {
return $sampleController;
});
$this->plugin->dispatch('sample', array('action' => 'test-circular'));
10 tests/ZendTest/Mvc/Controller/RestfulControllerTest.php
View
@@ -124,7 +124,7 @@ public function testShortCircuitsBeforeActionIfPreDispatchReturnsAResponse()
{
$response = new Response();
$response->setContent('short circuited!');
- $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$result = $this->controller->dispatch($this->request, $this->response);
@@ -135,7 +135,7 @@ public function testPostDispatchEventAllowsReplacingResponse()
{
$response = new Response();
$response->setContent('short circuited!');
- $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $this->controller->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, -10);
$result = $this->controller->dispatch($this->request, $this->response);
@@ -147,7 +147,7 @@ public function testEventManagerListensOnDispatchableInterfaceByDefault()
$response = new Response();
$response->setContent('short circuited!');
$events = new SharedEventManager();
- $events->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach('Zend\Stdlib\DispatchableInterface', MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$this->controller->getEventManager()->setSharedManager($events);
@@ -160,7 +160,7 @@ public function testEventManagerListensOnRestfulControllerClassByDefault()
$response = new Response();
$response->setContent('short circuited!');
$events = new SharedEventManager();
- $events->attach('Zend\Mvc\Controller\AbstractRestfulController', MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach('Zend\Mvc\Controller\AbstractRestfulController', MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$this->controller->getEventManager()->setSharedManager($events);
@@ -173,7 +173,7 @@ public function testEventManagerListensOnClassNameByDefault()
$response = new Response();
$response->setContent('short circuited!');
$events = new SharedEventManager();
- $events->attach(get_class($this->controller), MvcEvent::EVENT_DISPATCH, function($e) use ($response) {
+ $events->attach(get_class($this->controller), MvcEvent::EVENT_DISPATCH, function ($e) use ($response) {
return $response;
}, 10);
$this->controller->getEventManager()->setSharedManager($events);
4 tests/ZendTest/Navigation/ServiceFactoryTest.php
View
@@ -48,7 +48,7 @@ protected function setUp()
'extra_config' => array(
'service_manager' => array(
'factories' => array(
- 'Config' => function() {
+ 'Config' => function () {
return array(
'navigation' => array(
'file' => __DIR__ . '/_files/navigation.xml',
@@ -119,7 +119,7 @@ public function testMvcPagesGetInjectedWithComponents()
$this->serviceManager->setFactory('Navigation', 'Zend\Navigation\Service\DefaultNavigationFactory');
$container = $this->serviceManager->get('Navigation');
- $recursive = function($that, $pages) use (&$recursive) {
+ $recursive = function ($that, $pages) use (&$recursive) {
foreach ($pages as $page) {
if ($page instanceof MvcPage) {
$that->assertInstanceOf('Zend\Mvc\Router\RouteStackInterface', $page->getRouter());
4 tests/ZendTest/ServiceManager/ServiceManagerTest.php
View
@@ -249,11 +249,11 @@ public function testCanRetrieveFromChildPeeringManager()
public function testAllowsRetrievingFromPeeringContainerFirst()
{
$parent = new ServiceManager();
- $parent->setFactory('foo', function($sm) {
+ $parent->setFactory('foo', function ($sm) {
return 'bar';
});
$child = new ServiceManager();
- $child->setFactory('foo', function($sm) {
+ $child->setFactory('foo', function ($sm) {
return 'baz';
});
$child->addPeeringServiceManager($parent, ServiceManager::SCOPE_PARENT);
4 tests/ZendTest/Validator/CallbackTest.php
View
@@ -86,7 +86,7 @@ public function testCanAcceptContextWithoutOptions()
{
$value = 'bar';
$context = array('foo' => 'bar', 'bar' => 'baz');
- $validator = new Callback(function($v, $c) use ($value, $context) {
+ $validator = new Callback(function ($v, $c) use ($value, $context) {
return (($value == $v) && ($context == $c));
});
$this->assertTrue($validator->isValid($value, $context));
@@ -97,7 +97,7 @@ public function testCanAcceptContextWithOptions()
$value = 'bar';
$context = array('foo' => 'bar', 'bar' => 'baz');
$options = array('baz' => 'bat');
- $validator = new Callback(function($v, $c, $baz) use ($value, $context, $options) {
+ $validator = new Callback(function ($v, $c, $baz) use ($value, $context, $options) {
return (($value == $v) && ($context == $c) && ($options['baz'] == $baz));
});
$validator->setCallbackOptions($options);
2  tests/ZendTest/View/Helper/Navigation/AbstractTest.php
View
@@ -114,7 +114,7 @@ protected function setUp()
'extra_config' => array(
'service_manager' => array(
'factories' => array(
- 'Config' => function() use ($config) {
+ 'Config' => function () use ($config) {
return array(
'navigation' => array(
'default' => $config->get('nav_test1'),
2  tests/ZendTest/View/PhpRendererTest.php
View
@@ -152,7 +152,7 @@ public function testRenderingAllowsVariableSubstitutions()
public function testRenderingFiltersContentWithFilterChain()
{
$expected = 'foo bar baz';
- $this->renderer->getFilterChain()->attach(function($content) {
+ $this->renderer->getFilterChain()->attach(function ($content) {
return str_replace('INJECT', 'bar', $content);
});
$this->renderer->vars()->assign(array('bar' => 'INJECT'));
Something went wrong with that request. Please try again.