Skip to content

Commit

Permalink
Merge pull request #5 from sandrokeil/develop
Browse files Browse the repository at this point in the history
Updated source to psr-4
  • Loading branch information
sandrokeil committed Apr 29, 2014
2 parents 6908b05 + f02d9be commit 123ebeb
Show file tree
Hide file tree
Showing 41 changed files with 125 additions and 278 deletions.
16 changes: 7 additions & 9 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,34 @@ before_commands:
tools:
php_code_coverage:
enabled: true
test_command: phpunit -c phpunit.xml.dist
#filter:
#paths: ["src"]
test_command: ./vendor/bin/phpunit -c phpunit.xml.dist
php_code_sniffer:
enabled: true
config:
standard: PSR2
filter:
paths: ["src/*", "tests/*"]
paths: ["src/*", "test/*"]
php_cpd:
enabled: true
excluded_dirs: ["build/*", "docs", "examples", "tests", "vendor"]
excluded_dirs: ["build/*", "docs", "test", "vendor"]
php_cs_fixer:
enabled: true
config:
level: all
filter:
paths: ["src/*", "tests/*"]
paths: ["src/*", "test/*"]
php_loc:
enabled: true
excluded_dirs: ["build", "docs", "examples", "tests", "vendor"]
excluded_dirs: ["build", "docs", "test", "vendor"]
php_mess_detector:
enabled: true
filter:
paths: ["src/*"]
php_pdepend:
enabled: true
excluded_dirs: ["build", "docs", "examples", "tests", "vendor"]
excluded_dirs: ["build", "docs", "test", "vendor"]
php_analyzer: true
php_analyzer:
filter:
paths: ["src/*", "tests/*", "examples/*"]
paths: ["src/*", "test/*"]
sensiolabs_security_checker: true
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ php:
- 5.3
- 5.4
- 5.5
- hhvm

matrix:
allow_failures:
- php: hhvm

before_script:
- composer self-update
- composer install --dev --prefer-source

script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/SakeTest
- ./vendor/bin/phpcs --standard=PSR2 ./src/ ./test

after_script:
- php vendor/bin/coveralls -v
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# EasyConfig CHANGELOG

## 1.2.0 (2014-04-29)

- Updated source to PSR-4
- Removed Module.php
- Optimized tests

## 1.1.0 (2014-04-03)

- Optimized composer dependencies
- Updated docs

## 1.0.0 (2013-11-25)

- Initial release
Expand Down
10 changes: 0 additions & 10 deletions Module.php

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EasyConfig module for Zend Framework 2
# Easy Config module for Zend Framework 2
[![Build Status](https://travis-ci.org/sandrokeil/EasyConfig.png?branch=master)](https://travis-ci.org/sandrokeil/EasyConfig)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/sandrokeil/EasyConfig/badges/quality-score.png?s=cdef161c14156e3e36ed0ce3d6fd7979d38d916c)](https://scrutinizer-ci.com/g/sandrokeil/EasyConfig/)
[![Coverage Status](https://coveralls.io/repos/sandrokeil/EasyConfig/badge.png?branch=master)](https://coveralls.io/r/sandrokeil/EasyConfig?branch=master)
Expand All @@ -7,11 +7,11 @@
[![Total Downloads](https://poser.pugx.org/sandrokeil/easy-config/downloads.png)](https://packagist.org/packages/sandrokeil/easy-config)
[![License](https://poser.pugx.org/sandrokeil/easy-config/license.png)](https://packagist.org/packages/sandrokeil/easy-config)

Easy config provides some abstract factories to easily create instances depending on configuration or retrieve specified module options.
EasyConfig provides some abstract factories to easily create instances depending on configuration or retrieve specified module options.

You should have coding conventions and you should have config conventions. If not, you should think about that.

This module config keys should have the following structure `module.scope.name`. A common configuration looks like that:
The module config keys should have the following structure `module.scope.name`. A common configuration looks like that:

```php
return array(
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"type": "library",
"keywords": [
"zf2",
"zend framework",
"service manager",
"config",
"service",
"options"
Expand All @@ -14,9 +16,9 @@
{"name": "Sandro Keil"}
],
"autoload": {
"psr-0": {
"Sake\\EasyConfig": "src/",
"SakeTest\\EasyConfig": "tests/"
"psr-4": {
"Sake\\EasyConfig\\": "src/",
"SakeTest\\EasyConfig\\": "test/"
}
},
"require": {
Expand Down
11 changes: 6 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- disable strict to debug tests -->
<phpunit bootstrap="./tests/Bootstrap.php"
<phpunit bootstrap="./test/Bootstrap.php"
colors="true"
strict="true"
convertErrorsToExceptions="true"
Expand All @@ -13,22 +13,23 @@

<testsuites>
<testsuite name="Sake EasyConfig Test Suite">
<directory>./tests/SakeTest/EasyConfig</directory>
<directory>./test</directory>
<exclude>./test/Util/</exclude>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./config</directory>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-html" target="./tests/log/report/"
<log type="coverage-html" target="./build/logs/report/"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70" showUncoveredFiles="true" />
<log type="testdox-html" target="./tests/log/testdox.html" />
<log type="testdox-html" target="./build/logs/testdox.html" />
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>

Expand Down
7 changes: 6 additions & 1 deletion config/module.config.php → src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@

namespace Sake\EasyConfig;

return array();
/**
* This class initializes the EasyConfig module.
*/
class Module
{
}
28 changes: 0 additions & 28 deletions src/Sake/EasyConfig/Module.php

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions test/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Sake
*
* @link http://github.com/sandrokeil/EasyConfig for the canonical source repository
* @copyright Copyright (c) 2013 Sandro Keil
* @license http://github.com/sandrokeil/EasyConfig/blob/master/LICENSE.txt New BSD License
*/

namespace SakeTest\BlockchainWalletApi;

// set error reporting
error_reporting(E_ALL | E_STRICT);

chdir(dirname(__DIR__));

if (!file_exists('vendor/autoload.php')) {
throw new \RuntimeException(
'Unable to load ZF2. Run `php composer.phar install`'
);
}

// Setup autoloading
include 'vendor/autoload.php';
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,47 @@
* Sake
*
* @link http://github.com/sandrokeil/EasyConfig for the canonical source repository
* @copyright Copyright (c) 2013 Sandro Keil
* @copyright Copyright (c) 2013-2014 Sandro Keil
* @license http://github.com/sandrokeil/EasyConfig/blob/master/LICENSE.txt New BSD License
*/

namespace SakeTest\Util;
namespace SakeTest\EasyConfig\Service;

use SakeTest\Bootstrap;
use Zend\Test\Util\ModuleLoader;
use PHPUnit_Framework_TestCase as TestCase;

class TestCase extends \PHPUnit_Framework_TestCase
/**
* Class ServiceTestCase
*
* Main test case class for service test classes
*/
abstract class AbstractBaseTestCase extends TestCase
{
/**
* @var \Zend\ServiceManager\ServiceManager
*/
protected $serviceManager;

/**
* @var ModuleLoader
*/
protected $moduleLoader;

/**
* Setup tests
*/
public function setUp()
{
parent::setUp();
$this->serviceManager = Bootstrap::getServiceManager();

// Load the user-defined test configuration file, if it exists; otherwise, load default
if (is_readable('test/TestConfig.php')) {
$testConfig = require 'test/TestConfig.php';
} else {
$testConfig = require 'test/TestConfig.php.dist';
}
$this->moduleLoader = new ModuleLoader($testConfig);
$this->serviceManager = $this->moduleLoader->getServiceManager();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
* Sake
*
* @link http://github.com/sandrokeil/EasyConfig for the canonical source repository
* @copyright Copyright (c) 2013 Sandro Keil
* @copyright Copyright (c) 2013-2014 Sandro Keil
* @license http://github.com/sandrokeil/EasyConfig/blob/master/LICENSE.txt New BSD License
*/

namespace SakeTest\EasyConfig\Service;

use SakeTest\EasyConfig\Service\AbstractBaseTestCase as BaseTestCase;

/**
* Class AbstractConfigurableFactoryTest
*
* Tests integrity of \Sake\EasyConfig\Service\AbstractConfigurableFactory
*/
class AbstractConfigurableFactoryTest extends \SakeTest\Util\TestCase
class AbstractConfigurableFactoryAbstractBaseTest extends BaseTestCase
{
/**
* Class under test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
* Sake
*
* @link http://github.com/sandrokeil/EasyConfig for the canonical source repository
* @copyright Copyright (c) 2013 Sandro Keil
* @copyright Copyright (c) 2013-2014 Sandro Keil
* @license http://github.com/sandrokeil/EasyConfig/blob/master/LICENSE.txt New BSD License
*/

namespace SakeTest\EasyConfig\Service;

use \Sake\EasyConfig\Service\AbstractConstructorOptionConfigFactory;
use SakeTest\EasyConfig\Service\AbstractBaseTestCase as BaseTestCase;
use Sake\EasyConfig\Service\AbstractConstructorOptionConfigFactory;

/**
* Class AbstractConstructorOptionConfigFactoryTest
*
* Tests integrity of \Sake\EasyConfig\Service\AbstractConstructorOptionConfigFactory
*/
class AbstractConstructorOptionConfigFactoryTest extends \SakeTest\Util\TestCase
class AbstractConstructorOptionConfigFactoryAbstractBaseTest extends BaseTestCase
{
/**
* Class under test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
* Sake
*
* @link http://github.com/sandrokeil/EasyConfig for the canonical source repository
* @copyright Copyright (c) 2013 Sandro Keil
* @copyright Copyright (c) 2013-2014 Sandro Keil
* @license http://github.com/sandrokeil/EasyConfig/blob/master/LICENSE.txt New BSD License
*/

namespace SakeTest\EasyConfig\Service;

use SakeTest\EasyConfig\Service\AbstractBaseTestCase as BaseTestCase;

/**
* Class AbstractOptionHydratorConfigFactoryTest
*
* Tests integrity of \Sake\EasyConfig\Service\AbstractOptionHydratorConfigFactory
*/
class AbstractOptionHydratorConfigFactoryTest extends \SakeTest\Util\TestCase
class AbstractOptionHydratorConfigFactoryAbstractBaseTest extends BaseTestCase
{
/**
* Class under test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
* Sake
*
* @link http://github.com/sandrokeil/EasyConfig for the canonical source repository
* @copyright Copyright (c) 2013 Sandro Keil
* @copyright Copyright (c) 2013-2014 Sandro Keil
* @license http://github.com/sandrokeil/EasyConfig/blob/master/LICENSE.txt New BSD License
*/

namespace SakeTest\EasyConfig\Service;

use SakeTest\EasyConfig\Service\AbstractBaseTestCase as BaseTestCase;

/**
* Class AbstractServiceConfigFactoryTest
*
* Tests integrity of \Sake\EasyConfig\Service\AbstractServiceConfigFactory
*/
class AbstractServiceConfigFactoryTest extends \SakeTest\Util\TestCase
class AbstractServiceConfigFactoryAbstractBaseTest extends BaseTestCase
{
/**
* Class under test
Expand Down
Loading

0 comments on commit 123ebeb

Please sign in to comment.