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 into cach…
Browse files Browse the repository at this point in the history
…e_interfaces
  • Loading branch information
Show file tree
Hide file tree
Showing 23 changed files with 133 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .travis/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
travisdir=$(dirname $(readlink /proc/$$/fd/255))
travisdir=$(dirname "$0")
testdir="$travisdir/../tests"
testedcomponents=(`cat "$travisdir/tested-components"`)
result=0
Expand Down
1 change: 1 addition & 0 deletions .travis/skipped-components
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Zend/Amf
Zend/Date
Zend/Dojo
Zend/Queue
Zend/Service
Zend/Test
Expand Down
4 changes: 3 additions & 1 deletion .travis/tested-components
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ Zend/Form
Zend/GData
Zend/Http
Zend/InfoCard
Zend/InputFilter
Zend/Json
Zend/Ldap
Zend/Loader
Zend/Locale
Zend/Log
Zend/Mail
Zend/Markup
Zend/Math
Zend/Measure
Zend/Memory
Zend/Mime
Zend/Module
Zend/ModuleManager
Zend/Mvc
Zend/Navigation
Zend/OAuth
Expand Down
4 changes: 2 additions & 2 deletions src/Exception.php → src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace 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
*/
interface Exception
interface ExceptionInterface
{}
8 changes: 3 additions & 5 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* @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 InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\Config\Exception
{
}
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{}
7 changes: 2 additions & 5 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@
* @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 RuntimeException
extends \RuntimeException
implements \Zend\Config\Exception
{
}
class RuntimeException extends \RuntimeException implements ExceptionInterface
{}
8 changes: 3 additions & 5 deletions src/Processor/Constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@
namespace Zend\Config\Processor;

use Zend\Config\Config,
Zend\Config\Processor,
Zend\Config\Processor\Token,
Zend\Config\Exception\InvalidArgumentException,
\Traversable,
\ArrayObject;
Traversable,
ArrayObject;

/**
* @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 Constant extends Token implements Processor
class Constant extends Token implements ProcessorInterface
{
/**
* Replace only user-defined tokens
Expand Down
16 changes: 7 additions & 9 deletions src/Processor/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,44 @@
namespace Zend\Config\Processor;

use Zend\Config\Config,
Zend\Config\Processor,
Zend\Config\Exception,
Zend\Filter\FilterInterface as ZendFilter,
\Traversable,
\ArrayObject;
Traversable,
ArrayObject;

/**
* @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 Filter implements Processor
class Filter implements ProcessorInterface
{
/**
* @var \Zend\Filter\FilterInterface
* @var ZendFilter
*/
protected $filter;

/**
* Filter all config values using the supplied Zend\Filter
*
* @param \Zend\Filter\FilterInterface $filter
* @return \Zend\Config\Processor\Filter
* @param ZendFilter $filter
*/
public function __construct(ZendFilter $filter)
{
$this->setFilter($filter);
}

/**
* @return \Zend\Filter\FilterInterface
* @return ZendFilter
*/
public function getFilter()
{
return $this->filter;
}

/**
* @param \Zend\Filter\FilterInterface $filter
* @param ZendFilter $filter
*/
public function setFilter(ZendFilter $filter)
{
Expand Down
8 changes: 5 additions & 3 deletions src/Processor.php → src/Processor/ProcessorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Config;
namespace Zend\Config\Processor;

use Zend\Config\Config;

/**
* @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
*/
interface Processor
interface ProcessorInterface
{
/**
* Process the whole Config structure and recursively parse all its values.
*
* @param Config $value
* @return \Zend\Config\Config
* @return Config
*/
public function process(Config $value);

Expand Down
7 changes: 3 additions & 4 deletions src/Processor/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace Zend\Config\Processor;

use Zend\Config\Config,
Zend\Config\Processor,
Zend\Config\Exception\InvalidArgumentException,
Zend\Stdlib\PriorityQueue;

Expand All @@ -31,7 +30,7 @@
* @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 Queue extends PriorityQueue implements Processor
class Queue extends PriorityQueue implements ProcessorInterface
{
/**
* Process the whole config structure with each parser in the queue.
Expand All @@ -46,7 +45,7 @@ public function process(Config $config)
}

foreach ($this as $parser) {
/** @var $parser \Zend\Config\Processor */
/** @var $parser \Zend\Config\Processor\ProcessorInterface */
$parser->process($config);
}
}
Expand All @@ -60,7 +59,7 @@ public function process(Config $config)
public function processValue($value)
{
foreach ($this as $parser) {
/** @var $parser \Zend\Config\Processor */
/** @var $parser \Zend\Config\Processor\ProcessorInterface */
$value = $parser->processValue($value);
}

Expand Down
11 changes: 5 additions & 6 deletions src/Processor/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
namespace Zend\Config\Processor;

use Zend\Config\Config,
Zend\Config\Processor,
Zend\Config\Exception,
\Traversable,
\ArrayObject;
Traversable,
ArrayObject;

/**
* @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 Token implements Processor
class Token implements ProcessorInterface
{
/**
* Token prefix.
Expand Down Expand Up @@ -202,9 +201,9 @@ protected function buildMap()

/**
* Process
*
*
* @param Config $config
* @return Config
* @return Config
*/
public function process(Config $config)
{
Expand Down
26 changes: 16 additions & 10 deletions src/Processor/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,27 @@
namespace Zend\Config\Processor;

use Zend\Config\Config,
Zend\Config\Processor,
Zend\Config\Exception\InvalidArgumentException,
Zend\Translator\Translator as ZendTranslator,
Zend\Locale\Locale,
\Traversable,
\ArrayObject;
Traversable,
ArrayObject;

/**
* @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 Translator implements Processor
class Translator implements ProcessorInterface
{
/**
* @var \Zend\Translator\Translator
* @var ZendTranslator
*/
protected $translator;

/**
* @var \Zend\Locale\Locale|string|null
* @var Locale|string|null
*/
protected $locale = null;

Expand All @@ -61,37 +60,44 @@ public function __construct(ZendTranslator $translator, $locale = null)
}

/**
* @return \Zend\Translator\Translator
* @return ZendTranslator
*/
public function getTranslator()
{
return $this->translator;
}

/**
* @param \Zend\Translator\Translator $translator
* @param ZendTranslator $translator
*/
public function setTranslator(ZendTranslator $translator)
{
$this->translator = $translator;
}

/**
* @return \Zend\Locale\Locale|string|null
* @return Locale|string|null
*/
public function getLocale()
{
return $this->locale;
}

/**
* @param \Zend\Locale\Locale|string|null $locale
* @param Locale|string|null $locale
*/
public function setLocale($locale)
{
$this->locale = $locale;
}

/**
* Process
*
* @param Config $config
* @return Config
* @throws InvalidArgumentException
*/
public function process(Config $config)
{
if ($config->isReadOnly()) {
Expand Down
9 changes: 4 additions & 5 deletions src/Reader/Ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

namespace Zend\Config\Reader;

use Zend\Config\Reader,
Zend\Config\Exception;
use Zend\Config\Exception;

/**
* XML config reader.
Expand All @@ -33,7 +32,7 @@
* @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 Ini implements Reader
class Ini implements ReaderInterface
{
/**
* Separator for nesting levels of configuration data identifiers.
Expand Down Expand Up @@ -74,7 +73,7 @@ public function getNestSeparator()
/**
* fromFile(): defined by Reader interface.
*
* @see Reader::fromFile()
* @see ReaderInterface::fromFile()
* @param string $filename
* @return array
*/
Expand Down Expand Up @@ -102,7 +101,7 @@ function($error, $message = '', $file = '', $line = 0) use ($filename) {
/**
* fromString(): defined by Reader interface.
*
* @see Reader::fromString()
* @see ReaderInterface::fromString()
* @param string $string
* @return array
*/
Expand Down
Loading

0 comments on commit 315a9ac

Please sign in to comment.