Skip to content

Commit

Permalink
Merge pull request #82 from samsonasik/remove-gianarb-prefix
Browse files Browse the repository at this point in the history
Remove gianarb prefix
  • Loading branch information
Gianluca Arbezzano committed Oct 2, 2015
2 parents 593c212 + ce62cec commit c76f9ad
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
],
"autoload": {
"psr-4": {
"GianArb\\Penny\\": "./src"
"Penny\\": "./src"
}
},
"autoload-dev": {
"psr-4": {
"GianArb\\PennyTest\\": "./tests",
"PennyTest\\": "./tests",
"TestApp\\": "./tests/app"
}
}
Expand Down
6 changes: 3 additions & 3 deletions docs/flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Dispatcher tries to match router and request, if this match exists it returns th

There are two possible kind of problems:

* Route doesn't exist, an `GianArb\Penny\Exception\RouteNotFound` Exception is thrown;
* Route exists but the HTTP Method hasn't been matched, an `GianArb\Penny\Exception\MethodNotAllowed` Exception is thrown;
* Route doesn't exist, an `Penny\Exception\RouteNotFound` Exception is thrown;
* Route exists but the HTTP Method hasn't been matched, an `Penny\Exception\MethodNotAllowed` Exception is thrown;

If no exception are thrown, a response is returned back.

Expand All @@ -35,7 +35,7 @@ chdir(dirname(__DIR__));

require_once "./vendor/autoload.php";

$app = new \GianArb\Penny\App();
$app = new \Penny\App();

$app->getContainer()->get("event_manager")->attach("*", function ($event) {
$e = $event->getException();
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Every application has an entry point, `public/index.php` is our.
chdir(dirname(__DIR__));
require "vendor/autoload.php";

$app = new \GianArb\Penny\App();
$app = new \Penny\App();
$emitter = new \Zend\Diactoros\Response\SapiEmitter();
$emitter->emit($app->run());
```
Expand Down Expand Up @@ -359,7 +359,7 @@ Doctrine has an awesome console that helps you to manage database, schema, cache
// cli-config.php
require "vendor/autoload.php";

$app = new \GianArb\Penny\App();
$app = new \Penny\App();
return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($app->getContainer()->get("doctrine.em"));
```

Expand Down
6 changes: 3 additions & 3 deletions docs/the-dispatcher-concept.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class FastSymfonyDispatcher
$routeInfo = $this->router->dispatch($request->getMethod(), $request->getPathInfo());
switch ($routeInfo[0]) {
case \FastRoute\Dispatcher::NOT_FOUND:
throw new \GianArb\Penny\Exception\RouteNotFound();
throw new \Penny\Exception\RouteNotFound();
break;
case \FastRoute\Dispatcher::METHOD_NOT_ALLOWED:
throw new \GianArb\Penny\Exception\MethodNotAllowed();
throw new \Penny\Exception\MethodNotAllowed();
break;
case \FastRoute\Dispatcher::FOUND:
return $routeInfo;
Expand All @@ -75,7 +75,7 @@ class FastSymfonyDispatcher

```php
<?php
use GianArb\Penny\App;
use Penny\App;
use YourApp\Dispatcher\FastSymfonyDispatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
8 changes: 4 additions & 4 deletions src/App.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace GianArb\Penny;
namespace Penny;

use Exception;
use GianArb\Penny\Config\Loader;
use GianArb\Penny\Container;
use GianArb\Penny\Event\HttpFlowEvent;
use Penny\Config\Loader;
use Penny\Container;
use Penny\Event\HttpFlowEvent;
use ReflectionClass;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Loader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace GianArb\Penny\Config;
namespace Penny\Config;

use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\Glob;
Expand Down
4 changes: 2 additions & 2 deletions src/Container/PHPDiFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace GianArb\Penny\Container;
namespace Penny\Container;

use DI;

Expand All @@ -22,7 +22,7 @@ public static function buildContainer($config = [])
$builder->addDefinitions(
[
'event_manager' => DI\object('Zend\EventManager\EventManager'),
'dispatcher' => DI\object('GianArb\Penny\Dispatcher')
'dispatcher' => DI\object('Penny\Dispatcher')
->constructor(DI\get('router')),
]
);
Expand Down
6 changes: 3 additions & 3 deletions src/Dispatcher.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace GianArb\Penny;
namespace Penny;

use Exception;
use FastRoute\Dispatcher as BaseDispatcher;
use FastRoute\Dispatcher as FastRouterDispatcherInterface;
use GianArb\Penny\Exception\MethodNotAllowed;
use GianArb\Penny\Exception\RouteNotFound;
use Penny\Exception\MethodNotAllowed;
use Penny\Exception\RouteNotFound;
use Psr\Http\Message\RequestInterface;

class Dispatcher
Expand Down
2 changes: 1 addition & 1 deletion src/Event/HttpFlowEvent.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace GianArb\Penny\Event;
namespace Penny\Event;

use Exception;
use Zend\EventManager\Event;
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/MethodNotAllowed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace GianArb\Penny\Exception;
namespace Penny\Exception;

use Exception;

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/RouteNotFound.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace GianArb\Penny\Exception;
namespace Penny\Exception;

use Exception;

Expand Down
8 changes: 4 additions & 4 deletions tests/AppLoaderTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace GianArb\PennyTest;
namespace PennyTest;

use DI\ContainerBuilder;
use FastRoute;
use GianArb\Penny\App;
use GianArb\Penny\Container;
use GianArb\Penny\Config\Loader;
use Penny\App;
use Penny\Container;
use Penny\Config\Loader;
use PHPUnit_Framework_TestCase;
use Zend\Diactoros\Request;
use Zend\Diactoros\Response;
Expand Down
12 changes: 6 additions & 6 deletions tests/AppTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace GianArb\PennyTest;
namespace PennyTest;

use FastRoute;
use GianArb\Penny\App;
use GianArb\Penny\Container;
use GianArb\Penny\Exception\MethodNotAllowed;
use GianArb\Penny\Exception\RouteNotFound;
use GianArb\Penny\Config\Loader;
use Penny\App;
use Penny\Container;
use Penny\Exception\MethodNotAllowed;
use Penny\Exception\RouteNotFound;
use Penny\Config\Loader;
use PHPUnit_Framework_TestCase;
use Zend\Diactoros\Request;
use Zend\Diactoros\Response;
Expand Down
4 changes: 2 additions & 2 deletions tests/Config/LoaderTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace GianArb\PennyTest\Config;
namespace PennyTest\Config;

use GianArb\Penny\Config\Loader;
use Penny\Config\Loader;
use PHPUnit_Framework_TestCase;

class LoaderTest extends PHPUnit_Framework_TestCase
Expand Down
8 changes: 4 additions & 4 deletions tests/DiTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace GianArb\PennyTest;
namespace PennyTest;

use DI\ContainerBuilder;
use GianArb\Penny\Config\Loader;
use Penny\Config\Loader;
use FastRoute;
use GianArb\Penny\App;
use GianArb\Penny\Container;
use Penny\App;
use Penny\Container;
use PHPUnit_Framework_TestCase;
use Zend\Diactoros\Request;
use Zend\Diactoros\Response;
Expand Down
8 changes: 4 additions & 4 deletions tests/DispatcherTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace GianArb\PennyTest;
namespace PennyTest;

use FastRoute;
use GianArb\Penny\Dispatcher;
use Penny\Dispatcher;
use PHPUnit_Framework_TestCase;
use Zend\Diactoros\Request;
use Zend\Diactoros\Uri;
Expand Down Expand Up @@ -35,7 +35,7 @@ public function testSetRouter()

public function testDispatchRouteNotFoundRequest()
{
$this->setExpectedException('GianArb\Penny\Exception\RouteNotFound');
$this->setExpectedException('Penny\Exception\RouteNotFound');
$request = (new Request())
->withUri(new Uri('/doh'))
->withMethod('GET');
Expand All @@ -46,7 +46,7 @@ public function testDispatchRouteNotFoundRequest()

public function testDispatchMethodNotAllowedRequest()
{
$this->setExpectedException('GianArb\Penny\Exception\MethodNotAllowed');
$this->setExpectedException('Penny\Exception\MethodNotAllowed');
$request = (new Request())
->withUri(new Uri('/'))
->withMethod('POST');
Expand Down
12 changes: 6 additions & 6 deletions tests/EventFlowTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace GianArb\PennyTest;
namespace PennyTest;

use FastRoute;
use GianArb\Penny\Config\Loader;
use GianArb\Penny\App;
use GianArb\Penny\Container;
use GianArb\Penny\Exception\MethodNotAllowed;
use GianArb\Penny\Exception\RouteNotFound;
use Penny\Config\Loader;
use Penny\App;
use Penny\Container;
use Penny\Exception\MethodNotAllowed;
use Penny\Exception\RouteNotFound;
use PHPUnit_Framework_TestCase;
use Zend\Diactoros\Request;
use Zend\Diactoros\Response;
Expand Down
10 changes: 5 additions & 5 deletions tests/Http/SymfonyKernelTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace GianArb\PennyTest\Http;
namespace PennyTest\Http;

use GianArb\Penny\App;
use GianArb\Penny\Container;
use GianArb\Penny\Config\Loader;
use Penny\App;
use Penny\Container;
use Penny\Config\Loader;
use FastRoute;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -18,7 +18,7 @@ public function setUp()
$config['router'] = FastRoute\simpleDispatcher(function (FastRoute\RouteCollector $r) {
$r->addRoute('GET', '/', [get_class($this), 'index']);
});
$config['dispatcher'] = \Di\object('GianArb\PennyTest\Utils\FastSymfonyDispatcher')
$config['dispatcher'] = \Di\object('PennyTest\Utils\FastSymfonyDispatcher')
->constructor(\Di\get("router"));

$this->app = new App(Container\PHPDiFactory::buildContainer($config));
Expand Down
6 changes: 3 additions & 3 deletions tests/Utils/FastSymfonyDispatcher.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace GianArb\PennyTest\Utils;
namespace PennyTest\Utils;

use Symfony\Component\HttpFoundation\Request;

Expand All @@ -19,10 +19,10 @@ public function __invoke(Request $request)
->dispatch($request->getMethod(), $request->getPathInfo());
switch ($routeInfo[0]) {
case \FastRoute\Dispatcher::NOT_FOUND:
throw new \GianArb\Penny\Exception\RouteNotFound();
throw new \Penny\Exception\RouteNotFound();
break;
case \FastRoute\Dispatcher::METHOD_NOT_ALLOWED:
throw new \GianArb\Penny\Exception\MethodNotAllowed();
throw new \Penny\Exception\MethodNotAllowed();
break;
case \FastRoute\Dispatcher::FOUND:
return $routeInfo;
Expand Down

0 comments on commit c76f9ad

Please sign in to comment.