Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaGhostman committed Feb 2, 2015
1 parent 910909c commit ca9e2c1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 84 deletions.
3 changes: 0 additions & 3 deletions src/Wave/Framework/Application/Wave.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function __construct($container, $config = [])
return $router;
};
}
Emitter::getInstance();
}

/**
Expand All @@ -69,8 +68,6 @@ public function __call($name, $args)
*/
public function run(Request $request)
{
Emitter::getInstance()->trigger('request');

$dispatcher = new Dispatcher(
$this->router->getData(),
new RouteResolver($this->container)
Expand Down
59 changes: 0 additions & 59 deletions src/Wave/Framework/Event/Emitter.php

This file was deleted.

24 changes: 7 additions & 17 deletions src/Wave/Framework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
class Request
{

protected $request = array();
protected $headers = array();
protected $vars = array();
protected $request = [];
protected $headers = [];
protected $vars = [];

protected $source = array();
protected $source = [];

protected $params = array();
protected $params = [];

/**
* Creates a request object and accepts an array with key => value
Expand Down Expand Up @@ -98,16 +98,6 @@ public function method()
return $this->request('Method');
}

/**
* Alias of Request::request('Protocol');
*
* @return mixed
*/
public function protocol()
{
return $this->request('Protocol');
}

/**
* Gives access to 'HTTP_' from $_SERVER
*
Expand Down Expand Up @@ -167,10 +157,10 @@ public function __get($key)

public function toArray()
{
return array(
return [
'headers' => $this->headers,
'request' => $this->request,
'params' => $this->params
);
];
}
}
6 changes: 3 additions & 3 deletions src/Wave/Framework/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
*/
class Response
{
protected $headers = array();
protected $headers = [];
protected $protocol = 'HTTP/1.1';
private $status = null;
protected $requestHeaders = array();
protected $requestHeaders = [];

const HTTP_V1_0 = 1.0;
const HTTP_V1_1 = 1.1;


public function __construct($protocol = 1.1, $requestHeaders = array())
public function __construct($protocol = 1.1, $requestHeaders = [])
{
$this->protocol = $protocol;
$this->requestHeaders = $requestHeaders;
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Application/RouteResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
use Stub\Application\RouteResolverContainerStub;
use Wave\Framework\Application\RouteResolver;

class RouteResolverTest extends \PHPUnit_Framework_TestCase {
class RouteResolverTest extends \PHPUnit_Framework_TestCase
{
protected $resolver = null;

protected function setUp()
Expand Down
1 change: 1 addition & 0 deletions tests/Test/Decorator/Decorators/SerializeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Wave\Framework\Decorator\Decorators\Serialize;

/** @noinspection PhpUndefinedClassInspection */
class SerializeTest extends \PHPUnit_Framework_TestCase
{
private $decorator = null;
Expand Down
2 changes: 1 addition & 1 deletion tests/Test/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Wave\Framework\Http\Request;

/** @noinspection PhpUndefinedClassInspection */
class RequestTest extends \PHPUnit_Framework_TestCase
{
private $request = null;
Expand Down Expand Up @@ -41,7 +42,6 @@ public function testRequestGetter()
$this->assertSame('GET', $this->request->method());
$this->assertSame('GET', $this->request->REQUEST_METHOD);

$this->assertSame('HTTP/1.1', $this->request->protocol());
$this->assertSame('HTTP/1.1', $this->request->REQUEST_PROTOCOL);
}

Expand Down

0 comments on commit ca9e2c1

Please sign in to comment.