Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
Removal of white spaces etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-magosa committed Oct 19, 2014
1 parent 2fb4183 commit d8cc867
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/KM/Saffron/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __toString()
}
else {
$result .= str_repeat(' ', $indent);
$result .= $line."\n";
$result .= $line."\n";
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/KM/Saffron/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ protected function groupBy(\Closure $func)
$result = new $class;
foreach ($this as $item) {
$key = $func($item);

if (!isset($result[$key])) {
$result[$key] = new $class;
}

$result[$key]->append($item);
}

return $result;
return $result;
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/KM/Saffron/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(RoutingResult $result = null)
/**
* Sets controller to be fired.
* It can be object or name of class.
*
*
* @param object|string $controller
* @return Executor
*/
Expand All @@ -56,7 +56,7 @@ public function setController($controller)

/**
* Returns controller object
*
*
* @return object
*/
public function getController()
Expand All @@ -66,7 +66,7 @@ public function getController()

/**
* Sets method to be fired
*
*
* @param string $method
* @return Executor
*/
Expand All @@ -78,7 +78,7 @@ public function setMethod($method)

/**
* Sets parameters to be passed to controller
*
*
* @param array $parameters
* @return Executor
*/
Expand All @@ -90,7 +90,7 @@ public function setParameters(array $parameters)

/**
* Sets callable to be called before firing controller
*
*
* @param callable $func
* @return Executor
*/
Expand All @@ -102,7 +102,7 @@ public function setPreDispatch(callable $func)

/**
* Sets callable to be called after firing controller
*
*
* @param callable $func
* @return Executor
*/
Expand Down Expand Up @@ -134,7 +134,7 @@ protected function runHook($hook)
* - preDispatch (if set)
* - method in controller
* - postDispatch (if set)
*
*
* @return mixed Value returned by controller's method
*/
public function fire()
Expand Down
2 changes: 1 addition & 1 deletion src/KM/Saffron/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class Generator
/**
* Formats array into form parsable by php.
* Why not just var_export? Because output is hard to read and debug.
*
*
* @param array $data Array to be formatted
* @return string Formatted string
*/
Expand Down
16 changes: 8 additions & 8 deletions src/KM/Saffron/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Request

/**
* Returns domain or null when not set
*
*
* @return string|null
*/
public function getDomain()
Expand All @@ -34,7 +34,7 @@ public function getDomain()

/**
* Sets domain
*
*
* @return \KM\Saffron\Request
*/
public function setDomain($domain)
Expand All @@ -45,7 +45,7 @@ public function setDomain($domain)

/**
* Returns uri or null when not set
*
*
* @return string|null
*/
public function getUri()
Expand All @@ -65,7 +65,7 @@ public function setUri($uri)

/**
* Returns method or null when not set
*
*
* @return string|null
*/
public function getMethod()
Expand All @@ -75,7 +75,7 @@ public function getMethod()

/**
* Sets method
*
*
* @return \KM\Saffron\Request
*/
public function setMethod($method)
Expand All @@ -86,7 +86,7 @@ public function setMethod($method)

/**
* Returns info whether connection is secured by https
*
*
* @return bool
*/
public function getHttps()
Expand All @@ -96,7 +96,7 @@ public function getHttps()

/**
* Sets info whether connection is secured by https
*
*
* @return \KM\Saffron\Request
*/
public function setHttps($https)
Expand All @@ -107,7 +107,7 @@ public function setHttps($https)

/**
* Builds request object from super globals
*
*
* @return \KM\Saffron\Request
*/
static public function createFromGlobals()
Expand Down
4 changes: 2 additions & 2 deletions src/KM/Saffron/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function getUrlBuilder()
/**
* Match request against routes.
* Returns RoutingResult if request matches, null otherwise.
*
*
* @param Request $request
* @return RoutingResult
*/
Expand All @@ -64,7 +64,7 @@ public function match(Request $request)

/**
* Assembles links based on given name and parameters.
*
*
* @param string $name Name of route
* @param array $parameters Parameters
* @return string Built link
Expand Down
2 changes: 1 addition & 1 deletion src/KM/Saffron/RoutesCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RoutesCollection extends Collection
/**
* Create instance of Route and returns it.
* Also looks for duplicated names.
*
*
* @param string $name Name of route
* @return RoutesCollection
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function testRoutingResult()
'c' => '13',
]
);

$executor = new Executor($result);
$vars = $executor->fire();

Expand Down
8 changes: 4 additions & 4 deletions tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function testGlobals1()
$_SERVER['REQUEST_METHOD'] = 'POST';
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['HTTPS'] = 'on';
$request = Request::createFromGlobals();

$request = Request::createFromGlobals();
$this->assertEquals('/another/uri', $request->getUri());
$this->assertEquals('POST', $request->getMethod());
$this->assertEquals('example.com', $request->getDomain());
Expand All @@ -65,7 +65,7 @@ public function testGlobals2()
$_SERVER['REQUEST_METHOD'] = 'POST';
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['HTTPS'] = 'off';
$request = Request::createFromGlobals();
$request = Request::createFromGlobals();
$this->assertEquals(false, $request->getHttps());
}

Expand All @@ -75,7 +75,7 @@ public function testGlobals3()
$_SERVER['REQUEST_METHOD'] = 'POST';
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['HTTPS'] = '';
$request = Request::createFromGlobals();
$request = Request::createFromGlobals();
$this->assertEquals(false, $request->getHttps());
}
}

0 comments on commit d8cc867

Please sign in to comment.