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

Commit

Permalink
Merge branch 'master' of git://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 50 changed files with 720 additions and 795 deletions.
14 changes: 0 additions & 14 deletions .travis/run-tests.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .travis/skipped-components

This file was deleted.

61 changes: 0 additions & 61 deletions .travis/tested-components

This file was deleted.

54 changes: 25 additions & 29 deletions src/Config.php
@@ -1,36 +1,30 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Config
*/

namespace Zend\Config;

use Countable,
Iterator,
ArrayAccess,
Zend\Stdlib\ArrayUtils
;
use Countable;
use Iterator;
use ArrayAccess;
use Zend\Stdlib\ArrayUtils;

/**
* Provides a property based interface to an array.
* The data are read-only unless $allowModifications is set to true
* on construction.
*
* Implements Countable, Iterator and ArrayAccess
* to facilitate easy access to the data.
*
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Config implements Countable, Iterator, ArrayAccess
{
Expand Down Expand Up @@ -64,16 +58,13 @@ class Config implements Countable, Iterator, ArrayAccess
protected $skipNextIteration;

/**
* Zend_Config provides a property based interface to
* an array. The data are read-only unless $allowModifications
* is set to true on construction.
* Constructor.
*
* Zend_Config also implements Countable, Iterator and ArrayAccess to
* facilitate easy access to the data.
* Data is read-only unless $allowModifications is set to true
* on construction.
*
* @param array $array
* @param boolean $allowModifications
* @return void
*/
public function __construct(array $array, $allowModifications = false)
{
Expand Down Expand Up @@ -126,6 +117,7 @@ public function __get($name)
* @param string $name
* @param mixed $value
* @return void
* @throws Exception\RuntimeException
*/
public function __set($name, $value)
{
Expand Down Expand Up @@ -173,6 +165,7 @@ public function toArray()
$array = array();
$data = $this->data;

/** @var self $value */
foreach ($data as $key => $value) {
if ($value instanceof self) {
$array[$key] = $value->toArray();
Expand Down Expand Up @@ -200,6 +193,7 @@ public function __isset($name)
*
* @param string $name
* @return void
* @throws Exception\InvalidArgumentException
*/
public function __unset($name)
{
Expand Down Expand Up @@ -342,11 +336,12 @@ public function offsetUnset($offset)
* - Items in $merge with INTEGER keys will be appended.
* - Items in $merge with STRING keys will overwrite current values.
*
* @param Config $replace
* @param Config $merge
* @return Config
*/
public function merge(self $merge)
{
/** @var Config $value */
foreach ($merge as $key => $value) {
if (array_key_exists($key, $this->data)) {
if (is_int($key)) {
Expand Down Expand Up @@ -384,6 +379,7 @@ public function setReadOnly()
{
$this->allowModifications = false;

/** @var Config $value */
foreach ($this->data as $value) {
if ($value instanceof self) {
$value->setReadOnly();
Expand Down
23 changes: 6 additions & 17 deletions src/Exception/ExceptionInterface.php
@@ -1,30 +1,19 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Config
*/

namespace Zend\Config\Exception;

/**
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @subpackage Exception
*/
interface ExceptionInterface
{}
28 changes: 8 additions & 20 deletions src/Exception/InvalidArgumentException.php
@@ -1,31 +1,19 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Config
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Config
*/

namespace Zend\Config\Exception;

/**
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @category Zend
* @package Zend_Config
* @subpackage Exception
*/
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{}
25 changes: 7 additions & 18 deletions src/Exception/RuntimeException.php
@@ -1,30 +1,19 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Config
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Config
*/

namespace Zend\Config\Exception;

/**
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @category Zend
* @package Zend_Config
* @subpackage Exception
*/
class RuntimeException extends \RuntimeException implements ExceptionInterface
{}

0 comments on commit cb27129

Please sign in to comment.