Skip to content

Commit c22e4d3

Browse files
committed
Add HelloApplicationService
1 parent 13aa322 commit c22e4d3

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

radar-1.0-dev/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"autoload": {
1414
"psr-4": {
15-
"": "src/"
15+
"Domain\\": "src/"
1616
}
1717
},
1818
"scripts": {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Domain\Hello;
4+
5+
use Aura\Payload\Payload;
6+
7+
class HelloApplicationService
8+
{
9+
public function __construct()
10+
{
11+
$this->payload = new Payload();
12+
}
13+
14+
public function __invoke(array $input)
15+
{
16+
return $this->payload
17+
->setStatus(Payload::SUCCESS)
18+
->setOutput([
19+
'value' => 'Hello World!'
20+
]);
21+
}
22+
}

radar-1.0-dev/web/index.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,11 @@
3030
/**
3131
* Routes
3232
*/
33-
$adr->get('Hello', '/php-framework-benchmark/radar-1.0-dev/web/index.php/hello/index', function (array $input) {
34-
$payload = new Aura\Payload\Payload();
35-
return $payload
36-
->setStatus($payload::SUCCESS)
37-
->setOutput([
38-
'value' => 'Hello World!'
39-
]);
40-
});
33+
$adr->get(
34+
'Hello',
35+
'/php-framework-benchmark/radar-1.0-dev/web/index.php/hello/index',
36+
'Domain\Hello\HelloApplicationService'
37+
);
4138

4239
/**
4340
* Run

0 commit comments

Comments
 (0)