Test html contentspan>
@@ -53,7 +53,7 @@ public function tearDown(): void
$this->viewCache->enableCaching(false);
}
- public function testServeCachedView()
+ public function testServeCachedView(): void
{
$this->viewCache->enableCaching(true);
@@ -68,7 +68,7 @@ public function testServeCachedView()
$this->assertEquals($this->content, $response->getContent());
}
- public function testSetAndGetViewCache()
+ public function testSetAndGetViewCache(): void
{
$this->viewCache->set($this->route, $this->content);
@@ -77,7 +77,7 @@ public function testSetAndGetViewCache()
$this->assertEquals($this->content, $viewCache);
}
- public function testViewCacheContentMinification()
+ public function testViewCacheContentMinification(): void
{
$this->viewCache->enableMinification(true);
@@ -90,7 +90,7 @@ public function testViewCacheContentMinification()
$this->assertEquals($minifiedContent, $content);
}
- public function testViewCacheMinificationMissingDependency()
+ public function testViewCacheMinificationMissingDependency(): void
{
$viewCache = new ViewCacheDouble();
$viewCache->enableMinification(true);
@@ -101,14 +101,14 @@ public function testViewCacheMinificationMissingDependency()
$viewCache->set($this->route, 'test
');
}
- public function testExistsViewCache()
+ public function testExistsViewCache(): void
{
$this->viewCache->set($this->route, $this->content);
$this->assertTrue($this->viewCache->exists($this->route));
}
- public function testDeleteViewCache()
+ public function testDeleteViewCache(): void
{
$this->viewCache->set($this->route, $this->content);
@@ -119,14 +119,14 @@ public function testDeleteViewCache()
$this->assertFalse($this->viewCache->exists($this->route));
}
- public function testGetNonExistentViewCache()
+ public function testGetNonExistentViewCache(): void
{
$viewCache = $this->viewCache->get('/non-existent-route');
$this->assertNull($viewCache);
}
- public function testViewCacheIsExpired()
+ public function testViewCacheIsExpired(): void
{
$this->viewCache->setTtl(1);
@@ -139,7 +139,7 @@ public function testViewCacheIsExpired()
$this->assertNull($viewCache);
}
- public function testEnableDisableViewCache()
+ public function testEnableDisableViewCache(): void
{
$this->assertFalse($this->viewCache->isEnabled());
diff --git a/tests/Unit/Router/Helpers/RouteHelpersTest.php b/tests/Unit/Router/Helpers/RouteHelpersTest.php
index 6c3f8e1fe..a1b1f63a5 100644
--- a/tests/Unit/Router/Helpers/RouteHelpersTest.php
+++ b/tests/Unit/Router/Helpers/RouteHelpersTest.php
@@ -25,7 +25,7 @@ public function tearDown(): void
parent::tearDown();
}
- public function testHelpersReturnDefaultsWhenNoRouteMatched()
+ public function testHelpersReturnDefaultsWhenNoRouteMatched(): void
{
$this->assertNull(current_middlewares());
$this->assertNull(current_module());
@@ -41,7 +41,7 @@ public function testHelpersReturnDefaultsWhenNoRouteMatched()
$this->assertNull(route_prefix());
}
- public function testHelpersReturnValuesForMatchedControllerRoute()
+ public function testHelpersReturnValuesForMatchedControllerRoute(): void
{
$route = new Route(
['GET'],
@@ -80,9 +80,9 @@ public function testHelpersReturnValuesForMatchedControllerRoute()
$this->assertSame('api', route_prefix());
}
- public function testRouteCallbackReturnsClosureForClosureRoute()
+ public function testRouteCallbackReturnsClosureForClosureRoute(): void
{
- $closure = function () {
+ $closure = function (): void {
};
$route = new Route(
@@ -102,7 +102,7 @@ public function testRouteCallbackReturnsClosureForClosureRoute()
$this->assertNull(current_action());
}
- public function testFindRouteByNameReturnsRouteFromCollection()
+ public function testFindRouteByNameReturnsRouteFromCollection(): void
{
$route = new Route(
['GET'],
@@ -125,7 +125,7 @@ public function testFindRouteByNameReturnsRouteFromCollection()
$this->assertSame('DashboardController', $found->getController());
}
- public function testRouteGroupExistsDetectsGroupInModule()
+ public function testRouteGroupExistsDetectsGroupInModule(): void
{
$route = new Route(
['GET'],
@@ -147,7 +147,7 @@ public function testRouteGroupExistsDetectsGroupInModule()
$this->assertFalse(route_group_exists('auth', 'api'));
}
- public function testRouteMethodAndUri()
+ public function testRouteMethodAndUri(): void
{
$request = new Request();
$request->create('POST', 'http://example.com/api/test');
@@ -157,7 +157,7 @@ public function testRouteMethodAndUri()
$this->assertSame('api/test', route_uri());
}
- public function testFindRouteByNameDependsOnCollectionRegistration()
+ public function testFindRouteByNameDependsOnCollectionRegistration(): void
{
$this->assertNull(
find_route_by_name('dashboard', 'admin'),
@@ -190,7 +190,7 @@ public function testFindRouteByNameDependsOnCollectionRegistration()
$this->assertSame('DashboardController', $found->getController());
}
- public function testRouteGroupExistsDependsOnCollectionRegistration()
+ public function testRouteGroupExistsDependsOnCollectionRegistration(): void
{
$this->assertFalse(
route_group_exists('auth', 'web'),
diff --git a/tests/Unit/Router/MatchedRouteTest.php b/tests/Unit/Router/MatchedRouteTest.php
index 5b687aa75..983e5b1b6 100644
--- a/tests/Unit/Router/MatchedRouteTest.php
+++ b/tests/Unit/Router/MatchedRouteTest.php
@@ -8,7 +8,7 @@
class MatchedRouteTest extends AppTestCase
{
- public function testMatchedRouteStoresRouteAndParams()
+ public function testMatchedRouteStoresRouteAndParams(): void
{
$route = new Route(['GET'], 'users/[id=:num]', 'Ctrl', 'act');
$params = ['id' => '42'];
@@ -19,7 +19,7 @@ public function testMatchedRouteStoresRouteAndParams()
$this->assertSame($params, $matched->getParams());
}
- public function testMatchedRouteSupportsEmptyParams()
+ public function testMatchedRouteSupportsEmptyParams(): void
{
$route = new Route(['GET'], 'users', 'Ctrl', 'act');
@@ -28,7 +28,7 @@ public function testMatchedRouteSupportsEmptyParams()
$this->assertSame([], $matched->getParams());
}
- public function testMatchedRouteParamsAreReturnedAsGiven()
+ public function testMatchedRouteParamsAreReturnedAsGiven(): void
{
$route = new Route(['GET'], 'x', 'Ctrl', 'act');
@@ -48,7 +48,7 @@ public function testMatchedRouteParamsAreReturnedAsGiven()
$this->assertSame('hello', $matched->getParams()['slug']);
}
- public function testMatchedRouteRouteInstanceIsExactSameObject()
+ public function testMatchedRouteRouteInstanceIsExactSameObject(): void
{
$route = new Route(['POST'], 'submit', 'Ctrl', 'act');
diff --git a/tests/Unit/Router/PatternCompilerTest.php b/tests/Unit/Router/PatternCompilerTest.php
index 775fedab2..30e0ce40d 100644
--- a/tests/Unit/Router/PatternCompilerTest.php
+++ b/tests/Unit/Router/PatternCompilerTest.php
@@ -18,7 +18,7 @@ public function setUp(): void
$this->compiler = new PatternCompiler();
}
- public function testPatternCompilerStaticRouteMatch()
+ public function testPatternCompilerStaticRouteMatch(): void
{
$this->route = new Route(['GET'], 'users', 'Ctrl', 'act');
@@ -31,7 +31,7 @@ public function testPatternCompilerStaticRouteMatch()
$this->assertFalse($this->compiler->match($this->route, '/users/1'));
}
- public function testPatternCompilerNumericParamMatch()
+ public function testPatternCompilerNumericParamMatch(): void
{
$this->route = new Route(['GET'], 'users/[id=:num]', 'Ctrl', 'act');
@@ -44,7 +44,7 @@ public function testPatternCompilerNumericParamMatch()
$this->assertSame([], $this->compiler->getParams());
}
- public function testPatternCompilerAlphaParamMatch()
+ public function testPatternCompilerAlphaParamMatch(): void
{
$this->route = new Route(['GET'], 'tag/[name=:alpha]', 'Ctrl', 'act');
@@ -55,7 +55,7 @@ public function testPatternCompilerAlphaParamMatch()
$this->assertFalse($this->compiler->match($this->route, '/tag/test1'));
}
- public function testPatternCompilerAnyParamMatch()
+ public function testPatternCompilerAnyParamMatch(): void
{
$this->route = new Route(['GET'], 'file/[path=:any]', 'Ctrl', 'act');
@@ -64,7 +64,7 @@ public function testPatternCompilerAnyParamMatch()
$this->assertSame(['path' => 'a-b_c'], $this->compiler->getParams());
}
- public function testPatternCompilerOptionalParamAtEnd()
+ public function testPatternCompilerOptionalParamAtEnd(): void
{
$this->route = new Route(['GET'], 'post/[id=:num]?', 'Ctrl', 'act');
@@ -77,7 +77,7 @@ public function testPatternCompilerOptionalParamAtEnd()
$this->assertSame(['id' => '7'], $this->compiler->getParams());
}
- public function testPatternCompilerLengthConstraint()
+ public function testPatternCompilerLengthConstraint(): void
{
$this->route = new Route(['GET'], 'code/[id=:num:4]', 'Ctrl', 'act');
@@ -88,7 +88,7 @@ public function testPatternCompilerLengthConstraint()
$this->assertFalse($this->compiler->match($this->route, '/code/123'));
}
- public function testPatternCompilerMultipleParams()
+ public function testPatternCompilerMultipleParams(): void
{
$this->route = new Route(
['GET'],
@@ -102,7 +102,7 @@ public function testPatternCompilerMultipleParams()
$this->assertSame(['id' => '5', 'slug' => 'hello'], $this->compiler->getParams());
}
- public function testPatternCompilerOptionalLeadingParam()
+ public function testPatternCompilerOptionalLeadingParam(): void
{
$this->route = new Route(
['GET'],
@@ -116,7 +116,7 @@ public function testPatternCompilerOptionalLeadingParam()
$this->assertTrue($this->compiler->match($this->route, '/en/about'));
}
- public function testPatternCompilerInvalidParamNameThrowsException()
+ public function testPatternCompilerInvalidParamNameThrowsException(): void
{
$this->route = new Route(['GET'], '[id1=:num]', 'Ctrl', 'act');
@@ -125,7 +125,7 @@ public function testPatternCompilerInvalidParamNameThrowsException()
$this->compiler->compile($this->route);
}
- public function testPatternCompilerDuplicateParamNameThrowsException()
+ public function testPatternCompilerDuplicateParamNameThrowsException(): void
{
$this->route = new Route(
['GET'],
@@ -139,7 +139,7 @@ public function testPatternCompilerDuplicateParamNameThrowsException()
$this->compiler->compile($this->route);
}
- public function tesPatternCompilertUrlDecodedInput()
+ public function tesPatternCompilertUrlDecodedInput(): void
{
$this->route = new Route(['GET'], 'user/[id=:num]', 'Ctrl', 'act');
@@ -153,14 +153,14 @@ public function tesPatternCompilertUrlDecodedInput()
$this->assertSame(['id' => '42'], $this->compiler->getParams());
}
- public function testPatternCompilerRootPatternMatches()
+ public function testPatternCompilerRootPatternMatches(): void
{
$this->route = new Route(['GET'], '/', 'Ctrl', 'act');
$this->assertTrue($this->compiler->match($this->route, '/'));
}
- public function testPatternCompilerParamsResetAfterFailedMatch()
+ public function testPatternCompilerParamsResetAfterFailedMatch(): void
{
$this->route = new Route(['GET'], 'users/[id=:num]', 'Ctrl', 'act');
diff --git a/tests/Unit/Router/RouteBuilderTest.php b/tests/Unit/Router/RouteBuilderTest.php
index f9ae15964..e272e05e0 100644
--- a/tests/Unit/Router/RouteBuilderTest.php
+++ b/tests/Unit/Router/RouteBuilderTest.php
@@ -10,12 +10,12 @@
class RouteBuilderTest extends AppTestCase
{
- public function testRouteBuilderBuildReturnsRouteCollection()
+ public function testRouteBuilderBuildReturnsRouteCollection(): void
{
$builder = new RouteBuilder();
$routes = $builder->build([
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('users', 'UserController', 'index');
},
], []);
@@ -25,16 +25,16 @@ public function testRouteBuilderBuildReturnsRouteCollection()
$this->assertSame(1, $routes->count());
}
- public function testRouteBuilderBuildCollectsRoutesFromMultipleModules()
+ public function testRouteBuilderBuildCollectsRoutesFromMultipleModules(): void
{
$builder = new RouteBuilder();
$closures = [
- 'Api' => function (RouteBuilder $route) {
+ 'Api' => function (RouteBuilder $route): void {
$route->get('users', 'UsersController', 'index');
$route->post('login', 'AuthController', 'login');
},
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('', 'HomeController', 'index');
},
];
@@ -69,13 +69,13 @@ public function testRouteBuilderBuildCollectsRoutesFromMultipleModules()
$this->assertTrue($all[2]->allowsMethod('GET'));
}
- public function testRouteBuilderMissingModuleConfigFallsBackSafely()
+ public function testRouteBuilderMissingModuleConfigFallsBackSafely(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Test' => function (RouteBuilder $route) {
+ 'Test' => function (RouteBuilder $route): void {
$route->get('ping', 'PingController', 'index');
},
],
@@ -91,13 +91,13 @@ public function testRouteBuilderMissingModuleConfigFallsBackSafely()
$this->assertSame('/ping', $route->getPattern());
}
- public function testRouteBuilderPrefixIsAppliedToRoutes()
+ public function testRouteBuilderPrefixIsAppliedToRoutes(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Api' => function (RouteBuilder $route) {
+ 'Api' => function (RouteBuilder $route): void {
$route->get('status', 'StatusController', 'index');
},
],
@@ -113,14 +113,14 @@ public function testRouteBuilderPrefixIsAppliedToRoutes()
$this->assertSame('Api', $route->getModule());
}
- public function testRouteBuilderGroupAssignsGroupNameToRoutes()
+ public function testRouteBuilderGroupAssignsGroupNameToRoutes(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
- $route->group('auth', function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('auth', function (RouteBuilder $route): void {
$route->get('dashboard', 'DashboardController', 'index');
});
},
@@ -133,7 +133,7 @@ public function testRouteBuilderGroupAssignsGroupNameToRoutes()
$this->assertSame('auth', $route->getGroup());
}
- public function testRouteBuilderNestedGroupsAreNotAllowed()
+ public function testRouteBuilderNestedGroupsAreNotAllowed(): void
{
$this->expectException(RouteException::class);
@@ -141,9 +141,9 @@ public function testRouteBuilderNestedGroupsAreNotAllowed()
$builder->build(
[
- 'Web' => function (RouteBuilder $route) {
- $route->group('one', function (RouteBuilder $route) {
- $route->group('two', function () {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('one', function (RouteBuilder $route): void {
+ $route->group('two', function (): void {
});
});
},
@@ -152,14 +152,14 @@ public function testRouteBuilderNestedGroupsAreNotAllowed()
);
}
- public function testRouteBuilderGroupMiddlewaresAreAppliedToRoutes()
+ public function testRouteBuilderGroupMiddlewaresAreAppliedToRoutes(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
- $route->group('auth', function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('auth', function (RouteBuilder $route): void {
$route->get('profile', 'ProfileController', 'show');
})->middlewares(['Auth']);
},
@@ -172,14 +172,14 @@ public function testRouteBuilderGroupMiddlewaresAreAppliedToRoutes()
$this->assertSame(['Auth'], $route->getMiddlewares());
}
- public function testRouteBuilderRouteMiddlewaresPrependToGroupMiddlewares()
+ public function testRouteBuilderRouteMiddlewaresPrependToGroupMiddlewares(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
- $route->group('auth', function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('auth', function (RouteBuilder $route): void {
$route
->get('profile', 'ProfileController', 'show')
->middlewares(['Editor']);
@@ -197,7 +197,7 @@ public function testRouteBuilderRouteMiddlewaresPrependToGroupMiddlewares()
);
}
- public function testRouteBuilderMiddlewaresMustBeCalledAfterRouteOrInsideGroup()
+ public function testRouteBuilderMiddlewaresMustBeCalledAfterRouteOrInsideGroup(): void
{
$this->expectException(RouteException::class);
@@ -205,7 +205,7 @@ public function testRouteBuilderMiddlewaresMustBeCalledAfterRouteOrInsideGroup()
$builder->build(
[
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->middlewares(['Invalid']);
},
],
@@ -213,14 +213,14 @@ public function testRouteBuilderMiddlewaresMustBeCalledAfterRouteOrInsideGroup()
);
}
- public function testRouteBuilderMiddlewareOrderAcrossModulesGroupsAndStandaloneRoutes()
+ public function testRouteBuilderMiddlewareOrderAcrossModulesGroupsAndStandaloneRoutes(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
- $route->group('auth', function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('auth', function (RouteBuilder $route): void {
$route->get('profile', 'ProfileController', 'show')->middlewares(['ProfileMw']);
$route->get('settings', 'SettingsController', 'show')->middlewares(['SettingsMw']);
})->middlewares(['AuthMw']);
@@ -228,8 +228,8 @@ public function testRouteBuilderMiddlewareOrderAcrossModulesGroupsAndStandaloneR
$route->get('home', 'HomeController', 'index')->middlewares(['HomeMw']);
},
- 'Api' => function (RouteBuilder $route) {
- $route->group('api-auth', function (RouteBuilder $route) {
+ 'Api' => function (RouteBuilder $route): void {
+ $route->group('api-auth', function (RouteBuilder $route): void {
$route->get('users', 'UsersController', 'index')->middlewares(['UsersMw1', 'UsersMw2']);
$route->post('login', 'AuthController', 'login')->middlewares(['LoginMw']);
})->middlewares(['ApiAuthMw']);
@@ -255,13 +255,13 @@ public function testRouteBuilderMiddlewareOrderAcrossModulesGroupsAndStandaloneR
$this->assertSame(['StatusMw'], $all[5]->getMiddlewares());
}
- public function testRouteBuilderRouteNameIsAssigned()
+ public function testRouteBuilderRouteNameIsAssigned(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('home', 'HomeController', 'index')
->name('home');
},
@@ -272,7 +272,7 @@ public function testRouteBuilderRouteNameIsAssigned()
$this->assertSame('home', $routes->all()[0]->getName());
}
- public function testRouteBuilderRouteNamesMustBeUnique()
+ public function testRouteBuilderRouteNamesMustBeUnique(): void
{
$this->expectException(RouteException::class);
@@ -280,7 +280,7 @@ public function testRouteBuilderRouteNamesMustBeUnique()
$builder->build(
[
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('a', 'AController', 'a')->name('dup');
$route->get('b', 'BController', 'b')->name('dup');
},
@@ -289,16 +289,16 @@ public function testRouteBuilderRouteNamesMustBeUnique()
);
}
- public function testRouteBuilderRouteNamesCanRepeatAcrossModules()
+ public function testRouteBuilderRouteNamesCanRepeatAcrossModules(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Api' => function (RouteBuilder $route) {
+ 'Api' => function (RouteBuilder $route): void {
$route->get('posts', 'ApiPostController', 'index')->name('posts');
},
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('posts', 'WebPostController', 'index')->name('posts');
},
],
@@ -317,7 +317,7 @@ public function testRouteBuilderRouteNamesCanRepeatAcrossModules()
$this->assertSame('Web', $all[1]->getModule());
}
- public function testRouteBuilderNameMustBeCalledAfterRouteDefinition()
+ public function testRouteBuilderNameMustBeCalledAfterRouteDefinition(): void
{
$this->expectException(RouteException::class);
@@ -325,7 +325,7 @@ public function testRouteBuilderNameMustBeCalledAfterRouteDefinition()
$builder->build(
[
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->name('invalid');
},
],
@@ -333,13 +333,13 @@ public function testRouteBuilderNameMustBeCalledAfterRouteDefinition()
);
}
- public function testRouteBuilderCacheableAppliesToSingleRoute()
+ public function testRouteBuilderCacheableAppliesToSingleRoute(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('page', 'PageController', 'show')
->cacheable(true, 60);
},
@@ -353,14 +353,14 @@ public function testRouteBuilderCacheableAppliesToSingleRoute()
$this->assertSame(60, $cache['ttl']);
}
- public function testRouteBuilderCacheableAppliesToGroupRoutes()
+ public function testRouteBuilderCacheableAppliesToGroupRoutes(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Web' => function (RouteBuilder $route) {
- $route->group('cached', function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('cached', function (RouteBuilder $route): void {
$route->get('a', 'AController', 'a');
$route->get('b', 'BController', 'b');
})->cacheable(true, 120);
@@ -376,7 +376,7 @@ public function testRouteBuilderCacheableAppliesToGroupRoutes()
}
}
- public function testRouteBuilderAddRouteRequiresControllerAndAction()
+ public function testRouteBuilderAddRouteRequiresControllerAndAction(): void
{
$this->expectException(RouteException::class);
@@ -384,7 +384,7 @@ public function testRouteBuilderAddRouteRequiresControllerAndAction()
$builder->build(
[
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('broken', 'OnlyController');
},
],
@@ -392,13 +392,13 @@ public function testRouteBuilderAddRouteRequiresControllerAndAction()
);
}
- public function testRouteBuilderResolvesShortControllerNameToFqcn()
+ public function testRouteBuilderResolvesShortControllerNameToFqcn(): void
{
$builder = new RouteBuilder();
$routes = $builder->build(
[
- 'Test' => function (RouteBuilder $route) {
+ 'Test' => function (RouteBuilder $route): void {
$route->get('tests', 'TestController', 'tests');
},
],
@@ -407,22 +407,22 @@ public function testRouteBuilderResolvesShortControllerNameToFqcn()
$route = $routes->all()[0];
- $expected = 'Quantum\\Tests\\_root\\modules\\Test\\Controllers\\TestController';
+ $expected = \Quantum\Tests\_root\modules\Test\Controllers\TestController::class;
$this->assertTrue(class_exists($expected), 'Expected test controller class to exist');
$this->assertSame($expected, $route->getController());
}
- public function testRouteBuilderDoesNotModifyExplicitFqcnController()
+ public function testRouteBuilderDoesNotModifyExplicitFqcnController(): void
{
$builder = new RouteBuilder();
- $fqcn = 'Quantum\\Tests\\_root\\modules\\Test\\Controllers\\TestController';
+ $fqcn = \Quantum\Tests\_root\modules\Test\Controllers\TestController::class;
$routes = $builder->build(
[
- 'Test' => function (RouteBuilder $route) use ($fqcn) {
+ 'Test' => function (RouteBuilder $route) use ($fqcn): void {
$route->get('tests', $fqcn, 'tests');
},
],
@@ -436,19 +436,19 @@ public function testRouteBuilderDoesNotModifyExplicitFqcnController()
$this->assertSame($fqcn, $route->getController());
}
- public function testRouteBuilderAddRouteRejectsEmptyMethods()
+ public function testRouteBuilderAddRouteRejectsEmptyMethods(): void
{
$this->expectException(RouteException::class);
$builder = new RouteBuilder();
$builder->build([
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->add('test', '', 'TestController', 'index');
},
], []);
}
- public function testRouteBuilderShortControllerWithoutModuleThrows()
+ public function testRouteBuilderShortControllerWithoutModuleThrows(): void
{
$this->expectException(RouteException::class);
@@ -467,10 +467,10 @@ public function testRouteBuilderShortControllerWithoutModuleThrows()
);
}
- public function testRouteBuilderMiddlewaresAppliedDirectlyToRoute()
+ public function testRouteBuilderMiddlewaresAppliedDirectlyToRoute(): void
{
$routes = (new RouteBuilder())->build([
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->get('a', 'AController', 'a');
$route->middlewares(['Direct']);
},
@@ -479,22 +479,22 @@ public function testRouteBuilderMiddlewaresAppliedDirectlyToRoute()
$this->assertSame(['Direct'], $routes->all()[0]->getMiddlewares());
}
- public function testRouteBuilderCacheableMustFollowRouteOrGroup()
+ public function testRouteBuilderCacheableMustFollowRouteOrGroup(): void
{
$this->expectException(RouteException::class);
(new RouteBuilder())->build([
- 'Web' => function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
$route->cacheable(true);
},
], []);
}
- public function testRouteBuilderResolvePathTrimsSlashesCorrectly()
+ public function testRouteBuilderResolvePathTrimsSlashesCorrectly(): void
{
$routes = (new RouteBuilder())->build(
[
- 'Api' => function (RouteBuilder $route) {
+ 'Api' => function (RouteBuilder $route): void {
$route->get('/users/', 'UserController', 'index');
},
],
@@ -506,13 +506,11 @@ public function testRouteBuilderResolvePathTrimsSlashesCorrectly()
$this->assertSame('/v1/users', $routes->all()[0]->getPattern());
}
- public function testRouteBuilderClosureBasedRouteIsSupported()
+ public function testRouteBuilderClosureBasedRouteIsSupported(): void
{
$routes = (new RouteBuilder())->build([
- 'Web' => function (RouteBuilder $route) {
- $route->get('ping', function () {
- return 'pong';
- });
+ 'Web' => function (RouteBuilder $route): void {
+ $route->get('ping', fn (): string => 'pong');
},
], []);
@@ -520,11 +518,11 @@ public function testRouteBuilderClosureBasedRouteIsSupported()
$this->assertNull($routes->all()[0]->getController());
}
- public function testRouteBuilderGroupedRoutesAreRegisteredIndividually()
+ public function testRouteBuilderGroupedRoutesAreRegisteredIndividually(): void
{
$routes = (new RouteBuilder())->build([
- 'Web' => function (RouteBuilder $route) {
- $route->group('g', function (RouteBuilder $route) {
+ 'Web' => function (RouteBuilder $route): void {
+ $route->group('g', function (RouteBuilder $route): void {
$route->get('a', 'AController', 'a');
$route->get('b', 'BController', 'b');
});
diff --git a/tests/Unit/Router/RouteCollectionTest.php b/tests/Unit/Router/RouteCollectionTest.php
index 8d40f8623..8860a5a0f 100644
--- a/tests/Unit/Router/RouteCollectionTest.php
+++ b/tests/Unit/Router/RouteCollectionTest.php
@@ -8,7 +8,7 @@
class RouteCollectionTest extends AppTestCase
{
- public function testRouteCollectionStartsEmpty()
+ public function testRouteCollectionStartsEmpty(): void
{
$collection = new RouteCollection();
@@ -17,7 +17,7 @@ public function testRouteCollectionStartsEmpty()
$this->assertSame(0, $collection->count());
}
- public function testRouteCollectionAddIncreasesCount()
+ public function testRouteCollectionAddIncreasesCount(): void
{
$collection = new RouteCollection();
@@ -28,7 +28,7 @@ public function testRouteCollectionAddIncreasesCount()
$this->assertSame(2, $collection->count());
}
- public function testRouteCollectionAllReturnsAddedRoutes()
+ public function testRouteCollectionAllReturnsAddedRoutes(): void
{
$collection = new RouteCollection();
@@ -44,7 +44,7 @@ public function testRouteCollectionAllReturnsAddedRoutes()
$this->assertSame([$r1, $r2], $all);
}
- public function testRouteCollectionInsertionOrderIsPreserved()
+ public function testRouteCollectionInsertionOrderIsPreserved(): void
{
$collection = new RouteCollection();
@@ -61,7 +61,7 @@ public function testRouteCollectionInsertionOrderIsPreserved()
$this->assertSame($r2, $all[1]);
}
- public function testRouteCollectionAllReturnsSameInstances()
+ public function testRouteCollectionAllReturnsSameInstances(): void
{
$collection = new RouteCollection();
diff --git a/tests/Unit/Router/RouteDispatcherTest.php b/tests/Unit/Router/RouteDispatcherTest.php
index 1352c1852..8c77f5ba8 100644
--- a/tests/Unit/Router/RouteDispatcherTest.php
+++ b/tests/Unit/Router/RouteDispatcherTest.php
@@ -21,12 +21,12 @@ public function tearDown(): void
parent::tearDown();
}
- public function testDispatchExecutesClosureRoute()
+ public function testDispatchExecutesClosureRoute(): void
{
$called = false;
$receivedParam = null;
- $closure = function (string $id) use (&$called, &$receivedParam) {
+ $closure = function (string $id) use (&$called, &$receivedParam): void {
$called = true;
$receivedParam = $id;
};
@@ -49,7 +49,7 @@ public function testDispatchExecutesClosureRoute()
$this->assertSame('123', $receivedParam);
}
- public function testDispatchThrowsWhenClosureRouteHasNoClosure()
+ public function testDispatchThrowsWhenClosureRouteHasNoClosure(): void
{
$this->expectException(RouteException::class);
@@ -65,7 +65,7 @@ public function testDispatchThrowsWhenClosureRouteHasNoClosure()
$dispatcher->dispatch($matched, $request, $response);
}
- public function testDispatchExecutesControllerActionWithParams()
+ public function testDispatchExecutesControllerActionWithParams(): void
{
$controllerClass = new class () {
public static ?string $received = null;
@@ -94,7 +94,7 @@ public function post(string $uuid): void
);
}
- public function testDispatchCallsControllerHooksInCorrectOrder()
+ public function testDispatchCallsControllerHooksInCorrectOrder(): void
{
$controllerClass = new class () {
public static array $calls = [];
@@ -139,7 +139,7 @@ public function __after(string $uuid): void
);
}
- public function testDispatchThrowsWhenControllerActionDoesNotExist()
+ public function testDispatchThrowsWhenControllerActionDoesNotExist(): void
{
$this->expectException(RouteException::class);
@@ -159,7 +159,7 @@ public function testDispatchThrowsWhenControllerActionDoesNotExist()
$dispatcher->dispatch($matched, $request, $response);
}
- public function testDispatchFailsWhenCsrfIsEnabledAndTokenIsMissing()
+ public function testDispatchFailsWhenCsrfIsEnabledAndTokenIsMissing(): void
{
$this->expectException(CsrfException::class);
diff --git a/tests/Unit/Router/RouteFinderTest.php b/tests/Unit/Router/RouteFinderTest.php
index 3a5f37743..f81d474da 100644
--- a/tests/Unit/Router/RouteFinderTest.php
+++ b/tests/Unit/Router/RouteFinderTest.php
@@ -22,7 +22,7 @@ public function setUp(): void
$this->finder = new RouteFinder($this->collection);
}
- public function testRouteFinderFindReturnsMatchedRouteForStaticMatch()
+ public function testRouteFinderFindReturnsMatchedRouteForStaticMatch(): void
{
$route = new Route(['GET'], 'users', 'Ctrl', 'act');
$this->collection->add($route);
@@ -37,7 +37,7 @@ public function testRouteFinderFindReturnsMatchedRouteForStaticMatch()
$this->assertSame([], $result->getParams());
}
- public function testRouteFinderFindReturnsNullWhenNoMatch()
+ public function testRouteFinderFindReturnsNullWhenNoMatch(): void
{
$route = new Route(['GET'], 'users', 'Ctrl', 'act');
$this->collection->add($route);
@@ -48,7 +48,7 @@ public function testRouteFinderFindReturnsNullWhenNoMatch()
$this->assertNull($this->finder->find($req));
}
- public function testRouteFinderFindSkipsWrongHttpMethod()
+ public function testRouteFinderFindSkipsWrongHttpMethod(): void
{
$route = new Route(['POST'], 'users', 'Ctrl', 'act');
$this->collection->add($route);
@@ -59,7 +59,7 @@ public function testRouteFinderFindSkipsWrongHttpMethod()
$this->assertNull($this->finder->find($req));
}
- public function testRouteFinderFindReturnsFirstMatchingRouteOnly()
+ public function testRouteFinderFindReturnsFirstMatchingRouteOnly(): void
{
$r1 = new Route(['GET'], 'users', 'C1', 'a1');
$r2 = new Route(['GET'], 'users', 'C2', 'a2');
@@ -75,7 +75,7 @@ public function testRouteFinderFindReturnsFirstMatchingRouteOnly()
$this->assertSame($r1, $result->getRoute());
}
- public function testRouteFinderFindPassesExtractedParams()
+ public function testRouteFinderFindPassesExtractedParams(): void
{
$route = new Route(['GET'], 'users/[id=:num]', 'Ctrl', 'act');
$this->collection->add($route);
@@ -88,7 +88,7 @@ public function testRouteFinderFindPassesExtractedParams()
$this->assertSame(['id' => '42'], $result->getParams());
}
- public function testRouteFinderFindWithMultipleRoutesOnlyOneMatches()
+ public function testRouteFinderFindWithMultipleRoutesOnlyOneMatches(): void
{
$r1 = new Route(['GET'], 'posts', 'Ctrl', 'act');
$this->collection->add($r1);
diff --git a/tests/Unit/Router/RouteTest.php b/tests/Unit/Router/RouteTest.php
index b78f0b137..811719185 100644
--- a/tests/Unit/Router/RouteTest.php
+++ b/tests/Unit/Router/RouteTest.php
@@ -8,7 +8,7 @@
class RouteTest extends AppTestCase
{
- public function testRouteControllerRouteConstruction()
+ public function testRouteControllerRouteConstruction(): void
{
$route = new Route(
['get', 'post'],
@@ -28,9 +28,9 @@ public function testRouteControllerRouteConstruction()
$this->assertFalse($route->isClosure());
}
- public function testRouteClosureRouteConstruction()
+ public function testRouteClosureRouteConstruction(): void
{
- $handler = function () {
+ $handler = function (): void {
};
$route = new Route(
@@ -50,14 +50,14 @@ public function testRouteClosureRouteConstruction()
$this->assertNull($route->getAction());
}
- public function testRouteConstructorRejectsEmptyMethods()
+ public function testRouteConstructorRejectsEmptyMethods(): void
{
$this->expectException(RouteException::class);
new Route([], 'users', 'UserController', 'listAction');
}
- public function testRouteClosureRouteCannotDefineControllerOrAction()
+ public function testRouteClosureRouteCannotDefineControllerOrAction(): void
{
$this->expectException(RouteException::class);
@@ -66,19 +66,19 @@ public function testRouteClosureRouteCannotDefineControllerOrAction()
'health',
'HealthController',
'checkAction',
- function () {
+ function (): void {
}
);
}
- public function testRouteControllerRouteRequiresControllerAndAction()
+ public function testRouteControllerRouteRequiresControllerAndAction(): void
{
$this->expectException(RouteException::class);
new Route(['GET'], 'users', null, null);
}
- public function testRouteAllowsMethodIsCaseInsensitive()
+ public function testRouteAllowsMethodIsCaseInsensitive(): void
{
$route = new Route(
['GET'],
@@ -94,7 +94,7 @@ public function testRouteAllowsMethodIsCaseInsensitive()
$this->assertFalse($route->allowsMethod('POST'));
}
- public function testRouteCacheConfigurationIsStored()
+ public function testRouteCacheConfigurationIsStored(): void
{
$route = new Route(
['GET'],
@@ -111,7 +111,7 @@ public function testRouteCacheConfigurationIsStored()
);
}
- public function testRouteCompiledPatternCanBeStored()
+ public function testRouteCompiledPatternCanBeStored(): void
{
$route = new Route(
['GET'],
@@ -125,7 +125,7 @@ public function testRouteCompiledPatternCanBeStored()
$this->assertSame('^users$', $route->getCompiledPattern());
}
- public function testRouteMiddlewareStackingOrder()
+ public function testRouteMiddlewareStackingOrder(): void
{
$route = new Route(
['GET'],
@@ -143,7 +143,7 @@ public function testRouteMiddlewareStackingOrder()
);
}
- public function testRouteToArrayExportsRouteState()
+ public function testRouteToArrayExportsRouteState(): void
{
$route = new Route(
['GET'],
diff --git a/tests/Unit/Service/Factories/ServiceFactoryTest.php b/tests/Unit/Service/Factories/ServiceFactoryTest.php
index 3ef243f6a..a491da556 100644
--- a/tests/Unit/Service/Factories/ServiceFactoryTest.php
+++ b/tests/Unit/Service/Factories/ServiceFactoryTest.php
@@ -9,6 +9,9 @@ class TestService extends QtService
{
public static $count = 0;
+ /**
+ * @var TestModel
+ */
public $model;
public function __construct(TestModel $model)
@@ -18,7 +21,7 @@ public function __construct(TestModel $model)
$this->model = $model;
}
- public function hello()
+ public function hello(): string
{
return 'Hello';
}
@@ -55,7 +58,7 @@ public function tearDown(): void
TestService::$count = 0;
}
- public function testServiceFactoryGetInstance()
+ public function testServiceFactoryGetInstance(): void
{
$service = ServiceFactory::get(TestService::class);
@@ -64,7 +67,7 @@ public function testServiceFactoryGetInstance()
$this->assertInstanceOf(TestService::class, $service);
}
- public function testServiceFactoryVerifySingletonInstance()
+ public function testServiceFactoryVerifySingletonInstance(): void
{
$testServiceOne = ServiceFactory::get(TestService::class);
@@ -77,7 +80,7 @@ public function testServiceFactoryVerifySingletonInstance()
$this->assertSame($testServiceOne, $testServiceTwo);
}
- public function testServiceFactoryCreateInstance()
+ public function testServiceFactoryCreateInstance(): void
{
$service = ServiceFactory::create(TestService::class);
@@ -86,7 +89,7 @@ public function testServiceFactoryCreateInstance()
$this->assertInstanceOf(TestService::class, $service);
}
- public function testServiceFactoryVerifyFreshInstance()
+ public function testServiceFactoryVerifyFreshInstance(): void
{
$testServiceOne = ServiceFactory::create(TestService::class);
@@ -99,21 +102,21 @@ public function testServiceFactoryVerifyFreshInstance()
$this->assertNotSame($testServiceOne, $testServiceTwo);
}
- public function testServiceFactoryVerifyConstructorDependencyResolved()
+ public function testServiceFactoryVerifyConstructorDependencyResolved(): void
{
$testService = ServiceFactory::get(TestService::class);
$this->assertInstanceOf(DbModel::class, $testService->model);
}
- public function testServiceFactoryServiceMethodCall()
+ public function testServiceFactoryServiceMethodCall(): void
{
$this->assertEquals('Hello', ServiceFactory::get(TestService::class)->hello());
$this->assertEquals('Hello', ServiceFactory::create(TestService::class)->hello());
}
- public function testServiceFactoryServiceNotFound()
+ public function testServiceFactoryServiceNotFound(): void
{
$this->expectException(ServiceException::class);
diff --git a/tests/Unit/Service/Helpers/ServiceHelperFunctionTest.php b/tests/Unit/Service/Helpers/ServiceHelperFunctionTest.php
index e940480ff..8473c8f7c 100644
--- a/tests/Unit/Service/Helpers/ServiceHelperFunctionTest.php
+++ b/tests/Unit/Service/Helpers/ServiceHelperFunctionTest.php
@@ -9,7 +9,7 @@
class ServiceHelperFunctionTest extends AppTestCase
{
- public function testServiceReturnsQtServiceInstance()
+ public function testServiceReturnsQtServiceInstance(): void
{
$service = service(TokenService::class);
@@ -18,7 +18,7 @@ public function testServiceReturnsQtServiceInstance()
$this->assertInstanceOf(QtService::class, $service);
}
- public function testModelThrowsOnInvalidClass()
+ public function testModelThrowsOnInvalidClass(): void
{
$this->expectException(ServiceException::class);
diff --git a/tests/Unit/Service/QtServiceTest.php b/tests/Unit/Service/QtServiceTest.php
index af9d729b6..49fc275bb 100644
--- a/tests/Unit/Service/QtServiceTest.php
+++ b/tests/Unit/Service/QtServiceTest.php
@@ -28,7 +28,7 @@ public function setUp(): void
parent::setUp();
}
- public function testMissingMethods()
+ public function testMissingMethods(): void
{
$this->expectException(ServiceException::class);
diff --git a/tests/Unit/Session/Adapters/Database/DatabaseSessionAdapterTest.php b/tests/Unit/Session/Adapters/Database/DatabaseSessionAdapterTest.php
index afe6e8519..157302b8e 100644
--- a/tests/Unit/Session/Adapters/Database/DatabaseSessionAdapterTest.php
+++ b/tests/Unit/Session/Adapters/Database/DatabaseSessionAdapterTest.php
@@ -12,7 +12,7 @@ class DatabaseSessionAdapterTest extends AppTestCase
{
use TestCaseHelper;
- private $session;
+ private DatabaseSessionAdapter $session;
public function setUp(): void
{
@@ -32,12 +32,12 @@ public function tearDown(): void
ModelFactory::createDynamicModel('sessions')->deleteMany();
}
- public function testDatabaseSessionConstructor()
+ public function testDatabaseSessionConstructor(): void
{
$this->assertInstanceOf(DatabaseSessionAdapter::class, $this->session);
}
- public function testDatabaseSessionAll()
+ public function testDatabaseSessionAll(): void
{
$this->assertEmpty($this->session->all());
@@ -54,7 +54,7 @@ public function testDatabaseSessionAll()
$this->assertEquals('Test data', $this->session->all()['test']);
}
- public function testDatabaseSessionGetSetHasDelete()
+ public function testDatabaseSessionGetSetHasDelete(): void
{
$this->assertNull($this->session->get('auth'));
@@ -73,7 +73,7 @@ public function testDatabaseSessionGetSetHasDelete()
$this->assertNull($this->session->get('auth'));
}
- public function testDatabaseSessionGetSetFlash()
+ public function testDatabaseSessionGetSetFlash(): void
{
$this->session->setFlash('message', 'Flash message');
@@ -82,7 +82,7 @@ public function testDatabaseSessionGetSetFlash()
$this->assertNull($this->session->getFlash('message'));
}
- public function testDatabaseSessionFlush()
+ public function testDatabaseSessionFlush(): void
{
$this->session->set('test', 'Test data');
@@ -93,12 +93,12 @@ public function testDatabaseSessionFlush()
$this->assertEmpty($this->session->all());
}
- public function testDatabaseSessionGetSessionId()
+ public function testDatabaseSessionGetSessionId(): void
{
$this->assertEquals(session_id(), $this->session->getId());
}
- public function testDatabaseSessionRegenerateSessionId()
+ public function testDatabaseSessionRegenerateSessionId(): void
{
$sessionId = $this->session->getId();
diff --git a/tests/Unit/Session/Adapters/Native/NativeSessionAdapterTest.php b/tests/Unit/Session/Adapters/Native/NativeSessionAdapterTest.php
index cfcd8d6dd..b48f51c9e 100644
--- a/tests/Unit/Session/Adapters/Native/NativeSessionAdapterTest.php
+++ b/tests/Unit/Session/Adapters/Native/NativeSessionAdapterTest.php
@@ -7,7 +7,7 @@
class NativeSessionAdapterTest extends AppTestCase
{
- private $session;
+ private NativeSessionAdapter $session;
public function setUp(): void
{
@@ -18,12 +18,12 @@ public function setUp(): void
$this->session->delete('LAST_ACTIVITY');
}
- public function testNativeSessionConstructor()
+ public function testNativeSessionConstructor(): void
{
$this->assertInstanceOf(NativeSessionAdapter::class, $this->session);
}
- public function testNativeSessionSessionAll()
+ public function testNativeSessionSessionAll(): void
{
$this->assertEmpty($this->session->all());
@@ -40,7 +40,7 @@ public function testNativeSessionSessionAll()
$this->assertEquals('Test data', $this->session->all()['test']);
}
- public function testNativeSessionGetSetHasDelete()
+ public function testNativeSessionGetSetHasDelete(): void
{
$this->assertNull($this->session->get('auth'));
@@ -59,7 +59,7 @@ public function testNativeSessionGetSetHasDelete()
$this->assertNull($this->session->get('auth'));
}
- public function testNativeSessionGetSetFlash()
+ public function testNativeSessionGetSetFlash(): void
{
$this->session->setFlash('message', 'Flash message');
@@ -68,7 +68,7 @@ public function testNativeSessionGetSetFlash()
$this->assertNull($this->session->getFlash('message'));
}
- public function testNativeSessionFlush()
+ public function testNativeSessionFlush(): void
{
$this->session->set('test', 'Test data');
@@ -81,12 +81,12 @@ public function testNativeSessionFlush()
session_start();
}
- public function testNativeSessionGetSessionId()
+ public function testNativeSessionGetSessionId(): void
{
$this->assertEquals(session_id(), $this->session->getId());
}
- public function testNativeSessionRegenerateSessionId()
+ public function testNativeSessionRegenerateSessionId(): void
{
$sessionId = $this->session->getId();
diff --git a/tests/Unit/Session/Factories/SessionFactoryTest.php b/tests/Unit/Session/Factories/SessionFactoryTest.php
index 6913dd60b..0db03a381 100644
--- a/tests/Unit/Session/Factories/SessionFactoryTest.php
+++ b/tests/Unit/Session/Factories/SessionFactoryTest.php
@@ -39,35 +39,35 @@ public function tearDown(): void
ModelFactory::createDynamicModel('sessions')->deleteMany();
}
- public function testSessionFactoryInstance()
+ public function testSessionFactoryInstance(): void
{
$session = SessionFactory::get();
$this->assertInstanceOf(Session::class, $session);
}
- public function testSessionFactoryGetDefaultSessionAdapter()
+ public function testSessionFactoryGetDefaultSessionAdapter(): void
{
$session = SessionFactory::get();
$this->assertInstanceOf(NativeSessionAdapter::class, $session->getAdapter());
}
- public function testSessionFactoryGetNativeSessionAdapter()
+ public function testSessionFactoryGetNativeSessionAdapter(): void
{
$session = SessionFactory::get(Session::NATIVE);
$this->assertInstanceOf(NativeSessionAdapter::class, $session->getAdapter());
}
- public function testSessionFactoryGetDatabaseAdapter()
+ public function testSessionFactoryGetDatabaseAdapter(): void
{
$session = SessionFactory::get(Session::DATABASE);
$this->assertInstanceOf(DatabaseSessionAdapter::class, $session->getAdapter());
}
- public function testSessionSubsequentRequests()
+ public function testSessionSubsequentRequests(): void
{
config()->set('session.default', 'database');
@@ -102,7 +102,7 @@ public function testSessionSubsequentRequests()
$this->assertEquals('Data saved in persistent storage', $session->get('data'));
}
- public function testSessionFactoryInvalidTypeAdapter()
+ public function testSessionFactoryInvalidTypeAdapter(): void
{
$this->expectException(SessionException::class);
@@ -111,7 +111,7 @@ public function testSessionFactoryInvalidTypeAdapter()
SessionFactory::get('invalid_type');
}
- public function testMailerFactoryReturnsSameInstance()
+ public function testMailerFactoryReturnsSameInstance(): void
{
$session1 = SessionFactory::get(Session::NATIVE);
$session2 = SessionFactory::get(Session::NATIVE);
diff --git a/tests/Unit/Session/Helpers/SessionHelperFunctionsTest.php b/tests/Unit/Session/Helpers/SessionHelperFunctionsTest.php
index 28096c073..b1b7ee494 100644
--- a/tests/Unit/Session/Helpers/SessionHelperFunctionsTest.php
+++ b/tests/Unit/Session/Helpers/SessionHelperFunctionsTest.php
@@ -9,7 +9,7 @@
class SessionHelperFunctionsTest extends AppTestCase
{
- public function testSessionHelperGetDefaultSessionAdapter()
+ public function testSessionHelperGetDefaultSessionAdapter(): void
{
config()->delete('session');
@@ -20,7 +20,7 @@ public function testSessionHelperGetDefaultSessionAdapter()
$this->assertInstanceOf(NativeSessionAdapter::class, $session->getAdapter());
}
- public function testSessionHelperGetNativeSessionAdapter()
+ public function testSessionHelperGetNativeSessionAdapter(): void
{
$session = session(Session::NATIVE);
@@ -29,7 +29,7 @@ public function testSessionHelperGetNativeSessionAdapter()
$this->assertInstanceOf(NativeSessionAdapter::class, $session->getAdapter());
}
- public function testSessionHelperGetDatabaseSessionAdapter()
+ public function testSessionHelperGetDatabaseSessionAdapter(): void
{
$session = session(Session::DATABASE);
@@ -38,7 +38,7 @@ public function testSessionHelperGetDatabaseSessionAdapter()
$this->assertInstanceOf(DatabaseSessionAdapter::class, $session->getAdapter());
}
- public function testSessionMethodsViaHelper()
+ public function testSessionMethodsViaHelper(): void
{
$this->assertFalse(session()->has('test'));
diff --git a/tests/Unit/Session/SessionTest.php b/tests/Unit/Session/SessionTest.php
index e180c088a..56c3b787a 100644
--- a/tests/Unit/Session/SessionTest.php
+++ b/tests/Unit/Session/SessionTest.php
@@ -21,7 +21,7 @@ public function setUp(): void
}
}
- public function testSessionGetAdapter()
+ public function testSessionGetAdapter(): void
{
$session = new Session(new NativeSessionAdapter());
@@ -36,7 +36,7 @@ public function testSessionGetAdapter()
$this->assertInstanceOf(SessionStorageInterface::class, $session->getAdapter());
}
- public function testSessionCallingValidMethod()
+ public function testSessionCallingValidMethod(): void
{
$session = new Session(new NativeSessionAdapter());
@@ -45,7 +45,7 @@ public function testSessionCallingValidMethod()
$this->assertEquals('Test data', $session->get('test'));
}
- public function testSessionCallingInvalidMethod()
+ public function testSessionCallingInvalidMethod(): void
{
$mailer = new Session(new NativeSessionAdapter());
diff --git a/tests/Unit/Session/TestCaseHelper.php b/tests/Unit/Session/TestCaseHelper.php
index 3ff2a429d..62280d160 100644
--- a/tests/Unit/Session/TestCaseHelper.php
+++ b/tests/Unit/Session/TestCaseHelper.php
@@ -6,7 +6,7 @@
trait TestCaseHelper
{
- private function _createSessionsTable()
+ private function _createSessionsTable(): void
{
IdiormDbal::execute(
'CREATE TABLE IF NOT EXISTS sessions (
diff --git a/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php b/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php
index bfd03f8ae..fb19cc6ff 100644
--- a/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php
+++ b/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php
@@ -14,32 +14,17 @@ class DropboxAppTest extends AppTestCase
/**
* @var DropboxApp
*/
- private $dropboxApp;
+ private DropboxApp $dropboxApp;
- /**
- * @var string
- */
- private $appKey = 'x0hwm8wy63rrynm';
+ private string $appKey = 'x0hwm8wy63rrynm';
- /**
- * @var string
- */
- private $appSecret = 'xxx123yyy';
+ private string $appSecret = 'xxx123yyy';
- /**
- * @var string
- */
- private $authCode = 'd4k29ovC7-UAAAAAAAA3Q45go2mLgjMhJSeJNBOo-EA';
+ private string $authCode = 'd4k29ovC7-UAAAAAAAA3Q45go2mLgjMhJSeJNBOo-EA';
- /**
- * @var string
- */
- private $redirectUrl = 'http://localhost/confirm';
+ private string $redirectUrl = 'http://localhost/confirm';
- /**
- * @var array
- */
- private $tokensGrantResponse = [
+ private array $tokensGrantResponse = [
'access_token' => 'sl.BYEQ1_VadTz6nBU36WPBBVwokc3zWVMXGjcOKxV4Tadms8ZlEPM85aHVFa_k1sfjilCWOnl79RUncPZzJ3GhrqhLGIBFFRCH0rKMa_ZtcqkerJn-f5lu10Ki5PSw4fxYM80V4PL_',
'token_type' => 'bearer',
'expires_in' => 14400,
@@ -49,10 +34,7 @@ class DropboxAppTest extends AppTestCase
'account_id' => 'dbid:AAC9tDKbzTQlyNms0ZcB_iH3wLv7yNn-iyE',
];
- /**
- * @var array
- */
- private $profileDataResponse = [
+ private array $profileDataResponse = [
'account_id' => 'dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc',
'disabled' => false,
'email' => 'franz@dropbox.com',
@@ -68,20 +50,14 @@ class DropboxAppTest extends AppTestCase
'profile_photo_url' => 'https://dl-web.dropbox.com/account_photo/get/69330102&size=128x128',
];
- /**
- * @var array
- */
- private $errorResponse = [
+ private array $errorResponse = [
'error' => [
'.tag' => 'no_account',
],
'error_summary' => 'no_account/...',
];
- /**
- * @var string
- */
- private $fileContentResponse = 'Some plain text!';
+ private string $fileContentResponse = 'Some plain text!';
public function setUp(): void
{
@@ -94,7 +70,7 @@ public function setUp(): void
$this->dropboxApp = new DropboxApp($this->appKey, $this->appSecret, $tokenServiceMock, $httpClientMock);
}
- public function testDropboxGetAuthUrl()
+ public function testDropboxGetAuthUrl(): void
{
$authUrl = $this->dropboxApp->getAuthUrl($this->redirectUrl);
@@ -105,7 +81,7 @@ public function testDropboxGetAuthUrl()
$this->assertStringContainsString('token_access_type', $authUrl);
}
- public function testDropboxFetchTokens()
+ public function testDropboxFetchTokens(): void
{
$this->currentResponse = (object) $this->tokensGrantResponse;
@@ -118,7 +94,7 @@ public function testDropboxFetchTokens()
$this->assertTrue(property_exists($response, 'refresh_token'));
}
- public function testDropboxRpcRequest()
+ public function testDropboxRpcRequest(): void
{
$this->currentResponse = (object) $this->profileDataResponse;
@@ -131,7 +107,7 @@ public function testDropboxRpcRequest()
$this->assertTrue(property_exists($response, 'name'));
}
- public function testDropboxContentRequest()
+ public function testDropboxContentRequest(): void
{
$this->currentResponse = $this->fileContentResponse;
@@ -142,7 +118,7 @@ public function testDropboxContentRequest()
$this->assertEquals('Some plain text!', $response);
}
- public function testDropboxSendRequest()
+ public function testDropboxSendRequest(): void
{
$this->currentResponse = (object) $this->profileDataResponse;
@@ -153,7 +129,7 @@ public function testDropboxSendRequest()
$this->assertEquals((object) $this->profileDataResponse, $response);
}
- public function testDropboxRequestWithAccessTokenExpired()
+ public function testDropboxRequestWithAccessTokenExpired(): void
{
$this->currentErrors = ['code' => 401];
@@ -166,7 +142,7 @@ public function testDropboxRequestWithAccessTokenExpired()
$this->assertEquals((object) $this->profileDataResponse, $response);
}
- public function testDropboxPathNormalizer()
+ public function testDropboxPathNormalizer(): void
{
$this->assertEquals(['path' => '/message.txt'], $this->dropboxApp->path('/message.txt'));
diff --git a/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php b/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php
index 79aca06bd..58a5b55f0 100644
--- a/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php
+++ b/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php
@@ -14,25 +14,16 @@ class DropboxFileSystemAdapterTest extends AppTestCase
*/
protected $fs;
- /**
- * @var string
- */
- private $dirname = 'common';
+ private string $dirname = 'common';
- /**
- * @var string
- */
- private $filename = 'sample.txt';
+ private string $filename = 'sample.txt';
- /**
- * @var string
- */
- private $content = 'This file was created via dropbox api';
+ private string $content = 'This file was created via dropbox api';
/**
* @var array
*/
- private static $response = [];
+ private static array $response = [];
public function setUp(): void
{
@@ -42,7 +33,7 @@ public function setUp(): void
$dropboxAppMock
->shouldReceive('rpcRequest')
- ->andReturnUsing(function ($endpoint, $params) {
+ ->andReturnUsing(function ($endpoint, $params): array {
self::$response = array_merge(self::$response, $params);
return self::$response;
});
@@ -59,7 +50,7 @@ public function setUp(): void
$dropboxAppMock
->shouldReceive('path')
- ->andReturnUsing(fn ($path) => ['path' => '/' . trim($path, '/')]);
+ ->andReturnUsing(fn ($path): array => ['path' => '/' . trim($path, '/')]);
$this->fs = new DropboxFileSystemAdapter($dropboxAppMock);
}
@@ -69,7 +60,7 @@ public function tearDown(): void
self::$response = [];
}
- public function testDropboxMakeCheckRemoveDirectory()
+ public function testDropboxMakeCheckRemoveDirectory(): void
{
$this->assertFalse($this->fs->isDirectory($this->dirname));
@@ -86,7 +77,7 @@ public function testDropboxMakeCheckRemoveDirectory()
$this->assertFalse($this->fs->isDirectory($this->dirname));
}
- public function testDropboxCreateGetCheckRemoveFile()
+ public function testDropboxCreateGetCheckRemoveFile(): void
{
$this->assertFalse($this->fs->isFile($this->filename));
@@ -107,7 +98,7 @@ public function testDropboxCreateGetCheckRemoveFile()
$this->assertFalse($this->fs->exists($this->filename));
}
- public function testDropboxFileAppend()
+ public function testDropboxFileAppend(): void
{
self::$response['.tag'] = 'file';
@@ -122,7 +113,7 @@ public function testDropboxFileAppend()
$this->assertEquals($this->content . $moreContent, $this->fs->get($this->filename));
}
- public function testDropboxFileRename()
+ public function testDropboxFileRename(): void
{
$this->fs->put($this->filename, $this->content);
@@ -139,7 +130,7 @@ public function testDropboxFileRename()
$this->fs->remove($newFilename);
}
- public function testDropboxFileCopy()
+ public function testDropboxFileCopy(): void
{
$dirName = 'testing';
@@ -160,7 +151,7 @@ public function testDropboxFileCopy()
$this->fs->removeDirectory($dirName);
}
- public function testDropboxFileSize()
+ public function testDropboxFileSize(): void
{
$text = 'some bytes';
@@ -171,7 +162,7 @@ public function testDropboxFileSize()
$this->assertEquals(10, $this->fs->size($this->filename));
}
- public function testDropboxFileLastModified()
+ public function testDropboxFileLastModified(): void
{
$modified = '2023-02-12T15:50:38Z';
@@ -184,7 +175,7 @@ public function testDropboxFileLastModified()
$this->assertEquals(strtotime($modified), $this->fs->lastModified($this->filename));
}
- public function testDropboxListDirectory()
+ public function testDropboxListDirectory(): void
{
self::$response['entries'] = [
[
diff --git a/tests/Unit/Storage/Adapters/Dropbox/DropboxTokenServiceTestCase.php b/tests/Unit/Storage/Adapters/Dropbox/DropboxTokenServiceTestCase.php
index 365f4b81e..c7e72b907 100644
--- a/tests/Unit/Storage/Adapters/Dropbox/DropboxTokenServiceTestCase.php
+++ b/tests/Unit/Storage/Adapters/Dropbox/DropboxTokenServiceTestCase.php
@@ -13,7 +13,7 @@ protected function mockTokenService()
$tokenServiceMock
->shouldReceive('getRefreshToken')
- ->andReturnUsing(function () {
+ ->andReturnUsing(function (): string {
$this->currentResponse = (object) $this->tokensGrantResponse;
return 'ref_tok_1234';
});
@@ -24,7 +24,7 @@ protected function mockTokenService()
$tokenServiceMock
->shouldReceive('saveTokens')
- ->andReturnUsing(function ($tokens) {
+ ->andReturnUsing(function ($tokens): bool {
$this->currentResponse = (object) $this->profileDataResponse;
return true;
});
diff --git a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php
index dc2d48d59..5820059fe 100644
--- a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php
+++ b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php
@@ -14,55 +14,34 @@ class GoogleDriveAppTest extends AppTestCase
/**
* @var GoogleDriveApp
*/
- private $googleDriveApp;
+ private GoogleDriveApp $googleDriveApp;
- /**
- * @var string
- */
- private $appKey = 'x0hwm8wy63rrynm';
+ private string $appKey = 'x0hwm8wy63rrynm';
- /**
- * @var string
- */
- private $appSecret = 'xxx123yyy';
+ private string $appSecret = 'xxx123yyy';
- /**
- * @var string
- */
- private $authCode = 'd4k29ovC7-UAAAAAAAA3Q45go2mLgjMhJSeJNBOo-EA';
+ private string $authCode = 'd4k29ovC7-UAAAAAAAA3Q45go2mLgjMhJSeJNBOo-EA';
- /**
- * @var string
- */
- private $redirectUrl = 'http://localhost/confirm';
+ private string $redirectUrl = 'http://localhost/confirm';
- /**
- * @var array
- */
- private $tokensGrantResponse = [
+ private array $tokensGrantResponse = [
'access_token' => 'sl.BYEQ1_VadTz6nBU36WPBBVwokc3zWVMXGjcOKxV4Tadms8ZlEPM85aHVFa_k1sfjilCWOnl79RUncPZzJ3GhrqhLGIBFFRCH0rKMa_ZtcqkerJn-f5lu10Ki5PSw4fxYM80V4PL_',
'refresh_token' => '-3S067m3M5kAAAAAAAAAAcQF8zVqFUuhK-PFkFqiOfFTgiazWj5NyU-1EGWIh0ZS',
];
- /**
- * @var array
- */
- private $fileMetadataResponse = [
+ private array $fileMetadataResponse = [
'id' => 'file1',
'kind' => GoogleDriveApp::DRIVE_FILE_KIND,
'name' => 'myFile',
'mimeType' => 'text/plain',
];
- /**
- * @var string
- */
- private $fileContentResponse = 'Some plain text!';
+ private string $fileContentResponse = 'Some plain text!';
/**
* @var string
*/
- private $errorResponse = [
+ private array $errorResponse = [
'code' => GoogleDriveApp::INVALID_TOKEN_ERROR_CODE,
'message' => 'Invalid access token',
];
@@ -78,7 +57,7 @@ public function setUp(): void
$this->googleDriveApp = new GoogleDriveApp($this->appKey, $this->appSecret, $tokenServiceMock, $httpClientMock);
}
- public function testGoogleDriveGetAuthUrl()
+ public function testGoogleDriveGetAuthUrl(): void
{
$authUrl = $this->googleDriveApp->getAuthUrl($this->redirectUrl);
@@ -89,7 +68,7 @@ public function testGoogleDriveGetAuthUrl()
$this->assertStringContainsString('access_type', $authUrl);
}
- public function testGoogleDriveFetchTokens()
+ public function testGoogleDriveFetchTokens(): void
{
$this->currentResponse = (object) $this->tokensGrantResponse;
@@ -102,7 +81,7 @@ public function testGoogleDriveFetchTokens()
$this->assertTrue(property_exists($response, 'refresh_token'));
}
- public function testGoogleDriveRpcRequest()
+ public function testGoogleDriveRpcRequest(): void
{
$this->currentResponse = (object) $this->fileMetadataResponse;
@@ -119,7 +98,7 @@ public function testGoogleDriveRpcRequest()
$this->assertTrue(property_exists($response, 'mimeType'));
}
- public function testGoogleDriveGetFileInfo()
+ public function testGoogleDriveGetFileInfo(): void
{
$this->currentResponse = $this->fileContentResponse;
@@ -130,7 +109,7 @@ public function testGoogleDriveGetFileInfo()
$this->assertEquals('Some plain text!', $response);
}
- public function testGoogleDriveRequestWithAccessTokenExpired()
+ public function testGoogleDriveRequestWithAccessTokenExpired(): void
{
$this->currentErrors = ['code' => 401];
diff --git a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapterTest.php b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapterTest.php
index 9b71b7cd8..90b53c116 100644
--- a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapterTest.php
+++ b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapterTest.php
@@ -14,30 +14,15 @@ class GoogleDriveFileSystemAdapterTest extends AppTestCase
*/
protected $fs;
- /**
- * @var string
- */
- private $dirname = 'common';
+ private string $dirname = 'common';
- /**
- * @var string
- */
- private $filename = 'sample.txt';
+ private string $filename = 'sample.txt';
- /**
- * @var string
- */
- private $newFilename = 'new_name.txt';
+ private string $newFilename = 'new_name.txt';
- /**
- * @var string
- */
- private $content = 'This file was created via gdrive api';
+ private string $content = 'This file was created via gdrive api';
- /**
- * @var array
- */
- private static $response = [];
+ private static array $response = [];
public function setUp(): void
{
@@ -63,7 +48,7 @@ public function tearDown(): void
self::$response = [];
}
- public function testGoogleDriveMakeCheckRemoveDirectory()
+ public function testGoogleDriveMakeCheckRemoveDirectory(): void
{
$this->assertFalse($this->fs->isDirectory($this->dirname));
@@ -80,7 +65,7 @@ public function testGoogleDriveMakeCheckRemoveDirectory()
$this->assertFalse($this->fs->isDirectory($this->dirname));
}
- public function testGoogleDriveCreateGetCheckRemoveFile()
+ public function testGoogleDriveCreateGetCheckRemoveFile(): void
{
$this->assertFalse($this->fs->isFile($this->filename));
@@ -102,7 +87,7 @@ public function testGoogleDriveCreateGetCheckRemoveFile()
$this->assertFalse($this->fs->exists($this->filename));
}
- public function testGoogleDriveFileAppend()
+ public function testGoogleDriveFileAppend(): void
{
self::$response['kind'] = GoogleDriveApp::DRIVE_FILE_KIND;
self::$response['mimeType'] = 'text/plain';
@@ -118,7 +103,7 @@ public function testGoogleDriveFileAppend()
$this->assertEquals($this->content . $moreContent, $this->fs->get($this->filename));
}
- public function testGoogleDriveFileRename()
+ public function testGoogleDriveFileRename(): void
{
$this->fs->put($this->filename, $this->content);
@@ -134,7 +119,7 @@ public function testGoogleDriveFileRename()
$this->fs->remove($this->newFilename);
}
- public function testGoogleDriveFileCopy()
+ public function testGoogleDriveFileCopy(): void
{
$this->fs->makeDirectory($this->dirname);
@@ -154,7 +139,7 @@ public function testGoogleDriveFileCopy()
$this->fs->removeDirectory($this->dirname);
}
- public function testGoogleDriveFileSize()
+ public function testGoogleDriveFileSize(): void
{
$text = 'some bytes';
@@ -165,7 +150,7 @@ public function testGoogleDriveFileSize()
$this->assertEquals(strlen($text), $this->fs->size($this->filename));
}
- public function testGoogleDriveFileLastModified()
+ public function testGoogleDriveFileLastModified(): void
{
$modified = '2023-02-12T15:50:38Z';
@@ -179,7 +164,7 @@ public function testGoogleDriveFileLastModified()
$this->assertEquals(strtotime($modified), $result);
}
- public function testGoogleDriveListDirectory()
+ public function testGoogleDriveListDirectory(): void
{
self::$response['files'] = [
[
diff --git a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveTokenServiceTestCase.php b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveTokenServiceTestCase.php
index c884b30b2..f27f59388 100644
--- a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveTokenServiceTestCase.php
+++ b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveTokenServiceTestCase.php
@@ -11,14 +11,14 @@ protected function mockTokenService()
{
$tokenServiceMock = Mockery::mock(TokenServiceInterface::class);
- $tokenServiceMock->shouldReceive('getRefreshToken')->andReturnUsing(function () {
+ $tokenServiceMock->shouldReceive('getRefreshToken')->andReturnUsing(function (): string {
$this->currentResponse = (object) $this->tokensGrantResponse;
return 'ref_tok_1234';
});
$tokenServiceMock->shouldReceive('getAccessToken')->andReturn('acc_tok_1234');
- $tokenServiceMock->shouldReceive('saveTokens')->andReturnUsing(function ($tokens) {
+ $tokenServiceMock->shouldReceive('saveTokens')->andReturnUsing(function ($tokens): bool {
$this->currentResponse = (object) $this->fileMetadataResponse;
return true;
});
diff --git a/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php b/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php
index a9fab2268..38edecbca 100644
--- a/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php
+++ b/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php
@@ -15,17 +15,14 @@ class LocalFileSystemAdapterTest extends AppTestCase
/**
* @var string
*/
- private $dirname;
+ private string $dirname;
/**
* @var string
*/
- private $filename;
+ private string $filename;
- /**
- * @var string
- */
- private $content = 'Hello world';
+ private string $content = 'Hello world';
public function setUp(): void
{
@@ -47,7 +44,7 @@ public function tearDown(): void
}
}
- public function testLocalMakeRemoveDirectory()
+ public function testLocalMakeRemoveDirectory(): void
{
$this->assertDirectoryDoesNotExist($this->dirname);
@@ -60,7 +57,7 @@ public function testLocalMakeRemoveDirectory()
$this->assertDirectoryDoesNotExist($this->dirname);
}
- public function testLocalFileGetPut()
+ public function testLocalFileGetPut(): void
{
$this->fs->put($this->filename, $this->content);
@@ -69,7 +66,7 @@ public function testLocalFileGetPut()
$this->assertEquals($this->content, $this->fs->get($this->filename));
}
- public function testLocalFileAppend()
+ public function testLocalFileAppend(): void
{
$this->fs->put($this->filename, $this->content);
@@ -82,7 +79,7 @@ public function testLocalFileAppend()
$this->assertEquals($this->content . $moreContent, $this->fs->get($this->filename));
}
- public function tesLocalFileRename()
+ public function tesLocalFileRename(): void
{
$this->fs->put($this->filename, $this->content);
@@ -97,7 +94,7 @@ public function tesLocalFileRename()
$this->fs->remove($newFilename);
}
- public function testLocalFileCopy()
+ public function testLocalFileCopy(): void
{
$this->fs->makeDirectory($this->dirname);
@@ -114,7 +111,7 @@ public function testLocalFileCopy()
$this->fs->removeDirectory($this->dirname);
}
- public function testLocalFileExists()
+ public function testLocalFileExists(): void
{
$newFilename = base_dir() . DS . 'new_name.txt';
@@ -127,21 +124,21 @@ public function testLocalFileExists()
$this->fs->remove($newFilename);
}
- public function testLocalFileSize()
+ public function testLocalFileSize(): void
{
$this->fs->put($this->filename, 'some bytes');
$this->assertEquals(10, $this->fs->size($this->filename));
}
- public function testLocalFileLastModified()
+ public function testLocalFileLastModified(): void
{
$this->fs->put($this->filename, $this->content);
$this->assertIsInt($this->fs->lastModified($this->filename));
}
- public function testLocalFileRemove()
+ public function testLocalFileRemove(): void
{
$this->fs->put($this->filename, $this->content);
@@ -152,21 +149,21 @@ public function testLocalFileRemove()
$this->assertFileDoesNotExist($this->filename);
}
- public function testLocalIsFile()
+ public function testLocalIsFile(): void
{
$this->assertTrue($this->fs->isFile(__FILE__));
$this->assertFalse($this->fs->isFile(__DIR__));
}
- public function testLocalIsDirectory()
+ public function testLocalIsDirectory(): void
{
$this->assertTrue($this->fs->isDirectory(__DIR__));
$this->assertFalse($this->fs->isDirectory(__FILE__));
}
- public function testLocalListDirectory()
+ public function testLocalListDirectory(): void
{
$entries = $this->fs->listDirectory(base_dir());
@@ -177,7 +174,7 @@ public function testLocalListDirectory()
$this->assertEmpty($this->fs->listDirectory('nowhere'));
}
- public function testLocalGlob()
+ public function testLocalGlob(): void
{
$entries = $this->fs->glob(base_dir() . DS . '*.log');
@@ -186,7 +183,7 @@ public function testLocalGlob()
$this->assertIsString(current($entries));
}
- public function testLocalFileIsReadableWritable()
+ public function testLocalFileIsReadableWritable(): void
{
$this->fs->put($this->filename, '');
@@ -201,7 +198,7 @@ public function testLocalFileIsReadableWritable()
$this->assertFalse($this->fs->isWritable($this->filename));
}
- public function testLocalFileGetLines()
+ public function testLocalFileGetLines(): void
{
$lineOne = 'It\'s was started then ' . PHP_EOL;
$lineTwo = 'something happens' . PHP_EOL;
@@ -227,19 +224,19 @@ public function testLocalFileGetLines()
$this->assertCount(4, $lines);
}
- public function testLocalFileNameAndExtension()
+ public function testLocalFileNameAndExtension(): void
{
$this->assertEquals('test', $this->fs->fileName($this->filename));
$this->assertEquals('txt', $this->fs->extension($this->filename));
}
- public function testLocalFileNameWithExtension()
+ public function testLocalFileNameWithExtension(): void
{
$this->assertEquals('test.txt', $this->fs->fileNameWithExtension($this->filename));
}
- public function testLocalRequireOutput()
+ public function testLocalRequireOutput(): void
{
$this->fs->put($this->filename, $this->content);
@@ -252,7 +249,7 @@ public function testLocalRequireOutput()
$this->assertSame($this->content, $output);
}
- public function testLocalRequireReturn()
+ public function testLocalRequireReturn(): void
{
$this->fs->put($this->filename, " 'abc'];");
@@ -265,7 +262,7 @@ public function testLocalRequireReturn()
$this->assertEquals($result['key'], 'abc');
}
- public function testLocalRequireBehavior()
+ public function testLocalRequireBehavior(): void
{
$this->fs->put($this->filename, 'assertEquals(3, $GLOBALS['include_count']);
}
- public function testLocalRequireOnceBehavior()
+ public function testLocalRequireOnceBehavior(): void
{
$file = base_dir() . DS . 'track1.txt';
@@ -291,7 +288,7 @@ public function testLocalRequireOnceBehavior()
$this->fs->remove($file);
}
- public function testLocalIncludeOutput()
+ public function testLocalIncludeOutput(): void
{
$this->fs->put($this->filename, $this->content);
@@ -304,7 +301,7 @@ public function testLocalIncludeOutput()
$this->assertSame($this->content, $output);
}
- public function testLocalIncludeReturn()
+ public function testLocalIncludeReturn(): void
{
$this->fs->put($this->filename, " 'abc'];");
@@ -317,7 +314,7 @@ public function testLocalIncludeReturn()
$this->assertEquals($result['key'], 'abc');
}
- public function testLocalIncludeBehavior()
+ public function testLocalIncludeBehavior(): void
{
$this->fs->put($this->filename, 'assertEquals(3, $GLOBALS['include_count']);
}
- public function testLocalIncludeOnceBehavior()
+ public function testLocalIncludeOnceBehavior(): void
{
$file = base_dir() . DS . 'track2.txt';
diff --git a/tests/Unit/Storage/Factories/FileSystemFactoryTest.php b/tests/Unit/Storage/Factories/FileSystemFactoryTest.php
index 271531996..92214cff9 100644
--- a/tests/Unit/Storage/Factories/FileSystemFactoryTest.php
+++ b/tests/Unit/Storage/Factories/FileSystemFactoryTest.php
@@ -17,42 +17,42 @@ public function setUp(): void
parent::setUp();
}
- public function testFileSystemFactoryInstance()
+ public function testFileSystemFactoryInstance(): void
{
$fs = FileSystemFactory::get();
$this->assertInstanceOf(FileSystem::class, $fs);
}
- public function testFileSystemFactoryDefaultAdapter()
+ public function testFileSystemFactoryDefaultAdapter(): void
{
$fs = FileSystemFactory::get();
$this->assertInstanceOf(LocalFileSystemAdapter::class, $fs->getAdapter());
}
- public function testFileSystemFactoryLocalAdapter()
+ public function testFileSystemFactoryLocalAdapter(): void
{
$fs = FileSystemFactory::get(FileSystem::LOCAL);
$this->assertInstanceOf(LocalFileSystemAdapter::class, $fs->getAdapter());
}
- public function testFileSystemFactoryDropboxAdapter()
+ public function testFileSystemFactoryDropboxAdapter(): void
{
$fs = FileSystemFactory::get(FileSystem::DROPBOX);
$this->assertInstanceOf(DropboxFileSystemAdapter::class, $fs->getAdapter());
}
- public function testFileSystemFactoryGoogleDriveAdapter()
+ public function testFileSystemFactoryGoogleDriveAdapter(): void
{
$fs = FileSystemFactory::get(FileSystem::GDRIVE);
$this->assertInstanceOf(GoogleDriveFileSystemAdapter::class, $fs->getAdapter());
}
- public function testFileSystemFactoryInvalidTypeAdapter()
+ public function testFileSystemFactoryInvalidTypeAdapter(): void
{
$this->expectException(FileSystemException::class);
@@ -61,7 +61,7 @@ public function testFileSystemFactoryInvalidTypeAdapter()
FileSystemFactory::get('invalid_type');
}
- public function testFileSystemFactoryReturnsSameInstance()
+ public function testFileSystemFactoryReturnsSameInstance(): void
{
$fs1 = FileSystemFactory::get(FileSystem::LOCAL);
$fs2 = FileSystemFactory::get(FileSystem::LOCAL);
diff --git a/tests/Unit/Storage/FileSystemTest.php b/tests/Unit/Storage/FileSystemTest.php
index a95faa1ec..88a92299f 100644
--- a/tests/Unit/Storage/FileSystemTest.php
+++ b/tests/Unit/Storage/FileSystemTest.php
@@ -27,7 +27,7 @@ public function setUp(): void
$this->googleDriveAppMock = Mockery::mock(GoogleDriveApp::class);
}
- public function testFileSystemGetAdapter()
+ public function testFileSystemGetAdapter(): void
{
$localFs = new FileSystem(new LocalFileSystemAdapter());
@@ -48,14 +48,14 @@ public function testFileSystemGetAdapter()
$this->assertInstanceOf(FilesystemAdapterInterface::class, $googleDriveFs->getAdapter());
}
- public function testFileSystemCallingValidMethod()
+ public function testFileSystemCallingValidMethod(): void
{
$fs = new FileSystem(new LocalFileSystemAdapter());
$this->assertFalse($fs->exists('test.txt'));
}
- public function testMailerCallingInvalidMethod()
+ public function testMailerCallingInvalidMethod(): void
{
$mailer = new FileSystem(new LocalFileSystemAdapter());
diff --git a/tests/Unit/Storage/Helpers/FileSystemHelperFunctionsTest.php b/tests/Unit/Storage/Helpers/FileSystemHelperFunctionsTest.php
index c4a3ad1c1..0c2f69150 100644
--- a/tests/Unit/Storage/Helpers/FileSystemHelperFunctionsTest.php
+++ b/tests/Unit/Storage/Helpers/FileSystemHelperFunctionsTest.php
@@ -10,28 +10,28 @@
class FileSystemHelperFunctionsTest extends AppTestCase
{
- public function testFileSystemHelperGetDefaultFileSystem()
+ public function testFileSystemHelperGetDefaultFileSystem(): void
{
$this->assertInstanceOf(FileSystem::class, fs());
$this->assertInstanceOf(LocalFileSystemAdapter::class, fs()->getAdapter());
}
- public function testFileSystemHelperGetLocalFileSystem()
+ public function testFileSystemHelperGetLocalFileSystem(): void
{
$this->assertInstanceOf(FileSystem::class, fs(FileSystem::LOCAL));
$this->assertInstanceOf(LocalFileSystemAdapter::class, fs(FileSystem::LOCAL)->getAdapter());
}
- public function testFileSystemHelperGetDropboxFileSystem()
+ public function testFileSystemHelperGetDropboxFileSystem(): void
{
$this->assertInstanceOf(FileSystem::class, fs(FileSystem::DROPBOX));
$this->assertInstanceOf(DropboxFileSystemAdapter::class, fs(FileSystem::DROPBOX)->getAdapter());
}
- public function testFileSystemHelperGetGoogleDriveFileSystem()
+ public function testFileSystemHelperGetGoogleDriveFileSystem(): void
{
$this->assertInstanceOf(FileSystem::class, fs(FileSystem::GDRIVE));
diff --git a/tests/Unit/Storage/HttpClientTestCase.php b/tests/Unit/Storage/HttpClientTestCase.php
index 4d2686fa3..ae1cf845f 100644
--- a/tests/Unit/Storage/HttpClientTestCase.php
+++ b/tests/Unit/Storage/HttpClientTestCase.php
@@ -42,7 +42,7 @@ protected function mockHttpClient()
return $httpClientMock;
});
- $httpClientMock->shouldReceive('getErrors')->andReturnUsing(fn () => (array) $this->response[$this->url]['errors']);
+ $httpClientMock->shouldReceive('getErrors')->andReturnUsing(fn (): array => (array) $this->response[$this->url]['errors']);
$httpClientMock->shouldReceive('getResponseBody')->andReturnUsing(fn () => $this->response[$this->url]['body']);
diff --git a/tests/Unit/Storage/UploadedFileTest.php b/tests/Unit/Storage/UploadedFileTest.php
index f3536c7c3..5982253c1 100644
--- a/tests/Unit/Storage/UploadedFileTest.php
+++ b/tests/Unit/Storage/UploadedFileTest.php
@@ -26,7 +26,7 @@ protected function moveUploadedFile(string $filePath): bool
class UploadedFileTest extends AppTestCase
{
- private $fileMeta;
+ private array $fileMeta;
public function setUp(): void
{
@@ -52,14 +52,14 @@ public function tearDown(): void
}
}
- public function testUploadedFileConstructor()
+ public function testUploadedFileConstructor(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
$this->assertInstanceOf(UploadedFile::class, $uploadedFile);
}
- public function testUploadedFileGetSetName()
+ public function testUploadedFileGetSetName(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
@@ -70,7 +70,7 @@ public function testUploadedFileGetSetName()
$this->assertEquals('bar', $uploadedFile->getName());
}
- public function testUploadedFileSetGetRemoteFileSystem()
+ public function testUploadedFileSetGetRemoteFileSystem(): void
{
$dropboxAppMock = Mockery::mock(DropboxApp::class);
@@ -81,35 +81,35 @@ public function testUploadedFileSetGetRemoteFileSystem()
}
- public function testUploadedFileGetExtension()
+ public function testUploadedFileGetExtension(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
$this->assertEquals('jpg', $uploadedFile->getExtension());
}
- public function testUploadedFileGetNameWithExtension()
+ public function testUploadedFileGetNameWithExtension(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
$this->assertEquals('foo.jpg', $uploadedFile->getNameWithExtension());
}
- public function testUploadedFileGetMimeType()
+ public function testUploadedFileGetMimeType(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
$this->assertSame('image/jpeg', $uploadedFile->getMimeType());
}
- public function testUploadedFileGetMd5()
+ public function testUploadedFileGetMd5(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
$this->assertIsString($uploadedFile->getMd5());
}
- public function testUploadedFileGetDimensions()
+ public function testUploadedFileGetDimensions(): void
{
$uploadedFile = new UploadedFile($this->fileMeta);
@@ -118,7 +118,7 @@ public function testUploadedFileGetDimensions()
$this->assertEquals(300, $uploadedFile->getDimensions()['height']);
}
- public function testUploadedFileUploadWithoutFileSent()
+ public function testUploadedFileUploadWithoutFileSent(): void
{
$fileMeta = [
'size' => 500,
@@ -137,7 +137,7 @@ public function testUploadedFileUploadWithoutFileSent()
$this->assertFalse($uploadedFile->save(base_dir()));
}
- public function testUploadedFileUploadAndSave()
+ public function testUploadedFileUploadAndSave(): void
{
$uploadedFile = new UploadedDouble($this->fileMeta);
@@ -148,7 +148,7 @@ public function testUploadedFileUploadAndSave()
$this->assertTrue(file_exists(base_dir() . DS . $uploadedFile->getNameWithExtension()));
}
- public function testUploadedFileUploadNotAllowedExtensionForMimeType()
+ public function testUploadedFileUploadNotAllowedExtensionForMimeType(): void
{
$fileMeta = $this->fileMeta;
$fileMeta['name'] = 'foo.php';
@@ -161,7 +161,7 @@ public function testUploadedFileUploadNotAllowedExtensionForMimeType()
$uploadedFile->save(base_dir());
}
- public function testUploadedFileUploadNotAllowedMimeType()
+ public function testUploadedFileUploadNotAllowedMimeType(): void
{
$fileMeta = $this->fileMeta;
$fileMeta['name'] = 'foo.jpg';
@@ -175,7 +175,7 @@ public function testUploadedFileUploadNotAllowedMimeType()
$uploadedFile->save(base_dir());
}
- public function testUploadedFileUploadAllowedAfterSetterOverride()
+ public function testUploadedFileUploadAllowedAfterSetterOverride(): void
{
$fileMeta = $this->fileMeta;
$fileMeta['name'] = 'foo.txt';
@@ -191,7 +191,7 @@ public function testUploadedFileUploadAllowedAfterSetterOverride()
$this->assertTrue(file_exists(base_dir() . DS . $uploadedFile->getNameWithExtension()));
}
- public function testUploadedFileSaveAndTryOverwrite()
+ public function testUploadedFileSaveAndTryOverwrite(): void
{
$uploadedFile = new UploadedDouble($this->fileMeta);
@@ -208,7 +208,7 @@ public function testUploadedFileSaveAndTryOverwrite()
$uploadedFile->save(base_dir());
}
- public function testUploadedFileSaveAndOverwrite()
+ public function testUploadedFileSaveAndOverwrite(): void
{
$uploadedFile = new UploadedDouble($this->fileMeta);
@@ -219,7 +219,7 @@ public function testUploadedFileSaveAndOverwrite()
$this->assertTrue($uploadedFile->save(base_dir(), true));
}
- public function testUploadedFileModifyAndSave()
+ public function testUploadedFileModifyAndSave(): void
{
$uploadedFile = new UploadedDouble($this->fileMeta);
@@ -234,7 +234,7 @@ public function testUploadedFileModifyAndSave()
$this->assertEquals(100, $img[1]);
}
- public function testUploadedFileGetErrorCodeAndMessage()
+ public function testUploadedFileGetErrorCodeAndMessage(): void
{
$fileMeta = [
'size' => 500,
diff --git a/tests/Unit/Transformer/Helpers/TransformerHelperFunctionsTest.php b/tests/Unit/Transformer/Helpers/TransformerHelperFunctionsTest.php
index ed91828ab..6e30d05aa 100644
--- a/tests/Unit/Transformer/Helpers/TransformerHelperFunctionsTest.php
+++ b/tests/Unit/Transformer/Helpers/TransformerHelperFunctionsTest.php
@@ -51,7 +51,7 @@ class TransformerHelperFunctionsTest extends AppTestCase
'author' => 'Ken Watson',
],
];
- public function testTransformerHelper()
+ public function testTransformerHelper(): void
{
$transformed = transform($this->posts, new PostTransformer());
diff --git a/tests/Unit/Transformer/PostTransformer.php b/tests/Unit/Transformer/PostTransformer.php
index 5662f6304..b8b2b9aaa 100644
--- a/tests/Unit/Transformer/PostTransformer.php
+++ b/tests/Unit/Transformer/PostTransformer.php
@@ -6,7 +6,7 @@
class PostTransformer implements TransformerInterface
{
- public function transform($item)
+ public function transform($item): array
{
return [
'id' => $item['id'],
diff --git a/tests/Unit/Transformer/TransformerTest.php b/tests/Unit/Transformer/TransformerTest.php
index 5c058087e..e2f7d5a02 100644
--- a/tests/Unit/Transformer/TransformerTest.php
+++ b/tests/Unit/Transformer/TransformerTest.php
@@ -52,7 +52,7 @@ class TransformerTest extends TestCase
],
];
- public function testDataTransforming()
+ public function testDataTransforming(): void
{
$transformed = Transformer::transform($this->posts, new PostTransformer());
diff --git a/tests/Unit/Validation/Traits/FileRuleTest.php b/tests/Unit/Validation/Traits/FileRuleTest.php
index 3e3f8d949..4a3d3ccc5 100644
--- a/tests/Unit/Validation/Traits/FileRuleTest.php
+++ b/tests/Unit/Validation/Traits/FileRuleTest.php
@@ -9,8 +9,8 @@
class FileRuleTest extends AppTestCase
{
- public $validator;
- private $request;
+ public Validator $validator;
+ private Request $request;
public function setUp(): void
{
@@ -39,7 +39,7 @@ public function tearDown(): void
unlink(base_dir() . DS . 'php8fe2.tmp');
}
- public function testRuleFileSize()
+ public function testRuleFileSize(): void
{
$file = [
'image' => [
@@ -72,7 +72,7 @@ public function testRuleFileSize()
$this->assertEquals('validation.fileSize', $errors['image'][0]);
}
- public function testRuleFileMimeType()
+ public function testRuleFileMimeType(): void
{
$file = [
'image' => [
@@ -111,7 +111,7 @@ public function testRuleFileMimeType()
$this->assertEquals('validation.fileMimeType', $errors['image'][0]);
}
- public function testRuleFileExtension()
+ public function testRuleFileExtension(): void
{
$file = [
'image' => [
@@ -150,7 +150,7 @@ public function testRuleFileExtension()
$this->assertEquals('validation.fileExtension', $errors['image'][0]);
}
- public function testRuleImageDimensions()
+ public function testRuleImageDimensions(): void
{
$file = [
'image' => [
diff --git a/tests/Unit/Validation/Traits/GeneralRuleTest.php b/tests/Unit/Validation/Traits/GeneralRuleTest.php
index 0f658de8c..27b75633e 100644
--- a/tests/Unit/Validation/Traits/GeneralRuleTest.php
+++ b/tests/Unit/Validation/Traits/GeneralRuleTest.php
@@ -12,7 +12,7 @@
class GeneralRuleTest extends AppTestCase
{
- public $validator;
+ public Validator $validator;
public function setUp(): void
{
parent::setUp();
@@ -33,7 +33,7 @@ public function tearDown(): void
Database::execute('DROP TABLE IF EXISTS users');
}
- public function testRuleRequired()
+ public function testRuleRequired(): void
{
$this->validator->setRule('text', [
Rule::required(),
@@ -52,7 +52,7 @@ public function testRuleRequired()
$this->assertEquals('validation.required', $errors['text'][0]);
}
- public function testRuleEmail()
+ public function testRuleEmail(): void
{
$this->validator->setRule('text', [
Rule::email(),
@@ -69,7 +69,7 @@ public function testRuleEmail()
$this->assertEquals('validation.email', $errors['text'][0]);
}
- public function testRuleCreditCard()
+ public function testRuleCreditCard(): void
{
$this->validator->setRule('text', [
Rule::creditCard(),
@@ -86,7 +86,7 @@ public function testRuleCreditCard()
$this->assertEquals('validation.creditCard', $errors['text'][0]);
}
- public function testRuleIban()
+ public function testRuleIban(): void
{
$this->validator->setRule('text', [
Rule::iban(),
@@ -105,7 +105,7 @@ public function testRuleIban()
$this->assertEquals('validation.iban', $errors['text'][0]);
}
- public function testRuleName()
+ public function testRuleName(): void
{
$this->validator->setRule('text', [
Rule::name(),
@@ -126,7 +126,7 @@ public function testRuleName()
$this->assertEquals('validation.name', $errors['text'][0]);
}
- public function testRuleStreetAddress()
+ public function testRuleStreetAddress(): void
{
$this->validator->setRule('text', [
Rule::streetAddress(),
@@ -147,7 +147,7 @@ public function testRuleStreetAddress()
$this->assertEquals('validation.streetAddress', $errors['text'][0]);
}
- public function testRulePhoneNumber()
+ public function testRulePhoneNumber(): void
{
$this->validator->setRule('text', [
Rule::phoneNumber(),
@@ -176,7 +176,7 @@ public function testRulePhoneNumber()
$this->assertEquals('validation.phoneNumber', $errors['text'][0]);
}
- public function testRuleDate()
+ public function testRuleDate(): void
{
$this->validator->setRule('text', [
Rule::date(),
@@ -207,7 +207,7 @@ public function testRuleDate()
$this->assertEquals('validation.date', $errors['text'][0]);
}
- public function testRuleStarts()
+ public function testRuleStarts(): void
{
$this->validator->setRule('text', [
Rule::starts('b'),
@@ -230,7 +230,7 @@ public function testRuleStarts()
$this->assertEquals('validation.starts', $errors['text'][0]);
}
- public function testRuleRegex()
+ public function testRuleRegex(): void
{
$this->validator->setRule('text', [
Rule::regex('/^[1-9]+$/'),
@@ -255,7 +255,7 @@ public function testRuleRegex()
$this->assertEquals('validation.regex', $errors['text'][0]);
}
- public function testRuleJsonString()
+ public function testRuleJsonString(): void
{
$this->validator->setRule('text', [
Rule::jsonString(),
@@ -272,7 +272,7 @@ public function testRuleJsonString()
$this->assertEquals('validation.jsonString', $errors['text'][0]);
}
- public function testRuleSame()
+ public function testRuleSame(): void
{
$this->validator->setRule('password', [
Rule::same('confirm_password'),
@@ -289,7 +289,7 @@ public function testRuleSame()
$this->assertEquals('validation.same', $errors['password'][0]);
}
- public function testRuleUnique()
+ public function testRuleUnique(): void
{
$this->createUsersTable();
@@ -310,7 +310,7 @@ public function testRuleUnique()
$this->assertEquals('validation.unique', $errors['username'][0]);
}
- public function testRuleExists()
+ public function testRuleExists(): void
{
$this->createUsersTable();
diff --git a/tests/Unit/Validation/Traits/LengthRuleTest.php b/tests/Unit/Validation/Traits/LengthRuleTest.php
index 9837a441d..2a505454c 100644
--- a/tests/Unit/Validation/Traits/LengthRuleTest.php
+++ b/tests/Unit/Validation/Traits/LengthRuleTest.php
@@ -8,7 +8,7 @@
class LengthRuleTest extends AppTestCase
{
- public $validator;
+ public Validator $validator;
public function setUp(): void
{
@@ -18,7 +18,7 @@ public function setUp(): void
}
- public function testRuleMinLen()
+ public function testRuleMinLen(): void
{
$this->validator->setRule('text', [
Rule::minLen(3),
@@ -35,7 +35,7 @@ public function testRuleMinLen()
$this->assertEquals('validation.minLen', $errors['text'][0]);
}
- public function testRuleMaxLen()
+ public function testRuleMaxLen(): void
{
$this->validator->setRule('text', [
Rule::maxLen(5),
@@ -52,7 +52,7 @@ public function testRuleMaxLen()
$this->assertEquals('validation.maxLen', $errors['text'][0]);
}
- public function testRuleExactLen()
+ public function testRuleExactLen(): void
{
$this->validator->setRule('text', [
Rule::exactLen(4),
diff --git a/tests/Unit/Validation/Traits/ListRuleTest.php b/tests/Unit/Validation/Traits/ListRuleTest.php
index f1dd49512..a47911c51 100644
--- a/tests/Unit/Validation/Traits/ListRuleTest.php
+++ b/tests/Unit/Validation/Traits/ListRuleTest.php
@@ -8,8 +8,7 @@
class ListRuleTest extends AppTestCase
{
- public $validator;
- private $request;
+ public Validator $validator;
public function setUp(): void
{
@@ -19,7 +18,7 @@ public function setUp(): void
}
- public function testRuleContains()
+ public function testRuleContains(): void
{
$this->validator->setRule('text', [
Rule::contains('Fisherman goes out'),
@@ -40,7 +39,7 @@ public function testRuleContains()
$this->assertEquals('validation.contains', $errors['text'][0]);
}
- public function testRuleContainsList()
+ public function testRuleContainsList(): void
{
$this->validator->setRule('text', [
Rule::containsList('male', 'female'),
@@ -59,7 +58,7 @@ public function testRuleContainsList()
$this->assertEquals('validation.containsList', $errors['text'][0]);
}
- public function testRuleDoesntContainsList()
+ public function testRuleDoesntContainsList(): void
{
$this->validator->setRule('text', [
Rule::doesntContainsList('male', 'famale'),
diff --git a/tests/Unit/Validation/Traits/ResourceRuleTest.php b/tests/Unit/Validation/Traits/ResourceRuleTest.php
index b5ee157cf..313bf0820 100644
--- a/tests/Unit/Validation/Traits/ResourceRuleTest.php
+++ b/tests/Unit/Validation/Traits/ResourceRuleTest.php
@@ -8,7 +8,7 @@
class ResourceRuleTest extends AppTestCase
{
- public $validator;
+ public Validator $validator;
public function setUp(): void
{
@@ -18,7 +18,7 @@ public function setUp(): void
}
- public function testRuleUrl()
+ public function testRuleUrl(): void
{
$this->validator->setRule('text', [
Rule::url(),
@@ -39,7 +39,7 @@ public function testRuleUrl()
$this->assertEquals('validation.url', $errors['text'][0]);
}
- public function testRuleUrlExists()
+ public function testRuleUrlExists(): void
{
$this->validator->setRule('text', [
Rule::urlExists(),
@@ -56,7 +56,7 @@ public function testRuleUrlExists()
$this->assertEquals('validation.urlExists', $errors['text'][0]);
}
- public function testRuleIp()
+ public function testRuleIp(): void
{
$this->validator->setRule('text', [
Rule::ip(),
@@ -73,7 +73,7 @@ public function testRuleIp()
$this->assertEquals('validation.ip', $errors['text'][0]);
}
- public function testRuleIpV4()
+ public function testRuleIpV4(): void
{
$this->validator->setRule('text', [
Rule::ipv4(),
@@ -90,7 +90,7 @@ public function testRuleIpV4()
$this->assertEquals('validation.ipv4', $errors['text'][0]);
}
- public function testRuleIpV6()
+ public function testRuleIpV6(): void
{
$this->validator->setRule('text', [
Rule::ipv6(),
diff --git a/tests/Unit/Validation/Traits/TypeRuleTest.php b/tests/Unit/Validation/Traits/TypeRuleTest.php
index d2a2ce052..75ae1cce1 100644
--- a/tests/Unit/Validation/Traits/TypeRuleTest.php
+++ b/tests/Unit/Validation/Traits/TypeRuleTest.php
@@ -8,7 +8,7 @@
class TypeRuleTest extends AppTestCase
{
- public $validator;
+ public Validator $validator;
public function setUp(): void
{
parent::setUp();
@@ -16,7 +16,7 @@ public function setUp(): void
$this->validator = new Validator();
}
- public function testRuleAlpha()
+ public function testRuleAlpha(): void
{
$this->validator->setRule('text', [
Rule::alpha(),
@@ -35,7 +35,7 @@ public function testRuleAlpha()
$this->assertEquals('validation.alpha', $errors['text'][0]);
}
- public function testRuleAlphaNumeric()
+ public function testRuleAlphaNumeric(): void
{
$this->validator->setRule('text', [
Rule::alphaNumeric(),
@@ -56,7 +56,7 @@ public function testRuleAlphaNumeric()
$this->assertEquals('validation.alphaNumeric', $errors['text'][0]);
}
- public function testRuleAlphaDash()
+ public function testRuleAlphaDash(): void
{
$this->validator->setRule('text', [
Rule::alphaDash(),
@@ -75,7 +75,7 @@ public function testRuleAlphaDash()
$this->assertEquals('validation.alphaDash', $errors['text'][0]);
}
- public function testRuleAlphaSpace()
+ public function testRuleAlphaSpace(): void
{
$this->validator->setRule('text', [
Rule::alphaSpace(),
@@ -96,7 +96,7 @@ public function testRuleAlphaSpace()
$this->assertEquals('validation.alphaSpace', $errors['text'][0]);
}
- public function testRuleNumeric()
+ public function testRuleNumeric(): void
{
$this->validator->setRule('text', [
Rule::numeric(),
@@ -115,7 +115,7 @@ public function testRuleNumeric()
$this->assertEquals('validation.numeric', $errors['text'][0]);
}
- public function testRuleInteger()
+ public function testRuleInteger(): void
{
$this->validator->setRule('text', [
Rule::integer(),
@@ -134,7 +134,7 @@ public function testRuleInteger()
$this->assertEquals('validation.integer', $errors['text'][0]);
}
- public function testRuleFloat()
+ public function testRuleFloat(): void
{
$this->validator->setRule('text', [
Rule::float(),
@@ -155,7 +155,7 @@ public function testRuleFloat()
$this->assertEquals('validation.float', $errors['text'][0]);
}
- public function testRuleBoolean()
+ public function testRuleBoolean(): void
{
$this->validator->setRule('text', [
Rule::boolean(),
@@ -182,7 +182,7 @@ public function testRuleBoolean()
$this->assertEquals('validation.boolean', $errors['text'][0]);
}
- public function testRuleMinNumeric()
+ public function testRuleMinNumeric(): void
{
$this->validator->setRule('text', [
Rule::minNumeric(20),
@@ -199,7 +199,7 @@ public function testRuleMinNumeric()
$this->assertEquals('validation.minNumeric', $errors['text'][0]);
}
- public function testRuleMaxNumeric()
+ public function testRuleMaxNumeric(): void
{
$this->validator->setRule('text', [
Rule::maxNumeric(20),
diff --git a/tests/Unit/Validation/ValidatorTest.php b/tests/Unit/Validation/ValidatorTest.php
index 82659c243..503647b0d 100644
--- a/tests/Unit/Validation/ValidatorTest.php
+++ b/tests/Unit/Validation/ValidatorTest.php
@@ -8,7 +8,7 @@
class ValidatorTest extends AppTestCase
{
- private $validator;
+ private Validator $validator;
public function setUp(): void
{
@@ -17,12 +17,12 @@ public function setUp(): void
$this->validator = new Validator();
}
- public function testValidatorConstructor()
+ public function testValidatorConstructor(): void
{
$this->assertInstanceOf(Validator::class, $this->validator);
}
- public function testAddUpdateDeleteRule()
+ public function testAddUpdateDeleteRule(): void
{
$this->validator->setRule('text', [
Rule::minLen(5),
@@ -46,7 +46,7 @@ public function testAddUpdateDeleteRule()
$this->assertTrue($this->validator->isValid(['text' => 'some long text goes']));
}
- public function testMultipleRules()
+ public function testMultipleRules(): void
{
$this->validator->setRule('text', [
Rule::minLen(7),
@@ -75,7 +75,7 @@ public function testMultipleRules()
$this->assertEquals('validation.maxLen', $errors['text'][0]);
}
- public function testMultipleFields()
+ public function testMultipleFields(): void
{
$this->validator->setRules([
'name' => [
@@ -134,7 +134,7 @@ public function testMultipleFields()
$this->assertFalse($this->validator->isValid($data));
}
- public function testDifferentMultipleFields()
+ public function testDifferentMultipleFields(): void
{
$this->validator->setRules([
'name' => [
@@ -166,9 +166,9 @@ public function testDifferentMultipleFields()
$this->assertTrue($this->validator->isValid($data));
}
- public function testCustomValidator()
+ public function testCustomValidator(): void
{
- $this->validator->addRule('checkName', fn ($value, $param = null) => $value == $param);
+ $this->validator->addRule('checkName', fn ($value, $param = null): bool => $value == $param);
$this->validator->setRules([
'name' => [
diff --git a/tests/Unit/View/Factories/ViewFactoryTest.php b/tests/Unit/View/Factories/ViewFactoryTest.php
index 92b033230..e87edf72b 100644
--- a/tests/Unit/View/Factories/ViewFactoryTest.php
+++ b/tests/Unit/View/Factories/ViewFactoryTest.php
@@ -8,7 +8,7 @@
class ViewFactoryTest extends AppTestCase
{
- private $viewFactory;
+ private ViewFactory $viewFactory;
public function setUp(): void
{
@@ -17,12 +17,12 @@ public function setUp(): void
$this->viewFactory = new ViewFactory();
}
- public function testGetInstance()
+ public function testGetInstance(): void
{
$this->assertInstanceOf(QtView::class, $this->viewFactory->get());
}
- public function testProxyCalls()
+ public function testProxyCalls(): void
{
$view = $this->viewFactory->get();
diff --git a/tests/Unit/View/Helpers/ViewHelperTest.php b/tests/Unit/View/Helpers/ViewHelperTest.php
index 7b0b29d0c..a0e8dbe4e 100644
--- a/tests/Unit/View/Helpers/ViewHelperTest.php
+++ b/tests/Unit/View/Helpers/ViewHelperTest.php
@@ -8,10 +8,11 @@
use Quantum\Http\Request;
use Quantum\Di\Di;
use Quantum\Tests\Unit\AppTestCase;
+use Quantum\View\QtView;
class ViewHelperTest extends AppTestCase
{
- private $view;
+ private QtView $view;
public function setUp(): void
{
@@ -40,7 +41,7 @@ public function tearDown(): void
$this->view->setLayout(null);
}
- public function testView()
+ public function testView(): void
{
$this->view->setLayout('layout');
@@ -49,7 +50,7 @@ public function testView()
$this->assertEquals('Hello World, this is rendered html view
', view());
}
- public function testPartial()
+ public function testPartial(): void
{
$this->assertEquals('Hello World, this is rendered partial html view
', partial('partial'));
diff --git a/tests/Unit/View/QtViewTest.php b/tests/Unit/View/QtViewTest.php
index 766270b69..50ade78e6 100644
--- a/tests/Unit/View/QtViewTest.php
+++ b/tests/Unit/View/QtViewTest.php
@@ -6,6 +6,7 @@
use Quantum\View\Factories\ViewFactory;
use Quantum\Tests\Unit\AppTestCase;
use Quantum\Router\MatchedRoute;
+use Quantum\View\QtView;
use Quantum\View\RawParam;
use Quantum\Router\Route;
use Quantum\Http\Request;
@@ -13,7 +14,7 @@
class QtViewTest extends AppTestCase
{
- private $view;
+ private QtView $view;
public function setUp(): void
{
@@ -45,7 +46,7 @@ public function tearDown(): void
$this->view->flushParams();
}
- public function testSetGetLayout()
+ public function testSetGetLayout(): void
{
$this->assertNull($this->view->getLayout());
@@ -56,7 +57,7 @@ public function testSetGetLayout()
$this->assertIsString($this->view->getLayout());
}
- public function testSetGetParams()
+ public function testSetGetParams(): void
{
$this->assertEmpty($this->view->getParams());
@@ -75,7 +76,7 @@ public function testSetGetParams()
$this->assertNotEmpty($this->view->getParams());
}
- public function testSetGetRawParams()
+ public function testSetGetRawParams(): void
{
$this->assertEmpty($this->view->getParams());
@@ -103,7 +104,7 @@ public function testSetGetRawParams()
$this->assertEquals('Monkey people
', $this->view->getParam('chapter_two'));
}
- public function testRenderWithoutLayout()
+ public function testRenderWithoutLayout(): void
{
$this->expectException(ViewException::class);
@@ -112,7 +113,7 @@ public function testRenderWithoutLayout()
$this->view->render('index');
}
- public function testRenderWithLayout()
+ public function testRenderWithLayout(): void
{
$this->view->setLayout('layout');
@@ -123,7 +124,7 @@ public function testRenderWithLayout()
$this->assertEquals('' . PHP_EOL . '' . PHP_EOL . '' . PHP_EOL . 'Hello World, this is rendered html view
' . PHP_EOL . '' . PHP_EOL, $renderedView);
}
- public function testRenderWithData()
+ public function testRenderWithData(): void
{
$this->view->setLayout('layout');
@@ -138,7 +139,7 @@ public function testRenderWithData()
$this->assertEquals('Hello dolor sit amet, this is rendered html view
', $this->view->getView());
}
- public function testRenderWithEscapedHtmlData()
+ public function testRenderWithEscapedHtmlData(): void
{
$this->view->setLayout('layout');
@@ -149,7 +150,7 @@ public function testRenderWithEscapedHtmlData()
$this->assertEquals('<h1>Hello</h1>', $this->view->getView());
}
- public function testRenderWithUnEscapedHtmlData()
+ public function testRenderWithUnEscapedHtmlData(): void
{
$this->view->setLayout('layout');
@@ -160,7 +161,7 @@ public function testRenderWithUnEscapedHtmlData()
$this->assertEquals('Hello
', $this->view->getView());
}
- public function testRenderPartial()
+ public function testRenderPartial(): void
{
$this->assertIsString($this->view->renderPartial('partial'));
diff --git a/tests/Unit/View/RawParamTest.php b/tests/Unit/View/RawParamTest.php
index df5523b6b..f10e8f4e6 100644
--- a/tests/Unit/View/RawParamTest.php
+++ b/tests/Unit/View/RawParamTest.php
@@ -7,39 +7,39 @@
class RawParamTest extends AppTestCase
{
- public function testStoresAndReturnsString()
+ public function testStoresAndReturnsString(): void
{
$raw = new RawParam('test');
$this->assertSame('test', $raw->getValue());
}
- public function testStoresAndReturnsInteger()
+ public function testStoresAndReturnsInteger(): void
{
$raw = new RawParam(123);
$this->assertSame(123, $raw->getValue());
}
- public function testStoresAndReturnsArray()
+ public function testStoresAndReturnsArray(): void
{
$value = ['key' => 'value'];
$raw = new RawParam($value);
$this->assertSame($value, $raw->getValue());
}
- public function testStoresAndReturnsObject()
+ public function testStoresAndReturnsObject(): void
{
$value = (object) ['foo' => 'bar'];
$raw = new RawParam($value);
$this->assertSame($value, $raw->getValue());
}
- public function testStoresAndReturnsNull()
+ public function testStoresAndReturnsNull(): void
{
$raw = new RawParam(null);
$this->assertNull($raw->getValue());
}
- public function testStoresAndReturnsBoolean()
+ public function testStoresAndReturnsBoolean(): void
{
$rawTrue = new RawParam(true);
$rawFalse = new RawParam(false);
diff --git a/tests/_root/modules/Test/Controllers/TestController.php b/tests/_root/modules/Test/Controllers/TestController.php
index 17e48e18a..bf5079b6a 100644
--- a/tests/_root/modules/Test/Controllers/TestController.php
+++ b/tests/_root/modules/Test/Controllers/TestController.php
@@ -4,7 +4,7 @@
class TestController
{
- public function tests()
+ public function tests(): void
{
//
}
diff --git a/tests/_root/modules/Test/routes/routes.php b/tests/_root/modules/Test/routes/routes.php
index a5cd9152d..cf056a4e0 100644
--- a/tests/_root/modules/Test/routes/routes.php
+++ b/tests/_root/modules/Test/routes/routes.php
@@ -1,6 +1,6 @@
get('[:alpha:2]?/tests', 'TestController', 'tests');
$route->get('[:alpha:2]?/Test/[id=:any]', 'TestController', 'test');
};
diff --git a/tests/_root/shared/Commands/TestCommand.php b/tests/_root/shared/Commands/TestCommand.php
index 267a00ad9..d7f72e645 100644
--- a/tests/_root/shared/Commands/TestCommand.php
+++ b/tests/_root/shared/Commands/TestCommand.php
@@ -6,19 +6,19 @@
class TestCommand extends QtCommand
{
- protected $name = 'test:dummy';
- protected $description = 'Dummy test command';
- protected $help = 'Used only for core command discovery tests';
+ protected ?string $name = 'test:dummy';
+ protected ?string $description = 'Dummy test command';
+ protected ?string $help = 'Used only for core command discovery tests';
- protected $args = [
+ protected array $args = [
['uuid', 'optional', 'User uuid'],
];
- protected $options = [
+ protected array $options = [
['force', 'f', 'none', 'Force execution'],
];
- public function exec()
+ public function exec(): void
{
// intentionally empty
}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 4fa5639eb..8f8fefceb 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -16,6 +16,6 @@
createEnvFile();
-register_shutdown_function(function () {
+register_shutdown_function(function (): void {
removeEnvFile();
});
From aa29eefca75cac2f90dd28c489ad452b543b6b4b Mon Sep 17 00:00:00 2001
From: Arman <407448+armanist@users.noreply.github.com>
Date: Mon, 9 Mar 2026 20:30:45 +0400
Subject: [PATCH 2/3] Configure Rector with dead code cleanup
---
rector.php | 2 +-
src/App/Adapters/AppAdapter.php | 3 -
src/App/Adapters/ConsoleAppAdapter.php | 10 --
src/App/Adapters/WebAppAdapter.php | 3 +-
src/App/App.php | 14 ---
src/App/Contracts/AppInterface.php | 1 -
src/App/Exceptions/AppException.php | 3 -
src/App/Exceptions/BaseException.php | 17 ----
src/App/Exceptions/StopExecutionException.php | 4 -
src/App/Factories/AppFactory.php | 10 --
src/App/Helpers/app.php | 2 -
src/App/Helpers/dir.php | 13 ---
src/App/Helpers/misc.php | 14 ---
src/App/Helpers/uuid.php | 2 -
src/App/Traits/AppTrait.php | 2 -
src/App/Traits/ConsoleAppTrait.php | 9 --
src/App/Traits/WebAppTrait.php | 6 +-
src/Archive/Adapters/PharAdapter.php | 1 -
src/Archive/Adapters/ZipAdapter.php | 3 -
src/Archive/Archive.php | 8 --
src/Archive/Contracts/ArchiveInterface.php | 19 ----
src/Archive/Exceptions/ArchiveException.php | 7 --
src/Archive/Factories/ArchiveFactory.php | 4 -
src/Asset/Asset.php | 27 ------
src/Asset/AssetManager.php | 12 ---
src/Asset/Exceptions/AssetException.php | 9 --
src/Asset/Helpers/asset.php | 3 -
src/Auth/Adapters/JwtAuthAdapter.php | 18 ----
src/Auth/Adapters/SessionAuthAdapter.php | 9 --
src/Auth/Auth.php | 8 --
src/Auth/Contracts/AuthServiceInterface.php | 14 +--
.../Contracts/AuthenticatableInterface.php | 5 -
src/Auth/Exceptions/AuthException.php | 15 ---
src/Auth/Factories/AuthFactory.php | 13 ---
src/Auth/Helpers/auth.php | 2 -
src/Auth/Traits/AuthTrait.php | 30 ------
src/Auth/User.php | 11 ---
src/Cache/Adapters/DatabaseAdapter.php | 8 --
src/Cache/Adapters/FileAdapter.php | 3 -
src/Cache/Adapters/MemcachedAdapter.php | 3 -
src/Cache/Adapters/RedisAdapter.php | 3 -
src/Cache/Cache.php | 7 --
src/Cache/Factories/CacheFactory.php | 9 --
src/Cache/Helpers/cache.php | 2 -
src/Captcha/Adapters/HcaptchaAdapter.php | 2 -
src/Captcha/Adapters/RecaptchaAdapter.php | 2 -
src/Captcha/Captcha.php | 8 --
src/Captcha/Contracts/CaptchaInterface.php | 15 ---
src/Captcha/Factories/CaptchaFactory.php | 9 --
src/Captcha/Helpers/captcha.php | 2 -
src/Captcha/Traits/CaptchaTrait.php | 45 +--------
src/Config/Config.php | 18 +---
src/Config/Exceptions/ConfigException.php | 4 -
src/Config/Helpers/config.php | 1 -
src/Console/CommandDiscovery.php | 3 -
src/Console/Commands/CronRunCommand.php | 10 --
src/Console/Commands/DebugBarCommand.php | 9 --
src/Console/Commands/EnvCommand.php | 4 -
.../Commands/InstallToolkitCommand.php | 6 --
src/Console/Commands/KeyGenerateCommand.php | 5 -
.../Commands/MigrationGenerateCommand.php | 2 -
.../Commands/MigrationMigrateCommand.php | 2 -
.../Commands/ModuleGenerateCommand.php | 4 -
src/Console/Commands/OpenApiCommand.php | 10 --
.../Commands/ResourceCacheClearCommand.php | 39 --------
src/Console/Commands/RouteListCommand.php | 5 -
src/Console/Commands/ServeCommand.php | 22 -----
src/Console/Commands/VersionCommand.php | 3 -
src/Console/QtCommand.php | 23 -----
src/Contracts/StorageInterface.php | 5 -
.../Contracts/CookieStorageInterface.php | 8 --
src/Cookie/Cookie.php | 2 -
src/Cookie/Helpers/cookie.php | 1 -
src/Cron/Contracts/CronTaskInterface.php | 4 -
src/Cron/CronLock.php | 45 +--------
src/Cron/CronManager.php | 21 -----
src/Cron/CronTask.php | 5 -
src/Cron/Exceptions/CronException.php | 15 ---
src/Cron/Helpers/cron.php | 9 --
src/Cron/Schedule.php | 48 +---------
src/Csrf/Csrf.php | 14 ---
src/Csrf/Exceptions/CsrfException.php | 6 --
src/Csrf/Helpers/csrf.php | 2 -
src/Database/Adapters/Idiorm/IdiormDbal.php | 30 ------
src/Database/Adapters/Idiorm/IdiormPatch.php | 16 ----
.../Adapters/Idiorm/Statements/Criteria.php | 4 -
.../Adapters/Idiorm/Statements/Join.php | 8 --
.../Adapters/Idiorm/Statements/Query.php | 2 -
.../Adapters/Idiorm/Statements/Result.php | 1 -
src/Database/Adapters/Sleekdb/SleekDbal.php | 32 -------
.../Adapters/Sleekdb/Statements/Criteria.php | 1 -
.../Adapters/Sleekdb/Statements/Join.php | 22 -----
.../Adapters/Sleekdb/Statements/Model.php | 8 +-
.../Adapters/Sleekdb/Statements/Reducer.php | 4 -
.../Adapters/Sleekdb/Statements/Result.php | 1 -
src/Database/Contracts/DbalInterface.php | 42 ---------
.../Contracts/RelationalInterface.php | 25 -----
src/Database/Database.php | 8 --
src/Database/Exceptions/DatabaseException.php | 15 ---
src/Database/Factories/TableFactory.php | 13 ---
src/Database/Schemas/Column.php | 52 ----------
src/Database/Schemas/Table.php | 39 --------
src/Database/Traits/RelationalTrait.php | 14 ---
src/Database/Traits/TableTrait.php | 16 ----
src/Database/Traits/TransactionTrait.php | 2 -
src/Debugger/Debugger.php | 38 +-------
src/Debugger/DebuggerStore.php | 21 -----
src/Di/Di.php | 27 ------
src/Di/Exceptions/DiException.php | 24 -----
.../Adapters/AsymmetricEncryptionAdapter.php | 5 -
.../Adapters/SymmetricEncryptionAdapter.php | 5 -
.../Contracts/EncryptionInterface.php | 8 --
src/Encryption/Cryptor.php | 14 ---
.../Exceptions/CryptorException.php | 9 --
src/Encryption/Factories/CryptorFactory.php | 7 --
src/Encryption/Helpers/encryption.php | 4 -
src/Environment/Environment.php | 37 --------
src/Environment/Exceptions/EnvException.php | 6 --
src/Environment/Helpers/env.php | 1 -
src/Environment/Helpers/server.php | 3 -
src/Environment/Server.php | 42 ---------
src/Hasher/Exceptions/HasherException.php | 9 --
src/Hasher/Hasher.php | 19 ----
src/Hook/Exceptions/HookException.php | 8 --
src/Hook/Helpers/hook.php | 1 -
src/Hook/HookManager.php | 12 ---
src/Http/Helpers/http.php | 12 ---
src/Http/Request.php | 2 -
src/Http/Request/HttpRequest.php | 22 +----
src/Http/Response.php | 2 -
src/Http/Traits/Request/Body.php | 9 --
src/Http/Traits/Request/File.php | 5 -
src/Http/Traits/Request/Header.php | 16 ----
src/Http/Traits/Request/Internal.php | 14 +--
src/Http/Traits/Request/Params.php | 7 +-
src/Http/Traits/Request/Query.php | 7 --
src/Http/Traits/Request/RawInput.php | 20 ----
src/Http/Traits/Request/Route.php | 10 --
src/Http/Traits/Request/Url.php | 12 ---
src/Http/Traits/Response/Body.php | 28 ------
src/Http/Traits/Response/Header.php | 13 ---
src/Http/Traits/Response/Status.php | 6 --
.../Exceptions/HttpClientException.php | 4 -
src/HttpClient/HttpClient.php | 49 +---------
src/Jwt/Exceptions/JwtException.php | 3 -
src/Jwt/JwtToken.php | 23 -----
src/Lang/Exceptions/LangException.php | 6 --
src/Lang/Factories/LangFactory.php | 17 ----
src/Lang/Helpers/lang.php | 5 -
src/Lang/Lang.php | 19 ----
src/Lang/Translator.php | 9 --
src/Loader/Loader.php | 19 +---
src/Loader/Setup.php | 35 -------
src/Logger/Adapters/DailyAdapter.php | 3 -
src/Logger/Adapters/MessageAdapter.php | 3 -
src/Logger/Adapters/SingleAdapter.php | 3 -
src/Logger/Contracts/ReportableInterface.php | 2 -
src/Logger/Exceptions/LoggerException.php | 8 --
src/Logger/Factories/LoggerFactory.php | 9 --
src/Logger/Helpers/logger.php | 12 ---
src/Logger/Logger.php | 6 --
src/Logger/LoggerConfig.php | 8 --
src/Logger/Traits/LoggerTrait.php | 7 --
src/Mailer/Adapters/MailgunAdapter.php | 13 ---
src/Mailer/Adapters/MandrillAdapter.php | 10 --
src/Mailer/Adapters/SendgridAdapter.php | 10 --
src/Mailer/Adapters/SendinblueAdapter.php | 10 --
src/Mailer/Adapters/SmtpAdapter.php | 47 ++--------
src/Mailer/Contracts/MailerInterface.php | 16 ----
src/Mailer/Factories/MailerFactory.php | 9 --
src/Mailer/Helpers/mailer.php | 2 -
src/Mailer/MailTrap.php | 31 ------
src/Mailer/Mailer.php | 8 --
src/Mailer/Traits/MailerTrait.php | 43 +--------
.../Exceptions/MiddlewareException.php | 4 -
src/Middleware/MiddlewareManager.php | 11 ---
src/Middleware/QtMiddleware.php | 3 -
.../Exceptions/MigrationException.php | 10 --
src/Migration/MigrationManager.php | 48 +---------
src/Migration/MigrationTable.php | 4 -
src/Migration/QtMigration.php | 2 -
src/Migration/Templates/MigrationTemplate.php | 12 ---
src/Model/DbModel.php | 29 ------
src/Model/Exceptions/ModelException.php | 31 ------
src/Model/Factories/ModelFactory.php | 16 ----
src/Model/Helpers/model.php | 9 --
src/Model/Model.php | 22 -----
src/Model/ModelCollection.php | 13 ---
src/Model/Traits/HasTimestamps.php | 8 --
src/Model/Traits/SoftDeletes.php | 17 ----
src/Module/Exceptions/ModuleException.php | 21 -----
src/Module/ModuleLoader.php | 28 ------
src/Module/ModuleManager.php | 63 -------------
src/Paginator/Adapters/ArrayPaginator.php | 5 -
src/Paginator/Adapters/ModelPaginator.php | 11 ---
.../Contracts/PaginatorInterface.php | 21 -----
.../Exceptions/PaginatorException.php | 2 -
src/Paginator/Factories/PaginatorFactory.php | 9 --
src/Paginator/Paginator.php | 6 --
src/Paginator/Traits/PaginatorTrait.php | 94 ++++---------------
src/Renderer/Adapters/HtmlAdapter.php | 12 ---
src/Renderer/Adapters/TwigAdapter.php | 16 ----
.../Contracts/TemplateRendererInterface.php | 3 -
src/Renderer/Factories/RendererFactory.php | 9 --
src/Renderer/Renderer.php | 8 --
src/ResourceCache/ViewCache.php | 48 ----------
src/Router/Exceptions/RouteException.php | 50 ----------
src/Router/Helpers/router.php | 21 -----
src/Router/MatchedRoute.php | 12 ---
src/Router/PatternCompiler.php | 36 +------
src/Router/Route.php | 69 +-------------
src/Router/RouteBuilder.php | 56 +----------
src/Router/RouteCollection.php | 3 -
src/Router/RouteDispatcher.php | 19 +---
src/Router/RouteFinder.php | 11 ---
src/Service/Factories/ServiceFactory.php | 8 --
src/Service/Helpers/service.php | 2 -
src/Service/QtService.php | 2 -
.../Adapters/Database/DatabaseHandler.php | 4 -
.../Database/DatabaseSessionAdapter.php | 4 -
.../Adapters/Native/NativeSessionAdapter.php | 4 -
.../Contracts/SessionStorageInterface.php | 4 -
src/Session/Exceptions/SessionException.php | 6 --
src/Session/Factories/SessionFactory.php | 9 --
src/Session/Helpers/session.php | 2 -
src/Session/Session.php | 8 --
src/Storage/Adapters/Dropbox/DropboxApp.php | 34 -------
.../Dropbox/DropboxFileSystemAdapter.php | 3 -
.../Adapters/GoogleDrive/GoogleDriveApp.php | 35 +------
.../GoogleDriveFileSystemAdapter.php | 3 -
.../Adapters/Local/LocalFileSystemAdapter.php | 12 +--
src/Storage/Contracts/CloudAppInterface.php | 9 --
.../Contracts/FilesystemAdapterInterface.php | 28 ------
.../LocalFilesystemAdapterInterface.php | 20 ----
.../Contracts/TokenServiceInterface.php | 11 ---
.../Exceptions/FileSystemException.php | 12 ---
.../Exceptions/FileUploadException.php | 8 --
src/Storage/Factories/FileSystemFactory.php | 14 ---
src/Storage/FileSystem.php | 11 ---
src/Storage/Helpers/fs.php | 2 -
src/Storage/Traits/CloudAppTrait.php | 2 +-
src/Storage/UploadedFile.php | 44 ---------
src/Tracer/ErrorHandler.php | 47 +---------
src/Transformer/Helpers/transformer.php | 3 -
src/Transformer/Transformer.php | 3 -
src/Validation/Rule.php | 2 -
src/Validation/Traits/File.php | 14 ---
src/Validation/Traits/General.php | 36 -------
src/Validation/Traits/Length.php | 9 --
src/Validation/Traits/Lists.php | 9 --
src/Validation/Traits/Resource.php | 10 --
src/Validation/Traits/Type.php | 19 ----
src/Validation/Validator.php | 19 ----
src/View/Exceptions/ViewException.php | 6 --
src/View/Factories/ViewFactory.php | 2 -
src/View/Helpers/view.php | 14 +--
src/View/QtView.php | 53 +----------
tests/Unit/AppTestCase.php | 3 +-
.../Sleekdb/Statements/ReducerSleekTest.php | 2 +-
tests/Unit/Http/Helpers/HttpHelperTest.php | 3 +-
.../Traits/Request/HttpRequestRouteTest.php | 6 +-
tests/Unit/JWToken/JWTokenTest.php | 2 +-
tests/Unit/Lang/LangTest.php | 3 +-
.../Unit/Model/ModelSoftDeletesSleekTest.php | 8 +-
.../Renderer/Adapters/HtmlAdapterTest.php | 3 +-
.../Renderer/Adapters/TwigAdapterTest.php | 3 +-
tests/Unit/Renderer/RendererTest.php | 3 +-
.../Unit/Router/Helpers/RouteHelpersTest.php | 15 +--
tests/Unit/Router/RouteDispatcherTest.php | 34 +++----
.../Adapters/Dropbox/DropboxAppTest.php | 3 -
.../Dropbox/DropboxFileSystemAdapterTest.php | 3 -
.../GoogleDrive/GoogleDriveAppTest.php | 3 -
.../Local/LocalFileSystemAdapterTest.php | 6 --
tests/Unit/View/Helpers/ViewHelperTest.php | 3 +-
tests/Unit/View/QtViewTest.php | 3 +-
275 files changed, 109 insertions(+), 3511 deletions(-)
diff --git a/rector.php b/rector.php
index bc93d3812..e511ccecd 100644
--- a/rector.php
+++ b/rector.php
@@ -10,11 +10,11 @@
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
- __DIR__ . '/tests',
])
->withSets([
LevelSetList::UP_TO_PHP_80,
SetList::TYPE_DECLARATION,
+ SetList::DEAD_CODE,
])
->withSkip([
StrictStringParamConcatRector::class => [
diff --git a/src/App/Adapters/AppAdapter.php b/src/App/Adapters/AppAdapter.php
index eff84e1ac..ebf5a41de 100644
--- a/src/App/Adapters/AppAdapter.php
+++ b/src/App/Adapters/AppAdapter.php
@@ -28,9 +28,6 @@ abstract class AppAdapter implements AppInterface
{
use AppTrait;
- /**
- * @var string
- */
private static string $baseDir;
/**
diff --git a/src/App/Adapters/ConsoleAppAdapter.php b/src/App/Adapters/ConsoleAppAdapter.php
index 1cf0cefd4..a6887d547 100644
--- a/src/App/Adapters/ConsoleAppAdapter.php
+++ b/src/App/Adapters/ConsoleAppAdapter.php
@@ -38,19 +38,10 @@ class ConsoleAppAdapter extends AppAdapter
{
use ConsoleAppTrait;
- /**
- * @var ArgvInput
- */
protected ArgvInput $input;
- /**
- * @var ConsoleOutput
- */
protected ConsoleOutput $output;
- /**
- * @var Application|null
- */
protected ?Application $application = null;
public function __construct()
@@ -69,7 +60,6 @@ public function __construct()
}
/**
- * @return int|null
* @throws DiException
* @throws EnvException
* @throws BaseException
diff --git a/src/App/Adapters/WebAppAdapter.php b/src/App/Adapters/WebAppAdapter.php
index 8a8555b4d..7959b1ccc 100644
--- a/src/App/Adapters/WebAppAdapter.php
+++ b/src/App/Adapters/WebAppAdapter.php
@@ -80,7 +80,6 @@ public function __construct()
/**
* Starts the web app
- * @return int|null
* @throws BaseException
* @throws ConfigException
* @throws CsrfException
@@ -147,7 +146,7 @@ public function start(): ?int
}
$dispatcher = new RouteDispatcher();
- $dispatcher->dispatch($matchedRoute, $this->request, $this->response);
+ $dispatcher->dispatch($matchedRoute, $this->request);
stop();
} catch (StopExecutionException $exception) {
$this->handleCors($this->response);
diff --git a/src/App/App.php b/src/App/App.php
index 723ecc25e..16a2f4561 100644
--- a/src/App/App.php
+++ b/src/App/App.php
@@ -38,41 +38,27 @@ class App
private AppInterface $adapter;
- /**
- * @param AppInterface $adapter
- */
public function __construct(AppInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @param string $baseDir
- */
public static function setBaseDir(string $baseDir): void
{
self::$baseDir = $baseDir;
}
- /**
- * @return string
- */
public static function getBaseDir(): string
{
return self::$baseDir;
}
- /**
- * @return AppInterface
- */
public function getAdapter(): AppInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/App/Contracts/AppInterface.php b/src/App/Contracts/AppInterface.php
index b6bbc82d8..1ae2040e4 100644
--- a/src/App/Contracts/AppInterface.php
+++ b/src/App/Contracts/AppInterface.php
@@ -22,7 +22,6 @@ interface AppInterface
{
/**
* Starts the app
- * @return int|null
*/
public function start(): ?int;
}
diff --git a/src/App/Exceptions/AppException.php b/src/App/Exceptions/AppException.php
index cae9064f1..edc4a164e 100644
--- a/src/App/Exceptions/AppException.php
+++ b/src/App/Exceptions/AppException.php
@@ -24,9 +24,6 @@
*/
class AppException extends BaseException
{
- /**
- * @return AppException
- */
public static function missingAppKey(): self
{
return new self(
diff --git a/src/App/Exceptions/BaseException.php b/src/App/Exceptions/BaseException.php
index 03fcab03b..ff55e5ea5 100644
--- a/src/App/Exceptions/BaseException.php
+++ b/src/App/Exceptions/BaseException.php
@@ -25,18 +25,12 @@
*/
abstract class BaseException extends Exception
{
- /**
- * @param string $message
- * @param int $code
- */
final public function __construct(string $message = '', int $code = 0)
{
parent::__construct($message, $code);
}
/**
- * @param string $methodName
- * @param string $className
* @return static
*/
public static function methodNotSupported(string $methodName, string $className)
@@ -48,7 +42,6 @@ public static function methodNotSupported(string $methodName, string $className)
}
/**
- * @param string $name
* @return static
*/
public static function adapterNotSupported(string $name)
@@ -60,7 +53,6 @@ public static function adapterNotSupported(string $name)
}
/**
- * @param string $name
* @return static
*/
public static function driverNotSupported(string $name)
@@ -72,7 +64,6 @@ public static function driverNotSupported(string $name)
}
/**
- * @param string $name
* @return static
*/
public static function fileNotFound(string $name)
@@ -84,8 +75,6 @@ public static function fileNotFound(string $name)
}
/**
- * @param string $subject
- * @param string $name
* @return static
*/
public static function notFound(string $subject, string $name)
@@ -97,8 +86,6 @@ public static function notFound(string $subject, string $name)
}
/**
- * @param string $instance
- * @param string $name
* @return static
*/
public static function notInstanceOf(string $instance, string $name)
@@ -110,7 +97,6 @@ public static function notInstanceOf(string $instance, string $name)
}
/**
- * @param string $name
* @return static
*/
public static function cantConnect(string $name)
@@ -122,10 +108,8 @@ public static function cantConnect(string $name)
}
/**
- * @param string $name
* @return static
*/
-
public static function missingConfig(string $name)
{
return new static(
@@ -135,7 +119,6 @@ public static function missingConfig(string $name)
}
/**
- * @param string $name
* @return static
*/
public static function requestMethodNotAvailable(string $name)
diff --git a/src/App/Exceptions/StopExecutionException.php b/src/App/Exceptions/StopExecutionException.php
index d50cbe1ba..8512dcc5e 100644
--- a/src/App/Exceptions/StopExecutionException.php
+++ b/src/App/Exceptions/StopExecutionException.php
@@ -24,10 +24,6 @@
*/
class StopExecutionException extends BaseException
{
- /**
- * @param int|null $code
- * @return StopExecutionException
- */
public static function executionTerminated(?int $code): self
{
return new self(
diff --git a/src/App/Factories/AppFactory.php b/src/App/Factories/AppFactory.php
index 0b7e5fbe1..fe030f56b 100644
--- a/src/App/Factories/AppFactory.php
+++ b/src/App/Factories/AppFactory.php
@@ -37,9 +37,6 @@ class AppFactory
private static array $instances = [];
/**
- * @param string $type
- * @param string $baseDir
- * @return App
* @throws BaseException
*/
public static function create(string $type, string $baseDir): App
@@ -52,19 +49,12 @@ public static function create(string $type, string $baseDir): App
return self::$instances[$type];
}
- /**
- * @param string $type
- * @return void
- */
public static function destroy(string $type): void
{
unset(self::$instances[$type]);
}
/**
- * @param string $type
- * @param string $baseDir
- * @return App
* @throws BaseException
*/
private static function createInstance(string $type, string $baseDir): App
diff --git a/src/App/Helpers/app.php b/src/App/Helpers/app.php
index 19091a825..e140c56d4 100644
--- a/src/App/Helpers/app.php
+++ b/src/App/Helpers/app.php
@@ -16,8 +16,6 @@
/**
* Stops the app execution
- * @param Closure|null $closure
- * @param int|null $code
* @return never
* @throws StopExecutionException
*/
diff --git a/src/App/Helpers/dir.php b/src/App/Helpers/dir.php
index 47ff42250..7051ab379 100644
--- a/src/App/Helpers/dir.php
+++ b/src/App/Helpers/dir.php
@@ -16,7 +16,6 @@
/**
* Gets base directory
- * @return string
*/
function base_dir(): string
{
@@ -25,7 +24,6 @@ function base_dir(): string
/**
* Gets the log directory
- * @return string
*/
function logs_dir(): string
{
@@ -34,7 +32,6 @@ function logs_dir(): string
/**
* Gets the framework directory
- * @return string
*/
function framework_dir(): string
{
@@ -43,8 +40,6 @@ function framework_dir(): string
/**
* Gets modules directory
- * @param string|null $moduleDir
- * @return string
*/
function modules_dir(?string $moduleDir = null): string
{
@@ -53,7 +48,6 @@ function modules_dir(?string $moduleDir = null): string
/**
* Gets public directory
- * @return string
*/
function public_dir(): string
{
@@ -62,7 +56,6 @@ function public_dir(): string
/**
* Gets uploads directory
- * @return string
*/
function uploads_dir(): string
{
@@ -71,7 +64,6 @@ function uploads_dir(): string
/**
* Gets assets directory
- * @return string
*/
function assets_dir(): string
{
@@ -80,7 +72,6 @@ function assets_dir(): string
/**
* Gets hooks directory
- * @return string
*/
function hooks_dir(): string
{
@@ -89,8 +80,6 @@ function hooks_dir(): string
/**
* Recursively deletes folder
- * @param string $dir
- * @return bool
*/
function deleteDirectoryWithFiles(string $dir): bool
{
@@ -110,8 +99,6 @@ function deleteDirectoryWithFiles(string $dir): bool
/**
* Gets directory classes
- * @param string $path
- * @return array
*/
function get_directory_classes(string $path): array
{
diff --git a/src/App/Helpers/misc.php b/src/App/Helpers/misc.php
index a008e3b3e..7e59f9e42 100644
--- a/src/App/Helpers/misc.php
+++ b/src/App/Helpers/misc.php
@@ -17,9 +17,7 @@
/**
* Compose a message
- * @param string $subject
* @param string|array $params
- * @return string
*/
function _message(string $subject, $params): string
{
@@ -34,8 +32,6 @@ function _message(string $subject, $params): string
/**
* Validates base64 string
- * @param string $string
- * @return boolean
*/
function valid_base64(string $string): bool
{
@@ -50,8 +46,6 @@ function valid_base64(string $string): bool
/**
* Generates random number sequence
- * @param int $length
- * @return int
*/
function random_number(int $length = 10): int
{
@@ -64,8 +58,6 @@ function random_number(int $length = 10): int
/**
* Slugify the string
- * @param string $text
- * @return string
*/
function slugify(string $text): string
{
@@ -84,7 +76,6 @@ function slugify(string $text): string
/**
* Checks the app debug mode
- * @return bool
*/
function is_debug_mode(): bool
{
@@ -93,8 +84,6 @@ function is_debug_mode(): bool
/**
* Gets the caller class
- * @param integer $index
- * @return string|null
*/
function get_caller_class(int $index = 2): ?string
{
@@ -106,8 +95,6 @@ function get_caller_class(int $index = 2): ?string
/**
* Gets the caller function
- * @param integer $index
- * @return string|null
*/
function get_caller_function(int $index = 2): ?string
{
@@ -123,7 +110,6 @@ function get_caller_function(int $index = 2): ?string
/**
* Exports the variable
* @param $var
- * @return string
* @throws ExceptionInterface
*/
function export($var): string
diff --git a/src/App/Helpers/uuid.php b/src/App/Helpers/uuid.php
index d12b509b3..05b9ca049 100644
--- a/src/App/Helpers/uuid.php
+++ b/src/App/Helpers/uuid.php
@@ -16,7 +16,6 @@
/**
* Generate a standard v4 UUID (random)
- * @return string
*/
function uuid_random(): string
{
@@ -25,7 +24,6 @@ function uuid_random(): string
/**
* Generate an ordered UUID (time-based)
- * @return string
*/
function uuid_ordered(): string
{
diff --git a/src/App/Traits/AppTrait.php b/src/App/Traits/AppTrait.php
index 70b1d8aac..6ff9dedd0 100644
--- a/src/App/Traits/AppTrait.php
+++ b/src/App/Traits/AppTrait.php
@@ -36,7 +36,6 @@ trait AppTrait
{
/**
* Sets the app base directory
- * @param string $baseDir
*/
public static function setBaseDir(string $baseDir): void
{
@@ -45,7 +44,6 @@ public static function setBaseDir(string $baseDir): void
/**
* Gets the app base directory
- * @return string
*/
public static function getBaseDir(): string
{
diff --git a/src/App/Traits/ConsoleAppTrait.php b/src/App/Traits/ConsoleAppTrait.php
index 871688331..733906004 100644
--- a/src/App/Traits/ConsoleAppTrait.php
+++ b/src/App/Traits/ConsoleAppTrait.php
@@ -43,18 +43,12 @@ protected function loadEnvironment()
->load(new Setup('config', 'env'));
}
- /**
- * @param string $name
- * @param string $version
- * @return Application
- */
public function createApplication(string $name, string $version): Application
{
return new Application($name, $version);
}
/**
- * @return void
* @throws ReflectionException
*/
private function registerCoreCommands(): void
@@ -66,7 +60,6 @@ private function registerCoreCommands(): void
}
/**
- * @return void
* @throws ReflectionException
*/
private function registerAppCommands(): void
@@ -78,8 +71,6 @@ private function registerAppCommands(): void
}
/**
- * @param string $directory
- * @param string $namespace
* @throws ReflectionException
*/
private function registerCommands(string $directory, string $namespace): void
diff --git a/src/App/Traits/WebAppTrait.php b/src/App/Traits/WebAppTrait.php
index ab25f4790..74ad113e5 100644
--- a/src/App/Traits/WebAppTrait.php
+++ b/src/App/Traits/WebAppTrait.php
@@ -47,8 +47,6 @@ protected function loadEnvironment()
}
/**
- * @param Request $request
- * @param Response $response
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -70,10 +68,9 @@ private function initializeDebugger(): void
}
/**
- * @return ViewCache
* @throws ConfigException
* @throws DiException
- * @throws ReflectionException
+ * @throws ReflectionException|\Quantum\Loader\Exceptions\LoaderException
*/
private function setupViewCache(): ViewCache
{
@@ -87,7 +84,6 @@ private function setupViewCache(): ViewCache
}
/**
- * @param Response $response
* @throws ConfigException
* @throws DiException
* @throws ReflectionException
diff --git a/src/Archive/Adapters/PharAdapter.php b/src/Archive/Adapters/PharAdapter.php
index bf3531089..81bf5a722 100644
--- a/src/Archive/Adapters/PharAdapter.php
+++ b/src/Archive/Adapters/PharAdapter.php
@@ -51,7 +51,6 @@ public function setName(string $archiveName): void
}
/**
- * @return bool
* @throws ArchiveException
*/
public function removeArchive(): bool
diff --git a/src/Archive/Adapters/ZipAdapter.php b/src/Archive/Adapters/ZipAdapter.php
index 1c627cd8f..ba5379496 100644
--- a/src/Archive/Adapters/ZipAdapter.php
+++ b/src/Archive/Adapters/ZipAdapter.php
@@ -45,9 +45,6 @@ public function __construct()
$this->fs = FileSystemFactory::get();
}
- /**
- * @param string $archiveName
- */
public function setName(string $archiveName): void
{
$this->archiveName = $archiveName;
diff --git a/src/Archive/Archive.php b/src/Archive/Archive.php
index c8771a431..0e6b0ff1b 100644
--- a/src/Archive/Archive.php
+++ b/src/Archive/Archive.php
@@ -46,25 +46,17 @@ class Archive
private ArchiveInterface $adapter;
- /**
- * @param ArchiveInterface $adapter
- */
public function __construct(ArchiveInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return ArchiveInterface
- */
public function getAdapter(): ArchiveInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Archive/Contracts/ArchiveInterface.php b/src/Archive/Contracts/ArchiveInterface.php
index 874129b08..c9bbec28f 100644
--- a/src/Archive/Contracts/ArchiveInterface.php
+++ b/src/Archive/Contracts/ArchiveInterface.php
@@ -22,66 +22,47 @@ interface ArchiveInterface
{
/**
* Checks for the existence of a file
- * @param string $filename
- * @return bool
*/
public function offsetExists(string $filename): bool;
/**
* Makes a new empty directory
- * @param string $directory
- * @return bool
*/
public function addEmptyDir(string $directory): bool;
/**
* Adds new file to the archive
- * @param string $filePath
- * @param string $entryName
- * @return bool
*/
public function addFile(string $filePath, string $entryName): bool;
/**
* Adds new file to the archive from string
- * @param string $entryName
- * @param string $content
- * @return bool
*/
public function addFromString(string $entryName, string $content): bool;
/**
* Adds multiple files to the archive
- * @param array $fileNames
- * @return bool
*/
public function addMultipleFiles(array $fileNames): bool;
/**
* Files count in the archive
- * @return int
*/
public function count(): int;
/**
* Extracts the archive
- * @param string $pathToExtract
* @param string|array $files
- * @return bool
*/
public function extractTo(string $pathToExtract, $files = null): bool;
/**
* Delete the file from the archive
- * @param string $filename
- * @return bool
*/
public function deleteFile(string $filename): bool;
/**
* Delete a multiple files
- * @param array $fileNames
- * @return bool
*/
public function deleteMultipleFiles(array $fileNames): bool;
}
diff --git a/src/Archive/Exceptions/ArchiveException.php b/src/Archive/Exceptions/ArchiveException.php
index 5d40aaa2b..8fed68430 100644
--- a/src/Archive/Exceptions/ArchiveException.php
+++ b/src/Archive/Exceptions/ArchiveException.php
@@ -25,10 +25,6 @@
*/
class ArchiveException extends BaseException
{
- /**
- * @param string $name
- * @return ArchiveException
- */
public static function cantOpen(string $name): self
{
return new self(
@@ -37,9 +33,6 @@ public static function cantOpen(string $name): self
);
}
- /**
- * @return ArchiveException
- */
public static function missingArchiveName(): self
{
return new self(
diff --git a/src/Archive/Factories/ArchiveFactory.php b/src/Archive/Factories/ArchiveFactory.php
index 6346eaa15..629734ee3 100644
--- a/src/Archive/Factories/ArchiveFactory.php
+++ b/src/Archive/Factories/ArchiveFactory.php
@@ -37,8 +37,6 @@ class ArchiveFactory
private static array $instances = [];
/**
- * @param string $type
- * @return Archive
* @throws BaseException
*/
public static function get(string $type = Archive::PHAR): Archive
@@ -51,8 +49,6 @@ public static function get(string $type = Archive::PHAR): Archive
}
/**
- * @param string $type
- * @return Archive
* @throws BaseException
*/
private static function createInstance(string $type): Archive
diff --git a/src/Asset/Asset.php b/src/Asset/Asset.php
index 21a4c3492..ec227cd5b 100644
--- a/src/Asset/Asset.php
+++ b/src/Asset/Asset.php
@@ -30,29 +30,14 @@ class Asset
*/
public const JS = 2;
- /**
- * @var int
- */
private int $type;
- /**
- * @var string
- */
private string $path;
- /**
- * @var string|null
- */
private ?string $name;
- /**
- * @var array|null
- */
private ?array $attributes;
- /**
- * @var int|null
- */
private ?int $position;
/**
@@ -66,11 +51,6 @@ class Asset
/**
* Asset constructor
- * @param int $type
- * @param string $path
- * @param string|null $name
- * @param int|null $position
- * @param array|null $attributes
*/
public function __construct(int $type, string $path, ?string $name = null, ?int $position = -1, ?array $attributes = [])
{
@@ -83,7 +63,6 @@ public function __construct(int $type, string $path, ?string $name = null, ?int
/**
* Gets asset type
- * @return int
*/
public function getType(): int
{
@@ -92,7 +71,6 @@ public function getType(): int
/**
* Gets asset path
- * @return string
*/
public function getPath(): string
{
@@ -101,7 +79,6 @@ public function getPath(): string
/**
* Gets asset name
- * @return string|null
*/
public function getName(): ?string
{
@@ -110,7 +87,6 @@ public function getName(): ?string
/**
* Gets asset position
- * @return int|null
*/
public function getPosition(): ?int
{
@@ -119,7 +95,6 @@ public function getPosition(): ?int
/**
* Gets asset attributes
- * @return array
*/
public function getAttributes(): array
{
@@ -128,7 +103,6 @@ public function getAttributes(): array
/**
* Gets asset url
- * @return string
*/
public function url(): string
{
@@ -141,7 +115,6 @@ public function url(): string
/**
* Renders asset tag
- * @return string
*/
public function tag(): string
{
diff --git a/src/Asset/AssetManager.php b/src/Asset/AssetManager.php
index ef4de1f90..da4149655 100644
--- a/src/Asset/AssetManager.php
+++ b/src/Asset/AssetManager.php
@@ -57,7 +57,6 @@ private function __construct()
/**
* AssetManager instance
- * @return AssetManager
*/
public static function getInstance(): AssetManager
{
@@ -70,8 +69,6 @@ public static function getInstance(): AssetManager
/**
* Gets the asset by name
- * @param string $name
- * @return Asset|null
*/
public function get(string $name): ?Asset
{
@@ -86,8 +83,6 @@ public function get(string $name): ?Asset
/**
* Asset url
- * @param string $path
- * @return string
*/
public function url(string $path): string
{
@@ -112,7 +107,6 @@ public function register(array $assets): void
/**
* Register single asset
- * @param Asset $asset
* @throws AssetException
*/
public function registerAsset(Asset $asset): void
@@ -124,9 +118,6 @@ public function registerAsset(Asset $asset): void
$this->store[] = $asset;
}
- /**
- * @return void
- */
public function flush(): void
{
$this->store = [];
@@ -135,7 +126,6 @@ public function flush(): void
/**
* Dumps the assets
- * @param int $type
* @throws AssetException
* @throws LangException
*/
@@ -201,8 +191,6 @@ private function setRegularAssets(): void
/**
* Sets the Position
- * @param Asset $asset
- * @param int $index
*/
private function setPosition(Asset $asset, int $index): void
{
diff --git a/src/Asset/Exceptions/AssetException.php b/src/Asset/Exceptions/AssetException.php
index 394216080..6321078b0 100644
--- a/src/Asset/Exceptions/AssetException.php
+++ b/src/Asset/Exceptions/AssetException.php
@@ -24,11 +24,6 @@
*/
class AssetException extends \Exception
{
- /**
- * @param int $position
- * @param string $name
- * @return AssetException
- */
public static function positionInUse(int $position, string $name): AssetException
{
return new self(
@@ -37,10 +32,6 @@ public static function positionInUse(int $position, string $name): AssetExceptio
);
}
- /**
- * @param string|null $name
- * @return AssetException
- */
public static function nameInUse(?string $name): AssetException
{
return new self(
diff --git a/src/Asset/Helpers/asset.php b/src/Asset/Helpers/asset.php
index 6c5429930..659d02732 100644
--- a/src/Asset/Helpers/asset.php
+++ b/src/Asset/Helpers/asset.php
@@ -18,7 +18,6 @@
/**
* Gets the AssetFactory instance
- * @return AssetManager
*/
function asset(): AssetManager
{
@@ -27,8 +26,6 @@ function asset(): AssetManager
/**
* Dumps the assets
- * @param string $type
- * @return void
* @throws AssetException
* @throws LangException
*/
diff --git a/src/Auth/Adapters/JwtAuthAdapter.php b/src/Auth/Adapters/JwtAuthAdapter.php
index 44e3bd68d..d13433edb 100644
--- a/src/Auth/Adapters/JwtAuthAdapter.php
+++ b/src/Auth/Adapters/JwtAuthAdapter.php
@@ -37,10 +37,6 @@ class JwtAuthAdapter implements AuthenticatableInterface
use AuthTrait;
/**
- * @param AuthServiceInterface $authService
- * @param Mailer $mailer
- * @param Hasher $hasher
- * @param JwtToken|null $jwt
* @throws AuthException
*/
public function __construct(AuthServiceInterface $authService, Mailer $mailer, Hasher $hasher, ?JwtToken $jwt = null)
@@ -111,8 +107,6 @@ public function user(): ?User
/**
* Refresh user data
- * @param string $uuid
- * @return bool
* @throws JwtException
*/
public function refreshUser(string $uuid): bool
@@ -130,9 +124,6 @@ public function refreshUser(string $uuid): bool
/**
* Verify OTP
- * @param int $otp
- * @param string $otpToken
- * @return array
* @throws AuthException
* @throws JwtException
*/
@@ -144,8 +135,6 @@ public function verifyOtp(int $otp, string $otpToken): array
/**
* Get Updated Tokens
- * @param User $user
- * @return array
* @throws JwtException
*/
protected function getUpdatedTokens(User $user): array
@@ -158,8 +147,6 @@ protected function getUpdatedTokens(User $user): array
/**
* Set Updated Tokens
- * @param User $user
- * @return array
* @throws JwtException
*/
protected function setUpdatedTokens(User $user): array
@@ -181,7 +168,6 @@ protected function setUpdatedTokens(User $user): array
/**
* Check Refresh Token
- * @return User|null
*/
protected function checkRefreshToken(): ?User
{
@@ -191,9 +177,6 @@ protected function checkRefreshToken(): ?User
);
}
- /**
- * @return User|null
- */
private function getUserFromAccessToken(): ?User
{
$authorizationBearer = Request::getAuthorizationBearer();
@@ -210,7 +193,6 @@ private function getUserFromAccessToken(): ?User
}
/**
- * @return User|null
* @throws JwtException
*/
private function getUserFromRefreshToken(): ?User
diff --git a/src/Auth/Adapters/SessionAuthAdapter.php b/src/Auth/Adapters/SessionAuthAdapter.php
index 6cc86c667..0a06b9568 100644
--- a/src/Auth/Adapters/SessionAuthAdapter.php
+++ b/src/Auth/Adapters/SessionAuthAdapter.php
@@ -39,9 +39,6 @@ class SessionAuthAdapter implements AuthenticatableInterface
use AuthTrait;
/**
- * @param AuthServiceInterface $authService
- * @param Mailer $mailer
- * @param Hasher $hasher
* @throws AuthException
*/
public function __construct(AuthServiceInterface $authService, Mailer $mailer, Hasher $hasher)
@@ -128,8 +125,6 @@ public function user(): ?User
/**
* Refresh user data
- * @param string $uuid
- * @return bool
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -153,9 +148,6 @@ public function refreshUser(string $uuid): bool
/**
* Verify OTP
- * @param int $otp
- * @param string $otpToken
- * @return bool
* @throws AuthException
* @throws BaseException
* @throws ConfigException
@@ -195,7 +187,6 @@ private function checkRememberToken()
/**
* Set Remember Token
- * @param User $user
* @throws BaseException
*/
private function setRememberToken(User $user): void
diff --git a/src/Auth/Auth.php b/src/Auth/Auth.php
index d38d671c1..fc70fa710 100644
--- a/src/Auth/Auth.php
+++ b/src/Auth/Auth.php
@@ -40,25 +40,17 @@ class Auth
private AuthenticatableInterface $adapter;
- /**
- * @param AuthenticatableInterface $adapter
- */
public function __construct(AuthenticatableInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return AuthenticatableInterface
- */
public function getAdapter(): AuthenticatableInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Auth/Contracts/AuthServiceInterface.php b/src/Auth/Contracts/AuthServiceInterface.php
index 09c45f45d..a25f0c256 100644
--- a/src/Auth/Contracts/AuthServiceInterface.php
+++ b/src/Auth/Contracts/AuthServiceInterface.php
@@ -24,31 +24,21 @@ interface AuthServiceInterface
{
/**
* Get
- * @param string $field
- * @param string|null $value
- * @return User|null
*/
public function get(string $field, ?string $value): ?User;
/**
- * Add
- * @param array $data
- * @return User
- */
+ * Add
+ */
public function add(array $data): User;
/**
* Update
- * @param string $field
- * @param string|null $value
- * @param array $data
- * @return User|null
*/
public function update(string $field, ?string $value, array $data): ?User;
/**
* User Schema
- * @return array
*/
public function userSchema(): array;
}
diff --git a/src/Auth/Contracts/AuthenticatableInterface.php b/src/Auth/Contracts/AuthenticatableInterface.php
index faf37aba8..f54a62326 100644
--- a/src/Auth/Contracts/AuthenticatableInterface.php
+++ b/src/Auth/Contracts/AuthenticatableInterface.php
@@ -29,27 +29,22 @@ interface AuthenticatableInterface
/**
* Sign In
- * @param string $username
- * @param string $password
* @return mixed
*/
public function signin(string $username, string $password);
/**
* Sign Out
- * @return bool
*/
public function signout(): bool;
/**
* Check
- * @return bool
*/
public function check(): bool;
/**
* User
- * @return User|null
*/
public function user(): ?User;
}
diff --git a/src/Auth/Exceptions/AuthException.php b/src/Auth/Exceptions/AuthException.php
index d668dd90b..f47d451d5 100644
--- a/src/Auth/Exceptions/AuthException.php
+++ b/src/Auth/Exceptions/AuthException.php
@@ -25,9 +25,6 @@
*/
class AuthException extends BaseException
{
- /**
- * @return AuthException
- */
public static function incorrectCredentials(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function incorrectCredentials(): self
);
}
- /**
- * @return AuthException
- */
public static function inactiveAccount(): self
{
return new self(
@@ -47,9 +41,6 @@ public static function inactiveAccount(): self
);
}
- /**
- * @return AuthException
- */
public static function incorrectVerificationCode(): self
{
return new self(
@@ -58,9 +49,6 @@ public static function incorrectVerificationCode(): self
);
}
- /**
- * @return AuthException
- */
public static function verificationCodeExpired(): self
{
return new self(
@@ -69,9 +57,6 @@ public static function verificationCodeExpired(): self
);
}
- /**
- * @return AuthException
- */
public static function incorrectUserSchema(): self
{
return new self(
diff --git a/src/Auth/Factories/AuthFactory.php b/src/Auth/Factories/AuthFactory.php
index 778d7e445..8408553fb 100644
--- a/src/Auth/Factories/AuthFactory.php
+++ b/src/Auth/Factories/AuthFactory.php
@@ -49,8 +49,6 @@ class AuthFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Auth
* @throws AuthException
* @throws BaseException
* @throws ConfigException
@@ -76,9 +74,6 @@ public static function get(?string $adapter = null): Auth
}
/**
- * @param string $adapterClass
- * @param string $adapter
- * @return Auth
* @throws AuthException
* @throws BaseException
* @throws ConfigException
@@ -97,8 +92,6 @@ private static function createInstance(string $adapterClass, string $adapter): A
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
@@ -111,8 +104,6 @@ private static function getAdapterClass(string $adapter): string
}
/**
- * @param string $adapter
- * @return AuthServiceInterface
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -131,10 +122,6 @@ private static function createAuthService(string $adapter): AuthServiceInterface
return $authService;
}
- /**
- * @param string $adapter
- * @return JwtToken|null
- */
private static function createJwtInstance(string $adapter): ?JwtToken
{
return $adapter === Auth::JWT ? (new JwtToken())->setLeeway(1)->setClaims((array) config()->get('auth.claims')) : null;
diff --git a/src/Auth/Helpers/auth.php b/src/Auth/Helpers/auth.php
index 1f869fe4c..e4f1e7bd5 100644
--- a/src/Auth/Helpers/auth.php
+++ b/src/Auth/Helpers/auth.php
@@ -22,8 +22,6 @@
/**
* Gets the Auth handler
- * @param string|null $adapter
- * @return Auth
* @throws AuthException
* @throws BaseException
* @throws ConfigException
diff --git a/src/Auth/Traits/AuthTrait.php b/src/Auth/Traits/AuthTrait.php
index c0e44b42b..97ba89564 100644
--- a/src/Auth/Traits/AuthTrait.php
+++ b/src/Auth/Traits/AuthTrait.php
@@ -87,9 +87,6 @@ public function check(): bool
/**
* Sign Up
- * @param array $userData
- * @param array|null $customData
- * @return User
*/
public function signup(array $userData, ?array $customData = null): User
{
@@ -119,7 +116,6 @@ public function signup(array $userData, ?array $customData = null): User
/**
* Activate
- * @param string $token
*/
public function activate(string $token): void
{
@@ -132,8 +128,6 @@ public function activate(string $token): void
/**
* Forget
- * @param string $username
- * @return string|null
*/
public function forget(string $username): ?string
{
@@ -166,8 +160,6 @@ public function forget(string $username): ?string
/**
* Reset
- * @param string $token
- * @param string $password
*/
public function reset(string $token, string $password): void
{
@@ -191,8 +183,6 @@ public function reset(string $token, string $password): void
/**
* Resend OTP
- * @param string $otpToken
- * @return string
* @throws AuthException
* @throws Exception
*/
@@ -210,9 +200,6 @@ public function resendOtp(string $otpToken): string
/**
* Gets the user by username and password
- * @param string $username
- * @param string $password
- * @return User
* @throws AuthException
*/
protected function getUser(string $username, string $password): User
@@ -236,8 +223,6 @@ protected function getUser(string $username, string $password): User
/**
* Two-Step Verification
- * @param User $user
- * @return string
* @throws Exception
*/
protected function twoStepVerification(User $user): string
@@ -275,9 +260,6 @@ protected function twoStepVerification(User $user): string
/**
* Verify and update OTP
- * @param int $otp
- * @param string $otpToken
- * @return User
* @throws AuthException
* @throws Exception
*/
@@ -308,8 +290,6 @@ protected function verifyAndUpdateOtp(int $otp, string $otpToken): User
/**
* Filters and gets the visible fields
- * @param User $user
- * @return array
*/
protected function getVisibleFields(User $user): array
{
@@ -328,8 +308,6 @@ protected function getVisibleFields(User $user): array
/**
* Is user account activated
- * @param User $user
- * @return bool
*/
protected function isActivated(User $user): bool
{
@@ -338,8 +316,6 @@ protected function isActivated(User $user): bool
/**
* Generate Token
- * @param string|null $val
- * @return string
*/
protected function generateToken(?string $val = null): string
{
@@ -348,8 +324,6 @@ protected function generateToken(?string $val = null): string
/**
* Send email
- * @param User $user
- * @param array $body
*/
protected function sendMail(User $user, array $body)
{
@@ -366,7 +340,6 @@ protected function sendMail(User $user, array $body)
/**
* Verify user schema
- * @param array $schema
* @throws AuthException
*/
protected function verifySchema(array $schema)
@@ -388,9 +361,6 @@ protected function verifySchema(array $schema)
}
}
- /**
- * @return bool
- */
protected function isTwoFactorEnabled(): bool
{
return filter_var(config()->get('auth.two_fa'), FILTER_VALIDATE_BOOLEAN);
diff --git a/src/Auth/User.php b/src/Auth/User.php
index bafc52df4..fad45a7c4 100644
--- a/src/Auth/User.php
+++ b/src/Auth/User.php
@@ -24,7 +24,6 @@ class User
/**
* Set Data
- * @param array $data
* @return $this
*/
public function setData(array $data): self
@@ -35,7 +34,6 @@ public function setData(array $data): self
/**
* Get Data
- * @return array
*/
public function getData(): array
{
@@ -44,7 +42,6 @@ public function getData(): array
/**
* Get Fields
- * @return array
*/
public function getFields(): array
{
@@ -53,7 +50,6 @@ public function getFields(): array
/**
* Set Fields
- * @param array $schema
* @return $this
*/
public function setFields(array $schema): self
@@ -69,8 +65,6 @@ public function setFields(array $schema): self
/**
* Get Field Value
- * @param string $field
- * @return string|null
*/
public function getFieldValue(string $field): ?string
{
@@ -79,8 +73,6 @@ public function getFieldValue(string $field): ?string
/**
* Set Fields Value
- * @param string $field
- * @param string|null $value
* @return $this
*/
public function setFieldValue(string $field, ?string $value): self
@@ -91,8 +83,6 @@ public function setFieldValue(string $field, ?string $value): self
/**
* Has Field
- * @param string $field
- * @return bool
*/
public function hasField(string $field): bool
{
@@ -101,7 +91,6 @@ public function hasField(string $field): bool
/**
* Gets the user property
- * @param string $property
* @return string|null
*/
public function __get(string $property)
diff --git a/src/Cache/Adapters/DatabaseAdapter.php b/src/Cache/Adapters/DatabaseAdapter.php
index ea5997934..62d45d4b8 100644
--- a/src/Cache/Adapters/DatabaseAdapter.php
+++ b/src/Cache/Adapters/DatabaseAdapter.php
@@ -37,14 +37,8 @@ class DatabaseAdapter implements CacheInterface
*/
private $prefix;
- /**
- * @var DbModel
- */
private DbModel $cacheModel;
- /**
- * @param array $params
- */
public function __construct(array $params)
{
$this->ttl = $params['ttl'];
@@ -189,8 +183,6 @@ public function clear(): bool
/**
* Gets the hashed key
- * @param string $key
- * @return string
*/
private function keyHash(string $key): string
{
diff --git a/src/Cache/Adapters/FileAdapter.php b/src/Cache/Adapters/FileAdapter.php
index 1a48f4e81..d874162e3 100644
--- a/src/Cache/Adapters/FileAdapter.php
+++ b/src/Cache/Adapters/FileAdapter.php
@@ -48,7 +48,6 @@ class FileAdapter implements CacheInterface
private $cacheDir;
/**
- * @param array $params
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -207,8 +206,6 @@ public function clear(): bool
/**
* Gets the path for given cache key
- * @param string $key
- * @return string
*/
private function getPath(string $key): string
{
diff --git a/src/Cache/Adapters/MemcachedAdapter.php b/src/Cache/Adapters/MemcachedAdapter.php
index 4ca567f0c..96f2603aa 100644
--- a/src/Cache/Adapters/MemcachedAdapter.php
+++ b/src/Cache/Adapters/MemcachedAdapter.php
@@ -41,7 +41,6 @@ class MemcachedAdapter implements CacheInterface
private Memcached $memcached;
/**
- * @param array $params
* @throws BaseException
*/
public function __construct(array $params)
@@ -168,8 +167,6 @@ public function clear(): bool
/**
* Gets the hashed key
- * @param string $key
- * @return string
*/
private function keyHash(string $key): string
{
diff --git a/src/Cache/Adapters/RedisAdapter.php b/src/Cache/Adapters/RedisAdapter.php
index 280a24e1a..dea031a04 100644
--- a/src/Cache/Adapters/RedisAdapter.php
+++ b/src/Cache/Adapters/RedisAdapter.php
@@ -40,7 +40,6 @@ class RedisAdapter implements CacheInterface
private Redis $redis;
/**
- * @param array $params
* @throws RedisException
*/
public function __construct(array $params)
@@ -166,8 +165,6 @@ public function clear()
/**
* Gets the hashed key
- * @param string $key
- * @return string
*/
private function keyHash(string $key): string
{
diff --git a/src/Cache/Cache.php b/src/Cache/Cache.php
index f7c9b57b3..4c4df2049 100644
--- a/src/Cache/Cache.php
+++ b/src/Cache/Cache.php
@@ -52,14 +52,10 @@ class Cache
*/
public const REDIS = 'redis';
- /**
- * @var CacheInterface
- */
private CacheInterface $adapter;
/**
* Cache constructor
- * @param CacheInterface $cacheAdapter
*/
public function __construct(CacheInterface $cacheAdapter)
{
@@ -68,7 +64,6 @@ public function __construct(CacheInterface $cacheAdapter)
/**
* Gets the current adapter
- * @return CacheInterface
*/
public function getAdapter(): CacheInterface
{
@@ -76,8 +71,6 @@ public function getAdapter(): CacheInterface
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Cache/Factories/CacheFactory.php b/src/Cache/Factories/CacheFactory.php
index 642885710..1bebf336a 100644
--- a/src/Cache/Factories/CacheFactory.php
+++ b/src/Cache/Factories/CacheFactory.php
@@ -48,8 +48,6 @@ class CacheFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Cache
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -72,19 +70,12 @@ public static function get(?string $adapter = null): Cache
return self::$instances[$adapter];
}
- /**
- * @param string $adapterClass
- * @param string $adapter
- * @return Cache
- */
private static function createInstance(string $adapterClass, string $adapter): Cache
{
return new Cache(new $adapterClass(config()->get('cache.' . $adapter)));
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
diff --git a/src/Cache/Helpers/cache.php b/src/Cache/Helpers/cache.php
index cde21b342..82f44b162 100644
--- a/src/Cache/Helpers/cache.php
+++ b/src/Cache/Helpers/cache.php
@@ -19,8 +19,6 @@
use Quantum\Cache\Cache;
/**
- * @param string|null $adapter
- * @return Cache
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Captcha/Adapters/HcaptchaAdapter.php b/src/Captcha/Adapters/HcaptchaAdapter.php
index 5e652b147..55851c8f6 100644
--- a/src/Captcha/Adapters/HcaptchaAdapter.php
+++ b/src/Captcha/Adapters/HcaptchaAdapter.php
@@ -42,8 +42,6 @@ class HcaptchaAdapter implements CaptchaInterface
/**
* Hcaptcha constructor
- * @param array $params
- * @param HttpClient $httpClient
*/
public function __construct(array $params, HttpClient $httpClient)
{
diff --git a/src/Captcha/Adapters/RecaptchaAdapter.php b/src/Captcha/Adapters/RecaptchaAdapter.php
index 7078e4c09..7378e8749 100644
--- a/src/Captcha/Adapters/RecaptchaAdapter.php
+++ b/src/Captcha/Adapters/RecaptchaAdapter.php
@@ -42,8 +42,6 @@ class RecaptchaAdapter implements CaptchaInterface
/**
* RecaptchaAdapter constructor
- * @param array $params
- * @param HttpClient $httpClient
*/
public function __construct(array $params, HttpClient $httpClient)
{
diff --git a/src/Captcha/Captcha.php b/src/Captcha/Captcha.php
index 6d32926a4..94a18bfda 100644
--- a/src/Captcha/Captcha.php
+++ b/src/Captcha/Captcha.php
@@ -42,25 +42,17 @@ class Captcha
private CaptchaInterface $adapter;
- /**
- * @param CaptchaInterface $adapter
- */
public function __construct(CaptchaInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return CaptchaInterface
- */
public function getAdapter(): CaptchaInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Captcha/Contracts/CaptchaInterface.php b/src/Captcha/Contracts/CaptchaInterface.php
index 7a5971b6a..551010581 100644
--- a/src/Captcha/Contracts/CaptchaInterface.php
+++ b/src/Captcha/Contracts/CaptchaInterface.php
@@ -35,36 +35,21 @@ interface CaptchaInterface
*/
public const CAPTCHA_INVISIBLE = 'invisible';
- /**
- * @return string
- */
public function getName(): string;
- /**
- * @return string|null
- */
public function getType(): ?string;
- /**
- * @param string $type
- * @return self
- */
public function setType(string $type): self;
/**
- * @param string $formIdentifier
* @return mixed
*/
public function addToForm(string $formIdentifier);
/**
- * @param string $response
* @return mixed
*/
public function verify(string $response);
- /**
- * @return string|null
- */
public function getErrorMessage(): ?string;
}
diff --git a/src/Captcha/Factories/CaptchaFactory.php b/src/Captcha/Factories/CaptchaFactory.php
index 0c0ca9cc2..2ca22c771 100644
--- a/src/Captcha/Factories/CaptchaFactory.php
+++ b/src/Captcha/Factories/CaptchaFactory.php
@@ -45,8 +45,6 @@ class CaptchaFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Captcha
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -69,19 +67,12 @@ public static function get(?string $adapter = null): Captcha
return self::$instances[$adapter];
}
- /**
- * @param string $adapterClass
- * @param string $adapter
- * @return Captcha
- */
private static function createInstance(string $adapterClass, string $adapter): Captcha
{
return new Captcha(new $adapterClass(config()->get('captcha.' . $adapter), new HttpClient()));
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
diff --git a/src/Captcha/Helpers/captcha.php b/src/Captcha/Helpers/captcha.php
index def4c3f95..8fe75d26d 100644
--- a/src/Captcha/Helpers/captcha.php
+++ b/src/Captcha/Helpers/captcha.php
@@ -19,8 +19,6 @@
use Quantum\Captcha\Captcha;
/**
- * @param string|null $adapter
- * @return Captcha
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Captcha/Traits/CaptchaTrait.php b/src/Captcha/Traits/CaptchaTrait.php
index 10357f3f8..7157fc0df 100644
--- a/src/Captcha/Traits/CaptchaTrait.php
+++ b/src/Captcha/Traits/CaptchaTrait.php
@@ -31,47 +31,27 @@
*/
trait CaptchaTrait
{
- /**
- * @var string|null
- */
protected ?string $siteKey;
- /**
- * @var string|null
- */
protected ?string $secretKey;
- /**
- * @var HttpClient
- */
protected HttpClient $http;
/**
* @var mixed|null
*/
- protected $type = null;
+ protected $type;
- /**
- * @var array
- */
protected array $errorCodes = [];
- /**
- * @var array
- */
protected array $elementAttributes = [];
- /**
- * @return string|null
- */
public function getType(): ?string
{
return $this->type;
}
/**
- * @param string $type
- * @return CaptchaInterface
* @throws Exception
*/
public function setType(string $type): CaptchaInterface
@@ -84,9 +64,6 @@ public function setType(string $type): CaptchaInterface
return $this;
}
- /**
- * @return string
- */
public function getName(): string
{
return $this->name;
@@ -94,9 +71,6 @@ public function getName(): string
/**
* Generates an HTML code block for the captcha
- * @param string $formIdentifier
- * @param array $attributes
- * @return string
* @throws AssetException
* @throws Exception
*/
@@ -117,8 +91,6 @@ public function addToForm(string $formIdentifier = '', array $attributes = []):
/**
* Checks the code given by the captcha
- * @param string $code
- * @return bool
* @throws LangException
* @throws ErrorException
* @throws BaseException
@@ -170,9 +142,6 @@ public function verify(string $code): bool
return isset($response->success) && $response->success;
}
- /**
- * @return string|null
- */
public function getErrorMessage(): ?string
{
if (!empty($this->errorCodes)) {
@@ -182,10 +151,6 @@ public function getErrorMessage(): ?string
return null;
}
- /**
- * @param array $attributes
- * @return string
- */
protected function getVisibleElement(array $attributes = []): string
{
$this->extractAttributes($attributes);
@@ -194,8 +159,6 @@ protected function getVisibleElement(array $attributes = []): string
}
/**
- * @param string $formIdentifier
- * @return string
* @throws Exception
*/
protected function getInvisibleElement(string $formIdentifier): string
@@ -220,7 +183,6 @@ function onSubmit (){
/**
* @param $type
- * @return bool
*/
protected function isValidCaptchaType($type): bool
{
@@ -233,7 +195,6 @@ protected function isValidCaptchaType($type): bool
}
/**
- * @param array $attributes
* @return void
*/
protected function extractAttributes(array $attributes)
@@ -247,10 +208,6 @@ protected function extractAttributes(array $attributes)
}
}
- /**
- * @param string $challengeTs
- * @return bool
- */
protected function detectReplayAttack(string $challengeTs): bool
{
return time() - strtotime($challengeTs) > self::MAX_TIME_DIFF;
diff --git a/src/Config/Config.php b/src/Config/Config.php
index fbacb194a..655b8a960 100644
--- a/src/Config/Config.php
+++ b/src/Config/Config.php
@@ -15,10 +15,10 @@
namespace Quantum\Config;
use Quantum\Config\Exceptions\ConfigException;
+use Quantum\Loader\Exceptions\LoaderException;
use Quantum\Contracts\StorageInterface;
use Quantum\Di\Exceptions\DiException;
use Dflydev\DotAccessData\Data;
-use Quantum\Loader\Exceptions\LoaderException;
use Quantum\Loader\Loader;
use Quantum\Loader\Setup;
use ReflectionException;
@@ -30,19 +30,12 @@
*/
class Config implements StorageInterface
{
- /**
- * @var Data|null
- */
private static ?Data $configs = null;
- /**
- * @var Config|null
- */
private static ?Config $instance = null;
/**
* GetInstance
- * @return Config
*/
public static function getInstance(): Config
{
@@ -55,7 +48,6 @@ public static function getInstance(): Config
/**
* Loads configuration
- * @param Setup $setup
* @throws ConfigException
* @throws DiException
* @throws ReflectionException
@@ -71,7 +63,6 @@ public function load(Setup $setup): void
/**
* Imports new config file
- * @param Setup $setup
* @throws ConfigException
* @throws DiException
* @throws ReflectionException|LoaderException
@@ -93,7 +84,6 @@ public function import(Setup $setup): void
/**
* Gets the config item by given key
- * @param string $key
* @param mixed $default
* @return mixed|null
*/
@@ -108,7 +98,6 @@ public function get(string $key, $default = null)
/**
* Get all configs
- * @return Data|null
*/
public function all(): ?Data
{
@@ -117,8 +106,6 @@ public function all(): ?Data
/**
* Checks config data
- * @param string $key
- * @return bool
*/
public function has(string $key): bool
{
@@ -127,9 +114,7 @@ public function has(string $key): bool
/**
* Sets new value
- * @param string $key
* @param mixed $value
- * @return void
*/
public function set(string $key, $value): void
{
@@ -142,7 +127,6 @@ public function set(string $key, $value): void
/**
* Removes the data from config
- * @param string $key
*/
public function delete(string $key): void
{
diff --git a/src/Config/Exceptions/ConfigException.php b/src/Config/Exceptions/ConfigException.php
index bd2e0929a..b40910df7 100644
--- a/src/Config/Exceptions/ConfigException.php
+++ b/src/Config/Exceptions/ConfigException.php
@@ -25,10 +25,6 @@
*/
class ConfigException extends BaseException
{
- /**
- * @param string $name
- * @return ConfigException
- */
public static function configCollision(string $name): self
{
return new self(
diff --git a/src/Config/Helpers/config.php b/src/Config/Helpers/config.php
index 0b9aebaf0..877f549c9 100644
--- a/src/Config/Helpers/config.php
+++ b/src/Config/Helpers/config.php
@@ -16,7 +16,6 @@
/**
* Config facade
- * @return Config
*/
function config(): Config
{
diff --git a/src/Console/CommandDiscovery.php b/src/Console/CommandDiscovery.php
index 6cc1018c9..3b0ffe381 100644
--- a/src/Console/CommandDiscovery.php
+++ b/src/Console/CommandDiscovery.php
@@ -24,9 +24,6 @@
class CommandDiscovery
{
/**
- * @param string $directory
- * @param string $namespace
- * @return array
* @throws ReflectionException
*/
public static function discover(string $directory, string $namespace): array
diff --git a/src/Console/Commands/CronRunCommand.php b/src/Console/Commands/CronRunCommand.php
index 1d6bffb60..6c2d6c3f3 100644
--- a/src/Console/Commands/CronRunCommand.php
+++ b/src/Console/Commands/CronRunCommand.php
@@ -26,19 +26,16 @@ class CronRunCommand extends QtCommand
{
/**
* The console command name.
- * @var string|null
*/
protected ?string $name = 'cron:run';
/**
* The console command description.
- * @var string|null
*/
protected ?string $description = 'Run scheduled cron tasks';
/**
* Command help text.
- * @var string|null
*/
protected ?string $help = 'Executes scheduled tasks defined in the cron directory. Use --task to run a single task or --force to bypass locks.';
@@ -78,9 +75,6 @@ public function exec(): void
/**
* Run all due tasks
- * @param CronManager $manager
- * @param bool $force
- * @return void
*/
private function runAllDueTasks(CronManager $manager, bool $force): void
{
@@ -115,10 +109,6 @@ private function runAllDueTasks(CronManager $manager, bool $force): void
/**
* Run a specific task
- * @param CronManager $manager
- * @param string $taskName
- * @param bool $force
- * @return void
* @throws CronException
*/
private function runSpecificTask(CronManager $manager, string $taskName, bool $force): void
diff --git a/src/Console/Commands/DebugBarCommand.php b/src/Console/Commands/DebugBarCommand.php
index d196bb3ca..899a75295 100644
--- a/src/Console/Commands/DebugBarCommand.php
+++ b/src/Console/Commands/DebugBarCommand.php
@@ -31,37 +31,31 @@ class DebugBarCommand extends QtCommand
{
/**
* File System
- * @var FileSystem|null
*/
protected ?FileSystem $fs = null;
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'install:debugbar';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Publishes debugbar assets';
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will publish debugbar assets';
/**
* Path to public debug bar resources
- * @var string
*/
private string $publicDebugBarFolderPath = 'public/assets/DebugBar/Resources';
/**
* Path to vendor debug bar resources
- * @var string
*/
private string $vendorDebugBarFolderPath = 'vendor/php-debugbar/php-debugbar/src/DebugBar/Resources';
@@ -89,9 +83,6 @@ public function exec(): void
/**
* Recursively copies the debug bar assets
- * @param string $src
- * @param string $dst
- * @return void
* @throws FileSystemException
*/
private function copyResources(string $src, string $dst): void
diff --git a/src/Console/Commands/EnvCommand.php b/src/Console/Commands/EnvCommand.php
index b7f83819e..7836a6014 100644
--- a/src/Console/Commands/EnvCommand.php
+++ b/src/Console/Commands/EnvCommand.php
@@ -30,25 +30,21 @@ class EnvCommand extends QtCommand
{
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'core:env';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Generates new .env file';
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will generate new .env file from .env.example';
/**
* Command options
- * @var array
*/
protected array $options = [
['yes', 'y', 'none', 'Acceptance of the confirmation'],
diff --git a/src/Console/Commands/InstallToolkitCommand.php b/src/Console/Commands/InstallToolkitCommand.php
index f445e3152..a9ba2a6f4 100644
--- a/src/Console/Commands/InstallToolkitCommand.php
+++ b/src/Console/Commands/InstallToolkitCommand.php
@@ -29,19 +29,16 @@ class InstallToolkitCommand extends QtCommand
{
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'install:toolkit';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Installs toolkit';
/**
* Command arguments
- * @var array
*/
protected array $args = [
['username', 'required', 'The username for basic auth'],
@@ -50,7 +47,6 @@ class InstallToolkitCommand extends QtCommand
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will install Toolkit and its assets into your project';
@@ -90,8 +86,6 @@ public function exec(): void
/**
* Runs an external command
- * @param string $commandName
- * @param array $arguments
* @throws ExceptionInterface
*/
protected function runExternalCommand(string $commandName, array $arguments)
diff --git a/src/Console/Commands/KeyGenerateCommand.php b/src/Console/Commands/KeyGenerateCommand.php
index 96fb98104..4bbb02643 100644
--- a/src/Console/Commands/KeyGenerateCommand.php
+++ b/src/Console/Commands/KeyGenerateCommand.php
@@ -27,25 +27,21 @@ class KeyGenerateCommand extends QtCommand
{
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'core:key';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Generates and stores the application key';
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will generate APP_KEY and store in .env file';
/**
* Command options
- * @var array
*/
protected array $options = [
['length', 'l', 'required', 'Length of the key', 32],
@@ -75,7 +71,6 @@ public function exec(): void
/**
* Generates random string
- * @return string
* @throws Exception
*/
private function generateRandomKey(): string
diff --git a/src/Console/Commands/MigrationGenerateCommand.php b/src/Console/Commands/MigrationGenerateCommand.php
index fb6708cdd..9c071b7af 100644
--- a/src/Console/Commands/MigrationGenerateCommand.php
+++ b/src/Console/Commands/MigrationGenerateCommand.php
@@ -27,13 +27,11 @@ class MigrationGenerateCommand extends QtCommand
{
/**
* The console command name.
- * @var string|null
*/
protected ?string $name = 'migration:generate';
/**
* The console command description.
- * @var string|null
*/
protected ?string $description = 'Generates new migration file';
diff --git a/src/Console/Commands/MigrationMigrateCommand.php b/src/Console/Commands/MigrationMigrateCommand.php
index cfdb911ac..5b90d1c1c 100644
--- a/src/Console/Commands/MigrationMigrateCommand.php
+++ b/src/Console/Commands/MigrationMigrateCommand.php
@@ -31,13 +31,11 @@ class MigrationMigrateCommand extends QtCommand
{
/**
* The console command name.
- * @var string|null
*/
protected ?string $name = 'migration:migrate';
/**
* The console command description.
- * @var string|null
*/
protected ?string $description = 'Migrates the migrations';
diff --git a/src/Console/Commands/ModuleGenerateCommand.php b/src/Console/Commands/ModuleGenerateCommand.php
index ccf0d164f..f2bd84d8e 100644
--- a/src/Console/Commands/ModuleGenerateCommand.php
+++ b/src/Console/Commands/ModuleGenerateCommand.php
@@ -27,13 +27,11 @@ class ModuleGenerateCommand extends QtCommand
{
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'module:generate';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Generate new module';
@@ -47,13 +45,11 @@ class ModuleGenerateCommand extends QtCommand
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will create files for new module';
/**
* Command options
- * @var array
*/
protected array $options = [
['yes', 'y', 'none', 'Module enabled status'],
diff --git a/src/Console/Commands/OpenApiCommand.php b/src/Console/Commands/OpenApiCommand.php
index ead03289f..1656a0db7 100644
--- a/src/Console/Commands/OpenApiCommand.php
+++ b/src/Console/Commands/OpenApiCommand.php
@@ -36,7 +36,6 @@ class OpenApiCommand extends QtCommand
{
/**
* File System
- * @var FileSystem
*/
protected FileSystem $fs;
@@ -49,13 +48,11 @@ public function __construct()
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'install:openapi';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Generates files for OpenApi UI';
@@ -69,25 +66,21 @@ public function __construct()
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will publish OpenApi UI resources';
/**
* Path to public debug bar resources
- * @var string
*/
private string $publicOpenApiFolderPath = 'public/assets/OpenApiUi';
/**
* Path to vendor debug bar resources
- * @var string
*/
private string $vendorOpenApiFolderPath = 'vendor/swagger-api/swagger-ui/dist';
/**
* Exclude File Names
- * @var array
*/
private array $excludeFileNames = ['index.html', 'swagger-initializer.js', 'favicon-16x16.png', 'favicon-32x32.png'];
@@ -164,7 +157,6 @@ private function copyResources(): void
/**
* Generates file with OpenApi specifications
- * @param string $module
*/
private function generateOpenapiSpecification(string $module): void
{
@@ -181,8 +173,6 @@ private function generateOpenapiSpecification(string $module): void
/**
* Gets the OpenApi routes
- * @param string $module
- * @return string
*/
private function openapiRoutes(string $module): string
{
diff --git a/src/Console/Commands/ResourceCacheClearCommand.php b/src/Console/Commands/ResourceCacheClearCommand.php
index b4c7531f3..d9b217589 100644
--- a/src/Console/Commands/ResourceCacheClearCommand.php
+++ b/src/Console/Commands/ResourceCacheClearCommand.php
@@ -32,25 +32,21 @@ class ResourceCacheClearCommand extends QtCommand
{
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'cache:clear';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Clears resource cache';
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'The command will clear the resource cache';
/**
* Command options
- * @var array
*/
protected array $options = [
['all', 'all', 'none', ''],
@@ -58,34 +54,16 @@ class ResourceCacheClearCommand extends QtCommand
['module', 'm', 'required', ''],
];
- /**
- * @var array
- */
protected array $types = ['views', 'asserts'];
- /**
- * @var array
- */
protected array $modules = [];
- /**
- * @var string|null
- */
protected ?string $type = null;
- /**
- * @var string|null
- */
protected ?string $module = null;
- /**
- * @var string
- */
protected string $cacheDir = '';
- /**
- * @var FileSystem|null
- */
protected ?FileSystem $fs = null;
/**
@@ -121,9 +99,6 @@ public function exec(): void
$this->info('Resource cache cleared successfully.');
}
- /**
- * @return void
- */
private function importModules(): void
{
try {
@@ -141,7 +116,6 @@ private function importModules(): void
}
/**
- * @return void
* @throws ConfigException
* @throws DiException
* @throws ReflectionException
@@ -156,8 +130,6 @@ private function importConfig(): void
}
/**
- * @param string|null $moduleOption
- * @return void
* @throws Exception
*/
private function initModule(?string $moduleOption): void
@@ -175,8 +147,6 @@ private function initModule(?string $moduleOption): void
}
/**
- * @param string|null $typeOption
- * @return void
* @throws Exception
*/
private function initType(?string $typeOption): void
@@ -192,11 +162,6 @@ private function initType(?string $typeOption): void
}
}
- /**
- * @param string|null $moduleName
- * @param string|null $type
- * @return void
- */
private function clearResourceModuleAndType(?string $moduleName = null, ?string $type = null): void
{
$dir = $this->cacheDir;
@@ -216,10 +181,6 @@ private function clearResourceModuleAndType(?string $moduleName = null, ?string
$this->removeFilesFromDirectory($dir);
}
- /**
- * @param string $dir
- * @return void
- */
private function removeFilesFromDirectory(string $dir): void
{
$entries = $this->fs->glob($dir . DS . '*');
diff --git a/src/Console/Commands/RouteListCommand.php b/src/Console/Commands/RouteListCommand.php
index c5e340eb0..d9f46bc49 100644
--- a/src/Console/Commands/RouteListCommand.php
+++ b/src/Console/Commands/RouteListCommand.php
@@ -33,13 +33,11 @@ class RouteListCommand extends QtCommand
{
/**
* The console command name.
- * @var string|null
*/
protected ?string $name = 'route:list';
/**
* The console command description.
- * @var string|null
*/
protected ?string $description = 'Display all registered routes';
@@ -106,9 +104,6 @@ static function (Route $route) use ($module): bool {
/**
* Composes a table row
- * @param Route $route
- * @param int $maxContentLength
- * @return array
*/
private function composeTableRow(Route $route, int $maxContentLength = 25): array
{
diff --git a/src/Console/Commands/ServeCommand.php b/src/Console/Commands/ServeCommand.php
index 05bf57507..a4904de64 100644
--- a/src/Console/Commands/ServeCommand.php
+++ b/src/Console/Commands/ServeCommand.php
@@ -41,31 +41,26 @@ class ServeCommand extends QtCommand
/**
* The console command name.
- * @var string|null
*/
protected ?string $name = 'serve';
/**
* The console command description.
- * @var string|null
*/
protected ?string $description = 'Serves the application on the PHP development server';
/**
* Default host
- * @var string
*/
protected string $defaultHost = '127.0.0.1';
/**
* Default port
- * @var int
*/
protected int $defaultPort = 8000;
/**
* Max ports to scan
- * @var int
*/
protected int $maxPortScan = 50;
@@ -94,9 +89,6 @@ public function exec(): void
/**
* Start the server on the first available port.
- * @param string $host
- * @param int $startPort
- * @return array
* @throws RuntimeException
*/
protected function startServerOnAvailablePort(string $host, int $startPort): array
@@ -131,7 +123,6 @@ protected function startServerOnAvailablePort(string $host, int $startPort): arr
/**
* Handle server execution (browser opening and process monitoring).
- * @param array $serverData
*/
protected function handleServerExecution(array $serverData): void
{
@@ -155,9 +146,6 @@ protected function cleanupProcess($process): void
/**
* Check if port is already in use by another process.
- * @param string $host
- * @param int $port
- * @return bool
*/
protected function isPortInUse(string $host, int $port): bool
{
@@ -171,8 +159,6 @@ protected function isPortInUse(string $host, int $port): bool
/**
* Start PHP built-in server.
- * @param string $host
- * @param int $port
* @return resource
*/
protected function startPhpServer(string $host, int $port)
@@ -202,8 +188,6 @@ protected function startPhpServer(string $host, int $port)
/**
* Wait until the PHP server is ready to accept connections.
- * @param string $host
- * @param int $port
* @param resource $process
*/
protected function waitUntilServerIsReady(string $host, int $port, $process): void
@@ -245,7 +229,6 @@ protected function waitForProcess($process): void
/**
* Determine whether the browser should be opened.
- * @return bool
*/
protected function shouldOpenBrowser(): bool
{
@@ -254,7 +237,6 @@ protected function shouldOpenBrowser(): bool
/**
* Open the default browser.
- * @param string $url
*/
protected function openBrowser(string $url): void
{
@@ -277,8 +259,6 @@ protected function openBrowser(string $url): void
/**
* Resolve platform-specific browser command.
- * @param string $url
- * @return array|null
*/
protected function browserCommand(string $url): ?array
{
@@ -296,7 +276,6 @@ protected function browserCommand(string $url): ?array
/**
* Get host option.
- * @return string
*/
protected function host(): string
{
@@ -305,7 +284,6 @@ protected function host(): string
/**
* Get and validate port option.
- * @return int
*/
protected function port(): int
{
diff --git a/src/Console/Commands/VersionCommand.php b/src/Console/Commands/VersionCommand.php
index d6ac38622..0c67514c7 100644
--- a/src/Console/Commands/VersionCommand.php
+++ b/src/Console/Commands/VersionCommand.php
@@ -31,19 +31,16 @@ class VersionCommand extends QtCommand
{
/**
* Command name
- * @var string|null
*/
protected ?string $name = 'core:version';
/**
* Command description
- * @var string|null
*/
protected ?string $description = 'Core version';
/**
* Command help text
- * @var string|null
*/
protected ?string $help = 'Printing the current version of the framework into the terminal';
diff --git a/src/Console/QtCommand.php b/src/Console/QtCommand.php
index 42ef83cb8..6b1d093b6 100644
--- a/src/Console/QtCommand.php
+++ b/src/Console/QtCommand.php
@@ -30,44 +30,33 @@ abstract class QtCommand extends Command implements CommandInterface
{
/**
* Console command name
- * @var string|null
*/
protected ?string $name = null;
/**
* Console command description.
- * @var string|null
*/
protected ?string $description = null;
/**
* Console command help text
- * @var string|null
*/
protected ?string $help = null;
/**
* Console command input arguments
- * @var array
* @example ['name', 'type', 'description']
*/
protected array $args = [];
/**
* Console command options
- * @var array
* @example ['name', 'shortcut', 'type', 'description', 'default']
*/
protected array $options = [];
- /**
- * @var InputInterface|null
- */
protected ?InputInterface $input = null;
- /**
- * @var OutputInterface|null
- */
protected ?OutputInterface $output = null;
/**
@@ -88,7 +77,6 @@ public function __construct()
/**
* Returns the argument value for a given argument name.
- * @param string|null $key
* @return mixed|string
*/
public function getArgument(?string $key = null)
@@ -98,7 +86,6 @@ public function getArgument(?string $key = null)
/**
* Returns the option value for a given option name.
- * @param string|null $key
* @return mixed|string
*/
public function getOption(?string $key = null)
@@ -108,7 +95,6 @@ public function getOption(?string $key = null)
/**
* Outputs the string to console
- * @param string $message
*/
public function output(string $message): void
{
@@ -117,7 +103,6 @@ public function output(string $message): void
/**
* Outputs the string to the console as info
- * @param string $message
*/
public function info(string $message): void
{
@@ -126,7 +111,6 @@ public function info(string $message): void
/**
* Outputs the string to console as comment
- * @param string $message
*/
public function comment(string $message): void
{
@@ -135,7 +119,6 @@ public function comment(string $message): void
/**
* Outputs the string to console as question
- * @param string $message
*/
public function question(string $message): void
{
@@ -144,8 +127,6 @@ public function question(string $message): void
/**
* Asks confirmation
- * @param string $message
- * @return bool
*/
public function confirm(string $message): bool
{
@@ -158,7 +139,6 @@ public function confirm(string $message): bool
/**
* Outputs the string to the console as an error
- * @param string $message
*/
public function error(string $message): void
{
@@ -176,9 +156,6 @@ protected function configure()
/**
* Executes the current command.
- * @param InputInterface $input
- * @param OutputInterface $output
- * @return int
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
diff --git a/src/Contracts/StorageInterface.php b/src/Contracts/StorageInterface.php
index 435827298..eb9d523b1 100644
--- a/src/Contracts/StorageInterface.php
+++ b/src/Contracts/StorageInterface.php
@@ -27,28 +27,23 @@ public function all();
/**
* Checks if the storage contains a key
- * @param string $key
- * @return bool
*/
public function has(string $key): bool;
/**
* Gets the value from the storage by given key
- * @param string $key
* @return mixed|null
*/
public function get(string $key);
/**
* Sets storage value with the given key
- * @param string $key
* @param mixed $value
*/
public function set(string $key, $value);
/**
* Deletes the data from the storage by given key
- * @param string $key
*/
public function delete(string $key);
diff --git a/src/Cookie/Contracts/CookieStorageInterface.php b/src/Cookie/Contracts/CookieStorageInterface.php
index fa5351dae..33926f379 100644
--- a/src/Cookie/Contracts/CookieStorageInterface.php
+++ b/src/Cookie/Contracts/CookieStorageInterface.php
@@ -24,20 +24,12 @@ interface CookieStorageInterface extends StorageInterface
{
/**
* Sets data by given key
- * @param string $key
* @param mixed $value
- * @param int $time
- * @param string $path
- * @param string $domain
- * @param bool $secure
- * @param bool $httponly
*/
public function set(string $key, $value = '', int $time = 0, string $path = '/', string $domain = '', bool $secure = false, bool $httponly = false);
/**
* Deletes data by given key
- * @param string $key
- * @param string $path
*/
public function delete(string $key, string $path = '/');
}
diff --git a/src/Cookie/Cookie.php b/src/Cookie/Cookie.php
index 02e6bbbeb..415295f23 100644
--- a/src/Cookie/Cookie.php
+++ b/src/Cookie/Cookie.php
@@ -43,8 +43,6 @@ private function __construct()
/**
* Gets the cookie instance
- * @param array $storage
- * @return Cookie
*/
public static function getInstance(array &$storage): Cookie
{
diff --git a/src/Cookie/Helpers/cookie.php b/src/Cookie/Helpers/cookie.php
index 0b70ed964..5ab4748dc 100644
--- a/src/Cookie/Helpers/cookie.php
+++ b/src/Cookie/Helpers/cookie.php
@@ -16,7 +16,6 @@
/**
* Gets cookie handler
- * @return Cookie
*/
function cookie(): Cookie
{
diff --git a/src/Cron/Contracts/CronTaskInterface.php b/src/Cron/Contracts/CronTaskInterface.php
index 49e63a10f..3acaf6b77 100644
--- a/src/Cron/Contracts/CronTaskInterface.php
+++ b/src/Cron/Contracts/CronTaskInterface.php
@@ -22,25 +22,21 @@ interface CronTaskInterface
{
/**
* Get the cron expression
- * @return string
*/
public function getExpression(): string;
/**
* Get the task name
- * @return string
*/
public function getName(): string;
/**
* Check if the task should run at the current time
- * @return bool
*/
public function shouldRun(): bool;
/**
* Execute the task
- * @return void
*/
public function handle(): void;
}
diff --git a/src/Cron/CronLock.php b/src/Cron/CronLock.php
index 57f44ccff..1e90b10a1 100644
--- a/src/Cron/CronLock.php
+++ b/src/Cron/CronLock.php
@@ -20,40 +20,22 @@
*/
class CronLock
{
- /**
- * @var string
- */
private string $lockDirectory;
- /**
- * @var string
- */
private string $taskName;
- /**
- * @var string
- */
private string $lockFile;
/** @var resource|null */
- private $lockHandle = null;
+ private $lockHandle;
- /**
- * @var bool
- */
private bool $ownsLock = false;
- /**
- * @var int
- */
private int $maxLockAge;
private const DEFAULT_MAX_LOCK_AGE = 86400;
/**
- * @param string $taskName
- * @param string|null $lockDirectory
- * @param int|null $maxLockAge
* @throws BaseException|ConfigException|CronException|DiException|ReflectionException
*/
public function __construct(string $taskName, ?string $lockDirectory = null, ?int $maxLockAge = null)
@@ -97,7 +79,6 @@ public function acquire(): bool
/**
* Update the lock timestamp (useful for long-running jobs)
- * @return bool
*/
public function refresh(): bool
{
@@ -108,9 +89,6 @@ public function refresh(): bool
return $this->writeTimestampToHandle($this->lockHandle);
}
- /**
- * @return int
- */
public function getTimestamp(): int
{
if ($this->lockHandle === null) {
@@ -122,7 +100,6 @@ public function getTimestamp(): int
}
/**
- * @return bool
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -150,7 +127,6 @@ public function release(): bool
/**
* Check if another process currently holds the lock.
- * @return bool
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -178,10 +154,6 @@ public function isLocked(): bool
return false;
}
- /**
- * @param string $taskName
- * @return string
- */
private function sanitizeTaskName(string $taskName): string
{
$taskName = trim($taskName);
@@ -196,26 +168,18 @@ private function sanitizeTaskName(string $taskName): string
return $taskName !== '' ? $taskName : 'default';
}
- /**
- * @param string|null $lockDirectory
- * @return string
- */
private function resolveLockDirectory(?string $lockDirectory): string
{
$path = $lockDirectory ?? cron_config('lock_path');
return $path ?? $this->getDefaultLockDirectory();
}
- /**
- * @return string
- */
private function getDefaultLockDirectory(): string
{
return base_dir() . DS . 'runtime' . DS . 'cron' . DS . 'locks';
}
/**
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws CronException
@@ -236,8 +200,6 @@ private function ensureLockDirectoryExists(): void
}
/**
- * @param string $directory
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws CronException
@@ -262,7 +224,6 @@ private function createDirectory(string $directory): void
}
/**
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -305,7 +266,6 @@ private function cleanupStaleLocks(): void
/**
* @param $handle
- * @return bool
*/
private function writeTimestampToHandle($handle): bool
{
@@ -332,7 +292,6 @@ private function writeTimestampToHandle($handle): bool
/**
* @param $handle
- * @return int|null
*/
private function readTimestampFromHandle($handle): ?int
{
@@ -344,7 +303,7 @@ private function readTimestampFromHandle($handle): ?int
return null;
}
- $timestamp = (int) trim((string) $content);
+ $timestamp = (int) trim($content);
return $timestamp > 0 ? $timestamp : null;
}
}
diff --git a/src/Cron/CronManager.php b/src/Cron/CronManager.php
index b015ef37c..8f564f504 100644
--- a/src/Cron/CronManager.php
+++ b/src/Cron/CronManager.php
@@ -54,7 +54,6 @@ class CronManager
/**
* CronManager constructor
- * @param string|null $cronDirectory
*/
public function __construct(?string $cronDirectory = null)
{
@@ -67,9 +66,7 @@ public function __construct(?string $cronDirectory = null)
* @return void
* @throws CronException
*/
-
/**
- * @return void
* @throws CronException|BaseException|ConfigException|DiException|ReflectionException
*/
public function loadTasks(): void
@@ -91,8 +88,6 @@ public function loadTasks(): void
}
/**
- * @param string $file
- * @return void
* @throws BaseException|ConfigException|CronException|DiException|ReflectionException
*/
private function loadTaskFromFile(string $file): void
@@ -112,8 +107,6 @@ private function loadTaskFromFile(string $file): void
/**
* Create a task from array definition
- * @param array $definition
- * @return CronTask
* @throws CronException
*/
private function createTaskFromArray(array $definition): CronTask
@@ -134,9 +127,7 @@ private function createTaskFromArray(array $definition): CronTask
* @param bool $force Ignore locks
* @return array Statistics
*/
-
/**
- * @param bool $force
* @return array|int[]
* @throws BaseException|ConfigException|CronException|DiException|ReflectionException
*/
@@ -157,9 +148,6 @@ public function runDueTasks(bool $force = false): array
/**
* Run a specific task by name
- * @param string $taskName
- * @param bool $force
- * @return void
* @throws BaseException|ConfigException|CronException|DiException|ReflectionException
*/
public function runTaskByName(string $taskName, bool $force = false): void
@@ -175,9 +163,6 @@ public function runTaskByName(string $taskName, bool $force = false): void
/**
* Run a single task
- * @param CronTaskInterface $task
- * @param bool $force
- * @return void
* @throws BaseException|ConfigException|CronException|DiException|ReflectionException
*/
private function runTask(CronTaskInterface $task, bool $force = false): void
@@ -223,7 +208,6 @@ public function getTasks(): array
/**
* Get execution statistics
- * @return array
*/
public function getStats(): array
{
@@ -232,7 +216,6 @@ public function getStats(): array
/**
* Get default cron directory
- * @return string
*/
private function getDefaultCronDirectory(): string
{
@@ -241,10 +224,6 @@ private function getDefaultCronDirectory(): string
/**
* Log a message
- * @param string $level
- * @param string $message
- * @param array $context
- * @return void
*/
private function log(string $level, string $message, array $context = []): void
{
diff --git a/src/Cron/CronTask.php b/src/Cron/CronTask.php
index b4bcb657a..7ac24f12e 100644
--- a/src/Cron/CronTask.php
+++ b/src/Cron/CronTask.php
@@ -42,9 +42,6 @@ class CronTask implements CronTaskInterface
/**
* CronTask constructor
- * @param string $name
- * @param string $expression
- * @param callable $callback
* @throws CronException
*/
public function __construct(string $name, string $expression, callable $callback)
@@ -93,7 +90,6 @@ public function handle(): void
/**
* Get the next run date
- * @return \DateTime
*/
public function getNextRunDate(): \DateTime
{
@@ -102,7 +98,6 @@ public function getNextRunDate(): \DateTime
/**
* Get the previous run date
- * @return \DateTime
*/
public function getPreviousRunDate(): \DateTime
{
diff --git a/src/Cron/Exceptions/CronException.php b/src/Cron/Exceptions/CronException.php
index db278a6a9..9a94dbad6 100644
--- a/src/Cron/Exceptions/CronException.php
+++ b/src/Cron/Exceptions/CronException.php
@@ -24,8 +24,6 @@ class CronException extends \Exception
{
/**
* Task not found exception
- * @param string $taskName
- * @return CronException
*/
public static function taskNotFound(string $taskName): CronException
{
@@ -34,8 +32,6 @@ public static function taskNotFound(string $taskName): CronException
/**
* Invalid cron expression exception
- * @param string $expression
- * @return CronException
*/
public static function invalidExpression(string $expression): CronException
{
@@ -44,8 +40,6 @@ public static function invalidExpression(string $expression): CronException
/**
* Lock acquire failed exception
- * @param string $taskName
- * @return CronException
*/
public static function lockAcquireFailed(string $taskName): CronException
{
@@ -54,9 +48,6 @@ public static function lockAcquireFailed(string $taskName): CronException
/**
* Task execution failed exception
- * @param string $taskName
- * @param string $error
- * @return CronException
*/
public static function taskExecutionFailed(string $taskName, string $error): CronException
{
@@ -65,8 +56,6 @@ public static function taskExecutionFailed(string $taskName, string $error): Cro
/**
* Invalid task file exception
- * @param string $file
- * @return CronException
*/
public static function invalidTaskFile(string $file): CronException
{
@@ -75,8 +64,6 @@ public static function invalidTaskFile(string $file): CronException
/**
* Cron directory not found exception
- * @param string $directory
- * @return CronException
*/
public static function cronDirectoryNotFound(string $directory): CronException
{
@@ -85,8 +72,6 @@ public static function cronDirectoryNotFound(string $directory): CronException
/**
* Lock directory not writable exception
- * @param string $directory
- * @return CronException
*/
public static function lockDirectoryNotWritable(string $directory): CronException
{
diff --git a/src/Cron/Helpers/cron.php b/src/Cron/Helpers/cron.php
index 844c0b40e..feb3c925f 100644
--- a/src/Cron/Helpers/cron.php
+++ b/src/Cron/Helpers/cron.php
@@ -20,7 +20,6 @@
if (!function_exists('cron_config')) {
/**
* Resolve cron configuration value
- * @param string $key
* @param mixed $default
* @return mixed|null
*/
@@ -47,8 +46,6 @@ function cron_config(string $key, $default = null)
if (!function_exists('cron_manager')) {
/**
* Get CronManager instance
- * @param string|null $cronDirectory
- * @return CronManager
*/
function cron_manager(?string $cronDirectory = null): CronManager
{
@@ -59,10 +56,6 @@ function cron_manager(?string $cronDirectory = null): CronManager
if (!function_exists('cron_task')) {
/**
* Create a new cron task
- * @param string $name
- * @param string $expression
- * @param callable $callback
- * @return CronTask
* @throws \Quantum\Cron\Exceptions\CronException
*/
function cron_task(string $name, string $expression, callable $callback): CronTask
@@ -74,8 +67,6 @@ function cron_task(string $name, string $expression, callable $callback): CronTa
if (!function_exists('schedule')) {
/**
* Create a new schedule with fluent API
- * @param string $name
- * @return Schedule
*/
function schedule(string $name): Schedule
{
diff --git a/src/Cron/Schedule.php b/src/Cron/Schedule.php
index 8301f74b6..35e12c9d8 100644
--- a/src/Cron/Schedule.php
+++ b/src/Cron/Schedule.php
@@ -37,11 +37,10 @@ class Schedule
* Task callback
* @var callable|null
*/
- private $callback = null;
+ private $callback;
/**
* Schedule constructor
- * @param string $name
*/
public function __construct(string $name)
{
@@ -50,7 +49,6 @@ public function __construct(string $name)
/**
* Run the task every minute
- * @return self
*/
public function everyMinute(): self
{
@@ -60,7 +58,6 @@ public function everyMinute(): self
/**
* Run the task every five minutes
- * @return self
*/
public function everyFiveMinutes(): self
{
@@ -70,7 +67,6 @@ public function everyFiveMinutes(): self
/**
* Run the task every ten minutes
- * @return self
*/
public function everyTenMinutes(): self
{
@@ -80,7 +76,6 @@ public function everyTenMinutes(): self
/**
* Run the task every fifteen minutes
- * @return self
*/
public function everyFifteenMinutes(): self
{
@@ -90,7 +85,6 @@ public function everyFifteenMinutes(): self
/**
* Run the task every thirty minutes
- * @return self
*/
public function everyThirtyMinutes(): self
{
@@ -100,7 +94,6 @@ public function everyThirtyMinutes(): self
/**
* Run the task hourly
- * @return self
*/
public function hourly(): self
{
@@ -110,8 +103,6 @@ public function hourly(): self
/**
* Run the task hourly at a specific minute
- * @param int $minute
- * @return self
*/
public function hourlyAt(int $minute): self
{
@@ -121,7 +112,6 @@ public function hourlyAt(int $minute): self
/**
* Run the task every two hours
- * @return self
*/
public function everyTwoHours(): self
{
@@ -131,7 +121,6 @@ public function everyTwoHours(): self
/**
* Run the task every three hours
- * @return self
*/
public function everyThreeHours(): self
{
@@ -141,7 +130,6 @@ public function everyThreeHours(): self
/**
* Run the task every four hours
- * @return self
*/
public function everyFourHours(): self
{
@@ -151,7 +139,6 @@ public function everyFourHours(): self
/**
* Run the task every six hours
- * @return self
*/
public function everySixHours(): self
{
@@ -161,7 +148,6 @@ public function everySixHours(): self
/**
* Run the task daily
- * @return self
*/
public function daily(): self
{
@@ -172,7 +158,6 @@ public function daily(): self
/**
* Run the task daily at a specific time
* @param string $time Format: "HH:MM"
- * @return self
*/
public function dailyAt(string $time): self
{
@@ -185,9 +170,6 @@ public function dailyAt(string $time): self
/**
* Run the task twice daily
- * @param int $firstHour
- * @param int $secondHour
- * @return self
*/
public function twiceDaily(int $firstHour = 1, int $secondHour = 13): self
{
@@ -197,7 +179,6 @@ public function twiceDaily(int $firstHour = 1, int $secondHour = 13): self
/**
* Run the task weekly
- * @return self
*/
public function weekly(): self
{
@@ -209,7 +190,6 @@ public function weekly(): self
* Run the task weekly on a specific day and time
* @param int $dayOfWeek 0-6 (Sunday = 0)
* @param string $time Format: "HH:MM"
- * @return self
*/
public function weeklyOn(int $dayOfWeek, string $time = '0:00'): self
{
@@ -222,7 +202,6 @@ public function weeklyOn(int $dayOfWeek, string $time = '0:00'): self
/**
* Run the task monthly
- * @return self
*/
public function monthly(): self
{
@@ -232,9 +211,7 @@ public function monthly(): self
/**
* Run the task monthly on a specific day and time
- * @param int $dayOfMonth
* @param string $time Format: "HH:MM"
- * @return self
*/
public function monthlyOn(int $dayOfMonth = 1, string $time = '0:00'): self
{
@@ -247,10 +224,6 @@ public function monthlyOn(int $dayOfMonth = 1, string $time = '0:00'): self
/**
* Run the task twice monthly
- * @param int $firstDay
- * @param int $secondDay
- * @param string $time
- * @return self
*/
public function twiceMonthly(int $firstDay = 1, int $secondDay = 16, string $time = '0:00'): self
{
@@ -263,7 +236,6 @@ public function twiceMonthly(int $firstDay = 1, int $secondDay = 16, string $tim
/**
* Run the task quarterly
- * @return self
*/
public function quarterly(): self
{
@@ -273,7 +245,6 @@ public function quarterly(): self
/**
* Run the task yearly
- * @return self
*/
public function yearly(): self
{
@@ -283,7 +254,6 @@ public function yearly(): self
/**
* Run the task on weekdays
- * @return self
*/
public function weekdays(): self
{
@@ -293,7 +263,6 @@ public function weekdays(): self
/**
* Run the task on weekends
- * @return self
*/
public function weekends(): self
{
@@ -303,7 +272,6 @@ public function weekends(): self
/**
* Run the task on Mondays
- * @return self
*/
public function mondays(): self
{
@@ -312,7 +280,6 @@ public function mondays(): self
/**
* Run the task on Tuesdays
- * @return self
*/
public function tuesdays(): self
{
@@ -321,7 +288,6 @@ public function tuesdays(): self
/**
* Run the task on Wednesdays
- * @return self
*/
public function wednesdays(): self
{
@@ -330,7 +296,6 @@ public function wednesdays(): self
/**
* Run the task on Thursdays
- * @return self
*/
public function thursdays(): self
{
@@ -339,7 +304,6 @@ public function thursdays(): self
/**
* Run the task on Fridays
- * @return self
*/
public function fridays(): self
{
@@ -348,7 +312,6 @@ public function fridays(): self
/**
* Run the task on Saturdays
- * @return self
*/
public function saturdays(): self
{
@@ -357,7 +320,6 @@ public function saturdays(): self
/**
* Run the task on Sundays
- * @return self
*/
public function sundays(): self
{
@@ -367,7 +329,6 @@ public function sundays(): self
/**
* Run the task on specific days
* @param int|array $days
- * @return self
*/
public function days($days): self
{
@@ -379,7 +340,6 @@ public function days($days): self
/**
* Set the time for the task
* @param string $time Format: "HH:MM"
- * @return self
*/
public function at(string $time): self
{
@@ -398,8 +358,6 @@ public function at(string $time): self
/**
* Set custom cron expression
- * @param string $expression
- * @return self
*/
public function cron(string $expression): self
{
@@ -409,8 +367,6 @@ public function cron(string $expression): self
/**
* Set the callback for the task
- * @param callable $callback
- * @return self
*/
public function call(callable $callback): self
{
@@ -420,7 +376,6 @@ public function call(callable $callback): self
/**
* Build and return the CronTask
- * @return CronTask
* @throws CronException
*/
public function build(): CronTask
@@ -438,7 +393,6 @@ public function build(): CronTask
/**
* Get the cron expression
- * @return string|null
*/
public function getExpression(): ?string
{
diff --git a/src/Csrf/Csrf.php b/src/Csrf/Csrf.php
index 053a9f64a..069217953 100644
--- a/src/Csrf/Csrf.php
+++ b/src/Csrf/Csrf.php
@@ -39,19 +39,10 @@ class Csrf
*/
public const TOKEN_KEY = 'csrf-token';
- /**
- * @var Csrf|null
- */
private static ?Csrf $instance = null;
- /**
- * @var Session
- */
private Session $storage;
- /**
- * @var Hasher
- */
private Hasher $hasher;
/**
@@ -68,7 +59,6 @@ private function __construct()
/**
* Csrf instance
- * @return Csrf
*/
public static function getInstance(): Csrf
{
@@ -81,8 +71,6 @@ public static function getInstance(): Csrf
/**
* Generates the CSRF token or returns the previously generated one
- * @param string $key
- * @return string|null
*/
public function generateToken(string $key): ?string
{
@@ -95,8 +83,6 @@ public function generateToken(string $key): ?string
/**
* Checks the token
- * @param Request|null $request
- * @return bool
* @throws CsrfException
*/
public function checkToken(?Request $request): bool
diff --git a/src/Csrf/Exceptions/CsrfException.php b/src/Csrf/Exceptions/CsrfException.php
index 38b4e61e0..189f0309d 100644
--- a/src/Csrf/Exceptions/CsrfException.php
+++ b/src/Csrf/Exceptions/CsrfException.php
@@ -25,9 +25,6 @@
*/
class CsrfException extends BaseException
{
- /**
- * @return CsrfException
- */
public static function tokenNotFound(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function tokenNotFound(): self
);
}
- /**
- * @return CsrfException
- */
public static function tokenNotMatched(): self
{
return new self(
diff --git a/src/Csrf/Helpers/csrf.php b/src/Csrf/Helpers/csrf.php
index 7aa60deaf..ccce8dba6 100644
--- a/src/Csrf/Helpers/csrf.php
+++ b/src/Csrf/Helpers/csrf.php
@@ -18,7 +18,6 @@
/**
* Gets the Csrf instance
- * @return Csrf
*/
function csrf(): Csrf
{
@@ -27,7 +26,6 @@ function csrf(): Csrf
/**
* Generates the CSRF token
- * @return string|null
* @throws BaseException
*/
function csrf_token(): ?string
diff --git a/src/Database/Adapters/Idiorm/IdiormDbal.php b/src/Database/Adapters/Idiorm/IdiormDbal.php
index 2a218d1b1..ffd294001 100644
--- a/src/Database/Adapters/Idiorm/IdiormDbal.php
+++ b/src/Database/Adapters/Idiorm/IdiormDbal.php
@@ -94,19 +94,16 @@ class IdiormDbal implements DbalInterface, RelationalInterface
/**
* Idiorm Patch object
- * @var IdiormPatch
*/
private ?IdiormPatch $ormPatch = null;
/**
* ORM Model
- * @var ORM|null
*/
private ?ORM $ormModel = null;
/**
* Active connection
- * @var array|null
*/
private static ?array $connection = null;
@@ -135,13 +132,6 @@ class IdiormDbal implements DbalInterface, RelationalInterface
*/
private static string $ormClass = ORM::class;
- /**
- * @param string $table
- * @param string|null $modelName
- * @param string $idColumn
- * @param array $foreignKeys
- * @param array $hidden
- */
public function __construct(
string $table,
?string $modelName = null,
@@ -198,7 +188,6 @@ public function getTable(): string
/**
* Gets the ORM model
- * @return ORM
* @throws BaseException
*/
public function getOrmModel(): ORM
@@ -216,7 +205,6 @@ public function getOrmModel(): ORM
/**
* Gets foreign keys
- * @return array
*/
public function getForeignKeys(): array
{
@@ -225,7 +213,6 @@ public function getForeignKeys(): array
/**
* Gets the associated model name
- * @return string
*/
public function getModelName(): string
{
@@ -245,19 +232,11 @@ public function truncate(): bool
}
}
- /**
- * @param ORM $ormModel
- */
protected function updateOrmModel(ORM $ormModel)
{
$this->ormModel = $ormModel;
}
- /**
- * @param string $driver
- * @param array $config
- * @return array
- */
protected static function getBaseConfig(string $driver, array $config): array
{
return [
@@ -267,12 +246,6 @@ protected static function getBaseConfig(string $driver, array $config): array
];
}
- /**
- * @param string $driver
- * @param array $config
- * @param string $charset
- * @return array
- */
protected static function getDriverConfig(string $driver, array $config, string $charset): array
{
if ($driver === self::DRIVER_MYSQL || $driver === self::DRIVER_PGSQL) {
@@ -292,9 +265,6 @@ protected static function getDriverConfig(string $driver, array $config, string
/**
* Builds connection string
- * @param string $driver
- * @param array $config
- * @return string
*/
protected static function buildConnectionString(string $driver, array $config): string
{
diff --git a/src/Database/Adapters/Idiorm/IdiormPatch.php b/src/Database/Adapters/Idiorm/IdiormPatch.php
index 104228f37..c75b686a1 100644
--- a/src/Database/Adapters/Idiorm/IdiormPatch.php
+++ b/src/Database/Adapters/Idiorm/IdiormPatch.php
@@ -29,7 +29,6 @@ class IdiormPatch extends ORM
/**
* Get Instance
- * @return IdiormPatch
*/
public static function getInstance(): IdiormPatch
{
@@ -42,8 +41,6 @@ public static function getInstance(): IdiormPatch
/**
* Set ORM Object
- * @param object $ormModel
- * @return $this
*/
public function use(object $ormModel): IdiormPatch
{
@@ -53,10 +50,6 @@ public function use(object $ormModel): IdiormPatch
/**
* Add an LEFT JOIN source to the query
- * @param string $table
- * @param array $constraint
- * @param string|null $table_alias
- * @return object
*/
public function leftJoin(string $table, array $constraint, ?string $table_alias = null): object
{
@@ -65,10 +58,6 @@ public function leftJoin(string $table, array $constraint, ?string $table_alias
/**
* Add an RIGHT JOIN source to the query
- * @param string $table
- * @param array $constraint
- * @param string|null $table_alias
- * @return object
*/
public function rightJoin(string $table, array $constraint, ?string $table_alias = null): object
{
@@ -77,11 +66,6 @@ public function rightJoin(string $table, array $constraint, ?string $table_alias
/**
* Add Join
- * @param string $operator
- * @param string $table
- * @param array $constraint
- * @param string|null $table_alias
- * @return object
*/
public function addJoin(string $operator, string $table, array $constraint, ?string $table_alias = null): object
{
diff --git a/src/Database/Adapters/Idiorm/Statements/Criteria.php b/src/Database/Adapters/Idiorm/Statements/Criteria.php
index cc17973a7..6df57a07d 100644
--- a/src/Database/Adapters/Idiorm/Statements/Criteria.php
+++ b/src/Database/Adapters/Idiorm/Statements/Criteria.php
@@ -91,10 +91,7 @@ public function isNotNull(string $column): DbalInterface
/**
* Adds Criteria
- * @param string $column
- * @param string $operator
* @param mixed $value
- * @param string|null $func
* @throws DatabaseException
*/
protected function addCriteria(string $column, string $operator, $value, ?string $func = null)
@@ -110,7 +107,6 @@ protected function addCriteria(string $column, string $operator, $value, ?string
/**
* Adds one or more OR criteria in brackets
- * @param array $orCriterias
* @throws DatabaseException
*/
protected function orCriteria(array $orCriterias)
diff --git a/src/Database/Adapters/Idiorm/Statements/Join.php b/src/Database/Adapters/Idiorm/Statements/Join.php
index 0beecf7bc..27ba0c4b8 100644
--- a/src/Database/Adapters/Idiorm/Statements/Join.php
+++ b/src/Database/Adapters/Idiorm/Statements/Join.php
@@ -107,9 +107,6 @@ public function joinTo(DbModel $relatedModel, bool $switch = true): DbalInterfac
}
/**
- * @param DbModel $relatedModel
- * @param array $relation
- * @return void
* @throws BaseException
*/
protected function applyHasRelation(DbModel $relatedModel, array $relation): void
@@ -125,9 +122,6 @@ protected function applyHasRelation(DbModel $relatedModel, array $relation): voi
}
/**
- * @param DbModel $relatedModel
- * @param array $relation
- * @return void
* @throws BaseException
*/
protected function applyBelongsTo(DbModel $relatedModel, array $relation): void
@@ -143,8 +137,6 @@ protected function applyBelongsTo(DbModel $relatedModel, array $relation): void
}
/**
- * @param DbModel $modelToJoin
- * @return array
* @throws ModelException
*/
private function getValidatedRelation(DbModel $modelToJoin): array
diff --git a/src/Database/Adapters/Idiorm/Statements/Query.php b/src/Database/Adapters/Idiorm/Statements/Query.php
index b82621823..4a408059b 100644
--- a/src/Database/Adapters/Idiorm/Statements/Query.php
+++ b/src/Database/Adapters/Idiorm/Statements/Query.php
@@ -106,8 +106,6 @@ public static function queryLog(): array
/**
* Fetches columns of the table
- * @param string $table
- * @return array
* @throws DatabaseException
*/
public static function fetchColumns(string $table): array
diff --git a/src/Database/Adapters/Idiorm/Statements/Result.php b/src/Database/Adapters/Idiorm/Statements/Result.php
index 1f78d63f5..b33437632 100644
--- a/src/Database/Adapters/Idiorm/Statements/Result.php
+++ b/src/Database/Adapters/Idiorm/Statements/Result.php
@@ -106,7 +106,6 @@ public function asArray(): array
/**
* @param $result
- * @return array
*/
public function setHidden($result): array
{
diff --git a/src/Database/Adapters/Sleekdb/SleekDbal.php b/src/Database/Adapters/Sleekdb/SleekDbal.php
index 272b29097..5ec34e205 100644
--- a/src/Database/Adapters/Sleekdb/SleekDbal.php
+++ b/src/Database/Adapters/Sleekdb/SleekDbal.php
@@ -41,14 +41,8 @@ class SleekDbal implements DbalInterface
use Reducer;
use Join;
- /**
- * @var bool
- */
protected bool $isNew = false;
- /**
- * @var array
- */
protected array $data = [];
/**
@@ -56,14 +50,8 @@ class SleekDbal implements DbalInterface
*/
protected $modifiedFields = [];
- /**
- * @var array
- */
protected array $criterias = [];
- /**
- * @var array
- */
protected array $havings = [];
/**
@@ -124,7 +112,6 @@ class SleekDbal implements DbalInterface
/**
* ORM Model
- * @var Store|null
*/
private ?Store $ormModel = null;
@@ -148,13 +135,6 @@ class SleekDbal implements DbalInterface
'BETWEEN', 'NOT BETWEEN',
];
- /**
- * @param string $table
- * @param string|null $modelName
- * @param string $idColumn
- * @param array $foreignKeys
- * @param array $hidden
- */
public function __construct(
string $table,
?string $modelName = null,
@@ -189,17 +169,12 @@ public function setData(array $data): void
/**
* @param $modifiedFields
- * @return void
*/
public function setModifiedFields($modifiedFields): void
{
$this->modifiedFields = $modifiedFields;
}
- /**
- * @param bool $isNew
- * @return void
- */
public function setIsNew(bool $isNew): void
{
$this->isNew = $isNew;
@@ -231,7 +206,6 @@ public function getTable(): string
/**
* Gets the ORM model
- * @return Store
* @throws DatabaseException
* @throws IOException
* @throws InvalidArgumentException
@@ -259,9 +233,6 @@ public function getOrmModel(): Store
return $this->ormModel;
}
- /**
- * @param array|null $modelData
- */
public function updateOrmModel(?array $modelData): void
{
$this->data = $modelData;
@@ -284,7 +255,6 @@ public function truncate(): bool
/**
* Gets the query builder object
- * @return QueryBuilder
* @throws BaseException
* @throws DatabaseException
* @throws IOException
@@ -335,7 +305,6 @@ public function getBuilder(): QueryBuilder
/**
* Gets foreign keys
- * @return array
*/
public function getForeignKeys(): array
{
@@ -344,7 +313,6 @@ public function getForeignKeys(): array
/**
* Gets the associated model name
- * @return string
*/
public function getModelName(): string
{
diff --git a/src/Database/Adapters/Sleekdb/Statements/Criteria.php b/src/Database/Adapters/Sleekdb/Statements/Criteria.php
index ba790b5bf..66ef06128 100644
--- a/src/Database/Adapters/Sleekdb/Statements/Criteria.php
+++ b/src/Database/Adapters/Sleekdb/Statements/Criteria.php
@@ -90,7 +90,6 @@ public function isNotNull(string $column): DbalInterface
/**
* Adds one or more OR criteria in brackets
- * @param array $orCriterias
* @throws DatabaseException
*/
protected function orCriteria(array $orCriterias)
diff --git a/src/Database/Adapters/Sleekdb/Statements/Join.php b/src/Database/Adapters/Sleekdb/Statements/Join.php
index a121bdcbd..36966d058 100644
--- a/src/Database/Adapters/Sleekdb/Statements/Join.php
+++ b/src/Database/Adapters/Sleekdb/Statements/Join.php
@@ -54,11 +54,6 @@ private function applyJoins(): void
/**
* Apply the join to query builder
- * @param QueryBuilder $queryBuilder
- * @param SleekDbal $currentItem
- * @param array $nextItem
- * @param int $level
- * @return QueryBuilder
* @throws ModelException
*/
private function applyJoin(QueryBuilder $queryBuilder, SleekDbal $currentItem, array $nextItem, int $level = 1): QueryBuilder
@@ -96,11 +91,6 @@ private function applyJoin(QueryBuilder $queryBuilder, SleekDbal $currentItem, a
/**
* Apply join condition for JOINTO type
- * @param QueryBuilder $queryBuilder
- * @param DbModel $relatedModel
- * @param SleekDbal $currentModel
- * @param array $currentItem
- * @return void
* @throws InvalidArgumentException
* @throws ModelException
*/
@@ -124,10 +114,6 @@ private function applyJoinTo(QueryBuilder $queryBuilder, DbModel $relatedModel,
}
/**
- * @param QueryBuilder $queryBuilder
- * @param array $currentItem
- * @param array $relation
- * @return void
* @throws InvalidArgumentException
*/
private function applyHasRelation(QueryBuilder $queryBuilder, array $currentItem, array $relation): void
@@ -140,11 +126,6 @@ private function applyHasRelation(QueryBuilder $queryBuilder, array $currentItem
}
/**
- * @param QueryBuilder $queryBuilder
- * @param array $currentItem
- * @param array $relation
- * @param SleekDbal $currentModel
- * @return void
* @throws InvalidArgumentException
* @throws ModelException
*/
@@ -162,9 +143,6 @@ private function applyBelongsTo(QueryBuilder $queryBuilder, array $currentItem,
}
/**
- * @param SleekDbal $currentModel
- * @param DbModel $relatedModel
- * @return array
* @throws ModelException
*/
private function getValidatedRelation(SleekDbal $currentModel, DbModel $relatedModel): array
diff --git a/src/Database/Adapters/Sleekdb/Statements/Model.php b/src/Database/Adapters/Sleekdb/Statements/Model.php
index fb0047c80..94158673a 100644
--- a/src/Database/Adapters/Sleekdb/Statements/Model.php
+++ b/src/Database/Adapters/Sleekdb/Statements/Model.php
@@ -14,12 +14,13 @@
namespace Quantum\Database\Adapters\Sleekdb\Statements;
-use Quantum\Database\Exceptions\DatabaseException;
-use Quantum\Database\Contracts\DbalInterface;
use SleekDB\Exceptions\InvalidConfigurationException;
+use Quantum\Database\Exceptions\DatabaseException;
use SleekDB\Exceptions\InvalidArgumentException;
+use Quantum\Database\Contracts\DbalInterface;
use SleekDB\Exceptions\IdNotAllowedException;
use Quantum\Model\Exceptions\ModelException;
+use Quantum\App\Exceptions\BaseException;
use SleekDB\Exceptions\JsonException;
use SleekDB\Exceptions\IOException;
@@ -35,6 +36,7 @@ trait Model
public function create(): DbalInterface
{
$this->isNew = true;
+ $this->modifiedFields = [];
return $this;
}
@@ -58,7 +60,7 @@ public function prop(string $key, $value = null)
* @throws IdNotAllowedException
* @throws InvalidArgumentException
* @throws InvalidConfigurationException
- * @throws JsonException
+ * @throws JsonException|BaseException
*/
public function save(): bool
{
diff --git a/src/Database/Adapters/Sleekdb/Statements/Reducer.php b/src/Database/Adapters/Sleekdb/Statements/Reducer.php
index ae9dea220..5b3a68e3f 100644
--- a/src/Database/Adapters/Sleekdb/Statements/Reducer.php
+++ b/src/Database/Adapters/Sleekdb/Statements/Reducer.php
@@ -79,10 +79,6 @@ public function limit(int $limit): DbalInterface
return $this;
}
- /**
- * @param array $columns
- * @return array
- */
private function selectPatch(array $columns): array
{
foreach ($columns as &$column) {
diff --git a/src/Database/Adapters/Sleekdb/Statements/Result.php b/src/Database/Adapters/Sleekdb/Statements/Result.php
index 1ff303bb7..19f97946e 100644
--- a/src/Database/Adapters/Sleekdb/Statements/Result.php
+++ b/src/Database/Adapters/Sleekdb/Statements/Result.php
@@ -139,7 +139,6 @@ public function asArray(): array
/**
* @param $result
- * @return array
*/
public function setHidden($result): array
{
diff --git a/src/Database/Contracts/DbalInterface.php b/src/Database/Contracts/DbalInterface.php
index 6348a7605..684b1b390 100644
--- a/src/Database/Contracts/DbalInterface.php
+++ b/src/Database/Contracts/DbalInterface.php
@@ -24,13 +24,11 @@ interface DbalInterface
{
/**
* Connects to database
- * @param array $config
*/
public static function connect(array $config);
/**
* Gets the active connection
- * @return array|null
*/
public static function getConnection(): ?array;
@@ -41,113 +39,85 @@ public static function disconnect();
/**
* Gets the table
- * @return string
*/
public function getTable(): string;
/**
* Selects the values from provided table columns
* @param mixed $columns
- * @return DbalInterface
*/
public function select(...$columns): DbalInterface;
/**
* Finds the record by primary key
- * @param int $id
- * @return DbalInterface
*/
public function findOne(int $id): DbalInterface;
/**
* Finds the record by given column and value
- * @param string $column
* @param mixed $value
- * @return DbalInterface
*/
public function findOneBy(string $column, $value): DbalInterface;
/**
* Gets the first item
- * @return DbalInterface
*/
public function first(): DbalInterface;
/**
* Adds a criteria to query
- * @param string $column
- * @param string $operator
* @param mixed|null $value
- * @return DbalInterface
*/
public function criteria(string $column, string $operator, $value = null): DbalInterface;
/**
* Adds criteria to query
* @param array ...$criterias
- * @return DbalInterface
*/
public function criterias(...$criterias): DbalInterface;
/**
* Adds having criteria to query
- * @param string $column
- * @param string $operator
- * @param string|null $value
- * @return DbalInterface
*/
public function having(string $column, string $operator, ?string $value = null): DbalInterface;
/**
* Groups the result by given column
- * @param string $column
- * @return DbalInterface
*/
public function groupBy(string $column): DbalInterface;
/**
* Orders the result by ascending or descending
- * @param string $column
- * @param string $direction
- * @return DbalInterface
*/
public function orderBy(string $column, string $direction): DbalInterface;
/**
* Returns the result by given offset (works when limit also applied)
- * @param integer $offset
- * @return DbalInterface
*/
public function offset(int $offset): DbalInterface;
/**
* Returns the limited result set
- * @param int $limit
- * @return DbalInterface
*/
public function limit(int $limit): DbalInterface;
/**
* Gets the result set
- * @return array
*/
public function get(): array;
/**
* Returns the count
- * @return int
*/
public function count(): int;
/**
* Returns the data as array
- * @return array
*/
public function asArray(): array;
/**
* Sets or gets the model property
- * @param string $key
* @param mixed|null $value
* @return void|mixed|null
*/
@@ -155,53 +125,41 @@ public function prop(string $key, $value = null);
/**
* Creates new db record
- * @return DbalInterface
*/
public function create(): DbalInterface;
/**
* Saves the data into the database
- * @return bool
*/
public function save(): bool;
/**
* Deletes the record from the database
- * @return bool
*/
public function delete(): bool;
/**
* Deletes all records from the table
- * @return bool
*/
public function truncate(): bool;
/**
* Deletes many records by previously applied criteria
- * @return bool
*/
public function deleteMany(): bool;
/**
* Joins two models
- * @param DbModel $model
- * @param bool $switch
- * @return DbalInterface
*/
public function joinTo(DbModel $model, bool $switch = true): DbalInterface;
/**
* Checks if the given column is NULL
- * @param string $column
- * @return DbalInterface
*/
public function isNull(string $column): DbalInterface;
/**
* Checks if the given column is NOT NULL
- * @param string $column
- * @return DbalInterface
*/
public function isNotNull(string $column): DbalInterface;
}
diff --git a/src/Database/Contracts/RelationalInterface.php b/src/Database/Contracts/RelationalInterface.php
index b08d01eaf..56f8e34fd 100644
--- a/src/Database/Contracts/RelationalInterface.php
+++ b/src/Database/Contracts/RelationalInterface.php
@@ -22,72 +22,47 @@ interface RelationalInterface
{
/**
* Raw execute
- * @param string $query
- * @param array $parameters
- * @return bool
*/
public static function execute(string $query, array $parameters = []): bool;
/**
* Raw query
- * @param string $query
- * @param array $parameters
- * @return array
*/
public static function query(string $query, array $parameters = []): array;
/**
* Gets the last query executed
- * @return string|null
*/
public static function lastQuery(): ?string;
/**
* Returns the PDOStatement instance last used
- * @return object
*/
public static function lastStatement(): object;
/**
* Get an array containing all the queries
* run on a specified connection up to now.
- * @return array
*/
public static function queryLog(): array;
/**
* Adds a simple JOIN source to the query
- * @param string $table
- * @param array $constraint
- * @param string|null $tableAlias
- * @return DbalInterface
*/
public function join(string $table, array $constraint, ?string $tableAlias = null): DbalInterface;
/**
* Adds an INNER JOIN source to the query
- * @param string $table
- * @param array $constraint
- * @param string|null $tableAlias
- * @return DbalInterface
*/
public function innerJoin(string $table, array $constraint, ?string $tableAlias = null): DbalInterface;
/**
* Adds an LEFT JOIN source to the query
- * @param string $table
- * @param array $constraint
- * @param string|null $tableAlias
- * @return DbalInterface
*/
public function leftJoin(string $table, array $constraint, ?string $tableAlias = null): DbalInterface;
/**
* Adds an RIGHT JOIN source to the query
- * @param string $table
- * @param array $constraint
- * @param string|null $tableAlias
- * @return DbalInterface
*/
public function rightJoin(string $table, array $constraint, ?string $tableAlias = null): DbalInterface;
diff --git a/src/Database/Database.php b/src/Database/Database.php
index 9cd2f8993..a9233eac4 100644
--- a/src/Database/Database.php
+++ b/src/Database/Database.php
@@ -52,9 +52,6 @@ class Database
*/
private static ?Database $instance = null;
- /**
- * @var string
- */
private string $ormClass;
/**
@@ -82,7 +79,6 @@ private function __construct()
/**
* Get Instance
- * @return Database
*/
public static function getInstance(): Database
{
@@ -95,7 +91,6 @@ public static function getInstance(): Database
/**
* Gets the ORM class
- * @return string
*/
public function getOrmClass(): string
{
@@ -104,7 +99,6 @@ public function getOrmClass(): string
/**
* Gets the DB configurations
- * @return array|null
*/
public function getConfigs(): ?array
{
@@ -112,8 +106,6 @@ public function getConfigs(): ?array
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private function getAdapterClass(string $adapter): string
diff --git a/src/Database/Exceptions/DatabaseException.php b/src/Database/Exceptions/DatabaseException.php
index f1e69358a..739237071 100644
--- a/src/Database/Exceptions/DatabaseException.php
+++ b/src/Database/Exceptions/DatabaseException.php
@@ -25,9 +25,6 @@
*/
class DatabaseException extends BaseException
{
- /**
- * @return DatabaseException
- */
public static function incorrectConfig(): self
{
return new self(
@@ -36,10 +33,6 @@ public static function incorrectConfig(): self
);
}
- /**
- * @param string $operator
- * @return DatabaseException
- */
public static function operatorNotSupported(string $operator): self
{
return new self(
@@ -48,10 +41,6 @@ public static function operatorNotSupported(string $operator): self
);
}
- /**
- * @param string $name
- * @return DatabaseException
- */
public static function tableAlreadyExists(string $name): self
{
return new self(
@@ -60,10 +49,6 @@ public static function tableAlreadyExists(string $name): self
);
}
- /**
- * @param string $name
- * @return DatabaseException
- */
public static function tableDoesNotExists(string $name): self
{
return new self(
diff --git a/src/Database/Factories/TableFactory.php b/src/Database/Factories/TableFactory.php
index 41cb00e67..bf4ffc83a 100644
--- a/src/Database/Factories/TableFactory.php
+++ b/src/Database/Factories/TableFactory.php
@@ -26,8 +26,6 @@ class TableFactory
{
/**
* Creates new table
- * @param string $name
- * @return Table
* @throws DatabaseException
*/
public function create(string $name): Table
@@ -41,8 +39,6 @@ public function create(string $name): Table
/**
* Get the table
- * @param string $name
- * @return Table
* @throws DatabaseException
*/
public function get(string $name): Table
@@ -56,9 +52,6 @@ public function get(string $name): Table
/**
* Renames the table
- * @param string $oldName
- * @param string $newName
- * @return bool
* @throws DatabaseException
*/
public function rename(string $oldName, string $newName): bool
@@ -73,8 +66,6 @@ public function rename(string $oldName, string $newName): bool
/**
* Drops the table
- * @param string $name
- * @return bool
* @throws DatabaseException
*/
public function drop(string $name): bool
@@ -89,8 +80,6 @@ public function drop(string $name): bool
/**
* Checks if the DB table exists
- * @param string $name
- * @return bool
*/
public function checkTableExists(string $name): bool
{
@@ -105,8 +94,6 @@ public function checkTableExists(string $name): bool
/**
* Creates new Table instance
- * @param string $name
- * @return Table
*/
private function createInstance(string $name): Table
{
diff --git a/src/Database/Schemas/Column.php b/src/Database/Schemas/Column.php
index b8d5f776e..b729aac80 100644
--- a/src/Database/Schemas/Column.php
+++ b/src/Database/Schemas/Column.php
@@ -117,19 +117,10 @@ class Column
*/
public const ATTR_ZEROFILL = 'UNSIGNED ZEROFILL';
- /**
- * @var string
- */
private string $name;
- /**
- * @var string|null
- */
private ?string $newName = null;
- /**
- * @var string|null
- */
private ?string $type = null;
/**
@@ -137,14 +128,8 @@ class Column
*/
private $constraint;
- /**
- * @var string
- */
private ?string $attribute = null;
- /**
- * @var string
- */
private string $nullable = 'NOT NULL';
/**
@@ -152,45 +137,22 @@ class Column
*/
private $default;
- /**
- * @var bool
- */
private bool $defaultQuoted = true;
- /**
- * @var string|null
- */
private ?string $autoincrement = null;
- /**
- * @var string|null
- */
private ?string $indexKey = null;
- /**
- * @var string|null
- */
private ?string $indexName = null;
- /**
- * @var string|null
- */
private ?string $indexDrop = null;
- /**
- * @var string|null
- */
private ?string $comment = null;
- /**
- * @var string|null
- */
private ?string $afterColumn = null;
/**
* Column constructor.
- * @param string $name
- * @param string|null $type
* @param mixed $constraint
*/
public function __construct(string $name, ?string $type = null, $constraint = null)
@@ -205,8 +167,6 @@ public function __construct(string $name, ?string $type = null, $constraint = nu
/**
* Renames the column
- * @param string $newName
- * @return $this
*/
public function renameTo(string $newName): Column
{
@@ -222,8 +182,6 @@ public function indexDrop(string $indexName): Column
/**
* Gets the column property
- * @param string $property
- * @param string|null $action
* @return mixed
*/
public function get(string $property, ?string $action = null)
@@ -250,7 +208,6 @@ public function primary(): void
/**
* Adds an index key to the column
- * @param string|null $name
*/
public function index(?string $name = null): void
{
@@ -263,7 +220,6 @@ public function index(?string $name = null): void
/**
* Adds unique key to the column
- * @param string|null $name
*/
public function unique(?string $name = null): void
{
@@ -276,7 +232,6 @@ public function unique(?string $name = null): void
/**
* Adds a fulltext key the column
- * @param string|null $name
*/
public function fulltext(?string $name = null): void
{
@@ -289,7 +244,6 @@ public function fulltext(?string $name = null): void
/**
* Adds a spatial key the column
- * @param string|null $name
*/
public function spatial(?string $name = null): void
{
@@ -302,7 +256,6 @@ public function spatial(?string $name = null): void
/**
* Adds or removes nullable property
- * @param bool $indeed
*/
public function nullable(bool $indeed = true): void
{
@@ -312,7 +265,6 @@ public function nullable(bool $indeed = true): void
/**
* Adds default value to the column
* @param mixed $value
- * @param bool $quoted
*/
public function default($value, bool $quoted = true): void
{
@@ -322,7 +274,6 @@ public function default($value, bool $quoted = true): void
/**
* Adds or removes attribute to the column
- * @param string|null $value
*/
public function attribute(?string $value): void
{
@@ -331,7 +282,6 @@ public function attribute(?string $value): void
/**
* Adds or removes comment to the column
- * @param string|null $comment
*/
public function comment(?string $comment): void
{
@@ -340,7 +290,6 @@ public function comment(?string $comment): void
/**
* Adds column after a given column
- * @param string $columnName
*/
public function after(string $columnName): void
{
@@ -349,7 +298,6 @@ public function after(string $columnName): void
/**
* Adds quotes on default value
- * @return bool
*/
public function defaultQuoted(): bool
{
diff --git a/src/Database/Schemas/Table.php b/src/Database/Schemas/Table.php
index f89bb95f9..cccf9029f 100644
--- a/src/Database/Schemas/Table.php
+++ b/src/Database/Schemas/Table.php
@@ -60,24 +60,12 @@ class Table
*/
public const RENAME = 4;
- /**
- * @var string
- */
private string $name;
- /**
- * @var string
- */
private string $newName = '';
- /**
- * @var int|null
- */
private ?int $action = null;
- /**
- * @var array
- */
private array $columns = [];
/**
@@ -92,7 +80,6 @@ class Table
/**
* Table constructor.
- * @param string $name
*/
public function __construct(string $name)
{
@@ -111,8 +98,6 @@ public function __destruct()
/**
* Renames the table
- * @param string $newName
- * @return Table
*/
public function renameTo(string $newName): Table
{
@@ -122,9 +107,6 @@ public function renameTo(string $newName): Table
/**
* Sets an action on a table to be performed
- * @param int $action
- * @param array|null $data
- * @return Table
*/
public function setAction(int $action, ?array $data = null): Table
{
@@ -140,10 +122,7 @@ public function setAction(int $action, ?array $data = null): Table
/**
* Adds column to the table
- * @param string $name
- * @param string $type
* @param mixed $constraint
- * @return Table
*/
public function addColumn(string $name, string $type, $constraint = null): Table
{
@@ -157,10 +136,7 @@ public function addColumn(string $name, string $type, $constraint = null): Table
/**
* Modifies the column
- * @param string $name
- * @param string $type
* @param mixed $constraint
- * @return Table
*/
public function modifyColumn(string $name, string $type, $constraint = null): Table
{
@@ -176,8 +152,6 @@ public function modifyColumn(string $name, string $type, $constraint = null): Ta
/**
* Renames the column name
- * @param string $oldName
- * @param string $newName
*/
public function renameColumn(string $oldName, string $newName): void
{
@@ -191,7 +165,6 @@ public function renameColumn(string $oldName, string $newName): void
/**
* Drops the column
- * @param string $name
*/
public function dropColumn(string $name): void
{
@@ -205,9 +178,6 @@ public function dropColumn(string $name): void
/**
* Adds new index to column
- * @param string $columnName
- * @param string $indexType
- * @param string|null $indexName
*/
public function addIndex(string $columnName, string $indexType, ?string $indexName = null): void
{
@@ -223,7 +193,6 @@ public function addIndex(string $columnName, string $indexType, ?string $indexNa
/**
* Drops the column index
- * @param string $indexName
*/
public function dropIndex(string $indexName): void
{
@@ -237,8 +206,6 @@ public function dropIndex(string $indexName): void
/**
* Adds columns after specified one
- * @param string $columnName
- * @return $this
*/
public function after(string $columnName): Table
{
@@ -248,7 +215,6 @@ public function after(string $columnName): Table
/**
* Gets the generated query
- * @return string
*/
public function getSql(): string
{
@@ -274,8 +240,6 @@ public function getSql(): string
/**
* Allows to call methods of Column class
- * @param string $method
- * @param array|null $arguments
* @return $this
* @throws BaseException
*/
@@ -304,8 +268,6 @@ private function save(): void
/**
* Checks if column exists on a table
- * @param string $columnName
- * @return bool
* @throws DatabaseException
*/
private function checkColumnExists(string $columnName): bool
@@ -326,7 +288,6 @@ private function checkColumnExists(string $columnName): bool
/**
* Gets the column key
- * @return int
*/
private function columnKey(): int
{
diff --git a/src/Database/Traits/RelationalTrait.php b/src/Database/Traits/RelationalTrait.php
index 0c96d2848..0bb49b8ba 100644
--- a/src/Database/Traits/RelationalTrait.php
+++ b/src/Database/Traits/RelationalTrait.php
@@ -24,9 +24,6 @@ trait RelationalTrait
{
/**
* Raw execute
- * @param string $query
- * @param array $parameters
- * @return bool
* @throws DatabaseException
*/
public static function execute(string $query, array $parameters = []): bool
@@ -36,9 +33,6 @@ public static function execute(string $query, array $parameters = []): bool
/**
* Raw query
- * @param string $query
- * @param array $parameters
- * @return array
* @throws DatabaseException
*/
public static function query(string $query, array $parameters = []): array
@@ -48,9 +42,6 @@ public static function query(string $query, array $parameters = []): array
/**
* Fetches table columns
- * @param string $query
- * @param array $parameters
- * @return array
* @throws DatabaseException
*/
public static function fetchColumns(string $query, array $parameters = []): array
@@ -60,7 +51,6 @@ public static function fetchColumns(string $query, array $parameters = []): arra
/**
* Gets the last query executed
- * @return string|null
* @throws DatabaseException
*/
public static function lastQuery(): ?string
@@ -71,7 +61,6 @@ public static function lastQuery(): ?string
/**
* Get an array containing all the queries
* run on a specified connection up to now.
- * @return array
* @throws DatabaseException
*/
public static function queryLog(): array
@@ -81,9 +70,6 @@ public static function queryLog(): array
/**
* Resolves the requested query
- * @param string $method
- * @param string $query
- * @param array $parameters
* @return mixed
* @throws DatabaseException
*/
diff --git a/src/Database/Traits/TableTrait.php b/src/Database/Traits/TableTrait.php
index bd2920182..c5ad9401a 100644
--- a/src/Database/Traits/TableTrait.php
+++ b/src/Database/Traits/TableTrait.php
@@ -25,7 +25,6 @@ trait TableTrait
{
/**
* Generates create table statement
- * @return string
*/
protected function createTableSql(): string
{
@@ -43,7 +42,6 @@ protected function createTableSql(): string
/**
* Generates alter table statement
- * @return string
*/
protected function alterTableSql(): string
{
@@ -61,7 +59,6 @@ protected function alterTableSql(): string
/**
* Prepares rename table statement
- * @return string
*/
protected function renameTableSql(): string
{
@@ -70,7 +67,6 @@ protected function renameTableSql(): string
/**
* Prepares drop table statement
- * @return string
*/
protected function dropTableSql(): string
{
@@ -79,7 +75,6 @@ protected function dropTableSql(): string
/**
* Prepares columns statements for table
- * @return string
*/
protected function columnsSql(): string
{
@@ -120,9 +115,6 @@ protected function columnsSql(): string
/**
* Composes the column
- * @param Column $column
- * @param string|null $action
- * @return string
*/
protected function composeColumn(Column $column, ?string $action = null): string
{
@@ -142,9 +134,6 @@ protected function composeColumn(Column $column, ?string $action = null): string
/**
* Prepares column attributes
* @param mixed $definition
- * @param string $before
- * @param string $after
- * @return string
*/
protected function columnAttrSql($definition, string $before = '', string $after = ''): string
{
@@ -160,7 +149,6 @@ protected function columnAttrSql($definition, string $before = '', string $after
/**
* Prepares statement for primary key
- * @return string
*/
protected function primaryKeysSql(): string
{
@@ -184,8 +172,6 @@ protected function primaryKeysSql(): string
/**
* Prepares statement for index keys
- * @param string $type
- * @return string
*/
protected function indexKeysSql(string $type): string
{
@@ -211,7 +197,6 @@ protected function indexKeysSql(string $type): string
/**
* Builds a complete statement for index keys
- * @return string
*/
protected function indexesSql(): string
{
@@ -228,7 +213,6 @@ protected function indexesSql(): string
/**
* Builds a statement for drop indexes
- * @return string
*/
protected function dropIndexesSql(): string
{
diff --git a/src/Database/Traits/TransactionTrait.php b/src/Database/Traits/TransactionTrait.php
index aebc36c1b..3b5792d90 100644
--- a/src/Database/Traits/TransactionTrait.php
+++ b/src/Database/Traits/TransactionTrait.php
@@ -54,7 +54,6 @@ public static function rollback(): void
/**
* Resolves the transaction method call
- * @param string $method
* @return mixed
* @throws BaseException
*/
@@ -71,7 +70,6 @@ protected static function resolveTransaction(string $method)
/**
* Transaction wrapper using a closure
- * @param callable $callback
* @return mixed
* @throws BaseException
* @throws DatabaseException
diff --git a/src/Debugger/Debugger.php b/src/Debugger/Debugger.php
index 4b52ef819..e5af9c187 100644
--- a/src/Debugger/Debugger.php
+++ b/src/Debugger/Debugger.php
@@ -60,9 +60,6 @@ class Debugger
*/
private DebuggerStore $store;
- /**
- * @var Debugger|null
- */
private static ?Debugger $instance = null;
/**
@@ -82,9 +79,6 @@ class Debugger
/**
* Debugger constructor.
- * @param DebuggerStore $store
- * @param DebugBar $debugBar
- * @param array $collectors
* @throws DebugBarException
*/
public function __construct(DebuggerStore $store, DebugBar $debugBar, array $collectors = [])
@@ -98,10 +92,6 @@ public function __construct(DebuggerStore $store, DebugBar $debugBar, array $col
}
/**
- * @param DebuggerStore|null $store
- * @param DebugBar|null $debugBar
- * @param array|null $collectors
- * @return Debugger
* @throws DebugBarException
*/
public static function getInstance(?DebuggerStore $store = null, ?DebugBar $debugBar = null, ?array $collectors = []): Debugger
@@ -119,16 +109,12 @@ public static function getInstance(?DebuggerStore $store = null, ?DebugBar $debu
/**
* Checks if debug bar enabled
- * @return bool
*/
public function isEnabled(): bool
{
return filter_var(config()->get('app.debug'), FILTER_VALIDATE_BOOLEAN);
}
- /**
- * @return void
- */
public function initStore(): void
{
$this->store->init([
@@ -142,8 +128,6 @@ public function initStore(): void
/**
* Adds data to the store cell
- * @param string $cell
- * @param string $level
* @param mixed $data
*/
public function addToStoreCell(string $cell, string $level, $data): void
@@ -153,10 +137,6 @@ public function addToStoreCell(string $cell, string $level, $data): void
}
}
- /**
- * @param string $cell
- * @return array
- */
public function getStoreCell(string $cell): array
{
return $this->store->get($cell);
@@ -164,16 +144,12 @@ public function getStoreCell(string $cell): array
/**
* Clears the store cell
- * @param string $cell
*/
public function clearStoreCell(string $cell): void
{
$this->store->delete($cell);
}
- /**
- * @return void
- */
public function resetStore(): void
{
$this->store->flush();
@@ -181,7 +157,6 @@ public function resetStore(): void
/**
* Renders the debug bar
- * @return string
* @throws DebugBarException
*/
public function render(): string
@@ -197,7 +172,6 @@ public function render(): string
/**
* Creates a tab
- * @param string $type
* @throws DebugBarException
*/
protected function createTab(string $type)
@@ -208,17 +182,14 @@ protected function createTab(string $type)
$messages = $this->store->get($type);
- if (count($messages) > 0) {
- foreach ($messages as $message) {
- $fn = key($message);
- $this->debugBar[$type]->$fn($message[$fn]);
- }
+ foreach ($messages as $message) {
+ $fn = key($message);
+ $this->debugBar[$type]->$fn($message[$fn]);
}
}
/**
* Gets the renderer
- * @return JavascriptRenderer
*/
protected function getRenderer(): JavascriptRenderer
{
@@ -228,9 +199,6 @@ protected function getRenderer(): JavascriptRenderer
->addAssets([$this->customCss], []);
}
- /**
- * @return array
- */
protected static function getDefaultCollectors(): array
{
return [
diff --git a/src/Debugger/DebuggerStore.php b/src/Debugger/DebuggerStore.php
index 235564233..d5d0a6d21 100644
--- a/src/Debugger/DebuggerStore.php
+++ b/src/Debugger/DebuggerStore.php
@@ -24,10 +24,6 @@ class DebuggerStore implements StorageInterface
{
private static array $store = [];
- /**
- * @param array $keys
- * @return void
- */
public function init(array $keys): void
{
foreach ($keys as $key) {
@@ -45,28 +41,18 @@ public function all(): array
return self::$store;
}
- /**
- * @param string $key
- * @return bool
- */
public function has(string $key): bool
{
return isset(self::$store[$key]);
}
- /**
- * @param string $key
- * @return array
- */
public function get(string $key): array
{
return self::$store[$key] ?? [];
}
/**
- * @param string $key
* @param mixed $value
- * @return void
*/
public function set(string $key, $value): void
{
@@ -77,10 +63,6 @@ public function set(string $key, $value): void
}
}
- /**
- * @param string $key
- * @return void
- */
public function delete(string $key): void
{
if ($this->has($key)) {
@@ -88,9 +70,6 @@ public function delete(string $key): void
}
}
- /**
- * @return void
- */
public function flush(): void
{
self::$store = [];
diff --git a/src/Di/Di.php b/src/Di/Di.php
index 7d5b632b5..11e72dfed 100644
--- a/src/Di/Di.php
+++ b/src/Di/Di.php
@@ -45,8 +45,6 @@ class Di
/**
* Register dependencies
- * @param array $dependencies
- * @return void
* @throws DiException
*/
public static function registerDependencies(array $dependencies): void
@@ -60,9 +58,6 @@ public static function registerDependencies(array $dependencies): void
/**
* Registers new dependency
- * @param string $concrete
- * @param string|null $abstract
- * @return void
* @throws DiException
*/
public static function register(string $concrete, ?string $abstract = null): void
@@ -86,8 +81,6 @@ public static function register(string $concrete, ?string $abstract = null): voi
/**
* Checks if a dependency registered
- * @param string $abstract
- * @return bool
*/
public static function isRegistered(string $abstract): bool
{
@@ -99,7 +92,6 @@ public static function isRegistered(string $abstract): bool
* @template T of object
* @param class-string $abstract
* @param T $instance
- * @param bool $override
* @throws DiException
*/
public static function set(string $abstract, object $instance, bool $override = true): void
@@ -161,8 +153,6 @@ public static function create(string $dependency, array $args = [])
/**
* Autowire callable parameters
- * @param callable $entry
- * @param array $args
* @return list
* @throws DiException
* @throws ReflectionException
@@ -181,9 +171,6 @@ public static function autowire(callable $entry, array $args = []): array
return self::resolveParameters($reflection->getParameters(), $args);
}
- /**
- * @return void
- */
public static function reset(): void
{
self::$dependencies = [];
@@ -193,9 +180,6 @@ public static function reset(): void
/**
* Resolves the dependency
- * @param string $abstract
- * @param array $args
- * @param bool $singleton
* @return mixed|object
* @throws DiException|ReflectionException
*/
@@ -223,8 +207,6 @@ private static function resolve(string $abstract, array $args = [], bool $single
/**
* Instantiates the dependency
- * @param string $concrete
- * @param array $args
* @return mixed
* @throws ReflectionException|DiException
*/
@@ -242,9 +224,6 @@ private static function instantiate(string $concrete, array $args = [])
/**
* Resolve parameter list
- * @param array $parameters
- * @param array $args
- * @return array
* @throws DiException
*/
private static function resolveParameters(array $parameters, array &$args = []): array
@@ -260,8 +239,6 @@ private static function resolveParameters(array $parameters, array &$args = []):
/**
* Resolve single parameter
- * @param ReflectionParameter $param
- * @param array $args
* @return array|mixed|object|null
* @throws DiException|ReflectionException
*/
@@ -300,8 +277,6 @@ private static function resolveParameter(ReflectionParameter $param, array &$arg
/**
* Checks if the class is instantiable
- * @param string $class
- * @return bool
*/
protected static function instantiable(string $class): bool
{
@@ -310,8 +285,6 @@ protected static function instantiable(string $class): bool
}
/**
- * @param string $abstract
- * @return void
* @throws DiException
*/
private static function checkCircularDependency(string $abstract): void
diff --git a/src/Di/Exceptions/DiException.php b/src/Di/Exceptions/DiException.php
index 4056e7886..63fe899e6 100644
--- a/src/Di/Exceptions/DiException.php
+++ b/src/Di/Exceptions/DiException.php
@@ -25,10 +25,6 @@
*/
class DiException extends BaseException
{
- /**
- * @param string $name
- * @return DiException
- */
public static function dependencyNotRegistered(string $name): DiException
{
return new self(
@@ -37,10 +33,6 @@ public static function dependencyNotRegistered(string $name): DiException
);
}
- /**
- * @param string $name
- * @return DiException
- */
public static function dependencyAlreadyRegistered(string $name): DiException
{
return new self(
@@ -49,10 +41,6 @@ public static function dependencyAlreadyRegistered(string $name): DiException
);
}
- /**
- * @param string $name
- * @return DiException
- */
public static function dependencyNotInstantiable(string $name): DiException
{
return new self(
@@ -61,10 +49,6 @@ public static function dependencyNotInstantiable(string $name): DiException
);
}
- /**
- * @param string $name
- * @return DiException
- */
public static function invalidAbstractDependency(string $name): DiException
{
return new self(
@@ -73,10 +57,6 @@ public static function invalidAbstractDependency(string $name): DiException
);
}
- /**
- * @param string $chain
- * @return DiException
- */
public static function circularDependency(string $chain): DiException
{
return new self(
@@ -85,10 +65,6 @@ public static function circularDependency(string $chain): DiException
);
}
- /**
- * @param string|null $entry
- * @return DiException
- */
public static function invalidCallable(?string $entry = null): DiException
{
return new self(
diff --git a/src/Encryption/Adapters/AsymmetricEncryptionAdapter.php b/src/Encryption/Adapters/AsymmetricEncryptionAdapter.php
index d499707a8..d340db4f3 100644
--- a/src/Encryption/Adapters/AsymmetricEncryptionAdapter.php
+++ b/src/Encryption/Adapters/AsymmetricEncryptionAdapter.php
@@ -57,8 +57,6 @@ public function __construct()
/**
* Encrypts the string
- * @param string $plain
- * @return string
* @throws CryptorException
*/
public function encrypt(string $plain): string
@@ -73,8 +71,6 @@ public function encrypt(string $plain): string
/**
* Decrypts the string
- * @param string $encrypted
- * @return string
* @throws CryptorException
*/
public function decrypt(string $encrypted): string
@@ -89,7 +85,6 @@ public function decrypt(string $encrypted): string
/**
* Generate key pairs
- * @return array
* @throws BaseException
*/
private function generateKeyPair(): array
diff --git a/src/Encryption/Adapters/SymmetricEncryptionAdapter.php b/src/Encryption/Adapters/SymmetricEncryptionAdapter.php
index 15e0b6fb7..8abc9fabd 100644
--- a/src/Encryption/Adapters/SymmetricEncryptionAdapter.php
+++ b/src/Encryption/Adapters/SymmetricEncryptionAdapter.php
@@ -51,8 +51,6 @@ public function __construct()
/**
* Encrypts the string
- * @param string $plain
- * @return string
*/
public function encrypt(string $plain): string
{
@@ -65,8 +63,6 @@ public function encrypt(string $plain): string
/**
* Decrypts the string
- * @param string $encrypted
- * @return string
* @throws CryptorException
*/
public function decrypt(string $encrypted): string
@@ -89,7 +85,6 @@ public function decrypt(string $encrypted): string
/**
* Generates initialization vector
- * @return string
*/
private function generateIV(): string
{
diff --git a/src/Encryption/Contracts/EncryptionInterface.php b/src/Encryption/Contracts/EncryptionInterface.php
index 945fea051..d336e113f 100644
--- a/src/Encryption/Contracts/EncryptionInterface.php
+++ b/src/Encryption/Contracts/EncryptionInterface.php
@@ -20,15 +20,7 @@
*/
interface EncryptionInterface
{
- /**
- * @param string $plain
- * @return string
- */
public function encrypt(string $plain): string;
- /**
- * @param string $encrypted
- * @return string
- */
public function decrypt(string $encrypted): string;
}
diff --git a/src/Encryption/Cryptor.php b/src/Encryption/Cryptor.php
index 7ba4817dd..38ec4a431 100644
--- a/src/Encryption/Cryptor.php
+++ b/src/Encryption/Cryptor.php
@@ -37,38 +37,24 @@ class Cryptor
*/
public const ASYMMETRIC = 'asymmetric';
- /**
- * @var EncryptionInterface
- */
private EncryptionInterface $adapter;
- /**
- * @param EncryptionInterface $adapter
- */
public function __construct(EncryptionInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return EncryptionInterface
- */
public function getAdapter(): EncryptionInterface
{
return $this->adapter;
}
- /**
- * @return bool
- */
public function isAsymmetric(): bool
{
return $this->adapter instanceof AsymmetricEncryptionAdapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Encryption/Exceptions/CryptorException.php b/src/Encryption/Exceptions/CryptorException.php
index ebefb8d99..81008ff2d 100644
--- a/src/Encryption/Exceptions/CryptorException.php
+++ b/src/Encryption/Exceptions/CryptorException.php
@@ -25,9 +25,6 @@
*/
class CryptorException extends BaseException
{
- /**
- * @return CryptorException
- */
public static function publicKeyNotProvided(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function publicKeyNotProvided(): self
);
}
- /**
- * @return CryptorException
- */
public static function privateKeyNotProvided(): self
{
return new self(
@@ -47,9 +41,6 @@ public static function privateKeyNotProvided(): self
);
}
- /**
- * @return CryptorException
- */
public static function invalidCipher(): self
{
return new self(
diff --git a/src/Encryption/Factories/CryptorFactory.php b/src/Encryption/Factories/CryptorFactory.php
index 364410a55..a3025c1ad 100644
--- a/src/Encryption/Factories/CryptorFactory.php
+++ b/src/Encryption/Factories/CryptorFactory.php
@@ -34,14 +34,9 @@ class CryptorFactory
Cryptor::ASYMMETRIC => AsymmetricEncryptionAdapter::class,
];
- /**
- * @var array
- */
private static array $instances = [];
/**
- * @param string $type
- * @return Cryptor
* @throws BaseException
*/
public static function get(string $type = Cryptor::SYMMETRIC): Cryptor
@@ -54,8 +49,6 @@ public static function get(string $type = Cryptor::SYMMETRIC): Cryptor
}
/**
- * @param string $type
- * @return Cryptor
* @throws BaseException
*/
private static function createInstance(string $type): Cryptor
diff --git a/src/Encryption/Helpers/encryption.php b/src/Encryption/Helpers/encryption.php
index 111416ed5..b1303372d 100644
--- a/src/Encryption/Helpers/encryption.php
+++ b/src/Encryption/Helpers/encryption.php
@@ -19,8 +19,6 @@
/**
* Encodes the data cryptographically
* @param $data
- * @param string $type
- * @return string
* @throws BaseException
*/
function crypto_encode($data, string $type = Cryptor::SYMMETRIC): string
@@ -31,8 +29,6 @@ function crypto_encode($data, string $type = Cryptor::SYMMETRIC): string
}
/**
- * @param string $encryptedData
- * @param string $type
* @return mixed|string
* @throws BaseException
*/
diff --git a/src/Environment/Environment.php b/src/Environment/Environment.php
index 98c601636..6e2845cb2 100644
--- a/src/Environment/Environment.php
+++ b/src/Environment/Environment.php
@@ -35,40 +35,27 @@ class Environment
{
/**
* Environment file
- * @var string
*/
private string $envFile = '.env';
- /**
- * @var bool
- */
private bool $isMutable = false;
/**
* Loaded env content
- * @var array
*/
private array $envContent = [];
- /**
- * @var bool
- */
private bool $loaded = false;
- /**
- * @var string
- */
private static string $appEnv = Env::PRODUCTION;
/**
* Instance of Environment
- * @var Environment|null
*/
private static ?Environment $instance = null;
/**
* GetInstance
- * @return Environment
*/
public static function getInstance(): Environment
{
@@ -79,10 +66,6 @@ public static function getInstance(): Environment
return self::$instance;
}
- /**
- * @param bool $isMutable
- * @return Environment
- */
public function setMutable(bool $isMutable): Environment
{
$this->isMutable = $isMutable;
@@ -91,8 +74,6 @@ public function setMutable(bool $isMutable): Environment
/**
* Loads environment variables from file
- * @param Setup $setup
- * @return void
* @throws BaseException
* @throws EnvException
* @throws DiException
@@ -122,7 +103,6 @@ public function load(Setup $setup): void
/**
* Gets the app current environment
- * @return string
*/
public function getAppEnv(): string
{
@@ -131,7 +111,6 @@ public function getAppEnv(): string
/**
* Gets the environment variable value
- * @param string $key
* @param null|mixed $default
* @return mixed
* @throws EnvException
@@ -151,8 +130,6 @@ public function getValue(string $key, $default = null)
/**
* Checks if there is a such key
- * @param string $key
- * @return bool
*/
public function hasKey(string $key): bool
{
@@ -161,8 +138,6 @@ public function hasKey(string $key): bool
/**
* Gets the row of .env file by given key
- * @param string $key
- * @return string|null
*/
public function getRow(string $key): ?string
{
@@ -171,9 +146,6 @@ public function getRow(string $key): ?string
/**
* Creates or updates the row in .env
- * @param string $key
- * @param string|null $value
- * @return void
* @throws BaseException
* @throws DiException
* @throws EnvException
@@ -207,8 +179,6 @@ public function updateRow(string $key, ?string $value): void
/**
* Finds the row by provided key
- * @param string $key
- * @return string|null
*/
private function findKeyRow(string $key): ?string
{
@@ -221,10 +191,6 @@ private function findKeyRow(string $key): ?string
return null;
}
- /**
- * @param bool $forceMutableReload
- * @return array
- */
private function loadDotenvFile(bool $forceMutableReload = false): array
{
$baseDir = App::getBaseDir();
@@ -238,9 +204,6 @@ private function loadDotenvFile(bool $forceMutableReload = false): array
return is_array($loadedVars) ? $loadedVars : [];
}
- /**
- * @return string
- */
private function getEnvFilePath(): string
{
return App::getBaseDir() . DS . $this->envFile;
diff --git a/src/Environment/Exceptions/EnvException.php b/src/Environment/Exceptions/EnvException.php
index f8be14b51..1d98a5a1b 100644
--- a/src/Environment/Exceptions/EnvException.php
+++ b/src/Environment/Exceptions/EnvException.php
@@ -25,9 +25,6 @@
*/
class EnvException extends BaseException
{
- /**
- * @return EnvException
- */
public static function environmentImmutable(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function environmentImmutable(): self
);
}
- /**
- * @return EnvException
- */
public static function environmentNotLoaded(): self
{
return new self(
diff --git a/src/Environment/Helpers/env.php b/src/Environment/Helpers/env.php
index 5be3a12e4..a798720b9 100644
--- a/src/Environment/Helpers/env.php
+++ b/src/Environment/Helpers/env.php
@@ -17,7 +17,6 @@
/**
* Gets environment variable
- * @param string $var
* @param $default
* @return mixed
* @throws EnvException
diff --git a/src/Environment/Helpers/server.php b/src/Environment/Helpers/server.php
index 7750542bd..58e046f49 100644
--- a/src/Environment/Helpers/server.php
+++ b/src/Environment/Helpers/server.php
@@ -16,7 +16,6 @@
/**
* Gets Server instance
- * @return Server
*/
function server(): Server
{
@@ -25,7 +24,6 @@ function server(): Server
/**
* Gets user IP
- * @return string|null
*/
function get_user_ip(): ?string
{
@@ -38,7 +36,6 @@ function get_user_ip(): ?string
* Get all headers
* Built-in PHP function synonym of apache_request_headers()
* Declaring here for Nginx server
- * @return array
*/
function getallheaders(): array
{
diff --git a/src/Environment/Server.php b/src/Environment/Server.php
index f7c307385..7f183cc1d 100644
--- a/src/Environment/Server.php
+++ b/src/Environment/Server.php
@@ -34,7 +34,6 @@ private function __construct()
/**
* Get Instance
- * @return Server
*/
public static function getInstance(): Server
{
@@ -53,9 +52,6 @@ public function flush(): void
$this->server = [];
}
- /**
- * @return array
- */
public function all(): array
{
return $this->server;
@@ -72,7 +68,6 @@ public function get($key)
/**
* @param $key
- * @return bool
*/
public function has($key): bool
{
@@ -88,33 +83,21 @@ public function set($key, $value): void
$this->server[$key] = $value;
}
- /**
- * @return string|null
- */
public function uri(): ?string
{
return $this->get('REQUEST_URI');
}
- /**
- * @return string|null
- */
public function query(): ?string
{
return $this->get('QUERY_STRING');
}
- /**
- * @return string|null
- */
public function method(): ?string
{
return $this->get('REQUEST_METHOD');
}
- /**
- * @return string|null
- */
public function protocol(): ?string
{
$https = $this->get('HTTPS');
@@ -123,26 +106,16 @@ public function protocol(): ?string
return (!empty($https) && strtolower($https) !== 'off') || $port == 443 ? 'https' : 'http';
}
- /**
- * @return string|null
- */
public function host(): ?string
{
return $this->get('SERVER_NAME');
}
- /**
- * @return string|null
- */
public function port(): ?string
{
return $this->get('SERVER_PORT');
}
- /**
- * @param bool $exact
- * @return string|null
- */
public function contentType(bool $exact = false): ?string
{
$contentType = $this->get('CONTENT_TYPE');
@@ -154,25 +127,16 @@ public function contentType(bool $exact = false): ?string
return $contentType;
}
- /**
- * @return string|null
- */
public function referrer(): ?string
{
return $this->get('HTTP_REFERER');
}
- /**
- * @return bool
- */
public function ajax(): bool
{
return strtolower($this->get('HTTP_X_REQUESTED_WITH') ?? '') === 'xmlhttprequest';
}
- /**
- * @return string|null
- */
public function ip(): ?string
{
return $this->get('HTTP_CLIENT_IP')
@@ -180,9 +144,6 @@ public function ip(): ?string
?? $this->get('REMOTE_ADDR');
}
- /**
- * @return array
- */
public function getAllHeaders(): array
{
$data = $this->all();
@@ -200,9 +161,6 @@ public function getAllHeaders(): array
}, []);
}
- /**
- * @return string|null
- */
public function acceptedLang(): ?string
{
$accept = $this->get('HTTP_ACCEPT_LANGUAGE');
diff --git a/src/Hasher/Exceptions/HasherException.php b/src/Hasher/Exceptions/HasherException.php
index 239c5b775..867156761 100644
--- a/src/Hasher/Exceptions/HasherException.php
+++ b/src/Hasher/Exceptions/HasherException.php
@@ -25,11 +25,6 @@
*/
class HasherException extends BaseException
{
- /**
- *
- * @param string $algorithm
- * @return self
- */
public static function algorithmNotSupported(string $algorithm): self
{
return new self(
@@ -38,10 +33,6 @@ public static function algorithmNotSupported(string $algorithm): self
);
}
- /**
- *
- * @return self
- */
public static function invalidBcryptCost(): self
{
return new self(
diff --git a/src/Hasher/Hasher.php b/src/Hasher/Hasher.php
index 91dec73e2..97ca9410a 100644
--- a/src/Hasher/Hasher.php
+++ b/src/Hasher/Hasher.php
@@ -42,14 +42,8 @@ class Hasher
*/
private int $cost = self::DEFAULT_COST;
- public function __construct()
- {
- }
-
/**
* Sets the algorithm
- * @param string $algorithm
- * @return $this
*/
public function setAlgorithm(string $algorithm): Hasher
{
@@ -59,7 +53,6 @@ public function setAlgorithm(string $algorithm): Hasher
/**
* Gets the current algorithm
- * @return string
*/
public function getAlgorithm(): string
{
@@ -68,8 +61,6 @@ public function getAlgorithm(): string
/**
* Sets the cost
- * @param int $cost
- * @return $this
* @throws HasherException
*/
public function setCost(int $cost): Hasher
@@ -84,7 +75,6 @@ public function setCost(int $cost): Hasher
/**
* Gets the current cost
- * @return int
*/
public function getCost(): int
{
@@ -93,8 +83,6 @@ public function getCost(): int
/**
* Hashes the given string
- * @param string $password
- * @return string|null
*/
public function hash(string $password): ?string
{
@@ -103,8 +91,6 @@ public function hash(string $password): ?string
/**
* Checks if re-hash needed
- * @param string $hash
- * @return bool
*/
public function needsRehash(string $hash): bool
{
@@ -113,9 +99,6 @@ public function needsRehash(string $hash): bool
/**
* Checks the given string against the hash
- * @param string $password
- * @param string $hash
- * @return bool
*/
public function check(string $password, string $hash): bool
{
@@ -124,8 +107,6 @@ public function check(string $password, string $hash): bool
/**
* Gets an info of given hash
- * @param string $hash
- * @return array|null
*/
public function info(string $hash): ?array
{
diff --git a/src/Hook/Exceptions/HookException.php b/src/Hook/Exceptions/HookException.php
index a8ab404a2..9014b11cf 100644
--- a/src/Hook/Exceptions/HookException.php
+++ b/src/Hook/Exceptions/HookException.php
@@ -25,10 +25,6 @@
*/
class HookException extends BaseException
{
- /**
- * @param string $name
- * @return HookException
- */
public static function hookDuplicateName(string $name): self
{
return new self(
@@ -37,10 +33,6 @@ public static function hookDuplicateName(string $name): self
);
}
- /**
- * @param string $name
- * @return HookException
- */
public static function unregisteredHookName(string $name): self
{
return new self(
diff --git a/src/Hook/Helpers/hook.php b/src/Hook/Helpers/hook.php
index 688adfd1c..3a4d1b115 100644
--- a/src/Hook/Helpers/hook.php
+++ b/src/Hook/Helpers/hook.php
@@ -16,7 +16,6 @@
/**
* Gets the HookManager instance
- * @return HookManager
*/
function hook(): HookManager
{
diff --git a/src/Hook/HookManager.php b/src/Hook/HookManager.php
index 232d86e44..a9e6b42bb 100644
--- a/src/Hook/HookManager.php
+++ b/src/Hook/HookManager.php
@@ -37,9 +37,6 @@ class HookManager
*/
private static array $store = [];
- /**
- * @var HookManager|null
- */
private static ?HookManager $instance = null;
/**
@@ -63,7 +60,6 @@ private function __construct()
/**
* HookManager instance
- * @return HookManager
*/
public static function getInstance(): HookManager
{
@@ -76,8 +72,6 @@ public static function getInstance(): HookManager
/**
* Adds a new listener for a given hook
- * @param string $name
- * @param callable $function
* @throws HookException
*/
public function on(string $name, callable $function): void
@@ -91,8 +85,6 @@ public function on(string $name, callable $function): void
/**
* Fires the hook
- * @param string $name
- * @param array|null $args
* @throws HookException
*/
public function fire(string $name, ?array $args = null): void
@@ -109,7 +101,6 @@ public function fire(string $name, ?array $args = null): void
/**
* Gets all registered hooks
- * @return array
*/
public static function getRegistered(): array
{
@@ -118,7 +109,6 @@ public static function getRegistered(): array
/**
* Registers new hook
- * @param string $name
* @throws HookException
*/
protected function register(string $name)
@@ -132,8 +122,6 @@ protected function register(string $name)
/**
* Checks if hooks registered
- * @param string $name
- * @return bool
*/
protected function exists(string $name): bool
{
diff --git a/src/Http/Helpers/http.php b/src/Http/Helpers/http.php
index 980a65a49..e0a93d4b1 100644
--- a/src/Http/Helpers/http.php
+++ b/src/Http/Helpers/http.php
@@ -24,8 +24,6 @@
/**
* Gets the base url
- * @param bool $withModulePrefix
- * @return string
* @throws DiException
* @throws ReflectionException
*/
@@ -36,7 +34,6 @@ function base_url(bool $withModulePrefix = false): string
/**
* Gets the current url
- * @return string
*/
function current_url(): string
{
@@ -45,8 +42,6 @@ function current_url(): string
/**
* Redirect
- * @param string $url
- * @param int $code
*/
function redirect(string $url, int $code = StatusCode::FOUND): void
{
@@ -55,10 +50,6 @@ function redirect(string $url, int $code = StatusCode::FOUND): void
/**
* Redirect with data
- * @param string $url
- * @param array $data
- * @param int $code
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -72,7 +63,6 @@ function redirectWith(string $url, array $data, int $code = StatusCode::FOUND):
/**
* Gets old input values after redirect
- * @param string $key
* @return mixed|null
* @throws ConfigException
* @throws DiException
@@ -101,7 +91,6 @@ function old(string $key)
/**
* Gets the referrer
- * @return string|null
*/
function get_referrer(): ?string
{
@@ -110,7 +99,6 @@ function get_referrer(): ?string
/**
* Handles page not found
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Http/Request.php b/src/Http/Request.php
index 0ec72cb30..203287bc9 100644
--- a/src/Http/Request.php
+++ b/src/Http/Request.php
@@ -61,7 +61,6 @@ class Request
{
/**
* @param string $function The function name
- * @param array $arguments
* @return mixed
*/
public function __call(string $function, array $arguments)
@@ -71,7 +70,6 @@ public function __call(string $function, array $arguments)
/**
* @param string $function The function name
- * @param array $arguments
* @return mixed
*/
public static function __callStatic(string $function, array $arguments)
diff --git a/src/Http/Request/HttpRequest.php b/src/Http/Request/HttpRequest.php
index eb21a9e4c..246064244 100644
--- a/src/Http/Request/HttpRequest.php
+++ b/src/Http/Request/HttpRequest.php
@@ -64,23 +64,15 @@ abstract class HttpRequest
/**
* Request method
- * @var string|null
*/
private static ?string $__method = null;
- /**
- * @var Server
- */
protected static Server $server;
- /**
- * @var bool
- */
private static bool $initialized = false;
/**
* Initializes the request static properties using the server instance.
- * @param Server $server
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -127,7 +119,6 @@ public static function flush(): void
/**
* Sets the merged request parameters
- * @param array $params
*/
public static function setRequestParams(array $params): void
{
@@ -142,7 +133,6 @@ public static function setRequestParams(array $params): void
/**
* Sets the uploaded files array merging handled $_FILES and parsed files
- * @param array $files
* @throws BaseException
* @throws ReflectionException
*/
@@ -156,7 +146,6 @@ public static function setUploadedFiles(array $files): void
/**
* Gets the request method
- * @return string|null
*/
public static function getMethod(): ?string
{
@@ -165,8 +154,6 @@ public static function getMethod(): ?string
/**
* Sets the request method
- * @param string $method
- * @return void
* @throws BaseException
*/
public static function setMethod(string $method): void
@@ -180,8 +167,6 @@ public static function setMethod(string $method): void
/**
* Checks if the current method matches the given method
- * @param string $method
- * @return bool
*/
public static function isMethod(string $method): bool
{
@@ -190,7 +175,6 @@ public static function isMethod(string $method): bool
/**
* Gets Cross Site Request Forgery Token
- * @return string|null
*/
public static function getCsrfToken(): ?string
{
@@ -207,8 +191,6 @@ public static function getCsrfToken(): ?string
/**
* Gets the base url
- * @param bool $withModulePrefix
- * @return string
* @throws DiException|ReflectionException
*/
public static function getBaseUrl(bool $withModulePrefix = false): string
@@ -227,7 +209,6 @@ public static function getBaseUrl(bool $withModulePrefix = false): string
/**
* Gets the current url
- * @return string
*/
public static function getCurrentUrl(): string
{
@@ -240,7 +221,6 @@ public static function getCurrentUrl(): string
/**
* Gets the protocol, host, and optional port part of the URL.
- * @return string
*/
private static function getHostPrefix(): string
{
@@ -278,6 +258,6 @@ private static function setContentType(): void
*/
private static function setRequestHeaders(): void
{
- self::$__headers = array_change_key_case((array) getallheaders());
+ self::$__headers = array_change_key_case(getallheaders());
}
}
diff --git a/src/Http/Response.php b/src/Http/Response.php
index 45aac302f..173539519 100644
--- a/src/Http/Response.php
+++ b/src/Http/Response.php
@@ -48,7 +48,6 @@ class Response
{
/**
* @param string $function The function name
- * @param array $arguments
* @return mixed
*/
public function __call(string $function, array $arguments)
@@ -58,7 +57,6 @@ public function __call(string $function, array $arguments)
/**
* @param string $function The function name
- * @param array $arguments
* @return mixed
*/
public static function __callStatic(string $function, array $arguments)
diff --git a/src/Http/Traits/Request/Body.php b/src/Http/Traits/Request/Body.php
index 4e1587493..e40650efc 100644
--- a/src/Http/Traits/Request/Body.php
+++ b/src/Http/Traits/Request/Body.php
@@ -25,14 +25,11 @@ trait Body
{
/**
* Request body
- * @var array
*/
private static array $__request = [];
/**
* Checks if request contains a data by given key
- * @param string $key
- * @return bool
*/
public static function has(string $key): bool
{
@@ -41,9 +38,6 @@ public static function has(string $key): bool
/**
* Retrieves data from request by given key
- * @param string $key
- * @param string|null $default
- * @param bool $raw
* @return mixed
*/
public static function get(string $key, ?string $default = null, bool $raw = false)
@@ -65,7 +59,6 @@ public static function get(string $key, ?string $default = null, bool $raw = fal
/**
* Sets new key/value pair into request
- * @param string $key
* @param mixed $value
*/
public static function set(string $key, $value): void
@@ -79,7 +72,6 @@ public static function set(string $key, $value): void
/**
* Gets all request parameters
- * @return array
*/
public static function all(): array
{
@@ -88,7 +80,6 @@ public static function all(): array
/**
* Deletes the element from request by given key
- * @param string $key
*/
public static function delete(string $key): void
{
diff --git a/src/Http/Traits/Request/File.php b/src/Http/Traits/Request/File.php
index b28f1a4a4..11161526a 100644
--- a/src/Http/Traits/Request/File.php
+++ b/src/Http/Traits/Request/File.php
@@ -27,14 +27,11 @@ trait File
{
/**
* Files
- * @var array
*/
private static array $__files = [];
/**
* Checks to see if request contains file
- * @param string $key
- * @return bool
*/
public static function hasFile(string $key): bool
{
@@ -60,7 +57,6 @@ public static function hasFile(string $key): bool
/**
* Gets the file or array of file objects
- * @param string $key
* @return mixed
* @throws BaseException
*/
@@ -75,7 +71,6 @@ public static function getFile(string $key)
/**
* Handle files
- * @param array $files
* @return array>
* @throws BaseException
* @throws ReflectionException
diff --git a/src/Http/Traits/Request/Header.php b/src/Http/Traits/Request/Header.php
index 16f32a935..85912a3c9 100644
--- a/src/Http/Traits/Request/Header.php
+++ b/src/Http/Traits/Request/Header.php
@@ -22,14 +22,11 @@ trait Header
{
/**
* Request headers
- * @var array
*/
private static array $__headers = [];
/**
* Checks the request header existence by given key
- * @param string $key
- * @return bool
*/
public static function hasHeader(string $key): bool
{
@@ -40,8 +37,6 @@ public static function hasHeader(string $key): bool
/**
* Gets the request header by given key
- * @param string $key
- * @return string|null
*/
public static function getHeader(string $key): ?string
{
@@ -55,7 +50,6 @@ public static function getHeader(string $key): ?string
/**
* Sets the request header
- * @param string $key
* @param mixed $value
*/
public static function setHeader(string $key, $value): void
@@ -65,7 +59,6 @@ public static function setHeader(string $key, $value): void
/**
* Gets all request headers
- * @return array
*/
public static function allHeaders(): array
{
@@ -74,7 +67,6 @@ public static function allHeaders(): array
/**
* Deletes the header by given key
- * @param string $key
*/
public static function deleteHeader(string $key): void
{
@@ -85,7 +77,6 @@ public static function deleteHeader(string $key): void
/**
* Gets Authorization Bearer token
- * @return string|null
*/
public static function getAuthorizationBearer(): ?string
{
@@ -102,7 +93,6 @@ public static function getAuthorizationBearer(): ?string
/**
* Gets Basic Auth Credentials
- * @return array|null
*/
public static function getBasicAuthCredentials(): ?array
{
@@ -133,7 +123,6 @@ public static function getBasicAuthCredentials(): ?array
/**
* Checks to see if request was AJAX request
- * @return bool
*/
public static function isAjax(): bool
{
@@ -142,17 +131,12 @@ public static function isAjax(): bool
/**
* Gets the referrer
- * @return string|null
*/
public static function getReferrer(): ?string
{
return self::$server->referrer();
}
- /**
- * @param string $key
- * @return array
- */
private static function normalizeHeaderKey(string $key): array
{
$keyWithHyphens = str_replace('_', '-', strtolower($key));
diff --git a/src/Http/Traits/Request/Internal.php b/src/Http/Traits/Request/Internal.php
index 018a2051a..0ca0c6d01 100644
--- a/src/Http/Traits/Request/Internal.php
+++ b/src/Http/Traits/Request/Internal.php
@@ -29,11 +29,6 @@ trait Internal
{
/**
* Creates an internal request for testing purposes
- * @param string $method
- * @param string $url
- * @param array $params
- * @param array $headers
- * @param array $files
* @throws BaseException
* @throws ReflectionException
* @throws ConfigException
@@ -82,10 +77,8 @@ public static function create(
self::detectAndSetContentType($server, $params, $files);
- if ($headers !== []) {
- foreach ($headers as $name => $value) {
- $server->set('HTTP_' . strtoupper(str_replace('-', '_', $name)), $value);
- }
+ foreach ($headers as $name => $value) {
+ $server->set('HTTP_' . strtoupper(str_replace('-', '_', $name)), $value);
}
self::flush();
@@ -104,9 +97,6 @@ public static function create(
/**
* Detects the content type
* @param $server
- * @param array|null $data
- * @param array|null $files
- * @return void
*/
protected static function detectAndSetContentType($server, ?array $data = null, ?array $files = null): void
{
diff --git a/src/Http/Traits/Request/Params.php b/src/Http/Traits/Request/Params.php
index 356c195f0..89bf43e0a 100644
--- a/src/Http/Traits/Request/Params.php
+++ b/src/Http/Traits/Request/Params.php
@@ -30,11 +30,10 @@ trait Params
* Request content type
* @var string|null
*/
- private static $__contentType = null;
+ private static $__contentType;
/**
* Gets the GET params.
- * @return array
*/
private static function getParams(): array
{
@@ -47,7 +46,6 @@ private static function getParams(): array
/**
* Gets the POST params.
- * @return array
*/
private static function postParams(): array
{
@@ -60,7 +58,6 @@ private static function postParams(): array
/**
* Parses and returns JSON payload parameters.
- * @return array
*/
private static function jsonPayloadParams(): array
{
@@ -76,7 +73,6 @@ private static function jsonPayloadParams(): array
/**
* Parses and returns URL-encoded parameters.
- * @return array
*/
private static function urlEncodedParams(): array
{
@@ -114,7 +110,6 @@ private static function getRawInputParams(): array
/**
* Retrieves the raw HTTP request body as a string.
- * @return string
*/
private static function getRawInput(): string
{
diff --git a/src/Http/Traits/Request/Query.php b/src/Http/Traits/Request/Query.php
index 4d989f882..c6fef39c9 100644
--- a/src/Http/Traits/Request/Query.php
+++ b/src/Http/Traits/Request/Query.php
@@ -22,13 +22,11 @@ trait Query
{
/**
* Query string
- * @var string|null
*/
private static ?string $__query = null;
/**
* Gets the query string
- * @return string|null
*/
public static function getQuery(): ?string
{
@@ -37,7 +35,6 @@ public static function getQuery(): ?string
/**
* Sets the query string
- * @param string $query
*/
public static function setQuery(string $query): void
{
@@ -46,8 +43,6 @@ public static function setQuery(string $query): void
/**
* Gets the query param
- * @param string $key
- * @return string|null
*/
public static function getQueryParam(string $key): ?string
{
@@ -69,8 +64,6 @@ public static function getQueryParam(string $key): ?string
/**
* Sets the query param
- * @param string $key
- * @param string $value
*/
public static function setQueryParam(string $key, string $value): void
{
diff --git a/src/Http/Traits/Request/RawInput.php b/src/Http/Traits/Request/RawInput.php
index 3d8a3acb4..3ab036ce8 100644
--- a/src/Http/Traits/Request/RawInput.php
+++ b/src/Http/Traits/Request/RawInput.php
@@ -31,7 +31,6 @@ trait RawInput
{
/**
* Parses raw input data and returns parsed parameters and files
- * @param string $rawInput
* @return array|array[]
* @throws BaseException
* @throws ConfigException
@@ -53,7 +52,6 @@ public static function parse(string $rawInput): array
/**
* Extracts boundary string from Content-Type header
- * @return string|null
*/
private static function getBoundary(): ?string
{
@@ -70,9 +68,6 @@ private static function getBoundary(): ?string
/**
* Splits raw input into multipart blocks
- * @param string $boundary
- * @param string $rawInput
- * @return array
*/
private static function getBlocks(string $boundary, string $rawInput): array
{
@@ -84,8 +79,6 @@ private static function getBlocks(string $boundary, string $rawInput): array
/**
* Processes multipart blocks and extracts parameters and files
- * @param array $blocks
- * @return array
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -132,9 +125,6 @@ private static function processBlocks(array $blocks): array
/**
* Adds a parsed file to the files collection
- * @param array $files
- * @param string $nameParam
- * @param UploadedFile $file
*/
private static function addFileToCollection(array &$files, string $nameParam, UploadedFile $file): void
{
@@ -155,7 +145,6 @@ private static function addFileToCollection(array &$files, string $nameParam, Up
/**
* Detects the block type as a string identifier.
- * @param string $block
* @return string One of 'file', 'stream', 'param'
*/
private static function detectBlockType(string $block): string
@@ -173,8 +162,6 @@ private static function detectBlockType(string $block): string
/**
* Gets the parsed param
- * @param string $block
- * @return array
*/
private static function getParsedStream(string $block): array
{
@@ -185,8 +172,6 @@ private static function getParsedStream(string $block): array
/**
* Gets the parsed file
- * @param string $block
- * @return array|null
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -221,7 +206,6 @@ private static function getParsedFile(string $block): ?array
/**
* Parses a file block into metadata and binary content
- * @param string $block
* @return array{string, string, string, string}
*/
private static function parseFileData(string $block): array
@@ -250,8 +234,6 @@ private static function parseFileData(string $block): array
/**
* Parses a block and extracts normal form parameters
- * @param string $block
- * @return array
*/
private static function getParsedParameter(string $block): array
{
@@ -272,7 +254,6 @@ private static function getParsedParameter(string $block): array
/**
* Extracts name, filename, and content type from header lines
- * @param string $rawHeaders
* @return array{string, string, string}
*/
private static function parseHeaders(string $rawHeaders): array
@@ -305,7 +286,6 @@ private static function parseHeaders(string $rawHeaders): array
/**
* Parses array-like parameter names
- * @param string $parameter
* @return array|string
*/
private static function arrayParam(string $parameter)
diff --git a/src/Http/Traits/Request/Route.php b/src/Http/Traits/Request/Route.php
index c1895deb1..f5ec59913 100644
--- a/src/Http/Traits/Request/Route.php
+++ b/src/Http/Traits/Request/Route.php
@@ -22,23 +22,13 @@
*/
trait Route
{
- /**
- * @var MatchedRoute|null
- */
private static ?MatchedRoute $route = null;
- /**
- * @param MatchedRoute|null $route
- * @return void
- */
public static function setMatchedRoute(?MatchedRoute $route): void
{
self::$route = $route;
}
- /**
- * @return MatchedRoute|null
- */
public static function getMatchedRoute(): ?MatchedRoute
{
return self::$route;
diff --git a/src/Http/Traits/Request/Url.php b/src/Http/Traits/Request/Url.php
index 1031fa700..9fbd424cc 100644
--- a/src/Http/Traits/Request/Url.php
+++ b/src/Http/Traits/Request/Url.php
@@ -22,25 +22,21 @@ trait Url
{
/**
* Scheme
- * @var string|null
*/
private static ?string $__protocol = null;
/**
* Host name
- * @var string|null
*/
private static ?string $__host = null;
/**
* Server port
- * @var string|null
*/
private static ?string $__port = null;
/**
* Request URI
- * @var string|null
*/
private static ?string $__uri = null;
@@ -55,7 +51,6 @@ public static function getProtocol(): ?string
/**
* Sets the protocol
- * @param string $protocol
*/
public static function setProtocol(string $protocol): void
{
@@ -73,7 +68,6 @@ public static function getHost(): ?string
/**
* Sets the host name
- * @param string $host
*/
public static function setHost(string $host): void
{
@@ -91,7 +85,6 @@ public static function getPort(): ?string
/**
* Sets the port
- * @param string $port
*/
public static function setPort(string $port): void
{
@@ -100,7 +93,6 @@ public static function setPort(string $port): void
/**
* Gets the URI
- * @return string|null
*/
public static function getUri(): ?string
{
@@ -109,7 +101,6 @@ public static function getUri(): ?string
/**
* Sets the URI
- * @param string $uri
*/
public static function setUri(string $uri): void
{
@@ -118,8 +109,6 @@ public static function setUri(string $uri): void
/**
* Returns the URI segment at the specified index.
- * @param int $index
- * @return string|null
*/
public static function getSegment(int $index): ?string
{
@@ -130,7 +119,6 @@ public static function getSegment(int $index): ?string
/**
* Gets all URI segments as an array.
- * @return array
*/
public static function getAllSegments(): array
{
diff --git a/src/Http/Traits/Response/Body.php b/src/Http/Traits/Response/Body.php
index 92466c712..82add5494 100644
--- a/src/Http/Traits/Response/Body.php
+++ b/src/Http/Traits/Response/Body.php
@@ -29,7 +29,6 @@ trait Body
{
/**
* Response
- * @var array
*/
private static array $__response = [];
@@ -45,8 +44,6 @@ trait Body
/**
* Checks if response contains a data by given key
- * @param string $key
- * @return bool
*/
public static function has(string $key): bool
{
@@ -55,8 +52,6 @@ public static function has(string $key): bool
/**
* Gets the data from response by given key
- * @param string $key
- * @param string|null $default
* @return mixed
*/
public static function get(string $key, ?string $default = null)
@@ -66,7 +61,6 @@ public static function get(string $key, ?string $default = null)
/**
* Sets new key/value pair into response
- * @param string $key
* @param mixed $value
*/
public static function set(string $key, $value): void
@@ -76,7 +70,6 @@ public static function set(string $key, $value): void
/**
* Gets all response parameters
- * @return array
*/
public static function all(): array
{
@@ -85,7 +78,6 @@ public static function all(): array
/**
* Deletes the element from response by given key
- * @param string $key
*/
public static function delete(string $key): void
{
@@ -96,8 +88,6 @@ public static function delete(string $key): void
/**
* Prepares the JSON response
- * @param array|null $data
- * @param int|null $code
*/
public static function json(?array $data = null, ?int $code = null): void
{
@@ -114,9 +104,6 @@ public static function json(?array $data = null, ?int $code = null): void
/**
* Prepares the JSONP response
- * @param string $callback
- * @param array|null $data
- * @param int|null $code
*/
public static function jsonp(string $callback, ?array $data = null, ?int $code = null): void
{
@@ -135,8 +122,6 @@ public static function jsonp(string $callback, ?array $data = null, ?int $code =
/**
* Returns response with function
- * @param array $data
- * @return string
*/
public static function getJsonPData(array $data): string
{
@@ -145,8 +130,6 @@ public static function getJsonPData(array $data): string
/**
* Prepares the XML response
- * @param array|null $data
- * @param int|null $code
*/
public static function xml(?array $data = null, $root = '', ?int $code = null): void
{
@@ -165,8 +148,6 @@ public static function xml(?array $data = null, $root = '', ?int $c
/**
* Prepares the HTML content
- * @param string $html
- * @param int|null $code
*/
public static function html(string $html, ?int $code = null): void
{
@@ -181,7 +162,6 @@ public static function html(string $html, ?int $code = null): void
/**
* Gets the response content
- * @return string
* @throws HttpException
*/
public static function getContent(): string
@@ -199,8 +179,6 @@ public static function getContent(): string
/**
* Transforms array to XML
- * @param array $arr
- * @return string
* @throws Exception
*/
private static function arrayToXML(array $arr): string
@@ -216,8 +194,6 @@ private static function arrayToXML(array $arr): string
/**
* Compose XML
- * @param array $arr
- * @param SimpleXMLElement $simpleXML
*/
private static function composeXML(array $arr, SimpleXMLElement &$simpleXML): void
{
@@ -257,7 +233,6 @@ private static function composeXML(array $arr, SimpleXMLElement &$simpleXML): vo
/**
* Formats data as JSON
- * @return string
*/
private static function formatJson(): string
{
@@ -266,7 +241,6 @@ private static function formatJson(): string
/**
* Formats data as XML
- * @return string
* @throws Exception
*/
private static function formatXml(): string
@@ -276,7 +250,6 @@ private static function formatXml(): string
/**
* Formats data as HTML
- * @return string
*/
private static function formatHtml(): string
{
@@ -285,7 +258,6 @@ private static function formatHtml(): string
/**
* Formats data as JSONP
- * @return string
*/
private static function formatJsonp(): string
{
diff --git a/src/Http/Traits/Response/Header.php b/src/Http/Traits/Response/Header.php
index ff9211457..05f425453 100644
--- a/src/Http/Traits/Response/Header.php
+++ b/src/Http/Traits/Response/Header.php
@@ -25,14 +25,11 @@ trait Header
{
/**
* Response headers
- * @var array
*/
private static array $__headers = [];
/**
* Checks the response header existence by given key
- * @param string $key
- * @return bool
*/
public static function hasHeader(string $key): bool
{
@@ -41,8 +38,6 @@ public static function hasHeader(string $key): bool
/**
* Gets the response header by given key
- * @param string $key
- * @return string|null
*/
public static function getHeader(string $key): ?string
{
@@ -51,8 +46,6 @@ public static function getHeader(string $key): ?string
/**
* Sets the response header
- * @param string $key
- * @param string $value
*/
public static function setHeader(string $key, string $value): void
{
@@ -61,7 +54,6 @@ public static function setHeader(string $key, string $value): void
/**
* Get all response headers
- * @return array
*/
public static function allHeaders(): array
{
@@ -70,7 +62,6 @@ public static function allHeaders(): array
/**
* Deletes the header by given key
- * @param string $key
*/
public static function deleteHeader(string $key): void
{
@@ -81,7 +72,6 @@ public static function deleteHeader(string $key): void
/**
* Sets the content type
- * @param string $contentType
*/
public static function setContentType(string $contentType): void
{
@@ -90,7 +80,6 @@ public static function setContentType(string $contentType): void
/**
* Gets the content type
- * @return string
*/
public static function getContentType(): string
{
@@ -99,8 +88,6 @@ public static function getContentType(): string
/**
* Redirect
- * @param string $url
- * @param int $code
* @throws StopExecutionException
*/
public static function redirect(string $url, int $code = 302): void
diff --git a/src/Http/Traits/Response/Status.php b/src/Http/Traits/Response/Status.php
index eec4b5803..3b9411649 100644
--- a/src/Http/Traits/Response/Status.php
+++ b/src/Http/Traits/Response/Status.php
@@ -25,7 +25,6 @@ trait Status
{
/**
* Status code
- * @var int
*/
private static int $__statusCode = StatusCode::OK;
@@ -104,8 +103,6 @@ trait Status
/**
* Gets the reason phrase for a given HTTP status code.
- * @param int $code
- * @return string
*/
public static function getText(int $code): string
{
@@ -118,7 +115,6 @@ public static function getText(int $code): string
/**
* Sets the status code
- * @param int $code
*/
public static function setStatusCode(int $code): void
{
@@ -131,7 +127,6 @@ public static function setStatusCode(int $code): void
/**
* Gets the status code
- * @return int
*/
public static function getStatusCode(): int
{
@@ -140,7 +135,6 @@ public static function getStatusCode(): int
/**
* Gets the status text
- * @return string
*/
public static function getStatusText(): string
{
diff --git a/src/HttpClient/Exceptions/HttpClientException.php b/src/HttpClient/Exceptions/HttpClientException.php
index ccef57249..7dbff486e 100644
--- a/src/HttpClient/Exceptions/HttpClientException.php
+++ b/src/HttpClient/Exceptions/HttpClientException.php
@@ -25,10 +25,6 @@
*/
class HttpClientException extends BaseException
{
- /**
- * @return HttpClientException
- */
-
public static function requestNotCreated(): self
{
return new self(
diff --git a/src/HttpClient/HttpClient.php b/src/HttpClient/HttpClient.php
index e5642f2af..0a1004c8a 100644
--- a/src/HttpClient/HttpClient.php
+++ b/src/HttpClient/HttpClient.php
@@ -56,35 +56,23 @@ class HttpClient
/**
* @var MultiCurl|Curl
*/
- private $client = null;
+ private $client;
private string $method = 'GET';
/**
* @var mixed|null
*/
- private $data = null;
+ private $data;
- /**
- * @var array
- */
private array $requestHeaders = [];
- /**
- * @var array
- */
private array $response = [];
- /**
- * @var array
- */
private array $errors = [];
/**
* Creates request
- * @param string $url
- * @param Curl|null $client
- * @return HttpClient
*/
public function createRequest(string $url, ?Curl $client = null): HttpClient
{
@@ -95,8 +83,6 @@ public function createRequest(string $url, ?Curl $client = null): HttpClient
/**
* Creates multi request
- * @param MultiCurl|null $client
- * @return HttpClient
*/
public function createMultiRequest(?MultiCurl $client = null): HttpClient
{
@@ -111,10 +97,6 @@ public function createMultiRequest(?MultiCurl $client = null): HttpClient
/**
* Creates async multi request
- * @param callable $success
- * @param callable $error
- * @param MultiCurl|null $client
- * @return HttpClient
*/
public function createAsyncMultiRequest(callable $success, callable $error, ?MultiCurl $client = null): HttpClient
{
@@ -128,8 +110,6 @@ public function createAsyncMultiRequest(callable $success, callable $error, ?Mul
/**
* Sets http method
- * @param string $method
- * @return $this
* @throws BaseException
*/
public function setMethod(string $method): HttpClient
@@ -144,7 +124,6 @@ public function setMethod(string $method): HttpClient
/**
* Gets the current http method
- * @return string
*/
public function getMethod(): string
{
@@ -154,7 +133,6 @@ public function getMethod(): string
/**
* Sets data
* @param mixed $data
- * @return HttpClient
*/
public function setData($data): HttpClient
{
@@ -173,7 +151,6 @@ public function getData()
/**
* Checks if the request is multi cURL
- * @return bool
*/
public function isMultiRequest(): bool
{
@@ -202,7 +179,6 @@ public function start(): HttpClient
/**
* Gets single or all request headers
- * @param string|null $header
* @return mixed|null
* @throws BaseException
*/
@@ -219,7 +195,6 @@ public function getRequestHeaders(?string $header = null)
/**
* Gets the response headers
- * @param string|null $header
* @return mixed|null
* @throws BaseException
*/
@@ -238,7 +213,6 @@ public function getResponseHeaders(?string $header = null)
/**
* Gets the response cookies
- * @param string|null $cookie
* @return mixed|null
* @throws BaseException
*/
@@ -269,7 +243,6 @@ public function getResponseBody()
/**
* Gets the entire response
- * @return array
*/
public function getResponse(): array
{
@@ -278,7 +251,6 @@ public function getResponse(): array
/**
* Returns the errors
- * @return array
*/
public function getErrors(): array
{
@@ -287,7 +259,6 @@ public function getErrors(): array
/**
* Gets the curl info
- * @param int|null $option
* @return mixed
* @throws BaseException
*/
@@ -300,7 +271,6 @@ public function info(?int $option = null)
/**
* Gets the current url being executed
- * @return string|null
* @throws BaseException
*/
public function url(): ?string
@@ -311,9 +281,6 @@ public function url(): ?string
}
/**
- * @param string $method
- * @param array $arguments
- * @return $this
* @throws BaseException
* @throws HttpClientException
*/
@@ -335,7 +302,6 @@ public function __call(string $method, array $arguments): HttpClient
}
/**
- * @return void
* @throws ErrorException
*/
private function startSingleRequest(): void
@@ -352,7 +318,6 @@ private function startSingleRequest(): void
/**
* Handles the response
- * @param Curl $instance
*/
private function handleResponse(Curl $instance): void
{
@@ -370,10 +335,6 @@ private function handleResponse(Curl $instance): void
];
}
- /**
- * @param CaseInsensitiveArray $headers
- * @return array
- */
private function formatHeaders(CaseInsensitiveArray $headers): array
{
$formatted = [];
@@ -386,7 +347,6 @@ private function formatHeaders(CaseInsensitiveArray $headers): array
}
/**
- * @return void
* @throws BaseException
*/
private function ensureSingleRequest(): void
@@ -396,11 +356,6 @@ private function ensureSingleRequest(): void
}
}
- /**
- * @param string $method
- * @param array $arguments
- * @return void
- */
private function interceptCall(string $method, array $arguments): void
{
switch ($method) {
diff --git a/src/Jwt/Exceptions/JwtException.php b/src/Jwt/Exceptions/JwtException.php
index bdb3edf6c..cbbb9e5e6 100644
--- a/src/Jwt/Exceptions/JwtException.php
+++ b/src/Jwt/Exceptions/JwtException.php
@@ -25,9 +25,6 @@
*/
class JwtException extends BaseException
{
- /**
- * @return JwtException
- */
public static function payloadNotFound(): self
{
return new self(
diff --git a/src/Jwt/JwtToken.php b/src/Jwt/JwtToken.php
index 860c286f6..95a2d926a 100644
--- a/src/Jwt/JwtToken.php
+++ b/src/Jwt/JwtToken.php
@@ -28,30 +28,23 @@ class JwtToken extends JWT
{
/**
* JWT secret key
- * @var string
*/
private string $key;
/**
* Encryption algorithm
- * @var string
*/
private string $algorithm = 'HS256';
/**
* Payload data
- * @var array
*/
private array $payload = [];
- /**
- * @var object|null
- */
private ?object $fetchedPayload = null;
/**
* JwtToken constructor.
- * @param string|null $key
* @throws EnvException
*/
public function __construct(?string $key = null)
@@ -61,7 +54,6 @@ public function __construct(?string $key = null)
/**
* Sets extra leeway time
- * @return $this
*/
public function setLeeway($leeway): JwtToken
{
@@ -71,8 +63,6 @@ public function setLeeway($leeway): JwtToken
/**
* Sets the encryption algorithm
- * @param string $algorithm
- * @return $this
*/
public function setAlgorithm(string $algorithm): JwtToken
{
@@ -82,9 +72,7 @@ public function setAlgorithm(string $algorithm): JwtToken
/**
* Sets the claim
- * @param string $key
* @param mixed $value
- * @return $this
*/
public function setClaim(string $key, $value): JwtToken
{
@@ -94,8 +82,6 @@ public function setClaim(string $key, $value): JwtToken
/**
* Set claims
- * @param array $claims
- * @return $this
*/
public function setClaims(array $claims): JwtToken
{
@@ -108,8 +94,6 @@ public function setClaims(array $claims): JwtToken
/**
* Sets user data
- * @param array $data
- * @return $this
*/
public function setData(array $data): JwtToken
{
@@ -119,9 +103,6 @@ public function setData(array $data): JwtToken
/**
* Composes and signs the JWT
- * @param string|null $keyId
- * @param array|null $head
- * @return string
* @throws JwtException
*/
public function compose(?string $keyId = null, ?array $head = null): string
@@ -135,8 +116,6 @@ public function compose(?string $keyId = null, ?array $head = null): string
/**
* Retrieve and verifies the JWT
- * @param string $jwt
- * @return $this
*/
public function retrieve(string $jwt): JwtToken
{
@@ -155,7 +134,6 @@ public function fetchPayload(): ?object
/**
* Fetches the user data
- * @return array|null
*/
public function fetchData(): ?array
{
@@ -164,7 +142,6 @@ public function fetchData(): ?array
/**
* Fetches the claim
- * @param string $key
* @return mixed|null
*/
public function fetchClaim(string $key)
diff --git a/src/Lang/Exceptions/LangException.php b/src/Lang/Exceptions/LangException.php
index 7c5eb097c..9b7b72695 100644
--- a/src/Lang/Exceptions/LangException.php
+++ b/src/Lang/Exceptions/LangException.php
@@ -25,9 +25,6 @@
*/
class LangException extends BaseException
{
- /**
- * @return LangException
- */
public static function translationsNotFound(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function translationsNotFound(): self
);
}
- /**
- * @return LangException
- */
public static function misconfiguredDefaultConfig(): self
{
return new self(
diff --git a/src/Lang/Factories/LangFactory.php b/src/Lang/Factories/LangFactory.php
index 5c2d47186..486e9f2ed 100644
--- a/src/Lang/Factories/LangFactory.php
+++ b/src/Lang/Factories/LangFactory.php
@@ -35,7 +35,6 @@ class LangFactory
private static ?Lang $instance = null;
/**
- * @return Lang
* @throws ConfigException
* @throws LangException
* @throws DiException
@@ -58,7 +57,6 @@ public static function get(): Lang
}
/**
- * @return array
* @throws ConfigException
* @throws DiException
* @throws ReflectionException
@@ -77,9 +75,6 @@ private static function loadLangConfig(): array
}
/**
- * @param array $supported
- * @param string|null $default
- * @return string
* @throws LangException
*/
private static function detectLanguage(array $supported, ?string $default): string
@@ -105,10 +100,6 @@ private static function detectLanguage(array $supported, ?string $default): stri
return $lang;
}
- /**
- * @param array $supported
- * @return string|null
- */
private static function getLangFromQuery(array $supported): ?string
{
$queryLang = Request::getQueryParam('lang');
@@ -116,10 +107,6 @@ private static function getLangFromQuery(array $supported): ?string
return $queryLang && in_array($queryLang, $supported) ? $queryLang : null;
}
- /**
- * @param array $supported
- * @return string|null
- */
private static function getLangFromUrlSegment(array $supported): ?string
{
$segmentIndex = (int) config()->get('lang.url_segment');
@@ -133,10 +120,6 @@ private static function getLangFromUrlSegment(array $supported): ?string
return $segmentLang && in_array($segmentLang, $supported) ? $segmentLang : null;
}
- /**
- * @param array $supported
- * @return string|null
- */
private static function getLangFromHeader(array $supported): ?string
{
$acceptedLang = server()->acceptedLang();
diff --git a/src/Lang/Helpers/lang.php b/src/Lang/Helpers/lang.php
index 5315456c2..5c5c4ccb3 100644
--- a/src/Lang/Helpers/lang.php
+++ b/src/Lang/Helpers/lang.php
@@ -19,7 +19,6 @@
/**
* Gets the current lang
- * @return string|null
* @throws ConfigException
* @throws DiException
* @throws LangException
@@ -32,9 +31,7 @@ function current_lang(): ?string
/**
* Gets translation
- * @param string $key
* @param $params
- * @return string|null
* @throws ConfigException
* @throws ReflectionException
* @throws DiException
@@ -47,9 +44,7 @@ function t(string $key, $params = null): ?string
/**
* Outputs the translation
- * @param string $key
* @param $params
- * @return void
* @throws ConfigException
* @throws DiException
* @throws LangException
diff --git a/src/Lang/Lang.php b/src/Lang/Lang.php
index cb5104c94..d607c1f92 100644
--- a/src/Lang/Lang.php
+++ b/src/Lang/Lang.php
@@ -25,26 +25,12 @@
*/
class Lang
{
- /**
- * @var string|null
- */
private ?string $currentLang = null;
- /**
- * @var Translator
- */
private Translator $translator;
- /**
- * @var bool
- */
private bool $isEnabled;
- /**
- * @param string $lang
- * @param bool $isEnabled
- * @param Translator $translator
- */
public function __construct(string $lang, bool $isEnabled, Translator $translator)
{
$this->isEnabled = $isEnabled;
@@ -54,7 +40,6 @@ public function __construct(string $lang, bool $isEnabled, Translator $translato
/**
* Set the current language
- * @param string $lang
* @return $this
*/
public function setLang(string $lang): self
@@ -65,7 +50,6 @@ public function setLang(string $lang): self
/**
* Get current language
- * @return string|null
*/
public function getLang(): ?string
{
@@ -74,7 +58,6 @@ public function getLang(): ?string
/**
* Is multilang enabled
- * @return bool
*/
public function isEnabled(): bool
{
@@ -96,9 +79,7 @@ public function load(): void
/**
* Get translation by key
- * @param string $key
* @param $params
- * @return string|null
*/
public function getTranslation(string $key, $params = null): ?string
{
diff --git a/src/Lang/Translator.php b/src/Lang/Translator.php
index 66d3e9341..886f5f09c 100644
--- a/src/Lang/Translator.php
+++ b/src/Lang/Translator.php
@@ -29,14 +29,8 @@ class Translator
{
protected string $lang;
- /**
- * @var Data|null
- */
private ?Data $translations = null;
- /**
- * @param string $lang
- */
public function __construct(string $lang)
{
$this->lang = $lang;
@@ -82,7 +76,6 @@ public function loadTranslations(): void
/**
* Load translations
- * @param array $files
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -101,9 +94,7 @@ private function loadFiles(array $files): void
/**
* Get translation by key
- * @param string $key
* @param array|string|null $params
- * @return string
*/
public function get(string $key, $params = null): string
{
diff --git a/src/Loader/Loader.php b/src/Loader/Loader.php
index cf81561eb..d3ded9e1a 100644
--- a/src/Loader/Loader.php
+++ b/src/Loader/Loader.php
@@ -25,38 +25,31 @@ class Loader
{
/**
* Current module
- * @var string|null
*/
private ?string $module = null;
/**
* Environment
- * @var string|null
*/
private ?string $pathPrefix = null;
/**
* File name
- * @var string|null
*/
private ?string $fileName = null;
/**
* Hierarchical
- * @var bool
*/
private bool $hierarchical = false;
/**
* Exception message
- * @var string
*/
private string $exceptionMessage = '';
/**
* Setups the loader
- * @param Setup $setup
- * @return $this
*/
public function setup(Setup $setup): Loader
{
@@ -71,9 +64,7 @@ public function setup(Setup $setup): Loader
/**
* Sets new value
- * @param string $property
* @param mixed $value
- * @return $this
*/
public function set(string $property, $value): Loader
{
@@ -83,7 +74,6 @@ public function set(string $property, $value): Loader
/**
* Loads .php files from given directory
- * @param string $dir
*/
public function loadDir(string $dir): void
{
@@ -104,7 +94,6 @@ public function load()
/**
* Checks if the setup points to valid file
- * @return bool
*/
public function fileExists(): bool
{
@@ -124,7 +113,6 @@ public function fileExists(): bool
/**
* Gets the file path
- * @return string
* @throws LoaderException
*/
public function getFilePath(): string
@@ -146,9 +134,6 @@ public function getFilePath(): string
return $filePath;
}
- /**
- * @return string
- */
private function resolveFilePath(): string
{
$filePath = '';
@@ -161,8 +146,6 @@ private function resolveFilePath(): string
$filePath .= $this->pathPrefix . DS;
}
- $filePath .= $this->fileName . '.php';
-
- return $filePath;
+ return $filePath . ($this->fileName . '.php');
}
}
diff --git a/src/Loader/Setup.php b/src/Loader/Setup.php
index 257665418..5dee46e68 100644
--- a/src/Loader/Setup.php
+++ b/src/Loader/Setup.php
@@ -23,38 +23,18 @@
*/
class Setup
{
- /**
- * @var bool
- */
protected bool $hierarchical;
- /**
- * @var string|null
- */
protected ?string $module;
- /**
- * @var string|null
- */
protected ?string $pathPrefix;
- /**
- * @var string|null
- */
protected ?string $fileName;
- /**
- * @var string
- */
protected string $exceptionMessage;
/**
* Setup constructor.
- * @param string|null $pathPrefix
- * @param string|null $fileName
- * @param bool $hierarchical
- * @param string|null $module
- * @param string|null $exceptionMessage
* @throws DiException|ReflectionException
*/
public function __construct(?string $pathPrefix = null, ?string $fileName = null, bool $hierarchical = true, ?string $module = null, ?string $exceptionMessage = null)
@@ -68,8 +48,6 @@ public function __construct(?string $pathPrefix = null, ?string $fileName = null
/**
* Sets the path prefix
- * @param string $pathPrefix
- * @return $this
*/
public function setPathPrefix(string $pathPrefix): Setup
{
@@ -79,7 +57,6 @@ public function setPathPrefix(string $pathPrefix): Setup
/**
* Gets the path prefix
- * @return string|null
*/
public function getPathPrefix(): ?string
{
@@ -88,8 +65,6 @@ public function getPathPrefix(): ?string
/**
* Set the filename
- * @param string $fileName
- * @return $this
*/
public function setFilename(string $fileName): Setup
{
@@ -99,7 +74,6 @@ public function setFilename(string $fileName): Setup
/**
* Gets the filename
- * @return string|null
*/
public function getFilename(): ?string
{
@@ -108,8 +82,6 @@ public function getFilename(): ?string
/**
* Sets the module
- * @param string $module
- * @return $this
*/
public function setModule(string $module): Setup
{
@@ -119,7 +91,6 @@ public function setModule(string $module): Setup
/**
* Gets the module
- * @return string|null
*/
public function getModule(): ?string
{
@@ -128,8 +99,6 @@ public function getModule(): ?string
/**
* Sets the exception message
- * @param string $exceptionMessage
- * @return $this
*/
public function setExceptionMessage(string $exceptionMessage): Setup
{
@@ -139,7 +108,6 @@ public function setExceptionMessage(string $exceptionMessage): Setup
/**
* Gets the exception message
- * @return string
*/
public function getExceptionMessage(): string
{
@@ -148,8 +116,6 @@ public function getExceptionMessage(): string
/**
* Set the hierarchy
- * @param bool $hierarchy
- * @return $this
*/
public function setHierarchy(bool $hierarchy): Setup
{
@@ -159,7 +125,6 @@ public function setHierarchy(bool $hierarchy): Setup
/**
* Gets the hierarchy
- * @return bool
*/
public function getHierarchy(): bool
{
diff --git a/src/Logger/Adapters/DailyAdapter.php b/src/Logger/Adapters/DailyAdapter.php
index 9047a3c53..79aa8b366 100644
--- a/src/Logger/Adapters/DailyAdapter.php
+++ b/src/Logger/Adapters/DailyAdapter.php
@@ -32,7 +32,6 @@ class DailyAdapter implements ReportableInterface
use LoggerTrait;
/**
- * @param array $params
* @throws BaseException
* @throws LoggerException
* @throws DiException
@@ -47,8 +46,6 @@ public function __construct(array $params)
/**
* Initialize the adapter for Daily logs
- * @param array $params
- * @return void
* @throws LoggerException
*/
protected function initialize(array $params): void
diff --git a/src/Logger/Adapters/MessageAdapter.php b/src/Logger/Adapters/MessageAdapter.php
index e535571c2..615a33ca5 100644
--- a/src/Logger/Adapters/MessageAdapter.php
+++ b/src/Logger/Adapters/MessageAdapter.php
@@ -25,10 +25,7 @@
class MessageAdapter implements ReportableInterface
{
/**
- * @param string $level
* @param $message
- * @param array|null $context
- * @return void
* @throws DebugBarException
*/
public function report(string $level, $message, ?array $context = []): void
diff --git a/src/Logger/Adapters/SingleAdapter.php b/src/Logger/Adapters/SingleAdapter.php
index 62cfe7d19..2091a62de 100644
--- a/src/Logger/Adapters/SingleAdapter.php
+++ b/src/Logger/Adapters/SingleAdapter.php
@@ -32,7 +32,6 @@ class SingleAdapter implements ReportableInterface
use LoggerTrait;
/**
- * @param array $params
* @throws BaseException
* @throws LoggerException
* @throws DiException
@@ -47,8 +46,6 @@ public function __construct(array $params)
/**
* Initialize the adapter for Single log file
- * @param array $params
- * @return void
* @throws LoggerException
*/
protected function initialize(array $params): void
diff --git a/src/Logger/Contracts/ReportableInterface.php b/src/Logger/Contracts/ReportableInterface.php
index a483680f6..46ebeb56b 100644
--- a/src/Logger/Contracts/ReportableInterface.php
+++ b/src/Logger/Contracts/ReportableInterface.php
@@ -22,9 +22,7 @@ interface ReportableInterface
{
/**
* Reports the message
- * @param string $level
* @param mixed $message
- * @param array|null $context
*/
public function report(string $level, $message, ?array $context = []);
diff --git a/src/Logger/Exceptions/LoggerException.php b/src/Logger/Exceptions/LoggerException.php
index f22d8c596..cf730358f 100644
--- a/src/Logger/Exceptions/LoggerException.php
+++ b/src/Logger/Exceptions/LoggerException.php
@@ -25,10 +25,6 @@
*/
class LoggerException extends BaseException
{
- /**
- * @param string $name
- * @return LoggerException
- */
public static function logPathIsNotDirectory(string $name): self
{
return new self(
@@ -37,10 +33,6 @@ public static function logPathIsNotDirectory(string $name): self
);
}
- /**
- * @param string $name
- * @return LoggerException
- */
public static function logPathIsNotFile(string $name): self
{
return new self(
diff --git a/src/Logger/Factories/LoggerFactory.php b/src/Logger/Factories/LoggerFactory.php
index 0403be606..5c936f172 100644
--- a/src/Logger/Factories/LoggerFactory.php
+++ b/src/Logger/Factories/LoggerFactory.php
@@ -47,8 +47,6 @@ class LoggerFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Logger
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -81,11 +79,6 @@ public static function get(?string $adapter = null): Logger
return self::$instances[$adapter];
}
- /**
- * @param string $adapterClass
- * @param string $adapter
- * @return Logger
- */
private static function createInstance(string $adapterClass, string $adapter): Logger
{
return $adapter === Logger::MESSAGE
@@ -94,8 +87,6 @@ private static function createInstance(string $adapterClass, string $adapter): L
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
diff --git a/src/Logger/Helpers/logger.php b/src/Logger/Helpers/logger.php
index 4c4369f2b..6bff8a876 100644
--- a/src/Logger/Helpers/logger.php
+++ b/src/Logger/Helpers/logger.php
@@ -19,8 +19,6 @@
use Quantum\Logger\Logger;
/**
- * @param string|null $adapter
- * @return Logger
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -34,8 +32,6 @@ function logger(?string $adapter = null): Logger
/**
* Reports error
* @param $var
- * @param array $context
- * @return void
* @throws ConfigException
* @throws DiException
* @throws ReflectionException
@@ -49,8 +45,6 @@ function error($var, array $context = []): void
/**
* Reports warning
* @param $var
- * @param array $context
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -64,8 +58,6 @@ function warning($var, array $context = []): void
/**
* Reports notice
* @param $var
- * @param array $context
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -79,8 +71,6 @@ function notice($var, array $context = []): void
/**
* Reports info
* @param $var
- * @param array $context
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -94,8 +84,6 @@ function info($var, array $context = []): void
/**
* Reports debug
* @param $var
- * @param array $context
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Logger/Logger.php b/src/Logger/Logger.php
index 1346319cc..8600e1916 100644
--- a/src/Logger/Logger.php
+++ b/src/Logger/Logger.php
@@ -41,17 +41,11 @@ class Logger implements LoggerInterface
private ReportableInterface $adapter;
- /**
- * @param ReportableInterface $adapter
- */
public function __construct(ReportableInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return ReportableInterface
- */
public function getAdapter(): ReportableInterface
{
return $this->adapter;
diff --git a/src/Logger/LoggerConfig.php b/src/Logger/LoggerConfig.php
index 134ac31f1..89be469cc 100644
--- a/src/Logger/LoggerConfig.php
+++ b/src/Logger/LoggerConfig.php
@@ -39,15 +39,10 @@ class LoggerConfig
*/
public const DEFAULT_LOG_LEVEL = 'error';
- /**
- * @var string
- */
private static string $logLevel = self::DEFAULT_LOG_LEVEL;
/**
* Set the application's log level.
- * @param string $level
- * @return void
*/
public static function setAppLogLevel(string $level): void
{
@@ -58,7 +53,6 @@ public static function setAppLogLevel(string $level): void
/**
* Get the integer value of the application's log level.
- * @return int
*/
public static function getAppLogLevel(): int
{
@@ -67,8 +61,6 @@ public static function getAppLogLevel(): int
/**
* Get the integer log level for a given error type.
- * @param string $errorType
- * @return int
*/
public static function getLogLevel(string $errorType): int
{
diff --git a/src/Logger/Traits/LoggerTrait.php b/src/Logger/Traits/LoggerTrait.php
index cf6c297b0..f87fda0e6 100644
--- a/src/Logger/Traits/LoggerTrait.php
+++ b/src/Logger/Traits/LoggerTrait.php
@@ -35,17 +35,13 @@ trait LoggerTrait
/**
* Initialize the logger
- * @param array $params
* @throws LoggerException
*/
abstract protected function initialize(array $params): void;
/**
* Reports a log message
- * @param string $level
* @param $message
- * @param array|null $context
- * @return void
*/
public function report(string $level, $message, ?array $context = []): void
{
@@ -54,10 +50,7 @@ public function report(string $level, $message, ?array $context = []): void
/**
* Formats the log message
- * @param string $level
* @param $message
- * @param array|null $context
- * @return string
*/
protected function formatMessage(string $level, $message, ?array $context = []): string
{
diff --git a/src/Mailer/Adapters/MailgunAdapter.php b/src/Mailer/Adapters/MailgunAdapter.php
index 533056761..539747301 100644
--- a/src/Mailer/Adapters/MailgunAdapter.php
+++ b/src/Mailer/Adapters/MailgunAdapter.php
@@ -27,9 +27,6 @@ class MailgunAdapter implements MailerInterface
{
use MailerTrait;
- /**
- * @var string
- */
public string $name = 'Mailgun';
/**
@@ -37,19 +34,12 @@ class MailgunAdapter implements MailerInterface
*/
private $apiKey;
- /**
- * @var string
- */
private string $apiUrl = 'https://api.mailgun.net/v3/';
- /**
- * @var array
- */
private array $data = [];
/**
* MailgunAdapter constructor
- * @param array $params
*/
public function __construct(array $params)
{
@@ -88,9 +78,6 @@ private function prepare(): void
}
}
- /**
- * @return bool
- */
private function sendEmail(): bool
{
try {
diff --git a/src/Mailer/Adapters/MandrillAdapter.php b/src/Mailer/Adapters/MandrillAdapter.php
index 7e2367a05..634c99d18 100644
--- a/src/Mailer/Adapters/MandrillAdapter.php
+++ b/src/Mailer/Adapters/MandrillAdapter.php
@@ -32,19 +32,12 @@ class MandrillAdapter implements MailerInterface
*/
public $name = 'Mandrill';
- /**
- * @var string
- */
private string $apiUrl = 'https://mandrillapp.com/api/1.0/messages/send.json';
- /**
- * @var array
- */
private array $data = [];
/**
* MandrillAdapter constructor
- * @param array $params
*/
public function __construct(array $params)
{
@@ -85,9 +78,6 @@ private function prepare(): void
$this->data['message'] = $message;
}
- /**
- * @return bool
- */
private function sendEmail(): bool
{
try {
diff --git a/src/Mailer/Adapters/SendgridAdapter.php b/src/Mailer/Adapters/SendgridAdapter.php
index 59d63e5a6..5f62b456d 100644
--- a/src/Mailer/Adapters/SendgridAdapter.php
+++ b/src/Mailer/Adapters/SendgridAdapter.php
@@ -27,9 +27,6 @@ class SendgridAdapter implements MailerInterface
{
use MailerTrait;
- /**
- * @var string
- */
public string $name = 'Sendgrid';
/**
@@ -39,14 +36,10 @@ class SendgridAdapter implements MailerInterface
private string $apiUrl = 'https://api.sendgrid.com/v3/mail/send';
- /**
- * @var array
- */
private array $data = [];
/**
* SendgridAdapter constructor
- * @param array $params
*/
public function __construct(array $params)
{
@@ -86,9 +79,6 @@ public function prepare(): void
}
}
- /**
- * @return bool
- */
private function sendEmail(): bool
{
try {
diff --git a/src/Mailer/Adapters/SendinblueAdapter.php b/src/Mailer/Adapters/SendinblueAdapter.php
index f9284e625..e30f4d0bf 100644
--- a/src/Mailer/Adapters/SendinblueAdapter.php
+++ b/src/Mailer/Adapters/SendinblueAdapter.php
@@ -27,9 +27,6 @@ class SendinblueAdapter implements MailerInterface
{
use MailerTrait;
- /**
- * @var string
- */
public string $name = 'Sendinblue';
/**
@@ -39,14 +36,10 @@ class SendinblueAdapter implements MailerInterface
private string $apiUrl = 'https://api.sendinblue.com/v3/smtp/email';
- /**
- * @var array
- */
private array $data = [];
/**
* SendinblueAdapter constructor
- * @param array $params
*/
public function __construct(array $params)
{
@@ -78,9 +71,6 @@ private function prepare(): void
}
}
- /**
- * @return bool
- */
private function sendEmail(): bool
{
try {
diff --git a/src/Mailer/Adapters/SmtpAdapter.php b/src/Mailer/Adapters/SmtpAdapter.php
index bdddbf9f1..c58475ed8 100644
--- a/src/Mailer/Adapters/SmtpAdapter.php
+++ b/src/Mailer/Adapters/SmtpAdapter.php
@@ -29,14 +29,10 @@ class SmtpAdapter implements MailerInterface
{
use MailerTrait;
- /**
- * @var string
- */
public string $name = 'SMTP';
/**
* SmtpAdapter constructor
- * @param array $params
*/
public function __construct(array $params)
{
@@ -57,9 +53,6 @@ public function __construct(array $params)
/**
* Sets "Reply-To" address
- * @param string $email
- * @param string|null $name
- * @return $this
*/
public function setReplay(string $email, ?string $name = null): SmtpAdapter
{
@@ -73,7 +66,6 @@ public function setReplay(string $email, ?string $name = null): SmtpAdapter
/**
* Gets "Reply-To" addresses
- * @return array
*/
public function getReplays(): array
{
@@ -82,9 +74,6 @@ public function getReplays(): array
/**
* Sets "CC" address
- * @param string $email
- * @param string|null $name
- * @return $this
*/
public function setCC(string $email, ?string $name = null): SmtpAdapter
{
@@ -98,7 +87,6 @@ public function setCC(string $email, ?string $name = null): SmtpAdapter
/**
* Gets "CC" addresses
- * @return array
*/
public function getCCs(): array
{
@@ -107,9 +95,6 @@ public function getCCs(): array
/**
* Sets "BCC" address
- * @param string $email
- * @param string|null $name
- * @return $this
*/
public function setBCC(string $email, ?string $name = null): SmtpAdapter
{
@@ -123,7 +108,6 @@ public function setBCC(string $email, ?string $name = null): SmtpAdapter
/**
* Get "BCC" addresses
- * @return array
*/
public function getBCCs(): array
{
@@ -132,8 +116,6 @@ public function getBCCs(): array
/**
* Sets attachments from the path on the filesystem
- * @param string $attachment
- * @return $this
*/
public function setAttachment(string $attachment): SmtpAdapter
{
@@ -144,7 +126,6 @@ public function setAttachment(string $attachment): SmtpAdapter
/**
* Gets the attachments
- * @return array
*/
public function getAttachments(): array
{
@@ -153,9 +134,6 @@ public function getAttachments(): array
/**
* Sets attachment from the string
- * @param string $content
- * @param string $filename
- * @return $this
*/
public function setStringAttachment(string $content, string $filename): SmtpAdapter
{
@@ -169,7 +147,6 @@ public function setStringAttachment(string $content, string $filename): SmtpAdap
/**
* Gets the string attachments
- * @return array
*/
public function getStringAttachments(): array
{
@@ -178,7 +155,6 @@ public function getStringAttachments(): array
/**
* Setups the SMTP
- * @param array $params
*/
private function setupSmtp(array $params): void
{
@@ -223,28 +199,23 @@ private function prepare(): void
/**
* Fills the php mailer properties
- * @param string $method
- * @param array $fields
*/
private function fillProperties(string $method, array $fields = []): void
{
- if ($fields !== []) {
- foreach ($fields as $field) {
- if (is_string($field)) {
- $this->mailer->$method($field);
- } else {
- $valOne = current($field);
- next($field);
- $valTwo = current($field);
- $this->mailer->$method($valOne, $valTwo);
- reset($field);
- }
+ foreach ($fields as $field) {
+ if (is_string($field)) {
+ $this->mailer->$method($field);
+ } else {
+ $valOne = current($field);
+ next($field);
+ $valTwo = current($field);
+ $this->mailer->$method($valOne, $valTwo);
+ reset($field);
}
}
}
/**
- * @return bool
* @throws \PHPMailer\PHPMailer\Exception
*/
private function sendEmail(): bool
diff --git a/src/Mailer/Contracts/MailerInterface.php b/src/Mailer/Contracts/MailerInterface.php
index e9506a4c3..00b8ddb98 100644
--- a/src/Mailer/Contracts/MailerInterface.php
+++ b/src/Mailer/Contracts/MailerInterface.php
@@ -22,62 +22,47 @@ interface MailerInterface
{
/**
* Sets the 'From' email and the name
- * @param string $email
- * @param string|null $name
- * @return MailerInterface
*/
public function setFrom(string $email, ?string $name = null): MailerInterface;
/**
* Gets the 'From' email and the name
- * @return array
*/
public function getFrom(): array;
/**
* Sets 'To' addresses
- * @param string $email
- * @param string|null $name
- * @return MailerInterface
*/
public function setAddress(string $email, ?string $name = null): MailerInterface;
/**
* Gets 'To' addresses
- * @return array
*/
public function getAddresses(): array;
/**
* Sets the subject
- * @param string|null $subject
- * @return MailerInterface
*/
public function setSubject(?string $subject): MailerInterface;
/**
* Gets the subject
- * @return string|null
*/
public function getSubject(): ?string;
/**
* Sets the template
- * @param string $templatePath
- * @return MailerInterface
*/
public function setTemplate(string $templatePath): MailerInterface;
/**
* Gets the template
- * @return string|null
*/
public function getTemplate(): ?string;
/**
* Sets the body
* @param string|array $message
- * @return MailerInterface
*/
public function setBody($message): MailerInterface;
@@ -89,7 +74,6 @@ public function getBody();
/**
* Sends an email
- * @return bool
*/
public function send(): bool;
}
diff --git a/src/Mailer/Factories/MailerFactory.php b/src/Mailer/Factories/MailerFactory.php
index de2960153..1f7b86e67 100644
--- a/src/Mailer/Factories/MailerFactory.php
+++ b/src/Mailer/Factories/MailerFactory.php
@@ -50,8 +50,6 @@ class MailerFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Mailer
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -74,19 +72,12 @@ public static function get(?string $adapter = null): Mailer
return self::$instances[$adapter];
}
- /**
- * @param string $adapterClass
- * @param string $adapter
- * @return Mailer
- */
private static function createInstance(string $adapterClass, string $adapter): Mailer
{
return new Mailer(new $adapterClass(config()->get('mailer.' . $adapter)));
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
diff --git a/src/Mailer/Helpers/mailer.php b/src/Mailer/Helpers/mailer.php
index 1544ea737..cefe5453e 100644
--- a/src/Mailer/Helpers/mailer.php
+++ b/src/Mailer/Helpers/mailer.php
@@ -19,8 +19,6 @@
use Quantum\Mailer\Mailer;
/**
- * @param string|null $adapter
- * @return Mailer
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Mailer/MailTrap.php b/src/Mailer/MailTrap.php
index 0a769d2c3..620fb7e10 100644
--- a/src/Mailer/MailTrap.php
+++ b/src/Mailer/MailTrap.php
@@ -31,14 +31,8 @@
*/
class MailTrap
{
- /**
- * @var FileSystem
- */
private FileSystem $fs;
- /**
- * @var MessageParser
- */
private MessageParser $parser;
/**
@@ -46,14 +40,8 @@ class MailTrap
*/
private $message;
- /**
- * @var MailTrap|null
- */
private static ?MailTrap $instance = null;
- /**
- * @var string
- */
private string $emailsDirectory;
/**
@@ -71,7 +59,6 @@ private function __construct()
/**
* Get Instance
- * @return MailTrap
*/
public static function getInstance(): MailTrap
{
@@ -84,9 +71,6 @@ public static function getInstance(): MailTrap
/**
* Saves the message on the local file
- * @param string $filename
- * @param string $content
- * @return bool
*/
public function saveMessage(string $filename, string $content): bool
{
@@ -99,8 +83,6 @@ public function saveMessage(string $filename, string $content): bool
/**
* Gets the parsed email
- * @param string $filename
- * @return $this
* @throws BaseException
*/
public function parseMessage(string $filename): MailTrap
@@ -117,7 +99,6 @@ public function parseMessage(string $filename): MailTrap
/**
* Gets the parsed message ID
- * @return string|null
*/
public function getParsedMessageId(): ?string
{
@@ -126,7 +107,6 @@ public function getParsedMessageId(): ?string
/**
* Gets the parsed X Mailer
- * @return string|null
*/
public function getParsedXMailer(): ?string
{
@@ -135,7 +115,6 @@ public function getParsedXMailer(): ?string
/**
* Gets the parsed mime version
- * @return string|null
*/
public function getParsedMimeVersion(): ?string
{
@@ -144,7 +123,6 @@ public function getParsedMimeVersion(): ?string
/**
* Gets the parsed content type of the email
- * @return string|null
*/
public function getParsedContentType(): ?string
{
@@ -153,7 +131,6 @@ public function getParsedContentType(): ?string
/**
* Gets the parsed date
- * @return string|null
*/
public function getParsedDate(): ?string
{
@@ -162,7 +139,6 @@ public function getParsedDate(): ?string
/**
* Gets the parsed 'To' addresses
- * @return array
*/
public function getParsedToAddresses(): array
{
@@ -172,7 +148,6 @@ public function getParsedToAddresses(): array
/**
* Gets the parsed 'From' address
- * @return string|null
*/
public function getParsedFromAddress(): ?string
{
@@ -181,7 +156,6 @@ public function getParsedFromAddress(): ?string
/**
* Gets the parsed 'CC' addresses
- * @return array
*/
public function getParsedCcAddresses(): array
{
@@ -191,7 +165,6 @@ public function getParsedCcAddresses(): array
/**
* Gets the parsed 'BCC' addresses
- * @return array
*/
public function getParsedBccAddresses(): array
{
@@ -201,7 +174,6 @@ public function getParsedBccAddresses(): array
/**
* Gets the 'Reply To' addresses
- * @return array
*/
public function getParsedReplyToAddresses(): array
{
@@ -211,7 +183,6 @@ public function getParsedReplyToAddresses(): array
/**
* Gets the parsed subject
- * @return string|null
*/
public function getParsedSubject(): ?string
{
@@ -220,7 +191,6 @@ public function getParsedSubject(): ?string
/**
* Gets the parsed body
- * @return string
*/
public function getParsedBody(): string
{
@@ -241,7 +211,6 @@ public function getParsedBody(): string
/**
* Gets the parsed attachments
- * @return array|null
*/
public function getParsedAttachments(): ?array
{
diff --git a/src/Mailer/Mailer.php b/src/Mailer/Mailer.php
index 6679999d3..553e4d7bf 100644
--- a/src/Mailer/Mailer.php
+++ b/src/Mailer/Mailer.php
@@ -62,25 +62,17 @@ class Mailer
private MailerInterface $adapter;
- /**
- * @param MailerInterface $adapter
- */
public function __construct(MailerInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return MailerInterface
- */
public function getAdapter(): MailerInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Mailer/Traits/MailerTrait.php b/src/Mailer/Traits/MailerTrait.php
index d462a53e5..584288bff 100644
--- a/src/Mailer/Traits/MailerTrait.php
+++ b/src/Mailer/Traits/MailerTrait.php
@@ -31,19 +31,16 @@ trait MailerTrait
{
/**
* From address and name
- * @var array
*/
private array $from = [];
/**
* To addresses
- * @var array
*/
private array $addresses = [];
/**
* Email subject
- * @var string|null
*/
private ?string $subject = null;
@@ -51,64 +48,46 @@ trait MailerTrait
* Email body
* @var string|array|null
*/
- private $message = null;
+ private $message;
- /**
- * @var string|null
- */
private static ?string $messageId = null;
/**
* Template path
- * @var string|null
*/
private ?string $templatePath = null;
- /**
- * @var HttpClient|null
- */
protected ?HttpClient $httpClient = null;
- /**
- * @var PHPMailer|null
- */
protected ?PHPMailer $mailer = null;
/**
* Reply To addresses
- * @var array
*/
protected array $replyToAddresses = [];
/**
* CC addresses
- * @var array
*/
protected array $ccAddresses = [];
/**
* BCC addresses
- * @var array
*/
protected array $bccAddresses = [];
/**
* Email attachments
- * @var array
*/
protected array $attachments = [];
/**
* Email attachments created from string
- * @var array
*/
protected array $stringAttachments = [];
/**
* Sets the 'From' email and the name
- * @param string $email
- * @param string|null $name
- * @return MailerInterface
*/
public function setFrom(string $email, ?string $name = null): MailerInterface
{
@@ -119,7 +98,6 @@ public function setFrom(string $email, ?string $name = null): MailerInterface
/**
* Gets 'From' email and the "name"
- * @return array
*/
public function getFrom(): array
{
@@ -128,9 +106,6 @@ public function getFrom(): array
/**
* Sets 'To' addresses
- * @param string $email
- * @param string|null $name
- * @return MailerInterface
*/
public function setAddress(string $email, ?string $name = null): MailerInterface
{
@@ -144,7 +119,6 @@ public function setAddress(string $email, ?string $name = null): MailerInterface
/**
* Gets 'To' addresses
- * @return array
*/
public function getAddresses(): array
{
@@ -153,8 +127,6 @@ public function getAddresses(): array
/**
* Sets the subject
- * @param string|null $subject
- * @return MailerInterface
*/
public function setSubject(?string $subject): MailerInterface
{
@@ -173,8 +145,6 @@ public function getSubject(): ?string
/**
* Sets the template
- * @param string $templatePath
- * @return MailerInterface
*/
public function setTemplate(string $templatePath): MailerInterface
{
@@ -184,7 +154,6 @@ public function setTemplate(string $templatePath): MailerInterface
/**
* Gets the template
- * @return string|null
*/
public function getTemplate(): ?string
{
@@ -194,7 +163,6 @@ public function getTemplate(): ?string
/**
* Sets the body
* @param string|array $message
- * @return MailerInterface
*/
public function setBody($message): MailerInterface
{
@@ -234,7 +202,6 @@ public function send(): bool
/**
* Gets the message ID
- * @return string|null
* @throws Exception
*/
public function getMessageId(): ?string
@@ -254,7 +221,6 @@ public function getMessageId(): ?string
}
/**
- * @return bool
* @throws \PHPMailer\PHPMailer\Exception
* @throws Exception
*/
@@ -269,7 +235,6 @@ private function saveEmail(): bool
/**
* Create message body from email template
- * @return string
*/
private function createFromTemplate(): string
{
@@ -287,7 +252,6 @@ private function createFromTemplate(): string
/**
* Gets the complete message
- * @return string
* @throws Exception
*/
private function getMessageContent(): string
@@ -301,7 +265,6 @@ private function getMessageContent(): string
/**
* Generates the message content
- * @return string
* @throws Exception
*/
private function generateMessage(): string
@@ -326,9 +289,7 @@ private function generateMessage(): string
$message .= 'Content-Type: text/html; charset=UTF-8' . PHP_EOL . PHP_EOL;
- $message .= $this->message . PHP_EOL;
-
- return $message;
+ return $message . ($this->message . PHP_EOL);
}
/**
diff --git a/src/Middleware/Exceptions/MiddlewareException.php b/src/Middleware/Exceptions/MiddlewareException.php
index b1b021be6..3d8b99478 100644
--- a/src/Middleware/Exceptions/MiddlewareException.php
+++ b/src/Middleware/Exceptions/MiddlewareException.php
@@ -25,10 +25,6 @@
*/
class MiddlewareException extends BaseException
{
- /**
- * @param string $name
- * @return MiddlewareException
- */
public static function middlewareNotFound(string $name): self
{
return new self(
diff --git a/src/Middleware/MiddlewareManager.php b/src/Middleware/MiddlewareManager.php
index 26bb86ff2..af652e2b6 100644
--- a/src/Middleware/MiddlewareManager.php
+++ b/src/Middleware/MiddlewareManager.php
@@ -27,19 +27,14 @@ class MiddlewareManager
{
/**
* Middlewares queue
- * @var array
*/
private array $middlewares = [];
/**
* Current module
- * @var string|null
*/
private ?string $module;
- /**
- * @param MatchedRoute $matchedRoute
- */
public function __construct(MatchedRoute $matchedRoute)
{
$route = $matchedRoute->getRoute();
@@ -50,9 +45,6 @@ public function __construct(MatchedRoute $matchedRoute)
/**
* Apply Middlewares
- * @param Request $request
- * @param Response $response
- * @return array
* @throws MiddlewareException
*/
public function applyMiddlewares(Request $request, Response $response): array
@@ -73,9 +65,6 @@ public function applyMiddlewares(Request $request, Response $response): array
/**
* Loads and gets the current middleware instance
- * @param Request $request
- * @param Response $response
- * @return QtMiddleware
* @throws MiddlewareException
*/
private function getMiddleware(Request $request, Response $response): QtMiddleware
diff --git a/src/Middleware/QtMiddleware.php b/src/Middleware/QtMiddleware.php
index 839b59b0a..8a0ad602c 100644
--- a/src/Middleware/QtMiddleware.php
+++ b/src/Middleware/QtMiddleware.php
@@ -29,9 +29,6 @@ abstract class QtMiddleware
*
* Applies the middleware
*
- * @param Request $request
- * @param Response $response
- * @param Closure $next
* @return mixed
*/
abstract public function apply(Request $request, Response $response, Closure $next);
diff --git a/src/Migration/Exceptions/MigrationException.php b/src/Migration/Exceptions/MigrationException.php
index a6677ffd1..57e4f439d 100644
--- a/src/Migration/Exceptions/MigrationException.php
+++ b/src/Migration/Exceptions/MigrationException.php
@@ -27,9 +27,6 @@
*/
class MigrationException extends BaseException
{
- /**
- * @return MigrationException
- */
public static function wrongDirection(): self
{
return new self(
@@ -38,10 +35,6 @@ public static function wrongDirection(): self
);
}
- /**
- * @param string $action
- * @return MigrationException
- */
public static function unsupportedAction(string $action): self
{
return new self(
@@ -50,9 +43,6 @@ public static function unsupportedAction(string $action): self
);
}
- /**
- * @return MigrationException
- */
public static function nothingToMigrate(): self
{
return new self(
diff --git a/src/Migration/MigrationManager.php b/src/Migration/MigrationManager.php
index 53e20bc0d..e4c178a3f 100644
--- a/src/Migration/MigrationManager.php
+++ b/src/Migration/MigrationManager.php
@@ -54,29 +54,14 @@ class MigrationManager
*/
public const DRIVERS = ['mysql', 'pgsql', 'sqlite'];
- /**
- * @var array
- */
private array $migrations = [];
- /**
- * @var TableFactory
- */
private TableFactory $tableFactory;
- /**
- * @var string
- */
private string $migrationFolder;
- /**
- * @var FileSystem
- */
private FileSystem $fs;
- /**
- * @var Database
- */
private Database $db;
/**
@@ -103,9 +88,6 @@ public function __construct()
/**
* Generates new migration file
- * @param string $table
- * @param string $action
- * @return string
* @throws MigrationException
* @throws LangException
*/
@@ -126,9 +108,6 @@ public function generateMigration(string $table, string $action): string
/**
* Applies migrations
- * @param string $direction
- * @param int|null $step
- * @return int|null
* @throws BaseException
* @throws ConfigException
* @throws DatabaseException
@@ -146,7 +125,7 @@ public function applyMigrations(string $direction, ?int $step = null): ?int
switch ($direction) {
case self::UPGRADE:
- $migrated = $this->upgrade($step);
+ $migrated = $this->upgrade();
break;
case self::DOWNGRADE:
$migrated = $this->downgrade($step);
@@ -160,27 +139,21 @@ public function applyMigrations(string $direction, ?int $step = null): ?int
/**
* Runs up migrations
- * @param int|null $step
- * @return int
* @throws DatabaseException
* @throws LangException
* @throws MigrationException
*/
- private function upgrade(?int $step = null): int
+ private function upgrade(): int
{
if (!$this->tableFactory->checkTableExists(MigrationTable::TABLE)) {
$migrationTable = new MigrationTable();
$migrationTable->up($this->tableFactory);
}
-
- $this->prepareUpMigrations($step);
-
+ $this->prepareUpMigrations();
if (empty($this->migrations)) {
throw MigrationException::nothingToMigrate();
}
-
$migratedEntries = [];
-
foreach ($this->migrations as $migrationFile) {
$this->fs->require($migrationFile, true);
@@ -192,16 +165,12 @@ private function upgrade(?int $step = null): int
$migratedEntries[] = $migrationClassName;
}
-
$this->addMigratedEntries($migratedEntries);
-
return count($migratedEntries);
}
/**
* Runs down migrations
- * @param int|null $step
- * @return int
* @throws DatabaseException
* @throws LangException
* @throws MigrationException
@@ -239,20 +208,17 @@ private function downgrade(?int $step): int
/**
* Prepares up migrations
- * @param int|null $step
* @throws MigrationException
* @throws DatabaseException
*
*/
- private function prepareUpMigrations(?int $step = null): void
+ private function prepareUpMigrations(): void
{
$migratedEntries = $this->getMigratedEntries();
$migrationFiles = $this->getMigrationFiles();
-
if ($migratedEntries === [] && $migrationFiles === []) {
throw MigrationException::nothingToMigrate();
}
-
foreach ($migrationFiles as $timestamp => $migrationFile) {
foreach ($migratedEntries as $migratedEntry) {
if (pathinfo($migrationFile, PATHINFO_FILENAME) == $migratedEntry['migration']) {
@@ -262,13 +228,11 @@ private function prepareUpMigrations(?int $step = null): void
$this->migrations[$timestamp] = $migrationFile;
}
-
ksort($this->migrations);
}
/**
* Prepares down migrations
- * @param int|null $step
* @throws DatabaseException
* @throws MigrationException
*/
@@ -294,7 +258,6 @@ private function prepareDownMigrations(?int $step = null): void
/**
* Gets migration files
- * @return array
*/
private function getMigrationFiles(): array
{
@@ -314,7 +277,6 @@ private function getMigrationFiles(): array
/**
* Gets migrated entries from migrations table
- * @return array
* @throws DatabaseException
*/
private function getMigratedEntries(): array
@@ -324,7 +286,6 @@ private function getMigratedEntries(): array
/**
* Adds migrated entries to migrations table
- * @param array $entries
* @throws DatabaseException
*/
private function addMigratedEntries(array $entries): void
@@ -336,7 +297,6 @@ private function addMigratedEntries(array $entries): void
/**
* Removes migrated entries from migrations table
- * @param array $entries
* @throws DatabaseException
*/
private function removeMigratedEntries(array $entries): void
diff --git a/src/Migration/MigrationTable.php b/src/Migration/MigrationTable.php
index ad17be1f7..868371f98 100644
--- a/src/Migration/MigrationTable.php
+++ b/src/Migration/MigrationTable.php
@@ -31,8 +31,6 @@ class MigrationTable extends QtMigration
/**
* Creates the migrations table
- * @param TableFactory|null $tableFactory
- * @return void
* @throws DatabaseException
*/
public function up(?TableFactory $tableFactory): void
@@ -45,8 +43,6 @@ public function up(?TableFactory $tableFactory): void
/**
* Drops the migrations table
- * @param TableFactory|null $tableFactory
- * @return void
* @throws DatabaseException
*/
public function down(?TableFactory $tableFactory): void
diff --git a/src/Migration/QtMigration.php b/src/Migration/QtMigration.php
index dfc2b4267..35e735c19 100644
--- a/src/Migration/QtMigration.php
+++ b/src/Migration/QtMigration.php
@@ -24,13 +24,11 @@ abstract class QtMigration
{
/**
* Upgrades with the specified migration class
- * @param TableFactory|null $tableFactory
*/
abstract public function up(?TableFactory $tableFactory);
/**
* Downgrades with the specified migration class
- * @param TableFactory|null $tableFactory
*/
abstract public function down(?TableFactory $tableFactory);
}
diff --git a/src/Migration/Templates/MigrationTemplate.php b/src/Migration/Templates/MigrationTemplate.php
index 5777ba6e1..963abf165 100644
--- a/src/Migration/Templates/MigrationTemplate.php
+++ b/src/Migration/Templates/MigrationTemplate.php
@@ -22,9 +22,6 @@ class MigrationTemplate
{
/**
* Create migration template
- * @param string $className
- * @param string $tableName
- * @return string
*/
public static function create(string $className, string $tableName): string
{
@@ -52,9 +49,6 @@ public function down(?TableFactory $tableFactory)
/**
* Alter migration template
- * @param string $className
- * @param string $tableName
- * @return string
*/
public static function alter(string $className, string $tableName): string
{
@@ -81,9 +75,6 @@ public function down(?TableFactory $tableFactory)
/**
* Rename migration template
- * @param string $className
- * @param string $tableName
- * @return string
*/
public static function rename(string $className, string $tableName): string
{
@@ -110,9 +101,6 @@ public function down(?TableFactory $tableFactory)
/**
* Drop migration template
- * @param string $className
- * @param string $tableName
- * @return string
*/
public static function drop(string $className, string $tableName): string
{
diff --git a/src/Model/DbModel.php b/src/Model/DbModel.php
index bfbc3a73f..409433d34 100644
--- a/src/Model/DbModel.php
+++ b/src/Model/DbModel.php
@@ -44,26 +44,21 @@ abstract class DbModel extends Model
{
/**
* Database table
- * @var string
*/
public string $table = '';
/**
* Primary key column
- * @var string
*/
public string $idColumn = 'id';
/**
* ORM instance (Idiorm or SleekDB)
- * @var DbalInterface|null
*/
protected ?DbalInterface $ormInstance = null;
/**
* Set ORM instance
- * @param DbalInterface $ormInstance
- * @return void
*/
public function setOrmInstance(DbalInterface $ormInstance): void
{
@@ -72,7 +67,6 @@ public function setOrmInstance(DbalInterface $ormInstance): void
/**
* Get ORM instance
- * @return DbalInterface
* @throws ModelException
*/
public function getOrmInstance(): DbalInterface
@@ -84,9 +78,6 @@ public function getOrmInstance(): DbalInterface
return $this->ormInstance;
}
- /**
- * @return array
- */
public function relations(): array
{
return [];
@@ -94,8 +85,6 @@ public function relations(): array
/**
* Finds the record by primary key and returns a new model instance
- * @param int $id
- * @return DbModel|null
* @throws BaseException
*/
public function findOne(int $id): ?DbModel
@@ -107,9 +96,7 @@ public function findOne(int $id): ?DbModel
/**
* Finds the record by given column and value and returns a new model instance
- * @param string $column
* @param mixed $value
- * @return DbModel|null
* @throws BaseException
*/
public function findOneBy(string $column, $value): ?DbModel
@@ -121,7 +108,6 @@ public function findOneBy(string $column, $value): ?DbModel
/**
* Gets the first record and returns a new model instance
- * @return DbModel|null
* @throws BaseException
*/
public function first(): ?DbModel
@@ -133,7 +119,6 @@ public function first(): ?DbModel
/**
* Fetch multiple results
- * @return ModelCollection
* @throws BaseException
*/
public function get(): ModelCollection
@@ -148,9 +133,6 @@ public function get(): ModelCollection
/**
* Paginates the result
- * @param int $perPage
- * @param int $currentPage
- * @return Paginator
* @throws BaseException
* @throws PaginatorException
*/
@@ -177,7 +159,6 @@ public function create(): self
/**
* Save model
- * @return bool
* @throws ModelException
*/
public function save(): bool
@@ -197,7 +178,6 @@ public function save(): bool
/**
* Delete model
- * @return bool
* @throws ModelException
*/
public function delete(): bool
@@ -206,7 +186,6 @@ public function delete(): bool
}
/**
- * @param array $data
* @return $this
*/
public function hydrateFromOrm(array $data): self
@@ -216,8 +195,6 @@ public function hydrateFromOrm(array $data): self
}
/**
- * @param string $method
- * @param array $args
* @return mixed
* @throws ModelException
*/
@@ -252,7 +229,6 @@ public function __sleep()
/**
* Sync model attributes into ORM
- * @return void
* @throws ModelException
*/
protected function syncAttributesToOrm(): void
@@ -268,10 +244,6 @@ protected function syncAttributesToOrm(): void
}
}
- /**
- * @param string $key
- * @return bool
- */
protected function shouldFill(string $key): bool
{
if ($key === $this->idColumn) {
@@ -283,7 +255,6 @@ protected function shouldFill(string $key): bool
/**
* Syncs primary key from ORM to model attributes
- * @return void
* @throws ModelException
*/
private function syncPrimaryKeyFromOrm(): void
diff --git a/src/Model/Exceptions/ModelException.php b/src/Model/Exceptions/ModelException.php
index 6626c0491..667b95489 100644
--- a/src/Model/Exceptions/ModelException.php
+++ b/src/Model/Exceptions/ModelException.php
@@ -25,10 +25,6 @@
*/
class ModelException extends BaseException
{
- /**
- * @param string $name
- * @return ModelException
- */
public static function inappropriateProperty(string $name): self
{
return new self(
@@ -37,11 +33,6 @@ public static function inappropriateProperty(string $name): self
);
}
- /**
- * @param string $modelName
- * @param string $tableName
- * @return ModelException
- */
public static function wrongRelation(string $modelName, string $tableName): self
{
return new self(
@@ -50,11 +41,6 @@ public static function wrongRelation(string $modelName, string $tableName): self
);
}
- /**
- * @param string $modelName
- * @param string $relatedModelName
- * @return ModelException
- */
public static function relationTypeMissing(string $modelName, string $relatedModelName): self
{
return new self(
@@ -63,11 +49,6 @@ public static function relationTypeMissing(string $modelName, string $relatedMod
);
}
- /**
- * @param string $modelName
- * @param string $relatedModelName
- * @return ModelException
- */
public static function missingRelationKeys(string $modelName, string $relatedModelName): self
{
return new self(
@@ -76,11 +57,6 @@ public static function missingRelationKeys(string $modelName, string $relatedMod
);
}
- /**
- * @param string $modelName
- * @param string $foreignKey
- * @return ModelException
- */
public static function missingForeignKeyValue(string $modelName, string $foreignKey): self
{
return new self(
@@ -89,10 +65,6 @@ public static function missingForeignKeyValue(string $modelName, string $foreign
);
}
- /**
- * @param string $relationType
- * @return ModelException
- */
public static function unsupportedRelationType(string $relationType): self
{
return new self(
@@ -101,9 +73,6 @@ public static function unsupportedRelationType(string $relationType): self
);
}
- /**
- * @return ModelException
- */
public static function ormIsNotSet(): self
{
return new self(
diff --git a/src/Model/Factories/ModelFactory.php b/src/Model/Factories/ModelFactory.php
index 1af091328..800054c3f 100644
--- a/src/Model/Factories/ModelFactory.php
+++ b/src/Model/Factories/ModelFactory.php
@@ -28,8 +28,6 @@ class ModelFactory
{
/**
* Gets the Model
- * @param string $modelClass
- * @return Model
* @throws ModelException
*/
public static function get(string $modelClass): Model
@@ -61,12 +59,6 @@ public static function get(string $modelClass): Model
/**
* Creates anonymous dynamic model
- * @param string $table
- * @param string $modelName
- * @param string $idColumn
- * @param array $foreignKeys
- * @param array $hidden
- * @return DbModel
*/
public static function createDynamicModel(
string $table,
@@ -90,14 +82,6 @@ public static function createDynamicModel(
return $model;
}
- /**
- * @param string $table
- * @param string $modelName
- * @param string $idColumn
- * @param array $foreignKeys
- * @param array $hidden
- * @return DbalInterface
- */
protected static function createOrmInstance(
string $table,
string $modelName,
diff --git a/src/Model/Helpers/model.php b/src/Model/Helpers/model.php
index da27a7014..3af5a4498 100644
--- a/src/Model/Helpers/model.php
+++ b/src/Model/Helpers/model.php
@@ -32,12 +32,6 @@ function model(string $modelClass): Model
/**
* Creates anonymous dynamic model
- * @param string $table
- * @param string $modelName
- * @param string $idColumn
- * @param array $foreignKeys
- * @param array $hidden
- * @return DbModel
*/
function dynamicModel(
string $table,
@@ -57,9 +51,6 @@ function dynamicModel(
/**
* Wraps the orm instance into model
- * @param DbalInterface|null $ormInstance
- * @param string $modelClass
- * @return DbModel|null
* @throws ModelException
*/
function wrapToModel(?DbalInterface $ormInstance, string $modelClass): ?DbModel
diff --git a/src/Model/Model.php b/src/Model/Model.php
index 13087bd71..a1926bdfa 100644
--- a/src/Model/Model.php
+++ b/src/Model/Model.php
@@ -24,25 +24,21 @@ abstract class Model
{
/**
* Internal attributes
- * @var array
*/
protected array $attributes = [];
/**
* Models fillable properties
- * @var array
*/
protected array $fillable = [];
/**
* Models hidden properties
* Used by DBAL and plain models
- * @var array
*/
public array $hidden = [];
/**
- * @param string $key
* @param $value
* @return $this|mixed|null
*/
@@ -58,7 +54,6 @@ public function prop(string $key, $value = null)
/**
* Fill object properties
- * @param array $props
* @return $this
* @throws ModelException
*/
@@ -77,7 +72,6 @@ public function fill(array $props): self
/**
* Converts to array
- * @return array
*/
public function asArray(): array
{
@@ -93,7 +87,6 @@ public function asArray(): array
/**
* Checks if model is empty
- * @return bool
*/
public function isEmpty(): bool
{
@@ -101,7 +94,6 @@ public function isEmpty(): bool
}
/**
- * @param string $key
* @return $this|mixed|null
*/
public function __get(string $key)
@@ -110,37 +102,23 @@ public function __get(string $key)
}
/**
- * @param string $key
* @param $value
- * @return void
*/
public function __set(string $key, $value): void
{
$this->prop($key, $value);
}
- /**
- * @param string $key
- * @return bool
- */
public function __isset(string $key): bool
{
return isset($this->attributes[$key]);
}
- /**
- * @param string $key
- * @return void
- */
public function __unset(string $key): void
{
unset($this->attributes[$key]);
}
- /**
- * @param string $key
- * @return bool
- */
protected function shouldFill(string $key): bool
{
return in_array($key, $this->fillable, true);
diff --git a/src/Model/ModelCollection.php b/src/Model/ModelCollection.php
index b9663f48c..2ced7a603 100644
--- a/src/Model/ModelCollection.php
+++ b/src/Model/ModelCollection.php
@@ -31,18 +31,11 @@ class ModelCollection implements Countable, IteratorAggregate
*/
private array $models = [];
- /**
- * @var iterable
- */
private iterable $originalModels;
- /**
- * @var bool
- */
private bool $modelsProcessed = false;
/**
- * @param iterable $models
* @throws BaseException
*/
public function __construct(iterable $models = [])
@@ -57,7 +50,6 @@ public function __construct(iterable $models = [])
/**
* Add a model to the collection
* @param Model $model
- * @return self
* @throws BaseException
*/
public function add(Model $model): self
@@ -78,7 +70,6 @@ public function add(Model $model): self
/**
* Remove a model from the collection
* @param Model $model
- * @return self
* @throws BaseException
*/
public function remove(Model $model): self
@@ -105,7 +96,6 @@ public function all(): array
/**
* Get the count of models in the collection
- * @return int
* @throws BaseException
*/
public function count(): int
@@ -141,7 +131,6 @@ public function last(): ?Model
/**
* Check if the collection is empty
- * @return bool
* @throws BaseException
*/
public function isEmpty(): bool
@@ -151,7 +140,6 @@ public function isEmpty(): bool
/**
* Get an iterator for the collection
- * @return Generator
* @throws BaseException
*/
public function getIterator(): Generator
@@ -191,7 +179,6 @@ private function processModels(): void
/**
* Validate that an item is a Model instance
* @param $model
- * @return void
* @throws BaseException
*/
private function validateModel($model): void
diff --git a/src/Model/Traits/HasTimestamps.php b/src/Model/Traits/HasTimestamps.php
index cde40ad82..136418d71 100644
--- a/src/Model/Traits/HasTimestamps.php
+++ b/src/Model/Traits/HasTimestamps.php
@@ -24,25 +24,21 @@ trait HasTimestamps
{
/**
* Column name for created timestamp
- * @var string
*/
public string $createdAt = 'created_at';
/**
* Column name for updated timestamp
- * @var string
*/
public string $updatedAt = 'updated_at';
/**
* Timestamp storage type: datetime|unix
- * @var string
*/
public string $timestampType = 'datetime';
/**
* Determine whether the current model is new (insert) or existing (update).
- * @return bool
*/
protected function isNewRecord(): bool
{
@@ -67,7 +63,6 @@ protected function nowTimestampValue()
/**
* Get timestamp type.
- * @return string
*/
protected function getTimestampType(): string
{
@@ -80,7 +75,6 @@ protected function getTimestampType(): string
/**
* Get "created at" column name.
- * @return string
*/
protected function getCreatedAtColumn(): string
{
@@ -93,7 +87,6 @@ protected function getCreatedAtColumn(): string
/**
* Get "updated at" column name.
- * @return string
*/
protected function getUpdatedAtColumn(): string
{
@@ -106,7 +99,6 @@ protected function getUpdatedAtColumn(): string
/**
* Touch timestamps on save
- * @return void
*/
protected function touchTimestamps(): void
{
diff --git a/src/Model/Traits/SoftDeletes.php b/src/Model/Traits/SoftDeletes.php
index 82cb39cdf..1a616e708 100644
--- a/src/Model/Traits/SoftDeletes.php
+++ b/src/Model/Traits/SoftDeletes.php
@@ -27,14 +27,10 @@
*/
trait SoftDeletes
{
- /**
- * @var bool
- */
protected bool $includeTrashed = false;
/**
* Soft delete the model by setting the deleted_at timestamp.
- * @return bool
* @throws ModelException
*/
public function delete(): bool
@@ -45,7 +41,6 @@ public function delete(): bool
/**
* Restore a soft deleted model.
- * @return bool
* @throws ModelException
*/
public function restore(): bool
@@ -56,7 +51,6 @@ public function restore(): bool
/**
* Force delete the model from the database.
- * @return bool
* @throws ModelException
*/
public function forceDelete(): bool
@@ -91,7 +85,6 @@ public function onlyTrashed(): self
/**
* Get all non-deleted records unless withTrashed is called.
- * @return ModelCollection
* @throws BaseException
*/
public function get(): ModelCollection
@@ -103,9 +96,6 @@ public function get(): ModelCollection
/**
* Paginate non-deleted records unless withTrashed is called.
- * @param int $perPage
- * @param int $currentPage
- * @return Paginator
* @throws BaseException
* @throws PaginatorException
*/
@@ -118,7 +108,6 @@ public function paginate(int $perPage, int $currentPage = 1): Paginator
/**
* Count all non-deleted records unless withTrashed() is called.
- * @return int
* @throws ModelException
*/
public function count(): int
@@ -130,8 +119,6 @@ public function count(): int
/**
* Find one record by its ID, excluding soft deleted unless withTrashed() is called.
- * @param int $id
- * @return DbModel|null
* @throws BaseException
*/
public function findOne(int $id): ?DbModel
@@ -143,9 +130,7 @@ public function findOne(int $id): ?DbModel
/**
* Find one record by column and value, excluding soft deleted unless withTrashed() is called.
- * @param string $column
* @param $value
- * @return DbModel|null
* @throws BaseException
*/
public function findOneBy(string $column, $value): ?DbModel
@@ -157,7 +142,6 @@ public function findOneBy(string $column, $value): ?DbModel
/**
* Get the first record, excluding soft deleted unless withTrashed() is called.
- * @return DbModel|null
* @throws BaseException
*/
public function first(): ?DbModel
@@ -193,7 +177,6 @@ protected function getSoftDeleteTimestampValue()
/**
* Get the column name used for soft deletes.
- * @return string
*/
protected function getDeletedAtColumn(): string
{
diff --git a/src/Module/Exceptions/ModuleException.php b/src/Module/Exceptions/ModuleException.php
index 7cfbb1437..694dc20d7 100644
--- a/src/Module/Exceptions/ModuleException.php
+++ b/src/Module/Exceptions/ModuleException.php
@@ -24,10 +24,6 @@
*/
class ModuleException extends \Exception
{
- /**
- * @param string $name
- * @return ModuleException
- */
public static function moduleRoutesNotFound(string $name): self
{
return new self(
@@ -36,9 +32,6 @@ public static function moduleRoutesNotFound(string $name): self
);
}
- /**
- * @return ModuleException
- */
public static function moduleConfigNotFound(): self
{
return new self(
@@ -47,9 +40,6 @@ public static function moduleConfigNotFound(): self
);
}
- /**
- * @return ModuleException
- */
public static function moduleCreationIncomplete(): self
{
return new self(
@@ -58,10 +48,6 @@ public static function moduleCreationIncomplete(): self
);
}
- /**
- * @param string $name
- * @return ModuleException
- */
public static function missingModuleTemplate(string $name): self
{
return new self(
@@ -70,9 +56,6 @@ public static function missingModuleTemplate(string $name): self
);
}
- /**
- * @return ModuleException
- */
public static function missingModuleDirectory(): self
{
return new self(
@@ -81,10 +64,6 @@ public static function missingModuleDirectory(): self
);
}
- /**
- * @param string $name
- * @return ModuleException
- */
public static function moduleAlreadyExists(string $name): self
{
return new self(
diff --git a/src/Module/ModuleLoader.php b/src/Module/ModuleLoader.php
index 4220ce1c4..1470e14c5 100644
--- a/src/Module/ModuleLoader.php
+++ b/src/Module/ModuleLoader.php
@@ -32,27 +32,15 @@
*/
class ModuleLoader
{
- /**
- * @var array
- */
private static array $moduleDependencies = [];
- /**
- * @var array
- */
private static array $moduleConfigs = [];
/** @var array */
private static array $moduleRouteClosures = [];
- /**
- * @var FileSystem
- */
private FileSystem $fs;
- /**
- * @var ModuleLoader|null
- */
private static ?ModuleLoader $instance = null;
/**
@@ -67,9 +55,6 @@ private function __construct()
Di::registerDependencies($this->loadModulesDependencies());
}
- /**
- * @return ModuleLoader
- */
public static function getInstance(): ModuleLoader
{
if (self::$instance === null) {
@@ -80,7 +65,6 @@ public static function getInstance(): ModuleLoader
}
/**
- * @return array
* @throws ModuleException
* @throws RouteException
*/
@@ -104,8 +88,6 @@ public function loadModulesRoutes(): array
}
/**
- * @param string $module
- * @return Closure
* @throws ModuleException
* @throws RouteException
*/
@@ -131,7 +113,6 @@ private function getModuleRouteDefinitions(string $module): Closure
}
/**
- * @return array
* @throws ModuleException
*/
public function loadModulesDependencies(): array
@@ -149,10 +130,6 @@ public function loadModulesDependencies(): array
return $modulesDependencies;
}
- /**
- * @param string $module
- * @return array
- */
public function getModuleDependencies(string $module): array
{
if (!isset(self::$moduleDependencies[$module])) {
@@ -185,7 +162,6 @@ private function loadModuleConfig(): void
}
/**
- * @return array
* @throws ModuleException
*/
public function getModuleConfigs(): array
@@ -197,10 +173,6 @@ public function getModuleConfigs(): array
return self::$moduleConfigs;
}
- /**
- * @param array $options
- * @return bool
- */
private function isModuleEnabled(array $options): bool
{
return (bool) ($options['enabled'] ?? false);
diff --git a/src/Module/ModuleManager.php b/src/Module/ModuleManager.php
index b1ca9764b..cb7b71137 100644
--- a/src/Module/ModuleManager.php
+++ b/src/Module/ModuleManager.php
@@ -32,56 +32,25 @@ class ModuleManager
{
public const DEFAULT_TEMPLATE = 'DemoWeb';
- /**
- * @var FileSystem
- */
protected FileSystem $fs;
- /**
- * @var bool
- */
protected bool $optionEnabled;
- /**
- * @var string
- */
private string $moduleName;
- /**
- * @var string
- */
private string $template;
- /**
- * @var string
- */
private string $modulePath;
- /**
- * @var string
- */
private string $assetsPath;
- /**
- * @var string
- */
private string $templatePath;
- /**
- * @var bool
- */
private bool $withAssets;
- /**
- * @var string
- */
private string $modulesConfigPath;
/**
- * @param string $moduleName
- * @param string $template
- * @param bool $enabled
- * @param bool $withAssets
* @throws BaseException
* @throws DiException
* @throws ConfigException
@@ -103,9 +72,6 @@ public function __construct(string $moduleName, string $template, bool $enabled,
$this->modulesConfigPath = base_dir() . DS . 'shared' . DS . 'config' . DS . 'modules.php';
}
- /**
- * @return string
- */
public function getModuleName(): string
{
return $this->moduleName;
@@ -156,9 +122,6 @@ public function writeContents(): void
}
/**
- * @param string $src
- * @param string $dst
- * @return array
* @throws Exception
*/
private function copyDirectoryWithTemplates(string $src, string $dst): array
@@ -167,9 +130,6 @@ private function copyDirectoryWithTemplates(string $src, string $dst): array
}
/**
- * @param string $src
- * @param string $dst
- * @return array
* @throws Exception
*/
private function copyAssets(string $src, string $dst): array
@@ -178,11 +138,6 @@ private function copyAssets(string $src, string $dst): array
}
/**
- * @param string $src
- * @param string $dst
- * @param bool $processTemplates
- * @param array $copiedFiles
- * @return array
* @throws Exception
*/
private function copyDirectory(string $src, string $dst, bool $processTemplates, array $copiedFiles = []): array
@@ -216,10 +171,6 @@ private function copyDirectory(string $src, string $dst, bool $processTemplates,
return $copiedFiles;
}
- /**
- * @param string $srcPath
- * @param string $dstPath
- */
private function processTemplates(string $srcPath, string &$dstPath): void
{
$dstPath = str_replace('.php.tpl', '.php', $dstPath);
@@ -228,10 +179,6 @@ private function processTemplates(string $srcPath, string &$dstPath): void
$this->fs->put($dstPath, $processedContent);
}
- /**
- * @param string $content
- * @return string
- */
private function replacePlaceholders(string $content): string
{
$placeholders = [
@@ -242,10 +189,6 @@ private function replacePlaceholders(string $content): string
return str_replace(array_keys($placeholders), array_values($placeholders), $content);
}
- /**
- * @param string $module
- * @return array
- */
private function getModuleOptions(string $module): array
{
return [
@@ -255,8 +198,6 @@ private function getModuleOptions(string $module): array
}
/**
- * @param array $moduleConfigs
- * @return void
* @throws ExceptionInterface
*/
private function updateModuleConfigFile(array $moduleConfigs): void
@@ -267,10 +208,6 @@ private function updateModuleConfigFile(array $moduleConfigs): void
);
}
- /**
- * @param array $copiedFiles
- * @return bool
- */
protected function verifyModuleFilesCreated(array $copiedFiles): bool
{
foreach ($copiedFiles as $file) {
diff --git a/src/Paginator/Adapters/ArrayPaginator.php b/src/Paginator/Adapters/ArrayPaginator.php
index 734db4897..cd74b969b 100644
--- a/src/Paginator/Adapters/ArrayPaginator.php
+++ b/src/Paginator/Adapters/ArrayPaginator.php
@@ -27,11 +27,6 @@ class ArrayPaginator implements PaginatorInterface
private array $items;
- /**
- * @param array $items
- * @param int $perPage
- * @param int $page
- */
public function __construct(array $items, int $perPage, int $page = 1)
{
$this->initialize($perPage, $page);
diff --git a/src/Paginator/Adapters/ModelPaginator.php b/src/Paginator/Adapters/ModelPaginator.php
index 91f831d61..44618036a 100644
--- a/src/Paginator/Adapters/ModelPaginator.php
+++ b/src/Paginator/Adapters/ModelPaginator.php
@@ -29,21 +29,10 @@ class ModelPaginator implements PaginatorInterface
{
use PaginatorTrait;
- /**
- * @var string
- */
private string $modelClass;
- /**
- * @var DbModel
- */
private DbModel $model;
- /**
- * @param DbModel $model
- * @param int $perPage
- * @param int $page
- */
public function __construct(DbModel $model, int $perPage, int $page = 1)
{
$this->initialize($perPage, $page);
diff --git a/src/Paginator/Contracts/PaginatorInterface.php b/src/Paginator/Contracts/PaginatorInterface.php
index 53119f317..b6469113a 100644
--- a/src/Paginator/Contracts/PaginatorInterface.php
+++ b/src/Paginator/Contracts/PaginatorInterface.php
@@ -40,87 +40,66 @@ public function lastItem();
/**
* Get current page number
- * @return int
*/
public function currentPageNumber(): int;
/**
* Get previous page number
- * @return int|null
*/
public function previousPageNumber(): ?int;
/**
* Get next page number
- * @return int|null
*/
public function nextPageNumber(): ?int;
/**
* Get last page number
- * @return int
*/
public function lastPageNumber(): int;
/**
* Get current page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function currentPageLink(bool $withBaseUrl = false): ?string;
/**
* Get first page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function firstPageLink(bool $withBaseUrl = false): ?string;
/**
* Get previous page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function previousPageLink(bool $withBaseUrl = false): ?string;
/**
* Get next page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function nextPageLink(bool $withBaseUrl = false): ?string;
/**
* Get last page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function lastPageLink(bool $withBaseUrl = false): ?string;
/**
* Get items per page
- * @return int
*/
public function perPage(): int;
/**
* Get total items count
- * @return int
*/
public function total(): int;
/**
* Get all page links
- * @param bool $withBaseUrl
- * @return array
*/
public function links(bool $withBaseUrl = false): array;
/**
* Get pagination HTML
- * @param bool $withBaseUrl
- * @param int|null $pageItemsCount
- * @return string|null
*/
public function getPagination(bool $withBaseUrl = false, ?int $pageItemsCount = null): ?string;
}
diff --git a/src/Paginator/Exceptions/PaginatorException.php b/src/Paginator/Exceptions/PaginatorException.php
index 2f9ee904e..272506f4e 100644
--- a/src/Paginator/Exceptions/PaginatorException.php
+++ b/src/Paginator/Exceptions/PaginatorException.php
@@ -26,9 +26,7 @@
class PaginatorException extends BaseException
{
/**
- * @param string $type
* @param $missingParam
- * @return PaginatorException
*/
public static function missingRequiredParams(string $type, $missingParam): self
{
diff --git a/src/Paginator/Factories/PaginatorFactory.php b/src/Paginator/Factories/PaginatorFactory.php
index ad7155206..71d7cc107 100644
--- a/src/Paginator/Factories/PaginatorFactory.php
+++ b/src/Paginator/Factories/PaginatorFactory.php
@@ -52,9 +52,6 @@ class PaginatorFactory
/**
* Creates a new paginator instance using the selected adapter type.
- * @param string $type
- * @param array $params
- * @return Paginator
* @throws BaseException
* @throws PaginatorException
*/
@@ -77,9 +74,6 @@ public static function create(string $type, array $params): Paginator
/**
* Validates that all required parameters are present.
- * @param string $type
- * @param array $params
- * @return void
* @throws PaginatorException
*/
private static function validateRequiredParams(string $type, array $params): void
@@ -93,9 +87,6 @@ private static function validateRequiredParams(string $type, array $params): voi
/**
* Builds the list of arguments in the correct order for adapter instantiation.
- * @param string $type
- * @param array $params
- * @return array
*/
private static function buildConstructorArgs(string $type, array $params): array
{
diff --git a/src/Paginator/Paginator.php b/src/Paginator/Paginator.php
index 3bba192cc..07f8f9423 100644
--- a/src/Paginator/Paginator.php
+++ b/src/Paginator/Paginator.php
@@ -52,9 +52,6 @@ class Paginator
private PaginatorInterface $adapter;
- /**
- * @param PaginatorInterface $adapter
- */
public function __construct(PaginatorInterface $adapter)
{
$this->adapter = $adapter;
@@ -62,7 +59,6 @@ public function __construct(PaginatorInterface $adapter)
/**
* Get the adapter instance
- * @return PaginatorInterface
*/
public function getAdapter(): PaginatorInterface
{
@@ -70,8 +66,6 @@ public function getAdapter(): PaginatorInterface
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Paginator/Traits/PaginatorTrait.php b/src/Paginator/Traits/PaginatorTrait.php
index cfe402ac4..c6a5982c1 100644
--- a/src/Paginator/Traits/PaginatorTrait.php
+++ b/src/Paginator/Traits/PaginatorTrait.php
@@ -26,30 +26,15 @@
*/
trait PaginatorTrait
{
- /**
- * @var string
- */
protected string $baseUrl;
- /**
- * @var int
- */
protected int $total;
- /**
- * @var int
- */
protected int $perPage;
- /**
- * @var int
- */
protected int $page;
/**
- * @param int $perPage
- * @param int $page
- * @return void
* @throws DiException
* @throws ReflectionException
*/
@@ -62,7 +47,6 @@ protected function initialize(int $perPage, int $page = 1): void
/**
* Get the total number of items
- * @return int
*/
public function total(): int
{
@@ -71,7 +55,6 @@ public function total(): int
/**
* Get the current page number
- * @return int
*/
public function currentPageNumber(): int
{
@@ -80,7 +63,6 @@ public function currentPageNumber(): int
/**
* Get previous page number
- * @return int|null
*/
public function previousPageNumber(): ?int
{
@@ -97,7 +79,6 @@ public function previousPageNumber(): ?int
/**
* Get next page number
- * @return int|null
*/
public function nextPageNumber(): ?int
{
@@ -114,7 +95,6 @@ public function nextPageNumber(): ?int
/**
* Get last page number
- * @return int
*/
public function lastPageNumber(): int
{
@@ -123,8 +103,6 @@ public function lastPageNumber(): int
/**
* Get the current page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function currentPageLink(bool $withBaseUrl = false): ?string
{
@@ -133,8 +111,6 @@ public function currentPageLink(bool $withBaseUrl = false): ?string
/**
* Get first page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function firstPageLink(bool $withBaseUrl = false): ?string
{
@@ -143,8 +119,6 @@ public function firstPageLink(bool $withBaseUrl = false): ?string
/**
* Get previous page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function previousPageLink(bool $withBaseUrl = false): ?string
{
@@ -153,8 +127,6 @@ public function previousPageLink(bool $withBaseUrl = false): ?string
/**
* Get next page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function nextPageLink(bool $withBaseUrl = false): ?string
{
@@ -163,8 +135,6 @@ public function nextPageLink(bool $withBaseUrl = false): ?string
/**
* Get last page link
- * @param bool $withBaseUrl
- * @return string|null
*/
public function lastPageLink(bool $withBaseUrl = false): ?string
{
@@ -173,7 +143,6 @@ public function lastPageLink(bool $withBaseUrl = false): ?string
/**
* Get items per page
- * @return int
*/
public function perPage(): int
{
@@ -182,8 +151,6 @@ public function perPage(): int
/**
* Get all page links
- * @param bool $withBaseUrl
- * @return array
*/
public function links(bool $withBaseUrl = false): array
{
@@ -198,9 +165,7 @@ public function links(bool $withBaseUrl = false): array
/**
* Get pagination HTML
- * @param bool $withBaseUrl
- * @param int|null $pageItemsCount
- * @return string|null
+ * @throws ConfigException|DiException|LangException|ReflectionException
*/
public function getPagination(bool $withBaseUrl = false, ?int $pageItemsCount = null): ?string
{
@@ -240,8 +205,6 @@ public function getPagination(bool $withBaseUrl = false, ?int $pageItemsCount =
/**
* Get the URI for pagination
- * @param bool $withBaseUrl
- * @return string
* @throws DiException|ReflectionException
*/
protected function getUri(bool $withBaseUrl = false): string
@@ -261,9 +224,6 @@ protected function getUri(bool $withBaseUrl = false): string
/**
* Get page link
- * @param int|null $pageNumber
- * @param bool $withBaseUrl
- * @return string|null
* @throws DiException|ReflectionException
*/
protected function getPageLink(?int $pageNumber, bool $withBaseUrl = false): ?string
@@ -277,19 +237,17 @@ protected function getPageLink(?int $pageNumber, bool $withBaseUrl = false): ?st
/**
* Get next page item HTML
- * @param string|null $nextPageLink
- * @return string
* @throws DiException|ReflectionException|ConfigException|LangException
*/
protected function getNextPageItem(?string $nextPageLink): string
{
- $link = '';
+ $link = [];
if (!in_array($nextPageLink, [null, '', '0'], true)) {
- $link = '' . t('common.pagination.next') . '';
+ $link[] = '' . t('common.pagination.next') . '';
}
- return $link;
+ return implode('', $link);
}
/**
@@ -297,31 +255,23 @@ protected function getNextPageItem(?string $nextPageLink): string
* @param string|null $previousPageLink
* @return string
*/
-
/**
* Get previous page item HTML
- * @param string|null $previousPageLink
- * @return string
* @throws ConfigException|DiException|LangException|ReflectionException
*/
protected function getPreviousPageItem(?string $previousPageLink): string
{
- $link = '';
+ $link = [];
if (!in_array($previousPageLink, [null, '', '0'], true)) {
- $link = '' . t('common.pagination.prev') . '';
+ $link[] = '' . t('common.pagination.prev') . '';
}
- return $link;
+ return implode('', $link);
}
/**
* Get items links HTML
- * @param int $startPage
- * @param int $endPage
- * @param int $currentPage
- * @param array $links
- * @return string
*/
protected function getItemsLinks(int $startPage, int $endPage, int $currentPage, array $links): string
{
@@ -329,18 +279,14 @@ protected function getItemsLinks(int $startPage, int $endPage, int $currentPage,
for ($i = $startPage; $i <= $endPage; $i++) {
$active = $i === $currentPage ? 'class="' . Pagination::PAGINATION_CLASS_ACTIVE . '"' : '';
- $pagination .= '' . $i . '';
+ $pagination[] = '' . $i . '';
}
- return $pagination;
+ return implode('', $pagination);
}
/**
* Calculate start and end pages
- * @param int $currentPage
- * @param int $totalPages
- * @param int $pageItemsCount
- * @return array
*/
protected function calculateStartEndPages(int $currentPage, int $totalPages, int $pageItemsCount): array
{
@@ -352,41 +298,35 @@ protected function calculateStartEndPages(int $currentPage, int $totalPages, int
/**
* Add first page link HTML
- * @param int $startPage
- * @return string
*/
protected function addFirstPageLink(int $startPage): string
{
- $pagination = '';
+ $pagination = [];
if ($startPage > 1) {
- $pagination .= '' . Pagination::FIRST_PAGE_NUMBER . '';
+ $pagination[] = '' . Pagination::FIRST_PAGE_NUMBER . '';
if ($startPage > 2) {
- $pagination .= '...';
+ $pagination[] = '...';
}
}
- return $pagination;
+ return implode('', $pagination);
}
/**
* Add last page link HTML
- * @param int $endPage
- * @param int $totalPages
- * @param array $links
- * @return string
*/
protected function addLastPageLink(int $endPage, int $totalPages, array $links): string
{
- $pagination = '';
+ $pagination = [];
if ($endPage < $totalPages) {
if ($endPage < $totalPages - 1) {
- $pagination .= '...';
+ $pagination[] = '...';
}
- $pagination .= '' . $totalPages . '';
+ $pagination[] = '' . $totalPages . '';
}
- return $pagination;
+ return implode('', $pagination);
}
}
diff --git a/src/Renderer/Adapters/HtmlAdapter.php b/src/Renderer/Adapters/HtmlAdapter.php
index 802974cc4..9320dfd4f 100644
--- a/src/Renderer/Adapters/HtmlAdapter.php
+++ b/src/Renderer/Adapters/HtmlAdapter.php
@@ -29,18 +29,11 @@
*/
class HtmlAdapter implements TemplateRendererInterface
{
- /**
- * @var FileSystem
- */
protected FileSystem $fs;
- /**
- * @var array|null
- */
protected ?array $configs;
/**
- * @param array|null $configs
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -55,9 +48,6 @@ public function __construct(?array $configs = [])
/**
* Renders the view
- * @param string $view
- * @param array $params
- * @return string
* @throws BaseException
*/
public function render(string $view, array $params = []): string
@@ -81,8 +71,6 @@ public function render(string $view, array $params = []): string
}
/**
- * @param string $view
- * @return string
* @throws DiException
* @throws ReflectionException
*/
diff --git a/src/Renderer/Adapters/TwigAdapter.php b/src/Renderer/Adapters/TwigAdapter.php
index bf48fc813..3f273a4ce 100644
--- a/src/Renderer/Adapters/TwigAdapter.php
+++ b/src/Renderer/Adapters/TwigAdapter.php
@@ -35,18 +35,11 @@
*/
class TwigAdapter implements TemplateRendererInterface
{
- /**
- * @var FileSystem
- */
protected FileSystem $fs;
- /**
- * @var array|null
- */
protected ?array $configs;
/**
- * @param array|null $configs
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -61,9 +54,6 @@ public function __construct(?array $configs = [])
/**
* Renders the view
- * @param string $view
- * @param array $params
- * @return string
* @throws DiException|LoaderError|ReflectionException|RendererException|RuntimeError|SyntaxError
*/
public function render(string $view, array $params = []): string
@@ -78,8 +68,6 @@ public function render(string $view, array $params = []): string
}
/**
- * @param string $view
- * @return FilesystemLoader
* @throws RendererException|DiException|ReflectionException
*/
private function getLoader(string $view): FilesystemLoader
@@ -98,10 +86,6 @@ private function getLoader(string $view): FilesystemLoader
throw RendererException::fileNotFound($view);
}
- /**
- * @param Environment $twig
- * @return void
- */
private function addFunctionsToTwig(Environment $twig): void
{
$definedFunctions = get_defined_functions();
diff --git a/src/Renderer/Contracts/TemplateRendererInterface.php b/src/Renderer/Contracts/TemplateRendererInterface.php
index 59bd48d6c..58b37344f 100644
--- a/src/Renderer/Contracts/TemplateRendererInterface.php
+++ b/src/Renderer/Contracts/TemplateRendererInterface.php
@@ -22,9 +22,6 @@ interface TemplateRendererInterface
{
/**
* Renders the template
- * @param string $view
- * @param array $params
- * @return string
*/
public function render(string $view, array $params = []): string;
}
diff --git a/src/Renderer/Factories/RendererFactory.php b/src/Renderer/Factories/RendererFactory.php
index 814161bdc..8d2540461 100644
--- a/src/Renderer/Factories/RendererFactory.php
+++ b/src/Renderer/Factories/RendererFactory.php
@@ -44,8 +44,6 @@ class RendererFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Renderer
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -68,19 +66,12 @@ public static function get(?string $adapter = null): Renderer
return self::$instances[$adapter];
}
- /**
- * @param string $adapterClass
- * @param string $adapter
- * @return Renderer
- */
private static function createInstance(string $adapterClass, string $adapter): Renderer
{
return new Renderer(new $adapterClass(config()->get('view.' . $adapter)));
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
diff --git a/src/Renderer/Renderer.php b/src/Renderer/Renderer.php
index 0bac0ddc1..df3718f5b 100644
--- a/src/Renderer/Renderer.php
+++ b/src/Renderer/Renderer.php
@@ -37,25 +37,17 @@ class Renderer
private TemplateRendererInterface $adapter;
- /**
- * @param TemplateRendererInterface $adapter
- */
public function __construct(TemplateRendererInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return TemplateRendererInterface
- */
public function getAdapter(): TemplateRendererInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/ResourceCache/ViewCache.php b/src/ResourceCache/ViewCache.php
index 5bc379356..7451bbd15 100644
--- a/src/ResourceCache/ViewCache.php
+++ b/src/ResourceCache/ViewCache.php
@@ -42,19 +42,10 @@ class ViewCache
*/
private $ttl = 300;
- /**
- * @var bool
- */
private bool $isEnabled;
- /**
- * @var bool
- */
private bool $minification = false;
- /**
- * @var FileSystem
- */
private FileSystem $fs;
private static ?ViewCache $instance = null;
@@ -80,7 +71,6 @@ public function __construct()
}
/**
- * @return void
* @throws ConfigException|DiException|LoaderException|ReflectionException
*/
public function setup(): void
@@ -101,9 +91,6 @@ public function setup(): void
}
/**
- * @param string $uri
- * @param Response $response
- * @return bool
* @throws BaseException
* @throws ConfigException
* @throws DatabaseException
@@ -122,9 +109,6 @@ public function serveCachedView(string $uri, Response $response): bool
}
/**
- * @param string $key
- * @param string $content
- * @return $this
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -142,8 +126,6 @@ public function set(string $key, string $content): ViewCache
}
/**
- * @param string $key
- * @return string|null
* @throws BaseException
* @throws ConfigException
* @throws DatabaseException
@@ -161,8 +143,6 @@ public function get(string $key): ?string
}
/**
- * @param string $key
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -178,8 +158,6 @@ public function delete(string $key): void
}
/**
- * @param string $key
- * @return bool
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -191,36 +169,21 @@ public function exists(string $key): bool
return $this->fs->exists($cacheFile) && !$this->isExpired($cacheFile);
}
- /**
- * @return bool
- */
public function isEnabled(): bool
{
return $this->isEnabled;
}
- /**
- * @param bool $state
- * @return void
- */
public function enableCaching(bool $state): void
{
$this->isEnabled = $state;
}
- /**
- * @param int $ttl
- * @return void
- */
public function setTtl(int $ttl): void
{
$this->ttl = $ttl;
}
- /**
- * @param bool $state
- * @return void
- */
public function enableMinification(bool $state): void
{
$this->minification = $state;
@@ -228,7 +191,6 @@ public function enableMinification(bool $state): void
/**
* @param $cacheFile
- * @return bool
*/
private function isExpired(string $cacheFile): bool
{
@@ -240,9 +202,6 @@ private function isExpired(string $cacheFile): bool
return false;
}
- /**
- * @return string
- */
private function getCacheDir(): string
{
$configCacheDir = config()->get('view_cache.cache_dir', 'cache');
@@ -257,8 +216,6 @@ private function getCacheDir(): string
}
/**
- * @param string $key
- * @return string
* @throws ConfigException
* @throws DiException
* @throws ReflectionException
@@ -270,8 +227,6 @@ private function getCacheFile(string $key): string
}
/**
- * @param string $content
- * @return string
* @throws BaseException
*/
private function minify(string $content): string
@@ -283,9 +238,6 @@ private function minify(string $content): string
return (new HtmlMin())->minify($content);
}
- /**
- * @return bool
- */
protected function htmlMinifierExists(): bool
{
return class_exists(HtmlMin::class);
diff --git a/src/Router/Exceptions/RouteException.php b/src/Router/Exceptions/RouteException.php
index 2dff4592d..cd5b97c07 100644
--- a/src/Router/Exceptions/RouteException.php
+++ b/src/Router/Exceptions/RouteException.php
@@ -25,9 +25,6 @@
*/
class RouteException extends BaseException
{
- /**
- * @return self
- */
public static function noHttpMethods(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function noHttpMethods(): self
);
}
- /**
- * @return self
- */
public static function closureWithController(): self
{
return new self(
@@ -47,9 +41,6 @@ public static function closureWithController(): self
);
}
- /**
- * @return self
- */
public static function incompleteControllerRoute(): self
{
return new self(
@@ -58,10 +49,6 @@ public static function incompleteControllerRoute(): self
);
}
- /**
- * @param string $module
- * @return self
- */
public static function moduleRoutesNotClosure(string $module): self
{
return new self(
@@ -70,9 +57,6 @@ public static function moduleRoutesNotClosure(string $module): self
);
}
- /**
- * @return self
- */
public static function nestedGroups(): self
{
return new self(
@@ -81,9 +65,6 @@ public static function nestedGroups(): self
);
}
- /**
- * @return self
- */
public static function middlewaresOutsideRoute(): self
{
return new self(
@@ -92,10 +73,6 @@ public static function middlewaresOutsideRoute(): self
);
}
- /**
- * @param string $name
- * @return self
- */
public static function nonUniqueNameInModule(string $name): self
{
return new self(
@@ -104,9 +81,6 @@ public static function nonUniqueNameInModule(string $name): self
);
}
- /**
- * @return self
- */
public static function controllerWithoutModule(): self
{
return new self(
@@ -115,9 +89,6 @@ public static function controllerWithoutModule(): self
);
}
- /**
- * @return self
- */
public static function cacheableOutsideRoute(): self
{
return new self(
@@ -126,9 +97,6 @@ public static function cacheableOutsideRoute(): self
);
}
- /**
- * @return self
- */
public static function closureHandlerMissing(): self
{
return new self(
@@ -137,11 +105,6 @@ public static function closureHandlerMissing(): self
);
}
- /**
- * @param string $action
- * @param string $controller
- * @return self
- */
public static function actionNotFound(string $action, string $controller): self
{
return new self(
@@ -153,9 +116,6 @@ public static function actionNotFound(string $action, string $controller): self
);
}
- /**
- * @return RouteException
- */
public static function notClosure(): self
{
return new self(
@@ -164,9 +124,6 @@ public static function notClosure(): self
);
}
- /**
- * @return RouteException
- */
public static function nameBeforeDefinition(): self
{
return new self(
@@ -175,10 +132,6 @@ public static function nameBeforeDefinition(): self
);
}
- /**
- * @param string $name
- * @return RouteException
- */
public static function paramNameNotAvailable(string $name): self
{
return new self(
@@ -187,9 +140,6 @@ public static function paramNameNotAvailable(string $name): self
);
}
- /**
- * @return RouteException
- */
public static function paramNameNotValid(): self
{
return new self(
diff --git a/src/Router/Helpers/router.php b/src/Router/Helpers/router.php
index d3c64aa13..698374d6a 100644
--- a/src/Router/Helpers/router.php
+++ b/src/Router/Helpers/router.php
@@ -21,7 +21,6 @@
/**
* Gets current route middlewares
- * @return array|null
* @throws DiException|ReflectionException
*/
function current_middlewares(): ?array
@@ -34,7 +33,6 @@ function current_middlewares(): ?array
/**
* Gets current route module
- * @return string|null
* @throws DiException|ReflectionException
*/
function current_module(): ?string
@@ -47,7 +45,6 @@ function current_module(): ?string
/**
* Gets current route controller
- * @return string|null
* @throws DiException|ReflectionException
*/
function current_controller(): ?string
@@ -60,7 +57,6 @@ function current_controller(): ?string
/**
* Gets current route action
- * @return string|null
* @throws DiException|ReflectionException
*/
function current_action(): ?string
@@ -73,7 +69,6 @@ function current_action(): ?string
/**
* Gets current route callback
- * @return Closure|null
* @throws DiException|ReflectionException
*/
function route_callback(): ?Closure
@@ -86,7 +81,6 @@ function route_callback(): ?Closure
/**
* Gets current route DSL pattern
- * @return string|null
* @throws DiException|ReflectionException
*/
function current_route(): ?string
@@ -99,7 +93,6 @@ function current_route(): ?string
/**
* Gets current route complied pattern
- * @return string
* @throws DiException|ReflectionException
*/
function route_pattern(): string
@@ -112,7 +105,6 @@ function route_pattern(): string
/**
* Gets current route parameters
- * @return array
* @throws DiException|ReflectionException
*/
function route_params(): array
@@ -125,7 +117,6 @@ function route_params(): array
/**
* Gets route parameter by name
- * @param string $name
* @return mixed|null
* @throws DiException|ReflectionException
*/
@@ -137,7 +128,6 @@ function route_param(string $name)
/**
* Gets current route method
- * @return string
* @throws DiException|ReflectionException
*/
function route_method(): string
@@ -148,7 +138,6 @@ function route_method(): string
/**
* Gets the current route uri
- * @return string|null
* @throws DiException|ReflectionException
*/
function route_uri(): ?string
@@ -159,7 +148,6 @@ function route_uri(): ?string
/**
* Gets the current route cache settings
- * @return array|null
* @throws DiException|ReflectionException
*/
function route_cache_settings(): ?array
@@ -172,7 +160,6 @@ function route_cache_settings(): ?array
/**
* Gets the current route name
- * @return string|null
* @throws DiException|ReflectionException
*/
function route_name(): ?string
@@ -185,7 +172,6 @@ function route_name(): ?string
/**
* Gets the current route name
- * @return string|null
* @throws DiException|ReflectionException
*/
function route_prefix(): ?string
@@ -198,9 +184,6 @@ function route_prefix(): ?string
/**
* Finds the route by name in given module scope
- * @param string $name
- * @param string $module
- * @return Route|null
* @throws DiException|ReflectionException
*/
function find_route_by_name(string $name, string $module): ?Route
@@ -226,9 +209,6 @@ function find_route_by_name(string $name, string $module): ?Route
/**
* Checks the existence of the route group by name in given module scope
- * @param string $name
- * @param string $module
- * @return bool
* @throws DiException|ReflectionException
*/
function route_group_exists(string $name, string $module): bool
@@ -254,7 +234,6 @@ function route_group_exists(string $name, string $module): bool
/**
* Gets the module base namespace depending on env
- * @return string
*/
function module_base_namespace(): string
{
diff --git a/src/Router/MatchedRoute.php b/src/Router/MatchedRoute.php
index 026f0dcb8..f4435dd92 100644
--- a/src/Router/MatchedRoute.php
+++ b/src/Router/MatchedRoute.php
@@ -21,20 +21,10 @@
*/
final class MatchedRoute
{
- /**
- * @var Route
- */
private Route $route;
- /**
- * @var array
- */
private array $params;
- /**
- * @param Route $route
- * @param array $params
- */
public function __construct(Route $route, array $params)
{
$this->route = $route;
@@ -43,7 +33,6 @@ public function __construct(Route $route, array $params)
/**
* Return the original route definition.
- * @return Route
*/
public function getRoute(): Route
{
@@ -52,7 +41,6 @@ public function getRoute(): Route
/**
* Return parameters extracted from the URI at match time.
- * @return array
*/
public function getParams(): array
{
diff --git a/src/Router/PatternCompiler.php b/src/Router/PatternCompiler.php
index 7ed4341b3..ba0d05544 100644
--- a/src/Router/PatternCompiler.php
+++ b/src/Router/PatternCompiler.php
@@ -31,16 +31,10 @@ class PatternCompiler
':any' => '[^\/]',
];
- /**
- * @var array
- */
protected array $params = [];
/**
* Check whether the given URI matches the route pattern and store extracted params.
- * @param Route $route
- * @param string $uri
- * @return bool
* @throws RouteException
*/
public function match(Route $route, string $uri): bool
@@ -61,8 +55,6 @@ public function match(Route $route, string $uri): bool
/**
* Compile route pattern into regex and param metadata.
- * @param Route $route
- * @return array
* @throws RouteException
*/
public function compile(Route $route): array
@@ -72,7 +64,7 @@ public function compile(Route $route): array
$pattern = '(\/)?';
$params = [];
- $lastIndex = (int) array_key_last($segments);
+ $lastIndex = array_key_last($segments);
foreach ($segments as $index => $segment) {
$segmentParam = $this->getSegmentParam($segment, $index, $lastIndex);
@@ -102,7 +94,6 @@ public function compile(Route $route): array
/**
* Return parameters extracted from the last successful match.
- * @return array
*/
public function getParams(): array
{
@@ -111,9 +102,6 @@ public function getParams(): array
/**
* Build the final named parameter map from regex matches and param metadata.
- * @param array $params
- * @param array $matches
- * @return array
*/
protected function extractParams(array $params, array $matches): array
{
@@ -131,10 +119,6 @@ protected function extractParams(array $params, array $matches): array
/**
* Detect and build parameter definition for a single route segment if present.
- * @param string $segment
- * @param int $index
- * @param int $lastIndex
- * @return array
* @throws RouteException
*/
protected function getSegmentParam(string $segment, int $index, int $lastIndex): array
@@ -150,11 +134,6 @@ protected function getSegmentParam(string $segment, int $index, int $lastIndex):
/**
* Generate the regex pattern and name for a matched parameter segment.
- * @param array $match
- * @param string $expr
- * @param int $index
- * @param int $lastIndex
- * @return array
* @throws RouteException
*/
protected function getParamPattern(array $match, string $expr, int $index, int $lastIndex): array
@@ -187,9 +166,6 @@ protected function getParamPattern(array $match, string $expr, int $index, int $
/**
* Resolve and validate the parameter name from a segment match.
- * @param array $match
- * @param int $index
- * @return string
* @throws RouteException
*/
protected function getParamName(array $match, int $index): string
@@ -209,9 +185,6 @@ protected function getParamName(array $match, int $index): string
/**
* Ensure the parameter name is unique within the route pattern.
- * @param array $params
- * @param string $name
- * @return void
* @throws RouteException
*/
protected function checkParamName(array $params, string $name): void
@@ -225,11 +198,6 @@ protected function checkParamName(array $params, string $name): void
/**
* Adjust the accumulated route regex before appending the last segment pattern.
- * @param string $routePattern
- * @param array $segmentParam
- * @param int $index
- * @param int $lastIndex
- * @return string
*/
protected function normalizePattern(
string $routePattern,
@@ -250,8 +218,6 @@ protected function normalizePattern(
/**
* Escape forward slashes in a regex fragment safely.
- * @param string $str
- * @return string
*/
protected function escape(string $str): string
{
diff --git a/src/Router/Route.php b/src/Router/Route.php
index cc7f17c2a..0a0e0e9df 100644
--- a/src/Router/Route.php
+++ b/src/Router/Route.php
@@ -24,72 +24,31 @@
*/
final class Route
{
- /**
- * @var array
- */
protected array $methods;
- /**
- * @var string
- */
protected string $pattern;
- /**
- * @var string|null
- */
protected ?string $controller;
- /**
- * @var string|null
- */
protected ?string $action;
- /**
- * @var Closure|null
- */
protected ?Closure $closure;
- /**
- * @var string|null
- */
protected ?string $name = null;
- /**
- * @var string|null
- */
protected ?string $module = null;
- /**
- * @var array
- */
protected array $middlewares = [];
- /**
- * @var string|null
- */
protected ?string $group = null;
- /**
- * @var string|null
- */
protected ?string $prefix = null;
- /**
- * @var array|null
- */
protected ?array $cache = null;
- /**
- * @var string|null
- */
protected ?string $compiledPattern = null;
/**
- * @param array $methods
- * @param string $pattern
- * @param string|null $controller
- * @param string|null $action
- * @param Closure|null $closure
* @throws RouteException
*/
public function __construct(
@@ -97,7 +56,7 @@ public function __construct(
string $pattern,
?string $controller,
?string $action,
- Closure $closure = null
+ ?Closure $closure = null
) {
if ($methods === []) {
throw RouteException::noHttpMethods();
@@ -124,7 +83,6 @@ public function __construct(
/**
* Check whether this route is handled by a closure.
- * @return bool
*/
public function isClosure(): bool
{
@@ -133,8 +91,6 @@ public function isClosure(): bool
/**
* Configure response caching settings for this route.
- * @param bool $enabled
- * @param int|null $ttl
* @return $this
*/
public function cache(bool $enabled, ?int $ttl = null): self
@@ -149,7 +105,6 @@ public function cache(bool $enabled, ?int $ttl = null): self
/**
* Return caching configuration for this route.
- * @return array|null
*/
public function getCache(): ?array
{
@@ -158,7 +113,6 @@ public function getCache(): ?array
/**
* Store compiled regex pattern for this route.
- * @param string $pattern
* @return $this
*/
public function setCompiledPattern(string $pattern): self
@@ -169,7 +123,6 @@ public function setCompiledPattern(string $pattern): self
/**
* Return compiled regex pattern if set.
- * @return string|null
*/
public function getCompiledPattern(): ?string
{
@@ -178,7 +131,6 @@ public function getCompiledPattern(): ?string
/**
* Assign group name to this route.
- * @param string|null $group
* @return $this
*/
public function group(?string $group): self
@@ -189,7 +141,6 @@ public function group(?string $group): self
/**
* Return group name.
- * @return string|null
*/
public function getGroup(): ?string
{
@@ -198,7 +149,6 @@ public function getGroup(): ?string
/**
* Return URL prefix.
- * @param string|null $prefix
* @return $this
*/
public function prefix(?string $prefix): self
@@ -207,9 +157,6 @@ public function prefix(?string $prefix): self
return $this;
}
- /**
- * @return string|null
- */
public function getPrefix(): ?string
{
return $this->prefix;
@@ -217,7 +164,6 @@ public function getPrefix(): ?string
/**
* Assign unique route name.
- * @param string $name
* @return $this
*/
public function name(string $name): self
@@ -228,7 +174,6 @@ public function name(string $name): self
/**
* Add middleware(s) with group-aware stacking order.
- * @param array $middlewares
* @return $this
*/
public function addMiddlewares(array $middlewares): self
@@ -248,7 +193,6 @@ public function addMiddlewares(array $middlewares): self
/**
* Assign module name to this route.
- * @param string|null $module
* @return $this
*/
public function module(?string $module): self
@@ -259,8 +203,6 @@ public function module(?string $module): self
/**
* Check whether HTTP method is allowed for this route.
- * @param string $method
- * @return bool
*/
public function allowsMethod(string $method): bool
{
@@ -269,7 +211,6 @@ public function allowsMethod(string $method): bool
/**
* Return allowed HTTP methods.
- * @return array
*/
public function getMethods(): array
{
@@ -278,7 +219,6 @@ public function getMethods(): array
/**
* Return route pattern string.
- * @return string
*/
public function getPattern(): string
{
@@ -287,7 +227,6 @@ public function getPattern(): string
/**
* Return route closure handler if defined.
- * @return Closure|null
*/
public function getClosure(): ?Closure
{
@@ -296,7 +235,6 @@ public function getClosure(): ?Closure
/**
* Return controller class name.
- * @return string|null
*/
public function getController(): ?string
{
@@ -305,7 +243,6 @@ public function getController(): ?string
/**
* Return controller action name.
- * @return string|null
*/
public function getAction(): ?string
{
@@ -314,7 +251,6 @@ public function getAction(): ?string
/**
* Return route name.
- * @return string|null
*/
public function getName(): ?string
{
@@ -323,7 +259,6 @@ public function getName(): ?string
/**
* Return middleware list.
- * @return array
*/
public function getMiddlewares(): array
{
@@ -332,7 +267,6 @@ public function getMiddlewares(): array
/**
* Return middleware list.
- * @return string|null
*/
public function getModule(): ?string
{
@@ -341,7 +275,6 @@ public function getModule(): ?string
/**
* Export route definition as array.
- * @return array
*/
public function toArray(): array
{
diff --git a/src/Router/RouteBuilder.php b/src/Router/RouteBuilder.php
index 076dd10f8..43d8f00d7 100644
--- a/src/Router/RouteBuilder.php
+++ b/src/Router/RouteBuilder.php
@@ -24,49 +24,22 @@
*/
final class RouteBuilder
{
- /**
- * @var RouteCollection
- */
private RouteCollection $collection;
- /**
- * @var PatternCompiler
- */
private PatternCompiler $patternCompiler;
- /**
- * @var Route|null
- */
private ?Route $currentRoute = null;
- /**
- * @var string|null
- */
private ?string $currentModule = null;
- /**
- * @var string|null
- */
private ?string $currentPrefix = null;
- /**
- * @var bool
- */
private bool $inGroup = false;
- /**
- * @var string|null
- */
private ?string $currentGroupName = null;
- /**
- * @var array
- */
private array $groupRoutes = [];
- /**
- * @var array
- */
private array $groupMiddlewares = [];
/**
@@ -83,9 +56,6 @@ public function __construct()
/**
* Execute DSL and return final RouteCollection
- * @param array $moduleRouteClosures
- * @param array $moduleConfigs
- * @return RouteCollection
* @throws RouteException
*/
public function build(array $moduleRouteClosures, array $moduleConfigs): RouteCollection
@@ -112,11 +82,8 @@ public function build(array $moduleRouteClosures, array $moduleConfigs): RouteCo
/**
* Define a route with multiple HTTP methods.
- * @param string $path
- * @param string $methods
* @param $handler
* @param string|null $action
- * @return self
* @throws RouteException
*/
public function add(string $path, string $methods, $handler, string $action = null): self
@@ -131,10 +98,8 @@ public function add(string $path, string $methods, $handler, string $action = nu
/**
* Define a GET route.
- * @param string $path
* @param $handler
* @param string|null $action
- * @return self
* @throws RouteException
*/
public function get(string $path, $handler, string $action = null): self
@@ -144,10 +109,8 @@ public function get(string $path, $handler, string $action = null): self
/**
* Define a POST route.
- * @param string $path
* @param $handler
* @param string|null $action
- * @return self
* @throws RouteException
*/
public function post(string $path, $handler, string $action = null): self
@@ -157,10 +120,8 @@ public function post(string $path, $handler, string $action = null): self
/**
* Define a PUT route.
- * @param string $path
* @param $handler
* @param string|null $action
- * @return self
* @throws RouteException
*/
public function put(string $path, $handler, string $action = null): self
@@ -170,10 +131,8 @@ public function put(string $path, $handler, string $action = null): self
/**
* Define a DELETE route.
- * @param string $path
* @param $handler
* @param string|null $action
- * @return self
* @throws RouteException
*/
public function delete(string $path, $handler, string $action = null): self
@@ -183,8 +142,6 @@ public function delete(string $path, $handler, string $action = null): self
/**
* Group routes under a shared name and configuration.
- * @param string $name
- * @param callable $callback
* @return $this
* @throws RouteException
*/
@@ -219,7 +176,6 @@ public function group(string $name, callable $callback): self
/**
* Apply middlewares to the current route or group.
- * @param array $middlewares
* @return $this
* @throws RouteException
*/
@@ -253,7 +209,6 @@ public function middlewares(array $middlewares): self
/**
* Assign a unique name to the current route.
- * @param string $name
* @return $this
* @throws RouteException
*/
@@ -280,8 +235,6 @@ public function name(string $name): self
/**
* Enable or disable caching for the current route or group.
- * @param bool $enabled
- * @param int|null $ttl
* @return $this
* @throws RouteException
*/
@@ -314,11 +267,7 @@ public function cacheable(bool $enabled, ?int $ttl = null): self
/**
* Create and register a Route instance.
- * @param array $methods
- * @param string $path
* @param $handler
- * @param string|null $action
- * @return self
* @throws RouteException
*/
private function addRoute(
@@ -363,8 +312,7 @@ private function addRoute(
$methods,
$pattern,
$handler,
- $action,
- null
+ $action
);
}
@@ -388,8 +336,6 @@ private function addRoute(
/**
* Resolve path using the current prefix.
- * @param string $path
- * @return string
*/
private function resolvePath(string $path): string
{
diff --git a/src/Router/RouteCollection.php b/src/Router/RouteCollection.php
index 2d5ff3b63..6c1f2e427 100644
--- a/src/Router/RouteCollection.php
+++ b/src/Router/RouteCollection.php
@@ -28,8 +28,6 @@ final class RouteCollection
/**
* Add a route to the collection.
- * @param Route $route
- * @return void
*/
public function add(Route $route): void
{
@@ -47,7 +45,6 @@ public function all(): array
/**
* Return total number of routes.
- * @return int
*/
public function count(): int
{
diff --git a/src/Router/RouteDispatcher.php b/src/Router/RouteDispatcher.php
index 32344da07..d8068709f 100644
--- a/src/Router/RouteDispatcher.php
+++ b/src/Router/RouteDispatcher.php
@@ -17,7 +17,6 @@
use Quantum\Router\Exceptions\RouteException;
use Quantum\Csrf\Exceptions\CsrfException;
use Quantum\Di\Exceptions\DiException;
-use Quantum\Http\Response;
use Quantum\Http\Request;
use ReflectionException;
use Quantum\Csrf\Csrf;
@@ -31,13 +30,9 @@ final class RouteDispatcher
{
/**
* Dispatch a matched route.
- * @param MatchedRoute $matched
- * @param Request $request
- * @param Response $response
- * @return void
* @throws ReflectionException|CsrfException|DiException|RouteException
*/
- public function dispatch(MatchedRoute $matched, Request $request, Response $response): void
+ public function dispatch(MatchedRoute $matched, Request $request): void
{
$route = $matched->getRoute();
$params = $matched->getParams();
@@ -67,8 +62,6 @@ public function dispatch(MatchedRoute $matched, Request $request, Response $resp
/**
* Resolve controller callable from the route definition.
- * @param Route $route
- * @return array
* @throws RouteException
*/
private function resolveControllerCallable(Route $route): array
@@ -91,9 +84,6 @@ private function resolveControllerCallable(Route $route): array
/**
* Invoke a callable with parameters resolved via DI autowiring.
- * @param callable $callable
- * @param array $params
- * @return void
* @throws DiException|ReflectionException
*/
private function invoke(callable $callable, array $params): void
@@ -106,10 +96,6 @@ private function invoke(callable $callable, array $params): void
/**
* Invoke a controller lifecycle hook if it exists.
- * @param object $controller
- * @param string $hook
- * @param array $params
- * @return void
* @throws DiException|ReflectionException
*/
private function callHook(object $controller, string $hook, array $params): void
@@ -121,9 +107,6 @@ private function callHook(object $controller, string $hook, array $params): void
/**
* Verify CSRF token if controller requires it and request method applies.
- * @param object|null $controller
- * @param Request $request
- * @return void
* @throws CsrfException
*/
private function verifyCsrf(?object $controller, Request $request): void
diff --git a/src/Router/RouteFinder.php b/src/Router/RouteFinder.php
index b15e95f6f..dad7cfdc4 100644
--- a/src/Router/RouteFinder.php
+++ b/src/Router/RouteFinder.php
@@ -23,19 +23,10 @@
*/
final class RouteFinder
{
- /**
- * @var PatternCompiler
- */
private PatternCompiler $patternCompiler;
- /**
- * @var RouteCollection
- */
private RouteCollection $routes;
- /**
- * @param RouteCollection $routes
- */
public function __construct(RouteCollection $routes)
{
$this->patternCompiler = new PatternCompiler();
@@ -44,8 +35,6 @@ public function __construct(RouteCollection $routes)
/**
* Find the first route that matches request method and URI.
- * @param Request $request
- * @return MatchedRoute|null
* @throws Exceptions\RouteException
*/
public function find(Request $request): ?MatchedRoute
diff --git a/src/Service/Factories/ServiceFactory.php b/src/Service/Factories/ServiceFactory.php
index be65ca4cb..e6cc3b7c2 100644
--- a/src/Service/Factories/ServiceFactory.php
+++ b/src/Service/Factories/ServiceFactory.php
@@ -29,9 +29,6 @@ class ServiceFactory
{
/**
* Creates and initiates the service once
- * @param string $serviceClass
- * @param array $args
- * @return QtService
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -50,9 +47,6 @@ public static function get(string $serviceClass, array $args = []): QtService
/**
* Creates new service instance
- * @param string $serviceClass
- * @param array $args
- * @return QtService
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -67,8 +61,6 @@ public static function create(string $serviceClass, array $args = []): QtService
/**
* Validates the service class
- * @param string $serviceClass
- * @return void
* @throws ServiceException
* @throws BaseException
*/
diff --git a/src/Service/Helpers/service.php b/src/Service/Helpers/service.php
index 62f0fe72d..fb377fbe8 100644
--- a/src/Service/Helpers/service.php
+++ b/src/Service/Helpers/service.php
@@ -21,7 +21,6 @@
/**
* Gets or creates service instance
* @param class-string $serviceClass
- * @param bool $singleton
* @return T
* @throws BaseException
* @throws DiException
@@ -29,7 +28,6 @@
* @throws ServiceException
* @template T of QtService
*/
-
function service(string $serviceClass, bool $singleton = false): QtService
{
return $singleton ? ServiceFactory::get($serviceClass) : ServiceFactory::create($serviceClass);
diff --git a/src/Service/QtService.php b/src/Service/QtService.php
index 578cd7dfc..62351cf2f 100644
--- a/src/Service/QtService.php
+++ b/src/Service/QtService.php
@@ -25,8 +25,6 @@ class QtService
{
/**
* Handles the missing methods of the service
- * @param string $method
- * @param array $arguments
* @throws BaseException
*/
public function __call(string $method, array $arguments)
diff --git a/src/Session/Adapters/Database/DatabaseHandler.php b/src/Session/Adapters/Database/DatabaseHandler.php
index 913fdcae4..72361a97a 100644
--- a/src/Session/Adapters/Database/DatabaseHandler.php
+++ b/src/Session/Adapters/Database/DatabaseHandler.php
@@ -23,14 +23,10 @@
*/
class DatabaseHandler implements SessionHandlerInterface
{
- /**
- * @var DbalInterface
- */
private DbalInterface $sessionModel;
/**
* DatabaseHandler constructor.
- * @param DbalInterface $sessionModel
*/
public function __construct(DbalInterface $sessionModel)
{
diff --git a/src/Session/Adapters/Database/DatabaseSessionAdapter.php b/src/Session/Adapters/Database/DatabaseSessionAdapter.php
index 1698f567c..6defdd5d0 100644
--- a/src/Session/Adapters/Database/DatabaseSessionAdapter.php
+++ b/src/Session/Adapters/Database/DatabaseSessionAdapter.php
@@ -40,12 +40,10 @@ class DatabaseSessionAdapter implements SessionStorageInterface
/**
* Session storage
- * @var array $storage
*/
private static array $storage = [];
/**
- * @param array|null $params
* @throws SessionException|ModelException
*/
public function __construct(?array $params = null)
@@ -54,8 +52,6 @@ public function __construct(?array $params = null)
}
/**
- * @param array|null $params
- * @return void
* @throws SessionException|ModelException
*/
protected function initializeSession(?array $params = null): void
diff --git a/src/Session/Adapters/Native/NativeSessionAdapter.php b/src/Session/Adapters/Native/NativeSessionAdapter.php
index c49ddb2d7..c3bf703d3 100644
--- a/src/Session/Adapters/Native/NativeSessionAdapter.php
+++ b/src/Session/Adapters/Native/NativeSessionAdapter.php
@@ -38,12 +38,10 @@ class NativeSessionAdapter implements SessionStorageInterface
/**
* Session storage
- * @var array $storage
*/
private static array $storage = [];
/**
- * @param array|null $params
* @throws SessionException
*/
public function __construct(?array $params = null)
@@ -52,8 +50,6 @@ public function __construct(?array $params = null)
}
/**
- * @param array|null $params
- * @return void
* @throws SessionException
*/
protected function initializeSession(?array $params = null): void
diff --git a/src/Session/Contracts/SessionStorageInterface.php b/src/Session/Contracts/SessionStorageInterface.php
index 74ecba340..d968ee4d0 100644
--- a/src/Session/Contracts/SessionStorageInterface.php
+++ b/src/Session/Contracts/SessionStorageInterface.php
@@ -24,27 +24,23 @@ interface SessionStorageInterface extends StorageInterface
{
/**
* Gets flash value by given key
- * @param string $key
* @return mixed|string|null
*/
public function getFlash(string $key);
/**
* Sets flash value by given key
- * @param string $key
* @param mixed $value
*/
public function setFlash(string $key, $value);
/**
* Gets the session ID
- * @return string|null
*/
public function getId(): ?string;
/**
* Update the current session id with a newly generated one
- * @return bool
*/
public function regenerateId(): bool;
}
diff --git a/src/Session/Exceptions/SessionException.php b/src/Session/Exceptions/SessionException.php
index 4e6324f94..29bf98524 100644
--- a/src/Session/Exceptions/SessionException.php
+++ b/src/Session/Exceptions/SessionException.php
@@ -25,9 +25,6 @@
*/
class SessionException extends BaseException
{
- /**
- * @return SessionException
- */
public static function sessionNotStarted(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function sessionNotStarted(): self
);
}
- /**
- * @return SessionException
- */
public static function sessionNotDestroyed(): self
{
return new self(
diff --git a/src/Session/Factories/SessionFactory.php b/src/Session/Factories/SessionFactory.php
index d7d3e4b5b..499aed484 100644
--- a/src/Session/Factories/SessionFactory.php
+++ b/src/Session/Factories/SessionFactory.php
@@ -44,8 +44,6 @@ class SessionFactory
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return Session
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -68,19 +66,12 @@ public static function get(?string $adapter = null): Session
return self::$instances[$adapter];
}
- /**
- * @param string $adapterClass
- * @param string $adapter
- * @return Session
- */
private static function createInstance(string $adapterClass, string $adapter): Session
{
return new Session(new $adapterClass(config()->get('session.' . $adapter)));
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
diff --git a/src/Session/Helpers/session.php b/src/Session/Helpers/session.php
index def03ad0f..d1318931d 100644
--- a/src/Session/Helpers/session.php
+++ b/src/Session/Helpers/session.php
@@ -19,8 +19,6 @@
use Quantum\Session\Session;
/**
- * @param string|null $adapter
- * @return Session
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Session/Session.php b/src/Session/Session.php
index 5e17e9c40..d48bcdb1f 100644
--- a/src/Session/Session.php
+++ b/src/Session/Session.php
@@ -46,25 +46,17 @@ class Session
private SessionStorageInterface $adapter;
- /**
- * @param SessionStorageInterface $adapter
- */
public function __construct(SessionStorageInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return SessionStorageInterface
- */
public function getAdapter(): SessionStorageInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Storage/Adapters/Dropbox/DropboxApp.php b/src/Storage/Adapters/Dropbox/DropboxApp.php
index 2765d6b07..761abe752 100644
--- a/src/Storage/Adapters/Dropbox/DropboxApp.php
+++ b/src/Storage/Adapters/Dropbox/DropboxApp.php
@@ -103,32 +103,16 @@ class DropboxApp implements CloudAppInterface
*/
public const INVALID_TOKEN_ERROR_CODE = 401;
- /**
- * @var HttpClient
- */
private HttpClient $httpClient;
- /**
- * @var string
- */
private string $appKey;
- /**
- * @var string
- */
private string $appSecret;
- /**
- * @var TokenServiceInterface
- */
private TokenServiceInterface $tokenService;
/**
* DropboxApp constructor
- * @param string $appKey
- * @param string $appSecret
- * @param TokenServiceInterface $tokenService
- * @param HttpClient $httpClient
*/
public function __construct(string $appKey, string $appSecret, TokenServiceInterface $tokenService, HttpClient $httpClient)
{
@@ -140,9 +124,6 @@ public function __construct(string $appKey, string $appSecret, TokenServiceInter
/**
* Gets the auth URL
- * @param string $redirectUrl
- * @param string $tokenAccessType
- * @return string
* @throws BaseException
* @throws CryptorException
* @throws DatabaseException
@@ -162,9 +143,6 @@ public function getAuthUrl(string $redirectUrl, string $tokenAccessType = 'offli
/**
* Fetch tokens
- * @param string $code
- * @param string $redirectUrl
- * @return object|null
* @throws BaseException
* @throws HttpException
* @throws LangException
@@ -190,8 +168,6 @@ public function fetchTokens(string $code, string $redirectUrl): ?object
/**
* Fetches the access token by refresh token
- * @param string $refreshToken
- * @return string
* @throws BaseException
* @throws HttpException
* @throws LangException
@@ -216,8 +192,6 @@ private function fetchAccessTokenByRefreshToken(string $refreshToken): string
/**
* Sends rpc request
- * @param string $endpoint
- * @param array|null $params
* @return mixed|null
* @throws Exception
*/
@@ -233,9 +207,6 @@ public function rpcRequest(string $endpoint, ?array $params = [])
/**
* Sends content request
- * @param string $endpoint
- * @param array $params
- * @param string $content
* @return mixed|null
* @throws Exception
*/
@@ -252,8 +223,6 @@ public function contentRequest(string $endpoint, array $params, string $content
/**
* Gets the normalized path
- * @param string $name
- * @return array
*/
public function path(string $name): array
{
@@ -262,9 +231,6 @@ public function path(string $name): array
/**
* Checks if the access token need refresh
- * @param int $code
- * @param object|null $message
- * @return bool
*/
private function accessTokenNeedsRefresh(int $code, ?object $message = null): bool
{
diff --git a/src/Storage/Adapters/Dropbox/DropboxFileSystemAdapter.php b/src/Storage/Adapters/Dropbox/DropboxFileSystemAdapter.php
index 02d66dc45..131eeaac2 100644
--- a/src/Storage/Adapters/Dropbox/DropboxFileSystemAdapter.php
+++ b/src/Storage/Adapters/Dropbox/DropboxFileSystemAdapter.php
@@ -25,9 +25,6 @@ class DropboxFileSystemAdapter implements FilesystemAdapterInterface
{
private DropboxApp $dropboxApp;
- /**
- * @param DropboxApp $dropboxApp
- */
public function __construct(DropboxApp $dropboxApp)
{
$this->dropboxApp = $dropboxApp;
diff --git a/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php b/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php
index c59cd473d..f6f0e173f 100644
--- a/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php
+++ b/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php
@@ -71,32 +71,16 @@ class GoogleDriveApp implements CloudAppInterface
*/
public const INVALID_TOKEN_ERROR_CODE = 401;
- /**
- * @var HttpClient
- */
private HttpClient $httpClient;
- /**
- * @var string
- */
private string $appKey;
- /**
- * @var string
- */
private string $appSecret;
- /**
- * @var TokenServiceInterface
- */
private TokenServiceInterface $tokenService;
/**
* GoogleDriveApp constructor
- * @param string $appKey
- * @param string $appSecret
- * @param TokenServiceInterface $tokenService
- * @param HttpClient $httpClient
*/
public function __construct(string $appKey, string $appSecret, TokenServiceInterface $tokenService, HttpClient $httpClient)
{
@@ -108,9 +92,6 @@ public function __construct(string $appKey, string $appSecret, TokenServiceInter
/**
* Gets Auth URL
- * @param string $redirectUrl
- * @param string $accessType
- * @return string
* @throws BaseException
* @throws CryptorException
* @throws DatabaseException
@@ -131,9 +112,6 @@ public function getAuthUrl(string $redirectUrl, string $accessType = 'offline'):
/**
* Fetch tokens
- * @param string $code
- * @param string $redirectUrl
- * @return object|null
* @throws Exception
*/
public function fetchTokens(string $code, string $redirectUrl = ''): ?object
@@ -155,8 +133,6 @@ public function fetchTokens(string $code, string $redirectUrl = ''): ?object
/**
* Fetches the access token by refresh token
- * @param string $refreshToken
- * @return string
* @throws Exception
*/
private function fetchAccessTokenByRefreshToken(string $refreshToken): string
@@ -177,10 +153,7 @@ private function fetchAccessTokenByRefreshToken(string $refreshToken): string
/**
* Sends rpc request
- * @param string $url
* @param mixed $params
- * @param string $method
- * @param string $contentType
* @return mixed|null
* @throws Exception
*/
@@ -199,9 +172,6 @@ public function rpcRequest(string $url, $params = [], string $method = 'POST', s
/**
* Gets file information
- * @param string $fileId
- * @param bool $media
- * @param array $params
* @return mixed|null
* @throws Exception
*/
@@ -213,11 +183,8 @@ public function getFileInfo(string $fileId, bool $media = false, array $params =
/**
* Checks if the access token need refresh
- * @param int $code
- * @param object|null $message
- * @return bool
*/
- private function accessTokenNeedsRefresh(int $code, ?object $message = null): bool
+ private function accessTokenNeedsRefresh(int $code): bool
{
return $code === self::INVALID_TOKEN_ERROR_CODE;
}
diff --git a/src/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapter.php b/src/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapter.php
index 1c9d3914c..7f7fe3b75 100644
--- a/src/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapter.php
+++ b/src/Storage/Adapters/GoogleDrive/GoogleDriveFileSystemAdapter.php
@@ -25,9 +25,6 @@ class GoogleDriveFileSystemAdapter implements FilesystemAdapterInterface
{
private GoogleDriveApp $googleDriveApp;
- /**
- * @param GoogleDriveApp $googleDriveApp
- */
public function __construct(GoogleDriveApp $googleDriveApp)
{
$this->googleDriveApp = $googleDriveApp;
diff --git a/src/Storage/Adapters/Local/LocalFileSystemAdapter.php b/src/Storage/Adapters/Local/LocalFileSystemAdapter.php
index 0842037c1..4c0c0b207 100644
--- a/src/Storage/Adapters/Local/LocalFileSystemAdapter.php
+++ b/src/Storage/Adapters/Local/LocalFileSystemAdapter.php
@@ -24,8 +24,6 @@
class LocalFileSystemAdapter implements LocalFilesystemAdapterInterface
{
/**
- * @param string $dirname
- * @param string|null $parentId
* @inheritDoc
*/
public function makeDirectory(string $dirname, ?string $parentId = null): bool
@@ -55,7 +53,6 @@ public function get(string $filename)
/**
* Reads and returns the content of a file as JSON.
- * @param string $filename
* @return false|mixed
*/
public function getJson(string $filename)
@@ -72,9 +69,6 @@ public function getJson(string $filename)
}
/**
- * @param string $filename
- * @param string $content
- * @param string|null $parentId
* @inheritDoc
*/
public function put(string $filename, string $content, ?string $parentId = null)
@@ -222,7 +216,7 @@ public function getLines(string $filename, int $offset = 0, ?int $length = null)
*/
public function fileNameWithExtension(string $path): string
{
- return (string) pathinfo($path, PATHINFO_BASENAME);
+ return pathinfo($path, PATHINFO_BASENAME);
}
/**
@@ -230,7 +224,7 @@ public function fileNameWithExtension(string $path): string
*/
public function fileName(string $path): string
{
- return (string) pathinfo($path, PATHINFO_FILENAME);
+ return pathinfo($path, PATHINFO_FILENAME);
}
/**
@@ -238,7 +232,7 @@ public function fileName(string $path): string
*/
public function extension(string $path): string
{
- return (string) pathinfo($path, PATHINFO_EXTENSION);
+ return pathinfo($path, PATHINFO_EXTENSION);
}
/**
diff --git a/src/Storage/Contracts/CloudAppInterface.php b/src/Storage/Contracts/CloudAppInterface.php
index 5911d33b1..03342aabd 100644
--- a/src/Storage/Contracts/CloudAppInterface.php
+++ b/src/Storage/Contracts/CloudAppInterface.php
@@ -22,12 +22,6 @@
*/
interface CloudAppInterface
{
- /**
- * @param string $appKey
- * @param string $appSecret
- * @param TokenServiceInterface $tokenService
- * @param HttpClient $httpClient
- */
public function __construct(
string $appKey,
string $appSecret,
@@ -37,10 +31,7 @@ public function __construct(
/**
* Send request
- * @param string $url
* @param array|string|null $data
- * @param array $headers
- * @param string $method
* @return mixed
*/
public function sendRequest(
diff --git a/src/Storage/Contracts/FilesystemAdapterInterface.php b/src/Storage/Contracts/FilesystemAdapterInterface.php
index 69e004482..d900d0f26 100644
--- a/src/Storage/Contracts/FilesystemAdapterInterface.php
+++ b/src/Storage/Contracts/FilesystemAdapterInterface.php
@@ -22,104 +22,76 @@ interface FilesystemAdapterInterface
{
/**
* Makes a new directory
- * @param string $dirname
- * @param string|null $parentId
- * @return bool
*/
public function makeDirectory(string $dirname, ?string $parentId = null): bool;
/**
* Removes the directory
- * @param string $dirname
- * @return bool
*/
public function removeDirectory(string $dirname): bool;
/**
* Gets the file content
- * @param string $filename
* @return string|false
*/
public function get(string $filename);
/**
* Puts the content into the file
- * @param string $filename
- * @param string $content
- * @param string|null $parentId
* @return int|false
*/
public function put(string $filename, string $content, ?string $parentId = null);
/**
* Appends the content at the end of the file
- * @param string $filename
- * @param string $content
* @return int|false
*/
public function append(string $filename, string $content);
/**
* Renames the file
- * @param string $oldName
- * @param string $newName
- * @return bool
*/
public function rename(string $oldName, string $newName): bool;
/**
* Copy the file to destination
- * @param string $source
- * @param string $dest
- * @return bool
*/
public function copy(string $source, string $dest): bool;
/**
* File Exists
- * @param string $filename
- * @return bool
*/
public function exists(string $filename): bool;
/**
* Gets the file size
- * @param string $filename
* @return int|false
*/
public function size(string $filename);
/**
* Gets file modification time
- * @param string $filename
* @return int|false
*/
public function lastModified(string $filename);
/**
* Removes the file
- * @param string $filename
- * @return bool
*/
public function remove(string $filename): bool;
/**
* Is File
- * @param string $filename
- * @return bool
*/
public function isFile(string $filename): bool;
/**
* Is Directory
- * @param string $dirname
- * @return bool
*/
public function isDirectory(string $dirname): bool;
/**
* Lists the files inside the directory
- * @param string $dirname
* @return array|bool
*/
public function listDirectory(string $dirname);
diff --git a/src/Storage/Contracts/LocalFilesystemAdapterInterface.php b/src/Storage/Contracts/LocalFilesystemAdapterInterface.php
index 800a0b0c7..091808415 100644
--- a/src/Storage/Contracts/LocalFilesystemAdapterInterface.php
+++ b/src/Storage/Contracts/LocalFilesystemAdapterInterface.php
@@ -22,68 +22,48 @@ interface LocalFilesystemAdapterInterface extends FilesystemAdapterInterface
{
/**
* Find path names matching a pattern
- * @param string $pattern
- * @param int $flags
* @return array|false
*/
public function glob(string $pattern, int $flags = 0);
/**
* Is Readable
- * @param string $filename
- * @return bool
*/
public function isReadable(string $filename): bool;
/**
* Is Writable
- * @param string $filename
- * @return bool
*/
public function isWritable(string $filename): bool;
/**
* Gets the content between given lines
- * @param string $filename
- * @param int $offset
- * @param int|null $length
- * @return array
*/
public function getLines(string $filename, int $offset = 0, ?int $length = null): array;
/**
* Gets the filename with extension
- * @param string $path
- * @return string
*/
public function fileNameWithExtension(string $path): string;
/**
* Gets the file name
- * @param string $path
- * @return string
*/
public function fileName(string $path): string;
/**
* Gets the file extension
- * @param string $path
- * @return string
*/
public function extension(string $path): string;
/**
* Includes the required file
- * @param string $file
- * @param bool $once
* @return mixed
*/
public function require(string $file, bool $once = false);
/**
* Includes a file
- * @param string $file
- * @param bool $once
* @return mixed
*/
public function include(string $file, bool $once = false);
diff --git a/src/Storage/Contracts/TokenServiceInterface.php b/src/Storage/Contracts/TokenServiceInterface.php
index ecebb79a4..bb13ad96b 100644
--- a/src/Storage/Contracts/TokenServiceInterface.php
+++ b/src/Storage/Contracts/TokenServiceInterface.php
@@ -20,21 +20,10 @@
*/
interface TokenServiceInterface
{
- /**
- * @return string
- */
public function getAccessToken(): string;
- /**
- * @return string
- */
public function getRefreshToken(): string;
- /**
- * @param string $accessToken
- * @param string|null $refreshToken
- * @return bool
- */
public function saveTokens(string $accessToken, ?string $refreshToken = null): bool;
}
diff --git a/src/Storage/Exceptions/FileSystemException.php b/src/Storage/Exceptions/FileSystemException.php
index 7eee0ef2d..bc3aefb83 100644
--- a/src/Storage/Exceptions/FileSystemException.php
+++ b/src/Storage/Exceptions/FileSystemException.php
@@ -25,10 +25,6 @@
*/
class FileSystemException extends BaseException
{
- /**
- * @param string $name
- * @return FileSystemException
- */
public static function directoryNotExists(string $name): self
{
return new self(
@@ -37,10 +33,6 @@ public static function directoryNotExists(string $name): self
);
}
- /**
- * @param string $name
- * @return FileSystemException
- */
public static function directoryNotWritable(string $name): self
{
return new self(
@@ -49,10 +41,6 @@ public static function directoryNotWritable(string $name): self
);
}
- /**
- * @param string $path
- * @return FileSystemException
- */
public static function fileAlreadyExists(string $path): self
{
return new self(
diff --git a/src/Storage/Exceptions/FileUploadException.php b/src/Storage/Exceptions/FileUploadException.php
index fc15391f7..dc93d7ba1 100644
--- a/src/Storage/Exceptions/FileUploadException.php
+++ b/src/Storage/Exceptions/FileUploadException.php
@@ -26,10 +26,6 @@
*/
class FileUploadException extends BaseException
{
- /**
- * @param string $name
- * @return FileUploadException
- */
public static function fileTypeNotAllowed(string $name): self
{
return new self(
@@ -38,10 +34,6 @@ public static function fileTypeNotAllowed(string $name): self
);
}
- /**
- * @param string $name
- * @return FileUploadException
- */
public static function incorrectMimeTypesConfig(string $name): self
{
return new self(
diff --git a/src/Storage/Factories/FileSystemFactory.php b/src/Storage/Factories/FileSystemFactory.php
index d8eecee5d..cec9b531c 100644
--- a/src/Storage/Factories/FileSystemFactory.php
+++ b/src/Storage/Factories/FileSystemFactory.php
@@ -55,14 +55,9 @@ class FileSystemFactory
FileSystem::GDRIVE => GoogleDriveApp::class,
];
- /**
- * @var array
- */
private static array $instances = [];
/**
- * @param string|null $adapter
- * @return FileSystem
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -86,9 +81,6 @@ public static function get(?string $adapter = null): FileSystem
}
/**
- * @param string $adapterClass
- * @param string $adapter
- * @return FileSystem
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -102,8 +94,6 @@ private static function createInstance(string $adapterClass, string $adapter): F
}
/**
- * @param string $adapter
- * @return string
* @throws BaseException
*/
private static function getAdapterClass(string $adapter): string
@@ -116,8 +106,6 @@ private static function getAdapterClass(string $adapter): string
}
/**
- * @param string $adapter
- * @return CloudAppInterface|null
* @throws BaseException
* @throws DiException
* @throws ReflectionException
@@ -140,8 +128,6 @@ private static function createCloudApp(string $adapter): ?CloudAppInterface
}
/**
- * @param string $adapter
- * @return TokenServiceInterface
* @throws BaseException
* @throws DiException
* @throws ReflectionException
diff --git a/src/Storage/FileSystem.php b/src/Storage/FileSystem.php
index 5f35dabc5..5101705c4 100644
--- a/src/Storage/FileSystem.php
+++ b/src/Storage/FileSystem.php
@@ -61,30 +61,19 @@ class FileSystem
*/
public const GDRIVE = 'gdrive';
- /**
- * @var FilesystemAdapterInterface
- */
private FilesystemAdapterInterface $adapter;
- /**
- * @param FilesystemAdapterInterface $adapter
- */
public function __construct(FilesystemAdapterInterface $adapter)
{
$this->adapter = $adapter;
}
- /**
- * @return FilesystemAdapterInterface
- */
public function getAdapter(): FilesystemAdapterInterface
{
return $this->adapter;
}
/**
- * @param string $method
- * @param array|null $arguments
* @return mixed
* @throws BaseException
*/
diff --git a/src/Storage/Helpers/fs.php b/src/Storage/Helpers/fs.php
index 9222c5687..e7d602b95 100644
--- a/src/Storage/Helpers/fs.php
+++ b/src/Storage/Helpers/fs.php
@@ -20,8 +20,6 @@
/**
* Gets the FileSystem handler
- * @param string|null $adapter
- * @return FileSystem
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Storage/Traits/CloudAppTrait.php b/src/Storage/Traits/CloudAppTrait.php
index 857f9b166..2610a6104 100644
--- a/src/Storage/Traits/CloudAppTrait.php
+++ b/src/Storage/Traits/CloudAppTrait.php
@@ -45,7 +45,7 @@ public function sendRequest(string $uri, $data = null, array $headers = [], stri
if ($errors) {
$code = $errors['code'];
- if ($this->accessTokenNeedsRefresh($code, $responseBody)) {
+ if ($this->accessTokenNeedsRefresh($code)) {
$prevUrl = $this->httpClient->url();
$prevData = $this->httpClient->getData();
$prevHeaders = $this->httpClient->getRequestHeaders();
diff --git a/src/Storage/UploadedFile.php b/src/Storage/UploadedFile.php
index f0919719b..eb821837e 100644
--- a/src/Storage/UploadedFile.php
+++ b/src/Storage/UploadedFile.php
@@ -40,55 +40,46 @@ class UploadedFile extends SplFileInfo
{
/**
* Local File System
- * @var LocalFilesystemAdapterInterface
*/
protected LocalFilesystemAdapterInterface $localFileSystem;
/**
* Remove File System
- * @var FilesystemAdapterInterface|null
*/
protected ?FilesystemAdapterInterface $remoteFileSystem = null;
/**
* Original file name provided by client
- * @var string|null
*/
protected ?string $originalName = null;
/**
* File name (without extension)
- * @var string|null
*/
protected ?string $name = null;
/**
* File extension
- * @var string|null
*/
protected ?string $extension = null;
/**
* File mime type
- * @var string|null
*/
protected ?string $mimetype = null;
/**
* ImageResize function name
- * @var string|null
*/
protected ?string $imageModifierFuncName = null;
/**
* ImageResize function arguments
- * @var array
*/
protected array $params = [];
/**
* Upload error code messages
- * @var array
*/
protected array $errorMessages = [
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
@@ -102,7 +93,6 @@ class UploadedFile extends SplFileInfo
/**
* Allowed mime types => allowed extensions map
- * @var array
*/
protected array $allowedMimeTypes = [
'image/jpeg' => ['jpg', 'jpeg'],
@@ -112,12 +102,10 @@ class UploadedFile extends SplFileInfo
/**
* Upload error code
- * @var int
*/
protected int $errorCode;
/**
- * @param array $meta
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -146,9 +134,6 @@ public function __construct(array $meta)
/**
* Sets the allowed mime types => extensions map
- * @param array $allowedMimeTypes
- * @param bool $merge
- * @return $this
*/
public function setAllowedMimeTypes(array $allowedMimeTypes, bool $merge = true): UploadedFile
{
@@ -158,7 +143,6 @@ public function setAllowedMimeTypes(array $allowedMimeTypes, bool $merge = true)
/**
* Get name
- * @return string
*/
public function getName(): string
{
@@ -171,8 +155,6 @@ public function getName(): string
/**
* Set name (without extension)
- * @param string $name
- * @return $this
*/
public function setName(string $name): UploadedFile
{
@@ -182,8 +164,6 @@ public function setName(string $name): UploadedFile
/**
* Sets the remote file system adapter
- * @param FilesystemAdapterInterface $remoteFileSystem
- * @return $this
*/
public function setRemoteFileSystem(FilesystemAdapterInterface $remoteFileSystem): UploadedFile
{
@@ -193,7 +173,6 @@ public function setRemoteFileSystem(FilesystemAdapterInterface $remoteFileSystem
/**
* Gets the remote file system adapter
- * @return FilesystemAdapterInterface|null
*/
public function getRemoteFileSystem(): ?FilesystemAdapterInterface
{
@@ -202,7 +181,6 @@ public function getRemoteFileSystem(): ?FilesystemAdapterInterface
/**
* Get file extension (without leading dot)
- * @return string
*/
public function getExtension(): string
{
@@ -215,7 +193,6 @@ public function getExtension(): string
/**
* Get file name with extension
- * @return string
*/
public function getNameWithExtension(): string
{
@@ -224,7 +201,6 @@ public function getNameWithExtension(): string
/**
* Get mime type
- * @return string
*/
public function getMimeType(): string
{
@@ -241,7 +217,6 @@ public function getMimeType(): string
/**
* Get md5
- * @return string
*/
public function getMd5(): string
{
@@ -250,7 +225,6 @@ public function getMd5(): string
/**
* Get image dimensions
- * @return array
* @throws FileUploadException
*/
public function getDimensions(): array
@@ -269,9 +243,6 @@ public function getDimensions(): array
/**
* Save the uploaded file
- * @param string $dest
- * @param bool $overwrite
- * @return bool
* @throws BaseException
* @throws FileSystemException
* @throws FileUploadException
@@ -321,9 +292,6 @@ public function save(string $dest, bool $overwrite = false): bool
/**
* Sets modification function on image
- * @param string $funcName
- * @param array $params
- * @return $this
* @throws BaseException
* @throws FileUploadException
* @throws LangException
@@ -346,7 +314,6 @@ public function modify(string $funcName, array $params): UploadedFile
/**
* Gets the error code
- * @return int
*/
public function getErrorCode(): int
{
@@ -355,7 +322,6 @@ public function getErrorCode(): int
/**
* Gets the error message from code
- * @return string
*/
public function getErrorMessage(): string
{
@@ -364,7 +330,6 @@ public function getErrorMessage(): string
/**
* Tells whether the file was uploaded
- * @return bool
*/
public function isUploaded(): bool
{
@@ -374,7 +339,6 @@ public function isUploaded(): bool
/**
* Checks if the given file is image
* @param $filePath
- * @return bool
*/
public function isImage($filePath): bool
{
@@ -383,8 +347,6 @@ public function isImage($filePath): bool
/**
* Moves an uploaded file to a new location
- * @param string $filePath
- * @return bool
*/
protected function moveUploadedFile(string $filePath): bool
{
@@ -399,9 +361,6 @@ protected function moveUploadedFile(string $filePath): bool
/**
* Validates upload against allowed mime types => extensions map
- * @param string $extension
- * @param string $mimeType
- * @return bool
*/
protected function allowed(string $extension, string $mimeType): bool
{
@@ -446,9 +405,6 @@ protected function loadAllowedMimeTypesFromConfig(): void
/**
* Sets the allowed mime types => extensions map
- * @param array $allowedMimeTypes
- * @param bool $merge
- * @return void
*/
protected function setAllowedMimeTypesMap(array $allowedMimeTypes, bool $merge = true): void
{
diff --git a/src/Tracer/ErrorHandler.php b/src/Tracer/ErrorHandler.php
index 05f545029..b52e93107 100644
--- a/src/Tracer/ErrorHandler.php
+++ b/src/Tracer/ErrorHandler.php
@@ -60,14 +60,8 @@ class ErrorHandler
E_RECOVERABLE_ERROR => 'error',
];
- /**
- * @var Logger|null
- */
private ?Logger $logger = null;
- /**
- * @var ErrorHandler|null
- */
private static ?ErrorHandler $instance = null;
private function __construct()
@@ -80,9 +74,6 @@ private function __clone()
// Prevent cloning
}
- /**
- * @return ErrorHandler
- */
public static function getInstance(): ErrorHandler
{
if (self::$instance === null) {
@@ -92,9 +83,6 @@ public static function getInstance(): ErrorHandler
return self::$instance;
}
- /**
- * @param Logger $logger
- */
public function setup(Logger $logger): void
{
$this->logger = $logger;
@@ -104,11 +92,6 @@ public function setup(Logger $logger): void
}
/**
- * @param int $severity
- * @param string $message
- * @param string $file
- * @param int $line
- * @return bool
* @throws ErrorException
*/
public function handleError(int $severity, string $message, string $file, int $line): bool
@@ -121,8 +104,6 @@ public function handleError(int $severity, string $message, string $file, int $l
}
/**
- * @param Throwable $throwable
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -139,10 +120,6 @@ public function handleException(Throwable $throwable): void
}
}
- /**
- * @param Throwable $throwable
- * @return void
- */
private function handleCliException(Throwable $throwable): void
{
$output = new ConsoleOutput();
@@ -150,8 +127,6 @@ private function handleCliException(Throwable $throwable): void
}
/**
- * @param Throwable $throwable
- * @return void
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -178,11 +153,6 @@ private function handleWebException(Throwable $throwable): void
Response::send();
}
- /**
- * @param Throwable $e
- * @param string $errorType
- * @return void
- */
private function logError(Throwable $e, string $errorType): void
{
$logMethod = method_exists($this->logger, $errorType) ? $errorType : 'error';
@@ -192,8 +162,6 @@ private function logError(Throwable $e, string $errorType): void
/**
* Composes the stack trace
- * @param Throwable $e
- * @return array
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -224,10 +192,6 @@ private function composeStackTrace(Throwable $e): array
/**
* Gets the source code where the error happens
- * @param string $filename
- * @param int $lineNumber
- * @param string $className
- * @return string
* @throws BaseException
* @throws ConfigException
* @throws DiException
@@ -253,18 +217,11 @@ private function getSourceCode(string $filename, int $lineNumber, string $classN
$code .= $this->formatLineItem($currentLineNumber, $line, $lineNumber, $className);
}
- $code .= '';
-
- return $code;
+ return $code . '';
}
/**
* Formats the line item
- * @param int $currentLineNumber
- * @param string $line
- * @param int $lineNumber
- * @param string $className
- * @return string
*/
private function formatLineItem(int $currentLineNumber, string $line, int $lineNumber, string $className): string
{
@@ -281,8 +238,6 @@ private function formatLineItem(int $currentLineNumber, string $line, int $lineN
/**
* Gets the error type based on the exception class
- * @param Throwable $e
- * @return string
*/
private function getErrorType(Throwable $e): string
{
diff --git a/src/Transformer/Helpers/transformer.php b/src/Transformer/Helpers/transformer.php
index 1f3097412..af2018df5 100644
--- a/src/Transformer/Helpers/transformer.php
+++ b/src/Transformer/Helpers/transformer.php
@@ -17,9 +17,6 @@
/**
* Transforms the data by given transformer signature
- * @param array $data
- * @param TransformerInterface $transformer
- * @return array
*/
function transform(array $data, TransformerInterface $transformer): array
{
diff --git a/src/Transformer/Transformer.php b/src/Transformer/Transformer.php
index ca376de44..b9acac93b 100644
--- a/src/Transformer/Transformer.php
+++ b/src/Transformer/Transformer.php
@@ -24,9 +24,6 @@ class Transformer
{
/**
* Applies the transformer on each item of the array
- * @param array $data
- * @param TransformerInterface $transformer
- * @return array
*/
public static function transform(array $data, TransformerInterface $transformer): array
{
diff --git a/src/Validation/Rule.php b/src/Validation/Rule.php
index 2dfe892c0..84faf4355 100644
--- a/src/Validation/Rule.php
+++ b/src/Validation/Rule.php
@@ -62,8 +62,6 @@
class Rule
{
/**
- * @param string $name
- * @param array $params
* @return array[]
*/
public static function __callStatic(string $name, array $params): array
diff --git a/src/Validation/Traits/File.php b/src/Validation/Traits/File.php
index deb31ac37..0320e7954 100644
--- a/src/Validation/Traits/File.php
+++ b/src/Validation/Traits/File.php
@@ -25,10 +25,6 @@ trait File
{
/**
* Validates file size
- * @param UploadedFile $file
- * @param int $maxSize
- * @param int|null $minSize
- * @return bool
*/
public function fileSize(UploadedFile $file, int $maxSize, ?int $minSize = null): bool
{
@@ -40,9 +36,6 @@ public function fileSize(UploadedFile $file, int $maxSize, ?int $minSize = null)
/**
* Validates file mime type
- * @param UploadedFile $file
- * @param string ...$mimeTypes
- * @return bool
*/
public function fileMimeType(UploadedFile $file, string ...$mimeTypes): bool
{
@@ -51,9 +44,6 @@ public function fileMimeType(UploadedFile $file, string ...$mimeTypes): bool
/**
* Validates file extension
- * @param UploadedFile $file
- * @param string ...$extensions
- * @return bool
*/
public function fileExtension(UploadedFile $file, string ...$extensions): bool
{
@@ -62,10 +52,6 @@ public function fileExtension(UploadedFile $file, string ...$extensions): bool
/**
* Validates image dimensions
- * @param UploadedFile $file
- * @param int|null $width
- * @param int|null $height
- * @return bool
* @throws FileUploadException
*/
public function imageDimensions(UploadedFile $file, ?int $width = null, ?int $height = null): bool
diff --git a/src/Validation/Traits/General.php b/src/Validation/Traits/General.php
index 57f3e27d6..f2f07b074 100644
--- a/src/Validation/Traits/General.php
+++ b/src/Validation/Traits/General.php
@@ -32,8 +32,6 @@ trait General
{
/**
* Checks Field Required
- * @param string $value
- * @return bool
*/
protected function required(string $value): bool
{
@@ -42,8 +40,6 @@ protected function required(string $value): bool
/**
* Checks Email
- * @param string $value
- * @return bool
*/
protected function email(string $value): bool
{
@@ -52,8 +48,6 @@ protected function email(string $value): bool
/**
* Checks for a valid credit card number
- * @param string $value
- * @return bool
*/
protected function creditCard(string $value): bool
{
@@ -86,8 +80,6 @@ protected function creditCard(string $value): bool
/**
* Checks for a valid IBAN
- * @param string $value
- * @return bool
*/
protected function iban(string $value): bool
{
@@ -112,8 +104,6 @@ protected function iban(string $value): bool
/**
* Checks for a valid format human name
- * @param string $value
- * @return bool
*/
protected function name(string $value): bool
{
@@ -122,8 +112,6 @@ protected function name(string $value): bool
/**
* Checks that the provided string is a likely street address.
- * @param string $value
- * @return bool
*/
protected function streetAddress(string $value): bool
{
@@ -136,8 +124,6 @@ protected function streetAddress(string $value): bool
/**
* Validates the phone number // 555-555-5555 , 5555425555, 555 555 5555, 1(519) 555-4444, 1 (519) 555-4422, +1-555-555-5555
- * @param string $value
- * @return bool
*/
protected function phoneNumber(string $value): bool
{
@@ -148,9 +134,6 @@ protected function phoneNumber(string $value): bool
/**
* Determines if the provided input is a valid date
- * @param string $value
- * @param string|null $format
- * @return bool
*/
protected function date(string $value, ?string $format = null): bool
{
@@ -168,9 +151,6 @@ protected function date(string $value, ?string $format = null): bool
/**
* Ensures the value starts with a certain character / set of character
- * @param string $value
- * @param string|null $text
- * @return bool
*/
protected function starts(string $value, ?string $text = null): bool
{
@@ -179,9 +159,6 @@ protected function starts(string $value, ?string $text = null): bool
/**
* Custom regex validator
- * @param string $value
- * @param string $pattern
- * @return bool
*/
protected function regex(string $value, string $pattern): bool
{
@@ -190,8 +167,6 @@ protected function regex(string $value, string $pattern): bool
/**
* Validates JSON string
- * @param string $value
- * @return bool
*/
protected function jsonString(string $value): bool
{
@@ -202,9 +177,6 @@ protected function jsonString(string $value): bool
/**
* Validates same value for both fields
- * @param string $value
- * @param string $otherField
- * @return bool
*/
protected function same(string $value, string $otherField): bool
{
@@ -214,9 +186,6 @@ protected function same(string $value, string $otherField): bool
/**
* Validates uniqueness
* @param $value
- * @param string $className
- * @param string $columnName
- * @return bool
* @throws BaseException
* @throws ModelException
*/
@@ -233,9 +202,6 @@ protected function unique($value, string $className, string $columnName): bool
/**
* Validates record existence
* @param $value
- * @param string $className
- * @param string $columnName
- * @return bool
* @throws BaseException
* @throws ModelException
*/
@@ -251,8 +217,6 @@ protected function exists($value, string $className, string $columnName): bool
/**
* Check Captcha
- * @param string $value
- * @return bool
* @throws BaseException
* @throws ConfigException
* @throws DiException
diff --git a/src/Validation/Traits/Length.php b/src/Validation/Traits/Length.php
index 2a743ba13..b473110e8 100644
--- a/src/Validation/Traits/Length.php
+++ b/src/Validation/Traits/Length.php
@@ -22,9 +22,6 @@ trait Length
{
/**
* Checks the min Length
- * @param string $value
- * @param int $minLength
- * @return bool
*/
protected function minLen(string $value, int $minLength): bool
{
@@ -33,9 +30,6 @@ protected function minLen(string $value, int $minLength): bool
/**
* Checks the max Length
- * @param string $value
- * @param int $maxLength
- * @return bool
*/
protected function maxLen(string $value, int $maxLength): bool
{
@@ -44,9 +38,6 @@ protected function maxLen(string $value, int $maxLength): bool
/**
* Checks the exact length
- * @param string $value
- * @param int $exactLength
- * @return bool
*/
protected function exactLen(string $value, int $exactLength): bool
{
diff --git a/src/Validation/Traits/Lists.php b/src/Validation/Traits/Lists.php
index 2c1fe454c..54fd3eb2e 100644
--- a/src/Validation/Traits/Lists.php
+++ b/src/Validation/Traits/Lists.php
@@ -22,9 +22,6 @@ trait Lists
{
/**
* Validates that the field value is contained within a given string.
- * @param string $value
- * @param string $haystack
- * @return bool
*/
protected function contains(string $value, string $haystack): bool
{
@@ -36,9 +33,6 @@ protected function contains(string $value, string $haystack): bool
/**
* Verifies that a value is contained within the pre-defined value set.
- * @param string $value
- * @param string ...$list
- * @return bool
*/
protected function containsList(string $value, string ...$list): bool
{
@@ -51,9 +45,6 @@ protected function containsList(string $value, string ...$list): bool
/**
* Verifies that a value is not contained within the pre-defined value set.
- * @param string $value
- * @param string ...$list
- * @return bool
*/
protected function doesntContainsList(string $value, string ...$list): bool
{
diff --git a/src/Validation/Traits/Resource.php b/src/Validation/Traits/Resource.php
index 429337b4e..4a002c058 100644
--- a/src/Validation/Traits/Resource.php
+++ b/src/Validation/Traits/Resource.php
@@ -22,8 +22,6 @@ trait Resource
{
/**
* Checks for valid URL or subdomain
- * @param string $value
- * @return bool
*/
protected function url(string $value): bool
{
@@ -32,8 +30,6 @@ protected function url(string $value): bool
/**
* Checks to see if the url exists
- * @param string $value
- * @return bool
*/
protected function urlExists(string $value): bool
{
@@ -56,8 +52,6 @@ protected function urlExists(string $value): bool
/**
* Checks for valid IP address
- * @param string $value
- * @return bool
*/
protected function ip(string $value): bool
{
@@ -66,8 +60,6 @@ protected function ip(string $value): bool
/**
* Checks for valid IPv4 address
- * @param string $value
- * @return bool
*/
protected function ipv4(string $value): bool
{
@@ -76,8 +68,6 @@ protected function ipv4(string $value): bool
/**
* Checks for valid IPv6 address
- * @param string $value
- * @return bool
*/
protected function ipv6(string $value): bool
{
diff --git a/src/Validation/Traits/Type.php b/src/Validation/Traits/Type.php
index 2f9b5d24a..5315183dc 100644
--- a/src/Validation/Traits/Type.php
+++ b/src/Validation/Traits/Type.php
@@ -22,8 +22,6 @@ trait Type
{
/**
* Checks the alpha characters
- * @param string $value
- * @return bool
*/
protected function alpha(string $value): bool
{
@@ -32,8 +30,6 @@ protected function alpha(string $value): bool
/**
* Checks the alpha and numeric characters
- * @param string $value
- * @return bool
*/
protected function alphaNumeric(string $value): bool
{
@@ -42,8 +38,6 @@ protected function alphaNumeric(string $value): bool
/**
* Checks the alpha and dash characters
- * @param string $value
- * @return bool
*/
protected function alphaDash(string $value): bool
{
@@ -52,8 +46,6 @@ protected function alphaDash(string $value): bool
/**
* Checks the alphanumeric and space characters
- * @param string $value
- * @return bool
*/
protected function alphaSpace(string $value): bool
{
@@ -62,8 +54,6 @@ protected function alphaSpace(string $value): bool
/**
* Checks the numeric value
- * @param string $value
- * @return bool
*/
protected function numeric(string $value): bool
{
@@ -72,8 +62,6 @@ protected function numeric(string $value): bool
/**
* Checks the integer value
- * @param string $value
- * @return bool
*/
protected function integer(string $value): bool
{
@@ -82,8 +70,6 @@ protected function integer(string $value): bool
/**
* Checks the float value
- * @param string $value
- * @return bool
*/
protected function float(string $value): bool
{
@@ -93,7 +79,6 @@ protected function float(string $value): bool
/**
* Checks the boolean value
* @param $value
- * @return bool
*/
protected function boolean($value): bool
{
@@ -104,9 +89,7 @@ protected function boolean($value): bool
/**
* Determines if the provided numeric value is lower to a specific value
- * @param string $value
* @param $minValue
- * @return bool
*/
protected function minNumeric(string $value, $minValue): bool
{
@@ -115,9 +98,7 @@ protected function minNumeric(string $value, $minValue): bool
/**
* Determines if the provided numeric value is higher to a specific value
- * @param string $value
* @param $maxValue
- * @return bool
*/
protected function maxNumeric(string $value, $maxValue): bool
{
diff --git a/src/Validation/Validator.php b/src/Validation/Validator.php
index ceda9f7de..c51e63acb 100644
--- a/src/Validation/Validator.php
+++ b/src/Validation/Validator.php
@@ -43,19 +43,16 @@ class Validator
/**
* Rules
- * @var array
*/
private array $rules = [];
/**
* Validation Errors
- * @var array
*/
private array $errors = [];
/**
* Request data
- * @var array
*/
private array $data = [];
@@ -67,7 +64,6 @@ class Validator
/**
* Add rules for a single field
- * @param string $field
* @param array $rules Format: [['ruleName' => param], ...]
*/
public function setRule(string $field, array $rules): void
@@ -92,7 +88,6 @@ public function setRules(array $rules): void
/**
* Update a single rule for a field if exists
- * @param string $field
* @param array $rule Format: ['ruleName' => param]
*/
public function updateRule(string $field, array $rule): void
@@ -104,9 +99,7 @@ public function updateRule(string $field, array $rule): void
/**
* Delete a rule or all rules for a given field
- * @param string $field
* @param string|null $rule Specific rule to delete; if null deletes all rules for field
- * @return void
*/
public function deleteRule(string $field, ?string $rule = null): void
{
@@ -127,7 +120,6 @@ public function deleteRule(string $field, ?string $rule = null): void
/**
* Flush all rules and errors
- * @return void
*/
public function flushRules(): void
{
@@ -137,7 +129,6 @@ public function flushRules(): void
/**
* Validate given data against defined rules
- * @param array $data
* @return bool True if valid, false otherwise
*/
public function isValid(array $data): bool
@@ -184,7 +175,6 @@ public function isValid(array $data): bool
* Add a custom validation rule
* @param string $rule Rule name
* @param Closure $function Callback function with signature function($value, $param): bool
- * @return void
*/
public function addRule(string $rule, Closure $function): void
{
@@ -197,7 +187,6 @@ public function addRule(string $rule, Closure $function): void
/**
* Gets validation errors with translations
- * @return array
* @throws ConfigException
* @throws DiException
* @throws LangException
@@ -227,10 +216,7 @@ public function getErrors(): array
/**
* Adds an error for a field and rule
- * @param string $field
- * @param string $rule
* @param mixed|null $param
- * @return void
*/
protected function addError(string $field, string $rule, $param = null): void
{
@@ -243,7 +229,6 @@ protected function addError(string $field, string $rule, $param = null): void
/**
* Flush all errors
- * @return void
*/
public function flushErrors(): void
{
@@ -252,10 +237,8 @@ public function flushErrors(): void
/**
* Executes user defined rule
- * @param string $rule
* @param $value
* @param mixed ...$params
- * @return bool
*/
protected function executeCustomRule(string $rule, $value, ...$params): bool
{
@@ -269,8 +252,6 @@ protected function executeCustomRule(string $rule, $value, ...$params): bool
}
/**
- * @param string $field
- * @param string $ruleName
* @param $ruleParam
*/
private function setOrUpdateRule(string $field, string $ruleName, $ruleParam): void
diff --git a/src/View/Exceptions/ViewException.php b/src/View/Exceptions/ViewException.php
index a516b78cc..6c52eeea2 100644
--- a/src/View/Exceptions/ViewException.php
+++ b/src/View/Exceptions/ViewException.php
@@ -25,9 +25,6 @@
*/
class ViewException extends BaseException
{
- /**
- * @return ViewException
- */
public static function noLayoutSet(): self
{
return new self(
@@ -36,9 +33,6 @@ public static function noLayoutSet(): self
);
}
- /**
- * @return ViewException
- */
public static function viewNotRendered(): self
{
return new self(
diff --git a/src/View/Factories/ViewFactory.php b/src/View/Factories/ViewFactory.php
index 9c080ede5..e9855afb4 100644
--- a/src/View/Factories/ViewFactory.php
+++ b/src/View/Factories/ViewFactory.php
@@ -34,13 +34,11 @@ class ViewFactory
{
/**
* Instance of QtView
- * @var QtView|null
*/
private static ?QtView $instance = null;
/**
* QtView instance
- * @return QtView
* @throws DebugBarException
* @throws DiException
* @throws BaseException
diff --git a/src/View/Helpers/view.php b/src/View/Helpers/view.php
index dbb1ef00c..04a953f87 100644
--- a/src/View/Helpers/view.php
+++ b/src/View/Helpers/view.php
@@ -12,6 +12,7 @@
* @since 3.0.0
*/
+use League\CommonMark\Exception\CommonMarkException;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\View\Exceptions\ViewException;
use League\CommonMark\CommonMarkConverter;
@@ -24,7 +25,6 @@
/**
* Rendered view
- * @return string|null
* @throws BaseException
* @throws ConfigException
* @throws DebugBarException
@@ -39,9 +39,6 @@ function view(): ?string
/**
* Rendered partial
- * @param string $partial
- * @param array $args
- * @return string
* @throws BaseException
* @throws ConfigException
* @throws DebugBarException
@@ -55,7 +52,6 @@ function partial(string $partial, array $args = []): string
/**
* Gets the param passed to view
- * @param string $key
* @return mixed|null
* @throws BaseException
* @throws ConfigException
@@ -71,7 +67,6 @@ function view_param(string $key)
/**
* Creates a raw param
* @param $value
- * @return RawParam
*/
function raw_param($value): RawParam
{
@@ -80,7 +75,6 @@ function raw_param($value): RawParam
/**
* Rendered debug bar
- * @return string|null
* @throws DebugBarException
*/
function debugbar(): ?string
@@ -95,9 +89,7 @@ function debugbar(): ?string
}
/**
- * @param string $content
- * @param bool $sanitize
- * @return string
+ * @throws CommonMarkException
*/
function markdown_to_html(string $content, bool $sanitize = false): string
{
@@ -111,7 +103,7 @@ function markdown_to_html(string $content, bool $sanitize = false): string
$html = $converter->convertToHtml($content);
- if ($purifier instanceof \HTMLPurifier) {
+ if ($purifier instanceof HTMLPurifier) {
return $purifier->purify($html);
}
diff --git a/src/View/QtView.php b/src/View/QtView.php
index e223a34a9..77cb42934 100644
--- a/src/View/QtView.php
+++ b/src/View/QtView.php
@@ -34,56 +34,34 @@
*/
class QtView
{
- /**
- * @var Renderer
- */
private Renderer $renderer;
- /**
- * @var AssetManager
- */
private AssetManager $assetManager;
- /**
- * @var Debugger
- */
private Debugger $debugger;
- /**
- * @var ViewCache
- */
private ViewCache $viewCache;
/**
* Layout file
- * @var string|null
*/
private ?string $layoutFile = null;
/**
* Rendered view
- * @var string|null
*/
private ?string $viewContent = null;
/**
* Assets to be included
- * @var array
*/
private array $assets = [];
/**
* View params
- * @var array
*/
private array $params = [];
- /**
- * @param Renderer $renderer
- * @param AssetManager $assetManager
- * @param Debugger $debugger
- * @param ViewCache $viewCache
- */
public function __construct(
Renderer $renderer,
AssetManager $assetManager,
@@ -98,8 +76,6 @@ public function __construct(
/**
* Sets a layout
- * @param string|null $layoutFile
- * @param array $assets
*/
public function setLayout(?string $layoutFile, array $assets = []): void
{
@@ -112,7 +88,6 @@ public function setLayout(?string $layoutFile, array $assets = []): void
/**
* Gets the layout
- * @return string|null
*/
public function getLayout(): ?string
{
@@ -121,7 +96,6 @@ public function getLayout(): ?string
/**
* Sets view parameter
- * @param string $key
* @param mixed $value
*/
public function setParam(string $key, $value): void
@@ -130,9 +104,7 @@ public function setParam(string $key, $value): void
}
/**
- * @param string $key
* @param $value
- * @return void
*/
public function setRawParam(string $key, $value): void
{
@@ -141,7 +113,6 @@ public function setRawParam(string $key, $value): void
/**
* Gets the view parameter
- * @param string $key
* @return mixed|null
*/
public function getParam(string $key)
@@ -157,7 +128,6 @@ public function getParam(string $key)
/**
* Sets multiple view parameters
- * @param array $params
*/
public function setParams(array $params): void
{
@@ -168,14 +138,10 @@ public function setParams(array $params): void
/**
* Gets all view parameters
- * @return array
*/
public function getParams(): array
{
-
- $params = array_map(fn ($param) => ($param instanceof RawParam) ? $param->getValue() : $param, $this->params);
-
- return $params;
+ return array_map(fn ($param) => ($param instanceof RawParam) ? $param->getValue() : $param, $this->params);
}
/**
@@ -188,9 +154,6 @@ public function flushParams(): void
/**
* Renders the view.
- * @param string $viewFile
- * @param array $params
- * @return string|null
* @throws AssetException
* @throws BaseException
* @throws ConfigException
@@ -233,9 +196,6 @@ public function render(string $viewFile, array $params = []): ?string
/**
* Renders partial view.
- * @param string $viewFile
- * @param array $params
- * @return string
*/
public function renderPartial(string $viewFile, array $params = []): string
{
@@ -248,7 +208,6 @@ public function renderPartial(string $viewFile, array $params = []): string
/**
* Gets the rendered view.
- * @return string|null
* @throws ViewException
*/
public function getView(): ?string
@@ -262,8 +221,6 @@ public function getView(): ?string
/**
* Renders the view
- * @param string $viewFile
- * @return string
*/
private function renderFile(string $viewFile): string
{
@@ -306,19 +263,11 @@ private function xssFilter($params)
return $params;
}
- /**
- * @param string $value
- * @return string
- */
private function sanitizeHtml(string $value): string
{
return htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
}
- /**
- * @param string $viewFile
- * @return void
- */
private function updateDebugger(string $viewFile): void
{
$routesCell = $this->debugger->getStoreCell(Debugger::ROUTES);
diff --git a/tests/Unit/AppTestCase.php b/tests/Unit/AppTestCase.php
index e2bce7587..cdd00f170 100644
--- a/tests/Unit/AppTestCase.php
+++ b/tests/Unit/AppTestCase.php
@@ -83,8 +83,7 @@ protected function testRequest(
[$method],
$uri,
'TestController',
- 'testAction',
- null
+ 'testAction'
);
$route->module('Test');
diff --git a/tests/Unit/Database/Adapters/Sleekdb/Statements/ReducerSleekTest.php b/tests/Unit/Database/Adapters/Sleekdb/Statements/ReducerSleekTest.php
index 6f20fe00c..ff50a3480 100644
--- a/tests/Unit/Database/Adapters/Sleekdb/Statements/ReducerSleekTest.php
+++ b/tests/Unit/Database/Adapters/Sleekdb/Statements/ReducerSleekTest.php
@@ -15,7 +15,7 @@ public function testSleekSelect(): void
$this->assertCount(2, $user->asArray());
- $userModel = new SleekDbal('users');
+ new SleekDbal('users');
$user = $userProfileModel
->select('id', ['firstname' => 'name'], ['lastname' => 'surname'], 'age')
diff --git a/tests/Unit/Http/Helpers/HttpHelperTest.php b/tests/Unit/Http/Helpers/HttpHelperTest.php
index 17b277536..c19f44db0 100644
--- a/tests/Unit/Http/Helpers/HttpHelperTest.php
+++ b/tests/Unit/Http/Helpers/HttpHelperTest.php
@@ -53,8 +53,7 @@ public function testBaseUrlWithModulePrefix(): void
['GET'],
'/signin',
'AdminController',
- 'signin',
- null
+ 'signin'
);
$route->module('admin')->prefix('admin');
diff --git a/tests/Unit/Http/Traits/Request/HttpRequestRouteTest.php b/tests/Unit/Http/Traits/Request/HttpRequestRouteTest.php
index 1297b0bd5..1c8efcf10 100644
--- a/tests/Unit/Http/Traits/Request/HttpRequestRouteTest.php
+++ b/tests/Unit/Http/Traits/Request/HttpRequestRouteTest.php
@@ -35,8 +35,7 @@ public function testSetAndGetMatchedRoute(): void
['GET'],
'/test',
'TestController',
- 'tests',
- null
+ 'tests'
);
$matched = new MatchedRoute($route, ['id' => 1]);
@@ -52,8 +51,7 @@ public function testSetMatchedRouteToNullResetsState(): void
['GET'],
'/test',
'TestController',
- 'tests',
- null
+ 'tests'
);
$matched = new MatchedRoute($route, []);
diff --git a/tests/Unit/JWToken/JWTokenTest.php b/tests/Unit/JWToken/JWTokenTest.php
index 883b71857..0d801d3a8 100644
--- a/tests/Unit/JWToken/JWTokenTest.php
+++ b/tests/Unit/JWToken/JWTokenTest.php
@@ -58,7 +58,7 @@ public function testSetAlgorithm(): void
$this->assertNotEmpty($this->jwtToken->fetchPayload());
- $jwtEncoded = $this->jwtToken->setAlgorithm('HS512')->compose();
+ $this->jwtToken->setAlgorithm('HS512')->compose();
}
public function testRetrieveFetchPayload(): void
diff --git a/tests/Unit/Lang/LangTest.php b/tests/Unit/Lang/LangTest.php
index 679d1f369..35141829e 100644
--- a/tests/Unit/Lang/LangTest.php
+++ b/tests/Unit/Lang/LangTest.php
@@ -25,8 +25,7 @@ public function setUp(): void
['POST'],
'/api-signin',
'SomeController',
- 'signin',
- null
+ 'signin'
);
$route->module('Test');
diff --git a/tests/Unit/Model/ModelSoftDeletesSleekTest.php b/tests/Unit/Model/ModelSoftDeletesSleekTest.php
index 2fdec1340..913ffbaeb 100644
--- a/tests/Unit/Model/ModelSoftDeletesSleekTest.php
+++ b/tests/Unit/Model/ModelSoftDeletesSleekTest.php
@@ -183,7 +183,7 @@ private function _createProductsTableWithData(): void
$product->prop('description', 'High-quality product A');
$product->prop('price', 19.99);
$product->prop('created_at', '2025-05-01 10:00:00');
- $product->prop('deleted_at', null);
+ $product->prop('deleted_at');
$product->save();
$product->create();
@@ -199,7 +199,7 @@ private function _createProductsTableWithData(): void
$product->prop('description', 'Popular product C');
$product->prop('price', 39.99);
$product->prop('created_at', '2025-05-01 10:00:00');
- $product->prop('deleted_at', null);
+ $product->prop('deleted_at');
$product->save();
$product->create();
@@ -207,7 +207,7 @@ private function _createProductsTableWithData(): void
$product->prop('description', 'Limited edition product D');
$product->prop('price', 49.99);
$product->prop('created_at', '2025-05-01 10:00:00');
- $product->prop('deleted_at', null);
+ $product->prop('deleted_at');
$product->save();
$product->create();
@@ -223,7 +223,7 @@ private function _createProductsTableWithData(): void
$product->prop('description', 'Premium product F');
$product->prop('price', 69.99);
$product->prop('created_at', '2025-05-01 10:00:00');
- $product->prop('deleted_at', null);
+ $product->prop('deleted_at');
$product->save();
}
}
diff --git a/tests/Unit/Renderer/Adapters/HtmlAdapterTest.php b/tests/Unit/Renderer/Adapters/HtmlAdapterTest.php
index 0b00bb2d2..f76bb90b4 100644
--- a/tests/Unit/Renderer/Adapters/HtmlAdapterTest.php
+++ b/tests/Unit/Renderer/Adapters/HtmlAdapterTest.php
@@ -19,8 +19,7 @@ public function setUp(): void
['GET'],
'/test',
'SomeController',
- 'test',
- null
+ 'test'
);
$route->module('Test');
diff --git a/tests/Unit/Renderer/Adapters/TwigAdapterTest.php b/tests/Unit/Renderer/Adapters/TwigAdapterTest.php
index 344792ad2..7d7e401d4 100644
--- a/tests/Unit/Renderer/Adapters/TwigAdapterTest.php
+++ b/tests/Unit/Renderer/Adapters/TwigAdapterTest.php
@@ -19,8 +19,7 @@ public function setUp(): void
['GET'],
'/test',
'SomeController',
- 'test',
- null
+ 'test'
);
$route->module('Test');
diff --git a/tests/Unit/Renderer/RendererTest.php b/tests/Unit/Renderer/RendererTest.php
index 20c0ccd8c..7237a98ca 100644
--- a/tests/Unit/Renderer/RendererTest.php
+++ b/tests/Unit/Renderer/RendererTest.php
@@ -23,8 +23,7 @@ public function setUp(): void
['GET'],
'/test',
'SomeController',
- 'test',
- null
+ 'test'
);
$route->module('Test');
diff --git a/tests/Unit/Router/Helpers/RouteHelpersTest.php b/tests/Unit/Router/Helpers/RouteHelpersTest.php
index a1b1f63a5..47ca61264 100644
--- a/tests/Unit/Router/Helpers/RouteHelpersTest.php
+++ b/tests/Unit/Router/Helpers/RouteHelpersTest.php
@@ -47,8 +47,7 @@ public function testHelpersReturnValuesForMatchedControllerRoute(): void
['GET'],
'[:alpha:2]?/post/[uuid=:any]',
'PostController',
- 'show',
- null
+ 'show'
);
$route
@@ -108,8 +107,7 @@ public function testFindRouteByNameReturnsRouteFromCollection(): void
['GET'],
'dashboard',
'DashboardController',
- 'index',
- null
+ 'index'
);
$route->name('Dashboard')->module('Admin');
@@ -131,8 +129,7 @@ public function testRouteGroupExistsDetectsGroupInModule(): void
['GET'],
'profile',
'ProfileController',
- 'show',
- null
+ 'show'
);
$route->group('auth')->module('Web');
@@ -176,8 +173,7 @@ public function testFindRouteByNameDependsOnCollectionRegistration(): void
['GET'],
'dashboard',
'DashboardController',
- 'index',
- null
+ 'index'
);
$route->name('dashboard')->module('admin');
@@ -209,8 +205,7 @@ public function testRouteGroupExistsDependsOnCollectionRegistration(): void
['GET'],
'profile',
'ProfileController',
- 'show',
- null
+ 'show'
);
$route->group('auth')->module('web');
diff --git a/tests/Unit/Router/RouteDispatcherTest.php b/tests/Unit/Router/RouteDispatcherTest.php
index 8c77f5ba8..46a5a4a3f 100644
--- a/tests/Unit/Router/RouteDispatcherTest.php
+++ b/tests/Unit/Router/RouteDispatcherTest.php
@@ -41,9 +41,9 @@ public function testDispatchExecutesClosureRoute(): void
$dispatcher = new RouteDispatcher();
$request = Mockery::mock(Request::class);
- $response = Mockery::mock(Response::class);
+ Mockery::mock(Response::class);
- $dispatcher->dispatch($matched, $request, $response);
+ $dispatcher->dispatch($matched, $request);
$this->assertTrue($called);
$this->assertSame('123', $receivedParam);
@@ -53,16 +53,16 @@ public function testDispatchThrowsWhenClosureRouteHasNoClosure(): void
{
$this->expectException(RouteException::class);
- $route = new Route(['GET'], '/broken', null, null, null);
+ $route = new Route(['GET'], '/broken', null, null);
$matched = new MatchedRoute($route, []);
$dispatcher = new RouteDispatcher();
$request = Mockery::mock(Request::class);
- $response = Mockery::mock(Response::class);
+ Mockery::mock(Response::class);
- $dispatcher->dispatch($matched, $request, $response);
+ $dispatcher->dispatch($matched, $request);
}
public function testDispatchExecutesControllerActionWithParams(): void
@@ -76,16 +76,16 @@ public function post(string $uuid): void
}
};
- $route = new Route(['GET'], '[:alpha:2]?/post/[uuid=:any]', get_class($controllerClass), 'post', null);
+ $route = new Route(['GET'], '[:alpha:2]?/post/[uuid=:any]', get_class($controllerClass), 'post');
$matched = new MatchedRoute($route, ['uuid' => 'abc-123']);
$dispatcher = new RouteDispatcher();
$request = Mockery::mock(Request::class);
- $response = Mockery::mock(Response::class);
+ Mockery::mock(Response::class);
- $dispatcher->dispatch($matched, $request, $response);
+ $dispatcher->dispatch($matched, $request);
$this->assertSame(
'abc-123',
@@ -115,7 +115,7 @@ public function __after(string $uuid): void
}
};
- $route = new Route(['GET', 'POST'], '[:alpha:2]?/post/[uuid=:any]', get_class($controllerClass), 'post', null);
+ $route = new Route(['GET', 'POST'], '[:alpha:2]?/post/[uuid=:any]', get_class($controllerClass), 'post');
$matched = new MatchedRoute($route, ['uuid' => 'abc']);
@@ -124,9 +124,9 @@ public function __after(string $uuid): void
$request = Mockery::mock(Request::class);
$request->shouldReceive('getMethod')->andReturn('POST');
- $response = Mockery::mock(Response::class);
+ Mockery::mock(Response::class);
- $dispatcher->dispatch($matched, $request, $response);
+ $dispatcher->dispatch($matched, $request);
$this->assertSame(
[
@@ -147,16 +147,16 @@ public function testDispatchThrowsWhenControllerActionDoesNotExist(): void
// Intentionally no action method
};
- $route = new Route(['GET'], '[:alpha:2]?/broken', get_class($controllerClass), 'missingAction', null);
+ $route = new Route(['GET'], '[:alpha:2]?/broken', get_class($controllerClass), 'missingAction');
$matched = new MatchedRoute($route, []);
$dispatcher = new RouteDispatcher();
$request = Mockery::mock(Request::class);
- $response = Mockery::mock(Response::class);
+ Mockery::mock(Response::class);
- $dispatcher->dispatch($matched, $request, $response);
+ $dispatcher->dispatch($matched, $request);
}
public function testDispatchFailsWhenCsrfIsEnabledAndTokenIsMissing(): void
@@ -172,7 +172,7 @@ public function submit(): void
}
};
- $route = new Route(['POST'], '[:alpha:2]?/submit', get_class($controllerClass), 'submit', null);
+ $route = new Route(['POST'], '[:alpha:2]?/submit', get_class($controllerClass), 'submit');
$matched = new MatchedRoute($route, []);
@@ -182,10 +182,10 @@ public function submit(): void
->with(Csrf::TOKEN_KEY)
->andReturn(false);
- $response = Mockery::mock(Response::class);
+ Mockery::mock(Response::class);
$dispatcher = new RouteDispatcher();
- $dispatcher->dispatch($matched, $request, $response);
+ $dispatcher->dispatch($matched, $request);
}
}
diff --git a/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php b/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php
index fb19cc6ff..b12901e17 100644
--- a/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php
+++ b/tests/Unit/Storage/Adapters/Dropbox/DropboxAppTest.php
@@ -11,9 +11,6 @@ class DropboxAppTest extends AppTestCase
use DropboxTokenServiceTestCase;
use HttpClientTestCase;
- /**
- * @var DropboxApp
- */
private DropboxApp $dropboxApp;
private string $appKey = 'x0hwm8wy63rrynm';
diff --git a/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php b/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php
index 58a5b55f0..07a80a9bd 100644
--- a/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php
+++ b/tests/Unit/Storage/Adapters/Dropbox/DropboxFileSystemAdapterTest.php
@@ -20,9 +20,6 @@ class DropboxFileSystemAdapterTest extends AppTestCase
private string $content = 'This file was created via dropbox api';
- /**
- * @var array
- */
private static array $response = [];
public function setUp(): void
diff --git a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php
index 5820059fe..58d7f8f43 100644
--- a/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php
+++ b/tests/Unit/Storage/Adapters/GoogleDrive/GoogleDriveAppTest.php
@@ -11,9 +11,6 @@ class GoogleDriveAppTest extends AppTestCase
use GoogleDriveTokenServiceTestCase;
use HttpClientTestCase;
- /**
- * @var GoogleDriveApp
- */
private GoogleDriveApp $googleDriveApp;
private string $appKey = 'x0hwm8wy63rrynm';
diff --git a/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php b/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php
index 38edecbca..330c4bd69 100644
--- a/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php
+++ b/tests/Unit/Storage/Adapters/Local/LocalFileSystemAdapterTest.php
@@ -12,14 +12,8 @@ class LocalFileSystemAdapterTest extends AppTestCase
*/
protected $fs;
- /**
- * @var string
- */
private string $dirname;
- /**
- * @var string
- */
private string $filename;
private string $content = 'Hello world';
diff --git a/tests/Unit/View/Helpers/ViewHelperTest.php b/tests/Unit/View/Helpers/ViewHelperTest.php
index a0e8dbe4e..ca3e0790d 100644
--- a/tests/Unit/View/Helpers/ViewHelperTest.php
+++ b/tests/Unit/View/Helpers/ViewHelperTest.php
@@ -22,8 +22,7 @@ public function setUp(): void
['GET', 'POST'],
'/test',
'TestController',
- 'testAction',
- null
+ 'testAction'
);
$route->module('Test');
diff --git a/tests/Unit/View/QtViewTest.php b/tests/Unit/View/QtViewTest.php
index 50ade78e6..d1d181f5b 100644
--- a/tests/Unit/View/QtViewTest.php
+++ b/tests/Unit/View/QtViewTest.php
@@ -24,8 +24,7 @@ public function setUp(): void
['GET'],
'/test',
'SomeController',
- 'test',
- null
+ 'test'
);
$route->module('Test');
From 6e554c1bedbb3bfdda07eb3f4d1cb835aaa06e9b Mon Sep 17 00:00:00 2001
From: Arman <407448+armanist@users.noreply.github.com>
Date: Tue, 10 Mar 2026 20:10:35 +0400
Subject: [PATCH 3/3] Restoring accessTokenNeedsRefresh response-body argument
flow in cloud trait and Google Drive adapter
---
rector.php | 1 -
src/App/Traits/WebAppTrait.php | 3 ++-
src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php | 2 +-
src/Storage/Traits/CloudAppTrait.php | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rector.php b/rector.php
index e511ccecd..73ca57400 100644
--- a/rector.php
+++ b/rector.php
@@ -14,7 +14,6 @@
->withSets([
LevelSetList::UP_TO_PHP_80,
SetList::TYPE_DECLARATION,
- SetList::DEAD_CODE,
])
->withSkip([
StrictStringParamConcatRector::class => [
diff --git a/src/App/Traits/WebAppTrait.php b/src/App/Traits/WebAppTrait.php
index 74ad113e5..8173c0307 100644
--- a/src/App/Traits/WebAppTrait.php
+++ b/src/App/Traits/WebAppTrait.php
@@ -16,6 +16,7 @@
use Quantum\Environment\Exceptions\EnvException;
use Quantum\Config\Exceptions\ConfigException;
+use Quantum\Loader\Exceptions\LoaderException;
use Quantum\Http\Exceptions\HttpException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
@@ -70,7 +71,7 @@ private function initializeDebugger(): void
/**
* @throws ConfigException
* @throws DiException
- * @throws ReflectionException|\Quantum\Loader\Exceptions\LoaderException
+ * @throws ReflectionException|LoaderException
*/
private function setupViewCache(): ViewCache
{
diff --git a/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php b/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php
index f6f0e173f..3fdf54a63 100644
--- a/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php
+++ b/src/Storage/Adapters/GoogleDrive/GoogleDriveApp.php
@@ -184,7 +184,7 @@ public function getFileInfo(string $fileId, bool $media = false, array $params =
/**
* Checks if the access token need refresh
*/
- private function accessTokenNeedsRefresh(int $code): bool
+ private function accessTokenNeedsRefresh(int $code, ?object $message = null): bool
{
return $code === self::INVALID_TOKEN_ERROR_CODE;
}
diff --git a/src/Storage/Traits/CloudAppTrait.php b/src/Storage/Traits/CloudAppTrait.php
index 2610a6104..857f9b166 100644
--- a/src/Storage/Traits/CloudAppTrait.php
+++ b/src/Storage/Traits/CloudAppTrait.php
@@ -45,7 +45,7 @@ public function sendRequest(string $uri, $data = null, array $headers = [], stri
if ($errors) {
$code = $errors['code'];
- if ($this->accessTokenNeedsRefresh($code)) {
+ if ($this->accessTokenNeedsRefresh($code, $responseBody)) {
$prevUrl = $this->httpClient->url();
$prevData = $this->httpClient->getData();
$prevHeaders = $this->httpClient->getRequestHeaders();