-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcept.php
More file actions
64 lines (51 loc) · 1.48 KB
/
Copy pathconcept.php
File metadata and controls
64 lines (51 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
die('for reading only');
$service = new Service();
$response = $service->someMethod();
// opcija 1
if ($response == null)
{
$error_details = $service->getErrorDetails();
}
// opcija 2
if ($response->inError)
{
$error_details = $response;
}
// opcija 3
$validator = new Validator();
if (!$validator->isValid($response))
{
$error_details = $validator->errorDetails();
}
// opcija 4
$validator = new Validator();
$validator->setVailidationTest($validationTest);
if (!$validator->isValid($response))
{
$error_details = $validator->errorDetails();
}
// opcija 5
$validator = new Validator();
$validator->setVailidationTest($service);
if (!$validator->isValid($response))
{
$error_details = $validator->errorDetails();
}
/***********************************/
// opcija 6
$dynamic_element_model = Factory::create('ElementModelType1')
->augment(Factory::create('ElementModelType2')
->augment(Factory::create('ElementModelType3'))
->augment(Factory::create('ElementModelType4'))
)
->augment(Factory::create('ElementModelType3'));
$operation_on_elements = Factory::create('OperationType1');
$dynamic_validation_of_operation = Factory::create('ValidationType1')
->augment(Factory::create('ValidationType2'))
->augment(Factory::create('ValidationType3')
->augment(Factory::create('ValidationType4'))
->augment(Factory::create('ValidationType5'))
);
$operation_on_elements->validateUsing($dynamic_validation_of_operation);
$result = $dynamic_element_model->operation($dynamic_operation);