Skip to content

Commit 556b1e1

Browse files
committed
Fixed middleware class finding bug.
1 parent 246bcb8 commit 556b1e1

6 files changed

+9
-9
lines changed

src/Exception/InvalidArgumentException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Muhammet ŞAFAK <[email protected]>
88
* @copyright Copyright © 2022 Muhammet ŞAFAK
99
* @license ./LICENSE MIT
10-
* @version 1.1.2
10+
* @version 1.1.3
1111
* @link https://www.muhammetsafak.com.tr
1212
*/
1313

src/Exception/PageNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Muhammet ŞAFAK <[email protected]>
88
* @copyright Copyright © 2022 Muhammet ŞAFAK
99
* @license ./LICENSE MIT
10-
* @version 1.1.2
10+
* @version 1.1.3
1111
* @link https://www.muhammetsafak.com.tr
1212
*/
1313

src/Exception/RouterException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Muhammet ŞAFAK <[email protected]>
88
* @copyright Copyright © 2022 Muhammet ŞAFAK
99
* @license ./LICENSE MIT
10-
* @version 1.1.2
10+
* @version 1.1.3
1111
* @link https://www.muhammetsafak.com.tr
1212
*/
1313

src/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Muhammet ŞAFAK <[email protected]>
88
* @copyright Copyright © 2022 Muhammet ŞAFAK
99
* @license ./LICENSE MIT
10-
* @version 1.1.2
10+
* @version 1.1.3
1111
* @link https://www.muhammetsafak.com.tr
1212
*/
1313

src/Router.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Muhammet ŞAFAK <[email protected]>
88
* @copyright Copyright © 2022 Muhammet ŞAFAK
99
* @license ./LICENSE MIT
10-
* @version 1.1.2
10+
* @version 1.1.3
1111
* @link https://www.muhammetsafak.com.tr
1212
*/
1313

@@ -875,13 +875,13 @@ private function middleware_class_find(string $class): string
875875
if(!isset($this->current_route) || \class_exists($class)){
876876
return $class;
877877
}
878-
$namespace = $this->current_route['namespaces']['middleware'];
878+
$namespace = $this->current_route['options']['namespaces']['middleware'];
879879
$class_full_name = \rtrim($namespace, '\\') . '\\' . \ltrim($class, '\\');
880880
if(\class_exists($class_full_name)){
881881
return $class_full_name;
882882
}
883-
if(!empty($this->current_route['paths']['middleware'])){
884-
$path = \rtrim($this->current_route['paths']['middleware'], '/\\') . \DIRECTORY_SEPARATOR . \ltrim($class, '\\/') . '.php';
883+
if(!empty($this->current_route['options']['paths']['middleware'])){
884+
$path = \rtrim($this->current_route['options']['paths']['middleware'], '/\\') . \DIRECTORY_SEPARATOR . \ltrim($class, '\\/') . '.php';
885885
if(\is_file($path)){
886886
require $path;
887887
if(\class_exists($class_full_name)){

src/Uri.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @author Muhammet ŞAFAK <[email protected]>
88
* @copyright Copyright © 2022 Muhammet ŞAFAK
99
* @license ./LICENSE MIT
10-
* @version 1.1.2
10+
* @version 1.1.3
1111
* @link https://www.muhammetsafak.com.tr
1212
*/
1313

0 commit comments

Comments
 (0)