Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Willbanks committed Oct 20, 2013
1 parent a00c16a commit 26dd6a0
Show file tree
Hide file tree
Showing 47 changed files with 91 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
if (null !== $credentialValidationCallback) {
$this->setCredentialValidationCallback($credentialValidationCallback);
} else {
$this->setCredentialValidationCallback(function($a, $b) {
$this->setCredentialValidationCallback(function ($a, $b) {
return $a === $b;
});
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Storage/Adapter/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ protected function internalGetItems(array & $normalizedKeys)
//combine the key => value pairs and remove all missing values
return array_filter(
array_combine($normalizedKeys, $results),
function($value) {
function ($value) {
return $value !== false;
}
);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Adapter/Driver/IbmDb2/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,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];
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Adapter/Driver/Oci8/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,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];
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Entry/Atom.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Atom extends Renderer\AbstractRenderer implements Renderer\RendererInterfa
*
* @param Writer\Entry $container
*/
public function __construct (Writer\Entry $container)
public function __construct(Writer\Entry $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Deleted extends Renderer\AbstractRenderer implements Renderer\RendererInte
*
* @param Writer\Deleted $container
*/
public function __construct (Writer\Deleted $container)
public function __construct(Writer\Deleted $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Entry/AtomDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AtomDeleted extends Renderer\AbstractRenderer implements Renderer\Renderer
*
* @param Writer\Deleted $container
*/
public function __construct (Writer\Deleted $container)
public function __construct(Writer\Deleted $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Entry/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Rss extends Renderer\AbstractRenderer implements Renderer\RendererInterfac
*
* @param Writer\Entry $container
*/
public function __construct (Writer\Entry $container)
public function __construct(Writer\Entry $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Feed/Atom.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Atom extends AbstractAtom implements Renderer\RendererInterface
*
* @param Writer\Feed $container
*/
public function __construct (Writer\Feed $container)
public function __construct(Writer\Feed $container)
{
parent::__construct($container);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AbstractAtom extends Feed\Writer\Renderer\AbstractRenderer
*
* @param \Zend\Feed\Writer\Feed $container
*/
public function __construct ($container)
public function __construct($container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Source extends AbstractAtom implements Renderer\RendererInterface
*
* @param Writer\Source $container
*/
public function __construct (Writer\Source $container)
public function __construct(Writer\Source $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Feed/AtomSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AtomSource extends AbstractAtom implements Renderer\RendererInterface
*
* @param Writer\Source $container
*/
public function __construct (Writer\Source $container)
public function __construct(Writer\Source $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Writer/Renderer/Feed/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Rss extends Renderer\AbstractRenderer implements Renderer\RendererInterfac
*
* @param Writer\Feed $container
*/
public function __construct (Writer\Feed $container)
public function __construct(Writer\Feed $container)
{
parent::__construct($container);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Filter/StripNewlines.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StripNewlines extends AbstractFilter
* @param string $value
* @return string
*/
public function filter ($value)
public function filter($value)
{
return str_replace(array("\n", "\r"), '', $value);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Form/Element/DateSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getInputSpecification()
array(
'name' => 'Callback',
'options' => array(
'callback' => function($date) {
'callback' => function ($date) {
// Convert the date to a specific format
if (is_array($date)) {
$date = $date['year'] . '-' . $date['month'] . '-' . $date['day'];
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Form/Element/DateTimeSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function getInputSpecification()
array(
'name' => 'Callback',
'options' => array(
'callback' => function($date) {
'callback' => function ($date) {
// Convert the date to a specific format
if (is_array($date)) {
if (!isset($date['second'])) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Form/Element/MonthSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function getInputSpecification()
array(
'name' => 'Callback',
'options' => array(
'callback' => function($date) {
'callback' => function ($date) {
// Convert the date to a specific format
if (is_array($date)) {
$date = $date['year'] . '-' . $date['month'];
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Form/View/Helper/Captcha/ReCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function renderJsEvents($challengeId, $responseId)
function windowOnLoad(fn)
{
var old = window.onload;
window.onload = function() {
window.onload = function () {
if (old) {
old();
}
Expand All @@ -125,11 +125,11 @@ function zendBindEvent(el, eventName, eventHandler)
el.attachEvent('on'+eventName, eventHandler);
}
}
windowOnLoad(function() {
windowOnLoad(function () {
zendBindEvent(
document.getElementById("$challengeId").form,
'submit',
function(e) {
function (e) {
document.getElementById("$challengeId").value = document.getElementById("recaptcha_challenge_field").value;
document.getElementById("$responseId").value = document.getElementById("recaptcha_response_field").value;
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Json/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
* 'integer' => 9,
* 'string' => 'test string',
* 'function' => Zend\Json\Expr(
* 'function() { window.alert("javascript function encoded by Zend\Json\Json") }'
* 'function () { window.alert("javascript function encoded by Zend\Json\Json") }'
* ),
* );
*
* Zend\Json\Json::encode($foo, false, array('enableJsonExprFinder' => true));
* // it will returns json encoded string:
* // {"integer":9,"string":"test string","function":function() {window.alert("javascript function encoded by Zend\Json\Json")}}
* // {"integer":9,"string":"test string","function":function () {window.alert("javascript function encoded by Zend\Json\Json")}}
* </code>
*/
class Expr
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Loader/ClassMapAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static function realPharPath($path)
return ($p !== '' && $p !== '.');
}));

array_walk($parts, function ($value, $key) use(&$parts) {
array_walk($parts, function ($value, $key) use (&$parts) {
if ($value === '..') {
unset($parts[$key], $parts[$key-1]);
$parts = array_values($parts);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Log/Formatter/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function format($event)
* @param string $key
* @return array
*/
protected function buildReplacementsFromArray ($event, $key = null)
protected function buildReplacementsFromArray($event, $key = null)
{
$result = array();
foreach ($event as $index => $value) {
Expand Down
4 changes: 1 addition & 3 deletions library/Zend/Log/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,7 @@ public static function registerErrorHandler(Logger $logger, $continueNativeHandl

$errorPriorityMap = static::$errorPriorityMap;

$previous = set_error_handler(function ($level, $message, $file, $line)
use ($logger, $errorPriorityMap, $continueNativeHandler)
{
$previous = set_error_handler(function ($level, $message, $file, $line) use ($logger, $errorPriorityMap, $continueNativeHandler) {
$iniLevel = error_reporting();

if ($iniLevel & $level) {
Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected function handlePostRequest(FormInterface $form, $redirect, $redirectTo
$this->traverseInputs(
$inputFilter,
$previousFiles,
function($input, $value) {
function ($input, $value) {
if ($input instanceof FileInput) {
$input->setRequired(false);
}
Expand Down Expand Up @@ -135,7 +135,7 @@ protected function handleGetRequest(FormInterface $form)
$this->traverseInputs(
$inputFilter,
$post,
function($input, $value) {
function ($input, $value) {
if ($input instanceof FileInput) {
$input->setAutoPrependUploadValidator(false)
->setValidatorChain(new ValidatorChain())
Expand Down Expand Up @@ -242,7 +242,7 @@ protected function getNonEmptyUploadData(InputFilterInterface $inputFilter, $dat
return $this->traverseInputs(
$inputFilter,
$data,
function($input, $value) {
function ($input, $value) {
$messages = $input->getMessages();
if (is_array($value) && $input instanceof FileInput && empty($messages)) {
$rawValue = $input->getRawValue();
Expand Down Expand Up @@ -270,7 +270,7 @@ protected function getEmptyUploadData(InputFilterInterface $inputFilter, $data)
return $this->traverseInputs(
$inputFilter,
$data,
function($input, $value) {
function ($input, $value) {
$messages = $input->getMessages();
if (is_array($value) && $input instanceof FileInput && empty($messages)) {
$rawValue = $input->getRawValue();
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Paginator/SerializableLimitIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SerializableLimitIterator extends LimitIterator implements Serializable, A
* @param int $count Maximum number of elements to show or -1 for all
* @see LimitIterator::__construct
*/
public function __construct (Iterator $it, $offset=0, $count=-1)
public function __construct(Iterator $it, $offset=0, $count=-1)
{
parent::__construct($it, $offset, $count);
$this->offset = $offset;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Soap/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function setClass($class)
public function addFunction($function)
{
if (is_array($function)) {
foreach($function as $row){
foreach($function as $row) {
$this->addFunction($row);
}
} elseif (is_string($function)) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Stdlib/Hydrator/AbstractHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getFilter()
*
* <code>
* $composite->addFilter("servicelocator",
* function($property) {
* function ($property) {
* list($class, $method) = explode('::', $property);
* if ($method === 'getServiceLocator') {
* return false;
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Stdlib/Hydrator/Filter/FilterComposite.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class FilterComposite implements FilterInterface
public function __construct($orFilter = array(), $andFilter = array())
{
array_walk($orFilter,
function($value, $key) {
function ($value, $key) {
if (
!is_callable($value)
&& !$value instanceof FilterInterface
Expand All @@ -55,7 +55,7 @@ function($value, $key) {
);

array_walk($andFilter,
function($value, $key) {
function ($value, $key) {
if (
!is_callable($value)
&& !$value instanceof FilterInterface
Expand All @@ -79,7 +79,7 @@ function($value, $key) {
* This example will exclude all methods from the hydration, that starts with 'getService'
* <code>
* $composite->addFilter('exclude',
* function($method) {
* function ($method) {
* if (preg_match('/^getService/', $method) {
* return false;
* }
Expand Down
12 changes: 6 additions & 6 deletions library/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ClosureStrategy implements StrategyInterface
{
/**
* Function, used in extract method, default:
* function($value) {
* function ($value) {
* return $value;
* };
* @var callable
Expand All @@ -22,7 +22,7 @@ class ClosureStrategy implements StrategyInterface

/**
* Function, used in hydrate method, default:
* function($value) {
* function ($value) {
* return $value;
* };
* @var callable
Expand All @@ -32,10 +32,10 @@ class ClosureStrategy implements StrategyInterface
/**
* You can describe how your values will extract and hydrate, like this:
* $hydrator->addStrategy('category', new ClosureStrategy(
* function(Category $value) {
* function (Category $value) {
* return (int) $value->id;
* },
* function($value) {
* function ($value) {
* return new Category((int) $value);
* }
* ));
Expand All @@ -54,7 +54,7 @@ public function __construct($extractFunc = null, $hydrateFunc = null)

$this->extractFunc = $extractFunc;
} else {
$this->extractFunc = function($value) {
$this->extractFunc = function ($value) {
return $value;
};
}
Expand All @@ -66,7 +66,7 @@ public function __construct($extractFunc = null, $hydrateFunc = null)

$this->hydrateFunc = $hydrateFunc;
} else {
$this->hydrateFunc = function($value) {
$this->hydrateFunc = function ($value) {
return $value;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function url($url, $method = HttpRequest::METHOD_GET, $params = array())
} elseif ($method == HttpRequest::METHOD_PUT) {
if (count($params) != 0) {
array_walk($params,
function(&$item, $key) { $item = $key . '=' . $item; }
function (&$item, $key) { $item = $key . '=' . $item; }
);
$content = implode('&', $params);
$request->setContent($content);
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Validator/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public function getIdnCheck()
* @param bool $useIdnCheck Set to true to validate IDN domains
* @return Hostname
*/
public function useIdnCheck ($useIdnCheck)
public function useIdnCheck($useIdnCheck)
{
$this->options['useIdnCheck'] = (bool) $useIdnCheck;
return $this;
Expand All @@ -429,7 +429,7 @@ public function getTldCheck()
* @param bool $useTldCheck Set to true to validate TLD elements
* @return Hostname
*/
public function useTldCheck ($useTldCheck)
public function useTldCheck($useTldCheck)
{
$this->options['useTldCheck'] = (bool) $useTldCheck;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/View/Helper/FlashMessenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function render($namespace = PluginFlashMessenger::NAMESPACE_DEFAULT, arr
$translator = $this->getTranslator();
$translatorTextDomain = $this->getTranslatorTextDomain();

array_walk_recursive($messages, function($item) use (&$messagesToPrint, $escapeHtml, $translator, $translatorTextDomain) {
array_walk_recursive($messages, function ($item) use (&$messagesToPrint, $escapeHtml, $translator, $translatorTextDomain) {
if ($translator !== null) {
$item = $translator->translate(
$item,
Expand Down
Loading

0 comments on commit 26dd6a0

Please sign in to comment.