Skip to content

Commit

Permalink
Merge branch 'master' into fixAnnotationsOnZendDb
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Db/Adapter/AdapterInterface.php
  • Loading branch information
dennisdegreef committed Dec 2, 2014
2 parents 543dd65 + 5b557b2 commit 433a40e
Show file tree
Hide file tree
Showing 971 changed files with 3,194 additions and 2,145 deletions.
1 change: 1 addition & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $finder = Symfony\CS\Finder\DefaultFinder::create()
}
});
$config = Symfony\CS\Config\Config::create();
$config->level(null);
$config->fixers(
array(
'indentation',
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ before_script:
- cp tests/TestConfiguration.php.travis tests/TestConfiguration.php

script:
# Run coding standard checks in parallel
- ls -d library/Zend/* tests/ZendTest/* bin | parallel --gnu --keep-order 'echo "Running {} CS checks"; ./vendor/bin/php-cs-fixer fix {} -v --dry-run --config-file=.php_cs;' || exit 1
# Run tests for the various components in parallel
- ls -d tests/ZendTest/* | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/phpunit.xml.dist --coverage-php build/coverage/coverage-{/.}.cov {};' || exit 1
# Run coding standard checks in parallel
- ls -d library/Zend/* tests/ZendTest/* bin | parallel --gnu --keep-order 'echo "Running {} CS checks"; ./vendor/bin/php-cs-fixer fix {} -v --dry-run --config-file=.php_cs;' || exit 1

after_script:
# Merges the individual clover reports of each component into a single clover.xml
Expand Down
1 change: 0 additions & 1 deletion bin/pluginmap_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
}

if ($appending) {

$content = var_export((array) $map, true) . ';';

// Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op
Expand Down
5 changes: 3 additions & 2 deletions bin/templatemap_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
$map->{$mapName} = $filename;
}


if ($appending) {
$content = var_export((array) $map, true) . ';';

Expand Down Expand Up @@ -230,7 +229,9 @@
$maxWidth = max($maxWidth, strlen($match[1]));
}

$content = preg_replace('(\n\s+([^=]+)=>)e', "'\n \\1' . str_repeat(' ', " . $maxWidth . " - strlen('\\1')) . '=>'", $content);
$content = preg_replace_callback('(\n\s+([^=]+)=>)', function ($matches) use ($maxWidth) {
return PHP_EOL . ' ' . $matches[1] . str_repeat(' ', $maxWidth - strlen($matches[1])) . '=>';
}, $content);

// Make the file end by EOL
$content = rtrim($content, "\n") . "\n";
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"ircmaxell/random-lib": "dev-master",
"ircmaxell/security-lib": "dev-master",
"mikey179/vfsStream": "1.2.*",
"fabpot/php-cs-fixer": "dev-master#fcbb09b5204",
"fabpot/php-cs-fixer": "1.*",
"phpunit/PHPUnit": "3.7.*",
"satooshi/php-coveralls": "dev-master",
"sebastianbergmann/phpcov": "1.1.0"
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Authentication/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

abstract class AbstractAdapter implements ValidatableAdapterInterface
{

/**
* @var mixed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,21 @@ public function getResultRowObject($returnColumns = null, $omitColumns = null)
$returnObject = new stdClass();

if (null !== $returnColumns) {

$availableColumns = array_keys($this->resultRow);
foreach ((array) $returnColumns as $returnColumn) {
if (in_array($returnColumn, $availableColumns)) {
$returnObject->{$returnColumn} = $this->resultRow[$returnColumn];
}
}
return $returnObject;

} elseif (null !== $omitColumns) {

$omitColumns = (array) $omitColumns;
foreach ($this->resultRow as $resultColumn => $resultValue) {
if (!in_array($resultColumn, $omitColumns)) {
$returnObject->{$resultColumn} = $resultValue;
}
}
return $returnObject;

}

foreach ($this->resultRow as $resultColumn => $resultValue) {
Expand Down Expand Up @@ -352,7 +348,6 @@ protected function authenticateQuerySelect(Sql\Select $dbSelect)
*/
protected function authenticateValidateResultSet(array $resultIdentities)
{

if (count($resultIdentities) < 1) {
$this->authenticateResultInfo['code'] = AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND;
$this->authenticateResultInfo['messages'][] = 'A record with the supplied identity could not be found.';
Expand Down
11 changes: 4 additions & 7 deletions library/Zend/Authentication/Adapter/Digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,14 @@ public function authenticate()
}
if (substr($line, 0, $idLength) === $id) {
if (CryptUtils::compareStrings(substr($line, -32), md5("$this->identity:$this->realm:$this->credential"))) {
$result['code'] = AuthenticationResult::SUCCESS;
} else {
$result['code'] = AuthenticationResult::FAILURE_CREDENTIAL_INVALID;
$result['messages'][] = 'Password incorrect';
return new AuthenticationResult(AuthenticationResult::SUCCESS, $result['identity'], $result['messages']);
}
return new AuthenticationResult($result['code'], $result['identity'], $result['messages']);
$result['messages'][] = 'Password incorrect';
return new AuthenticationResult(AuthenticationResult::FAILURE_CREDENTIAL_INVALID, $result['identity'], $result['messages']);
}
}

$result['code'] = AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND;
$result['messages'][] = "Username '$this->identity' and realm '$this->realm' combination not found";
return new AuthenticationResult($result['code'], $result['identity'], $result['messages']);
return new AuthenticationResult(AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND, $result['identity'], $result['messages']);
}
}
1 change: 0 additions & 1 deletion library/Zend/Authentication/Adapter/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ protected function _parseDigestAuth($header)
if ($this->useOpaque) {
$ret = preg_match('/opaque="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {

// Big surprise: IE isn't RFC 2617-compliant.
$headers = $this->request->getHeaders();
if (!$headers->has('User-Agent')) {
Expand Down
3 changes: 0 additions & 3 deletions library/Zend/Authentication/Adapter/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

class Ldap extends AbstractAdapter
{

/**
* The Zend\Ldap\Ldap context.
*
Expand Down Expand Up @@ -214,7 +213,6 @@ public function authenticate()
* credentials against it.
*/
foreach ($this->options as $options) {

if (!is_array($options)) {
throw new Exception\InvalidArgumentException('Adapter options array not an array');
}
Expand Down Expand Up @@ -277,7 +275,6 @@ public function authenticate()
$failedAuthorities[$dname] = $groupResult;
}
} catch (LdapException $zle) {

/* LDAP based authentication is notoriously difficult to diagnose. Therefore
* we bend over backwards to capture and record every possible bit of
* information when something goes wrong.
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Barcode/Barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function getRendererPluginManager()
* Factory for Zend\Barcode classes.
*
* First argument may be a string containing the base of the adapter class
* name, e.g. 'int25' corresponds to class Object\Int25. This
* name, e.g. 'code25' corresponds to class Object\Code25. This
* is case-insensitive.
*
* First argument may alternatively be an object of type Traversable.
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Ean13.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Ean13 extends AbstractObject
{

/**
* Coding map
* - 0 = narrow bar
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Ean2.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Ean2 extends Ean5
{

protected $parities = array(
0 => array('A','A'),
1 => array('A','B'),
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Ean5.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Ean5 extends Ean13
{

protected $parities = array(
0 => array('B','B','A','A','A'),
1 => array('B','A','B','A','A'),
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Ean8.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class Ean8 extends Ean13
{

/**
* Default options for Postnet barcode
* @return void
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Identcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Identcode extends Code25interleaved
{

/**
* Default options for Identcode barcode
* @return void
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Itf14.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Itf14 extends Code25interleaved
{

/**
* Default options for Identcode barcode
* @return void
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Leitcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Leitcode extends Identcode
{

/**
* Default options for Leitcode barcode
* @return void
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Planet extends Postnet
{

/**
* Coding map
* - 0 = half bar
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Postnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Postnet extends AbstractObject
{

/**
* Coding map
* - 0 = half bar
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Royalmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Royalmail extends AbstractObject
{

/**
* Coding map
* - 0 = Tracker, Ascender and Descender
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Object/Upca.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Upca extends Ean13
{

/**
* Default options for Postnet barcode
* @return void
Expand Down
9 changes: 4 additions & 5 deletions library/Zend/Barcode/Object/Upce.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class Upce extends Ean13
{

protected $parities = array(
0 => array(
0 => array('B','B','B','A','A','A'),
Expand Down Expand Up @@ -60,8 +59,8 @@ protected function getDefaultOptions()
public function getText()
{
$text = parent::getText();
if ($text{0} != 1) {
$text{0} = 0;
if ($text[0] != 1) {
$text[0] = 0;
}
return $text;
}
Expand Down Expand Up @@ -192,8 +191,8 @@ protected function validateSpecificText($value, $options = array())
public function getChecksum($text)
{
$text = $this->addLeadingZeros($text, true);
if ($text{0} != 1) {
$text{0} = 0;
if ($text[0] != 1) {
$text[0] = 0;
}
return parent::getChecksum($text);
}
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Renderer/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ protected function drawText($text, $size, $position, $font, $color, $alignment =
}
imagestring($this->resource, $font, $positionX, $positionY, $text, $color);
} else {

if (!function_exists('imagettfbbox')) {
throw new Exception\RuntimeException(
'A font was provided, but this instance of PHP does not have TTF (FreeType) support'
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Barcode/Renderer/Svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
class Svg extends AbstractRenderer
{

/**
* Resource for the image
* @var DOMDocument
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Cache/Pattern/CaptureCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ protected function createDirectoryStructure($pathname)
$err = ErrorHandler::stop();
throw new Exception\RuntimeException("chmod('{$pathname}', 0{$oct}) failed", 0, $err);
}

} else {
// build-in mkdir function sets permission together with current umask
// which doesn't work well on multo threaded webservers
Expand Down
3 changes: 1 addition & 2 deletions library/Zend/Cache/Storage/Adapter/AdapterOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
class AdapterOptions extends AbstractOptions
{

/**
* The adapter using these options
*
Expand Down Expand Up @@ -259,7 +258,7 @@ protected function normalizeTtl(&$ttl)
}

if ($ttl < 0) {
throw new Exception\InvalidArgumentException("TTL can't be negative");
throw new Exception\InvalidArgumentException("TTL can't be negative");
}
}
}
1 change: 0 additions & 1 deletion library/Zend/Cache/Storage/Adapter/ApcIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class ApcIterator implements IteratorInterface
{

/**
* The apc storage instance
*
Expand Down
1 change: 0 additions & 1 deletion library/Zend/Cache/Storage/Adapter/Dba.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public function flush()
}

if (file_exists($pathname)) {

// close the dba file before delete
// and reopen (create) on next use
$this->_close();
Expand Down
Loading

0 comments on commit 433a40e

Please sign in to comment.