Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-present, Ibrahim BinAlshikh and contributors.
Copyright (c) 2019-present WebFiori Framework and contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down Expand Up @@ -488,7 +488,7 @@
*
* @return bool
*/
private static function argMatchesType($arg, \ReflectionNamedType $type): bool {

Check warning on line 491 in WebFiori/Framework/App.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused private "argmatchestype" method.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXG1lFS2SonGvjac&open=AZ7FEXG1lFS2SonGvjac&pullRequest=395
$typeName = $type->getName();

if ($arg === null) {
Expand Down Expand Up @@ -701,9 +701,9 @@
*/
private function setHandlers() {
Handler::registerHandler(new CLIErrHandler());
// Handler::registerHandler(new APICallErrHandler());
// Handler::registerHandler(new HTTPErrHandler());
// Handler::unregisterHandler(Handler::getHandler('Default'));

Check warning on line 706 in WebFiori/Framework/App.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXG1lFS2SonGvjad&open=AZ7FEXG1lFS2SonGvjad&pullRequest=395
Handler::setConfig(HandlerConfig::createDevelopmentConfig());
}
}
2 changes: 1 addition & 1 deletion WebFiori/Framework/AppBootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down Expand Up @@ -185,7 +185,7 @@
}

if (!$isLoaded) {
throw new Exception('Unable to locate the autoloader class.');

Check warning on line 188 in WebFiori/Framework/AppBootstrapper.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXGalFS2SonGvjaa&open=AZ7FEXGalFS2SonGvjaa&pullRequest=395
}
}
}
2 changes: 1 addition & 1 deletion WebFiori/Framework/Autoload/ClassInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2024 Ibrahim BinAlshikh
* Copyright (c) 2024-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Autoload/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Autoload/ClassLoaderException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/ClassRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down Expand Up @@ -105,8 +105,8 @@
$toPass[] = $param;
}
call_user_func_array($regCallback, $toPass);
} catch (Error $ex) {
}

Check warning on line 109 in WebFiori/Framework/ClassRegistrar.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Either remove or fill this block of code.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXGHlFS2SonGvjaX&open=AZ7FEXGHlFS2SonGvjaX&pullRequest=395
}
/**
* Checks if a class constructor can accept the given arguments.
Expand All @@ -116,7 +116,7 @@
*
* @return bool
*/
private static function canAcceptArgs(ReflectionClass $refClass, array $args): bool {

Check failure on line 119 in WebFiori/Framework/ClassRegistrar.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 21 to the 20 allowed.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXGHlFS2SonGvjaZ&open=AZ7FEXGHlFS2SonGvjaZ&pullRequest=395

Check warning on line 119 in WebFiori/Framework/ClassRegistrar.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This method has 7 returns, which is more than the 5 allowed.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXGHlFS2SonGvjaY&open=AZ7FEXGHlFS2SonGvjaY&pullRequest=395
if (empty($args)) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/CLITestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2024 Ibrahim BinAlshikh
* Copyright (c) 2024-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/CreateMigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/CreateSeederCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/InitMigrationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2025 Ibrahim BinAlshikh
* Copyright (c) 2025-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down Expand Up @@ -37,7 +37,7 @@
], 'Execute pending database migrations.');
}

public function exec(): int {

Check warning on line 40 in WebFiori/Framework/Cli/Commands/RunMigrationsCommandNew.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This method has 7 returns, which is more than the 5 allowed.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXBtlFS2SonGvjZ7&open=AZ7FEXBtlFS2SonGvjZ7&pullRequest=395
if ($this->isArgProvided('--all-connections') && $this->isArgProvided('--connection')) {
$this->error('Cannot use --all-connections and --connection together.');

Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/SchedulerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/StepMigrationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2026 Ibrahim BinAlshikh
* Copyright (c) 2026-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Commands/WHelpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Cli/Helpers/ClassInfoReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/EmailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/InitializationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/InvalidCRONExprException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/MissingLangException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/NoSuchThemeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/RoutingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/SessionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Exceptions/UIException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/ExtendedWebServicesManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Handlers/APICallErrHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2022 Ibrahim BinAlshikh
* Copyright (c) 2022-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Handlers/CLIErrHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2022 Ibrahim BinAlshikh
* Copyright (c) 2022-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Handlers/HTTPErrHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2022 Ibrahim BinAlshikh
* Copyright (c) 2022-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2023 Ibrahim BinAlshikh
* Copyright (c) 2023-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Middleware/AbstractMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Middleware/MiddlewareManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Middleware/MiddlewareRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Privilege.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2020 Ibrahim BinAlshikh
* Copyright (c) 2020-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/PrivilegesGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Router/RouteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down Expand Up @@ -261,7 +261,7 @@
];
}

private function copyOptionsToSub(array $options, array &$subRoute): void {

Check failure on line 264 in WebFiori/Framework/Router/RouteBuilder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 47 to the 20 allowed.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXDGlFS2SonGvjaG&open=AZ7FEXDGlFS2SonGvjaG&pullRequest=395
if (!isset($subRoute[RouteOption::CASE_SENSITIVE])) {
if (isset($options[RouteOption::CASE_SENSITIVE])) {
$caseSensitive = $options[RouteOption::CASE_SENSITIVE] === true;
Expand Down
2 changes: 1 addition & 1 deletion WebFiori/Framework/Router/RouteDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
* Copyright (c) 2019-present WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
Expand Down Expand Up @@ -41,7 +41,7 @@
* @param RouterUri $route The matched route.
* @param bool $loadResource Whether to load the resource.
*/
public function dispatch(RouterUri $route, bool $loadResource): void {

Check failure on line 44 in WebFiori/Framework/Router/RouteDispatcher.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 59 to the 20 allowed.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXC8lFS2SonGvjaD&open=AZ7FEXC8lFS2SonGvjaD&pullRequest=395
if ($route->isRequestMethodAllowed((App::getRequest()->getMethod()))) {
$this->router->setRouteUri($route);

Expand Down Expand Up @@ -189,7 +189,7 @@
];
}

private function loadResource(RouterUri $route): void {

Check failure on line 192 in WebFiori/Framework/Router/RouteDispatcher.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 22 to the 20 allowed.

See more on https://sonarcloud.io/project/issues?id=WebFiori_framework&issues=AZ7FEXC8lFS2SonGvjaE&open=AZ7FEXC8lFS2SonGvjaE&pullRequest=395
$file = $route->getRouteTo();
$info = $this->getFileDirAndName($file);
$fileObj = new File($info['name'], $info['dir']);
Expand Down
Loading
Loading