Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:zendframework/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 72 changed files with 230 additions and 230 deletions.
12 changes: 6 additions & 6 deletions src/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down Expand Up @@ -32,7 +32,7 @@ class Attribute
* @param array $data
* @param string $attribName
* @param string|array|\Traversable $value
* @param boolean $append
* @param bool $append
* @return void
*/
public static function setAttribute(array &$data, $attribName, $value, $append = false)
Expand Down Expand Up @@ -102,7 +102,7 @@ public static function getAttribute(array $data, $attribName, $index = null)
* @param array $data
* @param string $attribName
* @param mixed|array $value
* @return boolean
* @return bool
*/
public static function attributeHasValue(array &$data, $attribName, $value)
{
Expand Down Expand Up @@ -288,8 +288,8 @@ public static function createPassword($password, $hashType = self::PASSWORD_HASH
* @param array $data
* @param string $attribName
* @param integer|array|\Traversable $value
* @param boolean $utc
* @param boolean $append
* @param bool $utc
* @param bool $append
*/
public static function setDateTimeAttribute(
array &$data, $attribName, $value, $utc = false,
Expand All @@ -315,7 +315,7 @@ public static function setDateTimeAttribute(

/**
* @param integer $value
* @param boolean $utc
* @param bool $utc
* @return string|null
*/
private static function valueToLdapDateTime($value, $utc)
Expand Down
6 changes: 3 additions & 3 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down Expand Up @@ -57,7 +57,7 @@ public function __destruct()
/**
* Closes the current result set
*
* @return boolean
* @return bool
*/
public function close()
{
Expand Down Expand Up @@ -211,7 +211,7 @@ public function rewind()
* after calls to rewind() or next()
* Implements Iterator
*
* @return boolean
* @return bool
*/
public function valid()
{
Expand Down
12 changes: 6 additions & 6 deletions src/Collection/DefaultIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down Expand Up @@ -197,14 +197,14 @@ public function current()
return null;
}

$entry = array('dn' => $this->key());
$ber_identifier = null;
$entry = array('dn' => $this->key());
$berIdentifier = null;

$resource = $this->ldap->getResource();
ErrorHandler::start();
$name = ldap_first_attribute(
$resource, $this->current,
$ber_identifier
$berIdentifier
);
ErrorHandler::stop();

Expand Down Expand Up @@ -240,7 +240,7 @@ public function current()
ErrorHandler::start();
$name = ldap_next_attribute(
$resource, $this->current,
$ber_identifier
$berIdentifier
);
ErrorHandler::stop();
}
Expand Down Expand Up @@ -332,7 +332,7 @@ public function rewind()
* after calls to rewind() or next()
* Implements Iterator
*
* @return boolean
* @return bool
*/
public function valid()
{
Expand Down
16 changes: 8 additions & 8 deletions src/Converter/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down Expand Up @@ -38,7 +38,7 @@ class Converter
*/
public static function ascToHex32($string)
{
for ($i = 0; $i < strlen($string); $i++) {
for ($i = 0, $len = strlen($string); $i < $len; $i++) {
$char = substr($string, $i, 1);
if (ord($char) < 32) {
$hex = dechex(ord($char));
Expand Down Expand Up @@ -96,7 +96,7 @@ public static function toLdap($value, $type = self::STANDARD)
if (is_string($value)) {
return $value;
} elseif (is_int($value) || is_float($value)) {
return (string)$value;
return (string) $value;
} elseif (is_bool($value)) {
return static::toldapBoolean($value);
} elseif (is_object($value)) {
Expand Down Expand Up @@ -126,7 +126,7 @@ public static function toLdap($value, $type = self::STANDARD)
* DateTime Object, a string that is parseable by strtotime().
*
* @param integer|string|DateTime $date The date-entity
* @param boolean $asUtc Whether to return the LDAP-compatible date-string as UTC or as local value
* @param bool $asUtc Whether to return the LDAP-compatible date-string as UTC or as local value
* @return string
* @throws Exception\InvalidArgumentException
*/
Expand Down Expand Up @@ -160,7 +160,7 @@ public static function toLdapDateTime($date, $asUtc = true)
* case-insensitive string 'true' to an LDAP-compatible 'TRUE'. All other
* other values are converted to an LDAP-compatible 'FALSE'.
*
* @param boolean|integer|string $value The boolean value to encode
* @param bool|integer|string $value The boolean value to encode
* @return string
*/
public static function toLdapBoolean($value)
Expand Down Expand Up @@ -197,7 +197,7 @@ public static function toLdapSerialize($value)
* @see Converter::GENERALIZED_TIME
* @param string $value The value to convert
* @param int $type The conversion type to use
* @param boolean $dateTimeAsUtc Return DateTime values in UTC timezone
* @param bool $dateTimeAsUtc Return DateTime values in UTC timezone
* @return mixed
*/
public static function fromLdap($value, $type = self::STANDARD, $dateTimeAsUtc = true)
Expand Down Expand Up @@ -236,7 +236,7 @@ public static function fromLdap($value, $type = self::STANDARD, $dateTimeAsUtc =
* CAVEAT: The DateTime-Object returned will always be set to UTC-Timezone.
*
* @param string $date The generalized-Time
* @param boolean $asUtc Return the DateTime with UTC timezone
* @param bool $asUtc Return the DateTime with UTC timezone
* @return DateTime
* @throws Exception\InvalidArgumentException if a non-parseable-format is given
*/
Expand Down Expand Up @@ -360,7 +360,7 @@ public static function fromLdapDateTime($date, $asUtc = true)
* Convert an LDAP-compatible boolean value into a PHP-compatible one
*
* @param string $value The value to convert
* @return boolean
* @return bool
* @throws Exception\InvalidArgumentException
*/
public static function fromLdapBoolean($value)
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Exception/ConverterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
28 changes: 14 additions & 14 deletions src/Dn.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down Expand Up @@ -75,9 +75,9 @@ public static function fromString($dn, $caseFold = null)
if (empty($dn)) {
$dnArray = array();
} else {
$dnArray = static::explodeDn((string)$dn);
$dnArray = static::explodeDn((string) $dn);
}
return new self($dnArray, $caseFold);
return new static($dnArray, $caseFold);
}

/**
Expand All @@ -90,7 +90,7 @@ public static function fromString($dn, $caseFold = null)
*/
public static function fromArray(array $dn, $caseFold = null)
{
return new self($dn, $caseFold);
return new static($dn, $caseFold);
}

/**
Expand Down Expand Up @@ -145,7 +145,7 @@ public function getParentDn($levelUp = 1)
throw new Exception\LdapException(null, 'Cannot retrieve parent DN with given $levelUp');
}
$newDn = array_slice($this->dn, $levelUp);
return new self($newDn, $this->caseFold);
return new static($newDn, $this->caseFold);
}

/**
Expand Down Expand Up @@ -254,7 +254,7 @@ public function insert($index, array $value)
* Assert index is correct and usable
*
* @param mixed $index
* @return boolean
* @return bool
* @throws Exception\LdapException
*/
protected function assertIndex($index)
Expand All @@ -272,7 +272,7 @@ protected function assertIndex($index)
* Assert if value is in a correct RDN format
*
* @param array $value
* @return boolean
* @return bool
* @throws Exception\LdapException
*/
protected static function assertRdn(array $value)
Expand Down Expand Up @@ -377,7 +377,7 @@ public function __toString()
* Required by the ArrayAccess implementation
*
* @param int $offset
* @return boolean
* @return bool
*/
public function offsetExists($offset)
{
Expand Down Expand Up @@ -484,10 +484,10 @@ public static function escapeValue($values = array())
// Convert all leading and trailing spaces to sequences of \20.
if (preg_match('/^(\s*)(.+?)(\s*)$/', $val, $matches)) {
$val = $matches[2];
for ($i = 0; $i < strlen($matches[1]); $i++) {
for ($i = 0, $len = strlen($matches[1]); $i < $len; $i++) {
$val = '\20' . $val;
}
for ($i = 0; $i < strlen($matches[3]); $i++) {
for ($i = 0, $len = strlen($matches[3]); $i < $len; $i++) {
$val = $val . '\20';
}
}
Expand Down Expand Up @@ -556,7 +556,7 @@ public static function explodeDn(
throw new Exception\LdapException(null, 'DN is malformed');
}
$ret = array();
for ($i = 0; $i < count($k); $i++) {
for ($i = 0, $count = count($k); $i < $count; $i++) {
if (is_array($k[$i]) && is_array($v[$i]) && (count($k[$i]) === count($v[$i]))) {
$multi = array();
for ($j = 0; $j < count($k[$i]); $j++) {
Expand All @@ -583,7 +583,7 @@ public static function explodeDn(
* @param array $keys An optional array to receive DN keys (e.g. CN, OU, DC, ...)
* @param array $vals An optional array to receive DN values
* @param string $caseFold
* @return boolean True if the DN was successfully parsed or false if the string is not a valid DN.
* @return bool True if the DN was successfully parsed or false if the string is not a valid DN.
*/
public static function checkDn(
$dn, array &$keys = null, array &$vals = null,
Expand Down Expand Up @@ -731,7 +731,7 @@ public static function implodeDn(array $dnArray, $caseFold = null, $separator =
*
* @param string|Dn $childDn
* @param string|Dn $parentDn
* @return boolean
* @return bool
*/
public static function isChildOf($childDn, $parentDn)
{
Expand All @@ -756,7 +756,7 @@ public static function isChildOf($childDn, $parentDn)
if ($startIndex < 0) {
return false;
}
for ($i = 0; $i < count($pdn); $i++) {
for ($i = 0, $count = count($pdn); $i < $count; $i++) {
if ($cdn[$i + $startIndex] != $pdn[$i]) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/LdapException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Ldap
*/
Expand Down
Loading

0 comments on commit febd956

Please sign in to comment.