Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaszak committed Mar 18, 2016
1 parent e35531b commit 723ed90
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: php
php:
- '7.0'

install:
- composer require satooshi/php-coveralls:~0.6@stable

before_script:
- mkdir -p build/logs
- composer install

script:
- phpunit --coverage-clover build/logs/clover.xml

after_success:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;'
21 changes: 12 additions & 9 deletions src/RegistryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

namespace Ignaszak\Registry;

use Ignaszak\Registry\Scope\IRegistry;

/**
*
* @author Tomasz Ignaszak <tomek.ignaszak@gmail.com>
* @link
*
*/
class RegistryFactory
Expand All @@ -27,8 +28,9 @@ class RegistryFactory
private static $_registryArray = [];

/**
*
* @param string $registry
* @return Registry
* @return \Ignaszak\Registry\IRegistry
*/
public static function start(string $registry = 'request'): Registry
{
Expand All @@ -43,25 +45,26 @@ public static function start(string $registry = 'request'): Registry
}

/**
*
* @param string $registry
* @return string
* @throws Exception
* @throws \InvalidArgumentException
* @return \Ignaszak\Registry\Scope\IRegistry
*/
private static function getRegistryInstance(string $registry): Scope\IRegistry
private static function getRegistryInstance(string $registry): IRegistry
{
switch ($registry) {
case 'request':
return new Scope\RequestRegistry();
break;
break;
case 'session':
return new Scope\SessionRegistry();
break;
break;
case 'cookie':
return new Scope\CookieRegistry();
break;
break;
case 'file':
return new Scope\FileRegistry();
break;
break;
default:
throw new \InvalidArgumentException('Incorrect argument');
}
Expand Down

0 comments on commit 723ed90

Please sign in to comment.