1
1
<?php
2
2
namespace Krishna \API ;
3
3
4
- use Krishna \DataValidator \MultiLinedException ;
4
+ use Krishna \DataValidator \ComplexException ;
5
5
use Krishna \DataValidator \ObjectHandler ;
6
6
use Krishna \DataValidator \OutOfBoundAction ;
7
7
use Krishna \DataValidator \Validator ;
8
+
8
9
final class Func {
9
10
use \Krishna \Utilities \StaticOnlyTrait;
10
11
private static $ definition = null ;
@@ -23,9 +24,9 @@ public static function set_signature(array $signature, OutOfBoundAction $on_out_
23
24
try {
24
25
self ::$ signature = new Validator ($ signature , $ on_out_of_bound );
25
26
if (!is_a (self ::$ signature ->struct , ObjectHandler::class)) {
26
- throw new MultiLinedException ('Invalid signature; It has to be a object structure ' );
27
+ throw new ComplexException ('Invalid signature; It has to be a object structure ' );
27
28
}
28
- } catch (MultiLinedException $ ex ) {
29
+ } catch (ComplexException $ ex ) {
29
30
Server::error_from ($ ex ->getInfo (), __METHOD__ );
30
31
}
31
32
}
@@ -71,7 +72,7 @@ public static function execute(string $base_path, array &$request) {
71
72
foreach (self ::$ auth as $ handler ) {
72
73
$ test = $ handler ->authenticate ($ query , $ request ['func ' ]);
73
74
if (!$ test ->valid ) {
74
- Server::error ($ test ->value , StatusType::UNAUTH_REQ );
75
+ Server::error ($ test ->error , StatusType::UNAUTH_REQ );
75
76
}
76
77
}
77
78
0 commit comments