Skip to content

Commit 41f5404

Browse files
authored
CS fix (#116)
1 parent 01d21f4 commit 41f5404

File tree

25 files changed

+184
-130
lines changed

25 files changed

+184
-130
lines changed

src/Bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class Bootstrap
1515
{
1616
/**
17-
* Boot instace of App.
17+
* Boot instace of App
1818
*
1919
* @return \App\Controller\App
2020
*/
@@ -27,7 +27,7 @@ public static function boot(): \App\Controller\App
2727
}
2828

2929
/**
30-
* Returns instance of EntityManager.
30+
* Returns instance of EntityManager
3131
*
3232
* @return \Doctrine\ORM\EntityManager
3333
*/

src/Controller/App.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ public function __construct(\App\Lib\Http\Request $request, \Doctrine\ORM\Entity
2020
}
2121
}
2222

23+
/**
24+
* Cretes instace of controller depends on request
25+
*
26+
* @param \App\Lib\Http\Request $request
27+
* @param \Doctrine\ORM\EntityManager $entityManager
28+
* @return \App\Controller\Base
29+
*/
2330
private function controllerFactory(\App\Lib\Http\Request $request, \Doctrine\ORM\EntityManager $entityManager): \App\Controller\Base
2431
{
2532
$path = $request->getUri()->getPath();

src/Controller/Article.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
final class Article extends \App\Controller\Base
1212
{
1313
/**
14-
* Register routes to router.
14+
* Register routes to router
1515
*
1616
* @param \App\Lib\Middleware\Router $router
1717
* @return void
@@ -27,7 +27,7 @@ public function registerRoutes(\App\Lib\Middleware\Router $router): void
2727
}
2828

2929
/**
30-
* Gets all articles.
30+
* Gets all articles
3131
*
3232
* @return array<array>
3333
*/
@@ -40,7 +40,7 @@ public function getAll(): array
4040
}
4141

4242
/**
43-
* Gets one article by his ID.
43+
* Gets one article by his ID
4444
*
4545
* @param int $id
4646
* @return \App\Model\Entity\Article
@@ -57,7 +57,7 @@ public function getOneById(int $id): \App\Model\Entity\Article
5757
}
5858

5959
/**
60-
* Gets one article by his alias.
60+
* Gets one article by his alias
6161
*
6262
* @param string $alias
6363
* @return \App\Model\Entity\Article
@@ -74,7 +74,7 @@ public function getOneByAlias(string $alias): \App\Model\Entity\Article
7474
}
7575

7676
/**
77-
* Creates new article.
77+
* Creates new article
7878
*
7979
* @param string $title
8080
* @param string $content
@@ -95,7 +95,7 @@ public function create(string $title = '', string $alias = null, string $content
9595
}
9696

9797
/**
98-
* Edit article by ID.
98+
* Edit article by ID
9999
*
100100
* @param int $id
101101
* @param string $title
@@ -129,7 +129,7 @@ public function edit(int $id = 0, string $title = '', string $alias = '', string
129129
}
130130

131131
/**
132-
* Delete article by ID.
132+
* Delete article by ID
133133
*
134134
* @param int $id
135135
* @return void

src/Controller/Base.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(\Doctrine\ORM\EntityManager $entityManager)
4242
}
4343

4444
/**
45-
* Register routes to router.
45+
* Register routes to router
4646
*
4747
* @param \App\Lib\Middleware\Router $router
4848
* @return void
@@ -63,7 +63,8 @@ public function registerDefaultRoutes(\App\Lib\Middleware\Router $router): void
6363
}
6464

6565
/**
66-
* Dispatch request to predefined routes.
66+
* Dispatch request to predefined routes
67+
*
6768
* @param \App\Lib\Middleware\Router $router
6869
* @param \App\Lib\Http\Request $request
6970
*/
@@ -93,7 +94,7 @@ public function getState(): array
9394
}
9495

9596
/**
96-
* Sets view.
97+
* Sets view
9798
*
9899
* @param string $view
99100
* @return void
@@ -109,7 +110,7 @@ public function setView(string $view)
109110
}
110111

111112
/**
112-
* Sets request.
113+
* Sets request
113114
*
114115
* @param \App\Lib\Http\Request $request
115116
* @return void
@@ -120,7 +121,7 @@ public function setRequest(\App\Lib\Http\Request $request)
120121
}
121122

122123
/**
123-
* Checks user permitions on route action.
124+
* Checks user permitions on route action
124125
*
125126
* @param \App\Lib\Middleware\Route $route
126127
* @return void

src/Controller/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
final class File extends \App\Controller\Base
1212
{
1313
/**
14-
* Register routes to router.
14+
* Register routes to router
1515
*
1616
* @param \App\Lib\Middleware\Router $router
1717
* @return void

src/Lib/Assert/Text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static function isEmail(string $email): bool
1616
return filter_var($email, FILTER_VALIDATE_EMAIL) === false ? false : true;
1717
}
1818

19-
19+
2020
/**
2121
* Test string for max length
2222
*

src/Lib/Authorization/AuthorizationFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
2-
declare(strict_types = 1);
2+
3+
declare(strict_types=1);
4+
35
namespace App\Lib\Authorization;
46

5-
use App\Lib\Authorization\Jwt;
67
use Exception;
78

89
final class AuthorizationFactory

src/Lib/Authorization/Base.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace App\Lib\Authorization;
34

45
use App\Lib\Configuration\ConfigurationFactory;

src/Lib/Authorization/Jwt.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2-
declare(strict_types = 1);
2+
3+
declare(strict_types=1);
4+
35
namespace App\Lib\Authorization;
46

57
use App\Lib\Authorization\Base;
@@ -23,7 +25,7 @@ public function __construct()
2325
* @param array<string|int> $data
2426
* @return string
2527
*/
26-
public function getToken(array $data = []):string
28+
public function getToken(array $data = []): string
2729
{
2830
$payload = array(
2931
"iss" => self::SERVER_NAME,
@@ -40,7 +42,7 @@ public function getToken(array $data = []):string
4042
* @param string $token
4143
* @return object
4244
*/
43-
public function authorize(string $token):object
45+
public function authorize(string $token): object
4446
{
4547
[$token] = sscanf($token, 'Bearer %s');
4648
return \Firebase\JWT\JWT::decode($token, $this->key, array('HS256'));

src/Lib/Configuration/Configuration.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2-
declare(strict_types = 1);
2+
3+
declare(strict_types=1);
4+
35
namespace App\Lib\Configuration;
46

57
use Exception;
@@ -27,7 +29,7 @@ public function __construct(string $path)
2729
* @param string $path
2830
* @return array<array>
2931
*/
30-
private function parseIniFile(string $path):array
32+
private function parseIniFile(string $path): array
3133
{
3234
$configuration = parse_ini_file($path, true, INI_SCANNER_RAW) ?: [];
3335

@@ -40,7 +42,7 @@ private function parseIniFile(string $path):array
4042
* @param string $segment
4143
* @return array<string>
4244
*/
43-
public function getSegment(string $segment):array
45+
public function getSegment(string $segment): array
4446
{
4547
if (!(array_key_exists($segment, $this->configuration))) {
4648
throw new Exception('Segment ' . $segment . 'not exists!');
@@ -55,7 +57,7 @@ public function getSegment(string $segment):array
5557
* @param string $key
5658
* @return string
5759
*/
58-
public function get(string $key):string
60+
public function get(string $key): string
5961
{
6062
$configuration = $this->getSegment($this->segment);
6163
if (!(array_key_exists($key, $configuration))) {
@@ -71,7 +73,7 @@ public function get(string $key):string
7173
* @param string $segment
7274
* @return void
7375
*/
74-
public function setSegment(string $segment):void
76+
public function setSegment(string $segment): void
7577
{
7678
if (!array_key_exists($segment, $this->configuration)) {
7779
throw new Exception('Segment ' . $segment . ' not exists!');

0 commit comments

Comments
 (0)