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

Commit

Permalink
CS updates
Browse files Browse the repository at this point in the history
  • Loading branch information
denixport committed Jul 1, 2012
1 parent d333695 commit 6c552f5
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 93 deletions.
3 changes: 1 addition & 2 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
* @package Zend_Config
* @subpackage Exception
*/
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{}
8 changes: 4 additions & 4 deletions src/Processor/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class Token implements ProcessorInterface
* Token Processor walks through a Config structure and replaces all
* occurences of tokens with supplied values.
*
* @param array|Config|ArrayObject|Traversable $tokens Associative array of TOKEN => value
* to replace it with
* @param array|Config|Traversable $tokens Associative array of TOKEN => value
* to replace it with
* @param string $prefix
* @param string $suffix
* @internal param array $options
Expand Down Expand Up @@ -111,8 +111,8 @@ public function getSuffix()
/**
* Set token registry.
*
* @param array|Config|Traversable $tokens Associative array of TOKEN => value
* to replace it with
* @param array|Config|Traversable $tokens Associative array of TOKEN => value
* to replace it with
* @return Token
* @throws Exception\InvalidArgumentException
*/
Expand Down
5 changes: 1 addition & 4 deletions src/Processor/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
use Zend\Config\Config;
use Zend\Config\Exception;
use Zend\I18n\Translator\Translator as ZendTranslator;
use Locale;
use Traversable;
use ArrayObject;

/**
* @category Zend
Expand Down Expand Up @@ -83,7 +80,7 @@ public function setLocale($locale)
}

/**
* @return Locale|string|null
* @return string|null
*/
public function getLocale()
{
Expand Down
9 changes: 0 additions & 9 deletions src/Writer/AbstractWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ abstract class AbstractWriter implements WriterInterface
* @param mixed $config
* @param boolean $exclusiveLock
* @return void
<<<<<<< HEAD
* @throws Exception\InvalidArgumentException
* @throws Exception\RuntimeException
=======
* @throws Exception\RuntimeException
* @throws Exception\InvalidArgumentException
>>>>>>> initial commit, remove Broker
*/
public function toFile($filename, $config, $exclusiveLock = true)
{
Expand Down Expand Up @@ -66,11 +61,7 @@ function($error, $message = '', $file = '', $line = 0) use ($filename) {
*
* @see WriterInterface::toString()
* @param mixed $config
<<<<<<< HEAD
* @return void
=======
* @return string
>>>>>>> initial commit, remove Broker
* @throws Exception\InvalidArgumentException
*/
public function toString($config)
Expand Down
2 changes: 1 addition & 1 deletion test/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace ZendTest\Config;

use \Zend\Config\Config;
use Zend\Config\Config;

/**
* @category Zend
Expand Down
6 changes: 3 additions & 3 deletions test/Reader/AbstractReaderTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace ZendTest\Config\Reader;

use \PHPUnit_Framework_TestCase as TestCase,
\Zend\Config\Reader\ReaderInterface,
\ReflectionClass;
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Config\Reader\ReaderInterface;
use ReflectionClass;

/**
* @category Zend
Expand Down
2 changes: 1 addition & 1 deletion test/Reader/IniTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace ZendTest\Config\Reader;

use \Zend\Config\Reader\Ini;
use Zend\Config\Reader\Ini;

/**
* @category Zend
Expand Down
2 changes: 1 addition & 1 deletion test/Reader/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace ZendTest\Config\Reader;

use \Zend\Config\Reader\Json;
use Zend\Config\Reader\Json;

/**
* @category Zend
Expand Down
2 changes: 1 addition & 1 deletion test/Reader/XmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace ZendTest\Config\Reader;

use \Zend\Config\Reader\Xml;
use Zend\Config\Reader\Xml;

/**
* @category Zend
Expand Down
2 changes: 1 addition & 1 deletion test/Reader/YamlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace ZendTest\Config\Reader;

use \Zend\Config\Reader\Yaml as YamlReader;
use Zend\Config\Reader\Yaml as YamlReader;

/**
* @category Zend
Expand Down
8 changes: 4 additions & 4 deletions test/Writer/AbstractWriterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

namespace ZendTest\Config\Writer;

use \PHPUnit_Framework_TestCase as TestCase,
\Zend\Config\Config;
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Config\Config;

/**
* @category Zend
Expand All @@ -35,13 +35,13 @@
abstract class AbstractWriterTestCase extends TestCase
{
/**
* @var ReaderInterface
* @var \Zend\Config\Reader\ReaderInterface
*/
protected $reader;

/**
*
* @var WriterInterface
* @var \Zend\Config\Writer\WriterInterface
*/
protected $writer;

Expand Down
12 changes: 4 additions & 8 deletions test/Writer/IniTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace ZendTest\Config\Writer;

use \Zend\Config\Writer\Ini as IniWriter;
use \Zend\Config\Config;
use \Zend\Config\Reader\Ini as IniReader;
use Zend\Config\Writer\Ini as IniWriter;
use Zend\Config\Config;
use Zend\Config\Reader\Ini as IniReader;

/**
* @category Zend
Expand All @@ -35,15 +35,12 @@
*/
class IniTest extends AbstractWriterTestCase
{

public function setUp()
{
$this->reader = new IniReader();
$this->writer = new IniWriter();
}



public function testNoSection()
{
$config = new Config(array('test' => 'foo', 'test2' => array('test3' => 'bar')));
Expand All @@ -58,13 +55,12 @@ public function testNoSection()

public function testWriteAndReadOriginalFile()
{
$config = $this->reader->fromFile(__DIR__ . '/files/allsections.ini');
$config = $this->reader->fromFile(__DIR__ . '/_files/allsections.ini');

$this->writer->toFile($this->getTestAssetFileName(), $config);

$config = $this->reader->fromFile($this->getTestAssetFileName());

$this->assertEquals('multi', $config['all']['one']['two']['three']);

}
}
11 changes: 4 additions & 7 deletions test/Writer/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace ZendTest\Config\Writer;

use \Zend\Config\Writer\Json as JsonWriter;
use \Zend\Config\Config;
use \Zend\Config\Reader\Json as JsonReader;
use Zend\Config\Writer\Json as JsonWriter;
use Zend\Config\Config;
use Zend\Config\Reader\Json as JsonReader;

/**
* @category Zend
Expand All @@ -35,15 +35,12 @@
*/
class JsonTest extends AbstractWriterTestCase
{

public function setUp()
{
$this->reader = new JsonReader();
$this->writer = new JsonWriter();
}



public function testNoSection()
{
$config = new Config(array('test' => 'foo', 'test2' => array('test3' => 'bar')));
Expand All @@ -58,7 +55,7 @@ public function testNoSection()

public function testWriteAndReadOriginalFile()
{
$config = $this->reader->fromFile(__DIR__ . '/files/allsections.json');
$config = $this->reader->fromFile(__DIR__ . '/_files/allsections.json');

$this->writer->toFile($this->getTestAssetFileName(), $config);

Expand Down
6 changes: 3 additions & 3 deletions test/Writer/PhpArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace ZendTest\Config\Writer;

use \Zend\Config\Writer\PhpArray;
use \Zend\Config\Config;
use ZendTest\Config\Writer\files\PhpReader;
use Zend\Config\Writer\PhpArray;
use Zend\Config\Config;
use ZendTest\Config\Writer\TestAssets\PhpReader;

/**
* @category Zend
Expand Down
11 changes: 11 additions & 0 deletions test/Writer/TestAssets/PhpReader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace ZendTest\Config\Writer\TestAssets;

class PhpReader
{
public function fromFile($filename)
{
return include $filename;
}
}
8 changes: 4 additions & 4 deletions test/Writer/XmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace ZendTest\Config\Writer;

use \Zend\Config\Writer\Xml as XmlWriter;
use \Zend\Config\Config;
use \Zend\Config\Reader\Xml as XmlReader;
use Zend\Config\Writer\Xml as XmlWriter;
use Zend\Config\Config;
use Zend\Config\Reader\Xml as XmlReader;

/**
* @category Zend
Expand All @@ -33,7 +33,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
* @group Zend_Config
*/
class XmlTest extends \PHPUnit_Framework_TestCase
class XmlTest extends AbstractWriterTestCase
{
protected $_tempName;

Expand Down
9 changes: 4 additions & 5 deletions test/Writer/YamlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace ZendTest\Config\Writer;

use \Zend\Config\Writer\Yaml as YamlWriter;
use \Zend\Config\Config;
use \Zend\Config\Reader\Yaml as YamlReader;
use Zend\Config\Writer\Yaml as YamlWriter;
use Zend\Config\Config;
use Zend\Config\Reader\Yaml as YamlReader;

/**
* @category Zend
Expand All @@ -35,7 +35,6 @@
*/
class YamlTest extends AbstractWriterTestCase
{

public function setUp()
{
if (!constant('TESTS_ZEND_CONFIG_YAML_ENABLED')) {
Expand Down Expand Up @@ -75,7 +74,7 @@ public function testNoSection()

public function testWriteAndReadOriginalFile()
{
$config = $this->reader->fromFile(__DIR__ . '/files/allsections.yaml');
$config = $this->reader->fromFile(__DIR__ . '/_files/allsections.yaml');

$this->writer->toFile($this->getTestAssetFileName(), $config);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[all]
hostname = all
name = thisname
db.host = 127.0.0.1
db.user = username
db.pass = password
db.name = live
one.two.three = multi

[staging]
hostname = staging
db.name = dbstaging
debug = false

[debug]
hostname = debug
debug = true
values.changed = yes
db.name = dbdebug
special.no = no
special.null = null
special.false = false

[other_staging]
only_in = otherStaging
db.pass = anotherpwd
[all]
hostname = all
name = thisname
db.host = 127.0.0.1
db.user = username
db.pass = password
db.name = live
one.two.three = multi

[staging]
hostname = staging
db.name = dbstaging
debug = false

[debug]
hostname = debug
debug = true
values.changed = yes
db.name = dbdebug
special.no = no
special.null = null
special.false = false

[other_staging]
only_in = otherStaging
db.pass = anotherpwd
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 0 additions & 9 deletions test/Writer/files/PhpReader.php

This file was deleted.

0 comments on commit 6c552f5

Please sign in to comment.