Skip to content

Commit ca79afa

Browse files
committed
StyleChanges
1 parent 0965e56 commit ca79afa

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

functions/redirect.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
if (!function_exists('redirect')) {
66
/**
7-
* @param string $ref
8-
* @param array $params
7+
* @param string $ref
8+
* @param array $params
99
* @param string|null $schema
1010
*
1111
* @return Response
1212
*/
13-
function redirect(string $ref, array $params = [], string $schema = null) : Response
13+
function redirect(string $ref, array $params = [], string $schema = null): Response
1414
{
1515
$url = url($ref, $params, $schema);
1616

1717
return response(null, Response::CODE_REDIRECT_SEE_OTHER, [
18-
'Location' => $url
18+
'Location' => $url,
1919
]);
2020
}
21-
}
21+
}

functions/response.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
if (!function_exists('response')) {
66
/**
77
* @param string $body
8-
* @param int $code
9-
* @param array $headers
8+
* @param int $code
9+
* @param array $headers
1010
*
1111
* @return Response
1212
*/
13-
function response(string $body = null, int $code = Response::CODE_SUCCESS, array $headers = []) : Response
13+
function response(string $body = null, int $code = Response::CODE_SUCCESS, array $headers = []): Response
1414
{
1515
$response = new Response();
1616

@@ -28,4 +28,4 @@ function response(string $body = null, int $code = Response::CODE_SUCCESS, array
2828

2929
return $response;
3030
}
31-
}
31+
}

functions/url.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
use Corviz\Routing\Map;
55
use Corviz\String\ParametrizedString;
66
use Corviz\String\StringUtils;
7+
78
//use function Corviz\Mvc\;
89

910
if (!function_exists('url')) {
1011
/**
11-
* @param string $ref
12-
* @param array $params
12+
* @param string $ref
13+
* @param array $params
1314
* @param string|null $schema
1415
*
1516
* @return string
1617
*/
17-
function url(string $ref, array $params = [], string $schema = null) : string
18+
function url(string $ref, array $params = [], string $schema = null): string
1819
{
1920
$link = null;
2021
$getBaseUrl = function () use ($schema) {
@@ -95,4 +96,4 @@ function url(string $ref, array $params = [], string $schema = null) : string
9596

9697
return $link;
9798
}
98-
}
99+
}

functions/view.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
if (!function_exists('view')) {
88
/**
99
* @param string $template
10-
* @param array $data
10+
* @param array $data
1111
*
1212
* @return View
1313
*/
14-
function view(string $template, array $data = []) : View
14+
function view(string $template, array $data = []): View
1515
{
1616
$container = Application::current()->getContainer();
1717
$view = new View($container->get(TemplateEngine::class));
@@ -20,4 +20,4 @@ function view(string $template, array $data = []) : View
2020

2121
return $view;
2222
}
23-
}
23+
}

src/Mvc/Controller.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
namespace Corviz\Mvc;
44

55
use Corviz\Application;
6-
use Corviz\Http\Request;
76
use Corviz\Http\Response;
8-
use Corviz\Mvc\View\TemplateEngine;
9-
use Corviz\Routing\Map;
10-
use Corviz\String\ParametrizedString;
11-
use Corviz\String\StringUtils;
127

138
abstract class Controller
149
{
@@ -68,7 +63,7 @@ protected function link(string $ref, array $params = [], string $schema = null):
6863
*
6964
* @return Response
7065
*/
71-
protected function redirect(string $ref, array $params = [], string $schema = null) : Response
66+
protected function redirect(string $ref, array $params = [], string $schema = null): Response
7267
{
7368
return redirect($ref, $params, $schema);
7469
}
@@ -83,7 +78,7 @@ protected function redirect(string $ref, array $params = [], string $schema = nu
8378
*
8479
* @return View
8580
*/
86-
protected function view(string $templateName, array $data = []) : View
81+
protected function view(string $templateName, array $data = []): View
8782
{
8883
return view($templateName, $data);
8984
}

src/Routing/Map.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public static function getCurrentRoute()
5757

5858
//Checks the route string
5959
if (
60-
ParametrizedString
61-
::make($route['route'])
60+
ParametrizedString::make($route['route'])
6261
->matches($routeStr)
6362
) {
6463
$current = $route;

0 commit comments

Comments
 (0)