Skip to content

Commit

Permalink
Adds ContainerInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewest committed May 9, 2016
1 parent 475c3b6 commit ce953d3
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -10,8 +10,7 @@ script:
- vendor/bin/codecept run unit --coverage-xml

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml
- vendor/bin/ocular code-coverage:upload --format=php-clover tests/_output/coverage.xml

notifications:
irc: "irc.freenode.org#fuelphp-status"
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -3,7 +3,6 @@
[![Build Status](https://img.shields.io/travis/fuelphp/config.svg?style=flat-square)](https://travis-ci.org/fuelphp/config)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/fuelphp/config.svg?style=flat-square)](https://scrutinizer-ci.com/g/fuelphp/config)
[![Quality Score](https://img.shields.io/scrutinizer/g/fuelphp/config.svg?style=flat-square)](https://scrutinizer-ci.com/g/fuelphp/config)
[![HHVM Status](https://img.shields.io/hhvm/fuelphp/config.svg?style=flat-square)](http://hhvm.h4cc.de/package/fuelphp/config)


**Fuel package for loading, saving and accessing config settings.**
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -17,7 +17,8 @@
},
"require-dev": {
"codeception/codeception": "~2.0",
"phpunit/phpunit": "5.3.*"
"phpunit/phpunit": "5.3.*",
"scrutinizer/ocular": "^1.3"
},
"suggest": {
"symfony/yaml": "Allows YAML config handling."
Expand Down
6 changes: 3 additions & 3 deletions src/Container.php
Expand Up @@ -17,7 +17,7 @@
/**
* Holds configuration data
*/
class Container extends DataContainer
class Container extends DataContainer implements ContainerInterface
{
/**
* @var string
Expand Down Expand Up @@ -121,7 +121,7 @@ public function getEnvironment()
/**
* Sets the environment
*
* @param string $enviroment
* @param string $environment
*/
public function setEnvironment($environment)
{
Expand Down Expand Up @@ -377,7 +377,7 @@ public function removePath($path)
/**
* Removes paths
*
* @param array $path
* @param array $paths
*/
public function removePaths(array $paths)
{
Expand Down
106 changes: 106 additions & 0 deletions src/ContainerInterface.php
@@ -0,0 +1,106 @@
<?php
/**
* easyProperty.com
*
* @link www.easyproperty.com
* @copyright Copyright (c) 2016 easyproperty.com
* @license Proprietary
*/
namespace Fuel\Config;

/**
* Holds configuration data
*/
interface ContainerInterface
{
/**
* Returns the environment
*
* @return string
*/
public function getEnvironment();

/**
* Sets the environment
*
* @param string $enviroment
*/
public function setEnvironment($environment);

/**
* Unloads a config group
*
* @param string $group
*/
public function unload($group);

/**
* Reloads a group
*
* @param string $name
* @param string|boolean $group
*
* @return array|null
*/
public function reload($name, $group = true);

/**
* Loads a config file
*
* @param string $name
* @param null|string|boolean $group
*
* @return array|null
*/
public function load($name, $group = null);

/**
* Stores a config file
*
* @param string $group
* @param string|null $destination
*
* @throws \RuntimeException
*/
public function save($group, $destination = null);

/**
* Adds a path
*
* @param string $path
*
* @return $this
*/
public function addPath($path);

/**
* Adds paths to look in
*
* @param array $paths
*/
public function addPaths(array $paths);

/**
* Removes a path
*
* @param string $path
*/
public function removePath($path);

/**
* Removes paths
*
* @param array $paths
*/
public function removePaths(array $paths);

/**
* Delete data from the container
*
* @param string $key key to delete
*
* @return boolean delete success boolean
* @since 2.0.0
*/
public function delete($key);
}

0 comments on commit ce953d3

Please sign in to comment.