Skip to content

Commit f1acb35

Browse files
committed
use methods instead of properties
1 parent b58c211 commit f1acb35

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/Routing/Route.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ public function __construct(
7979
public function toArray(): array
8080
{
8181
return [
82-
'method' => $this->method,
83-
'path' => $this->path,
84-
'controller' => $this->controller,
85-
'name' => $this->name,
86-
'middleware' => $this->middleware,
87-
'domain' => $this->domain,
88-
'uri' => $this->uri,
89-
'parameters' => $this->parameters,
82+
'method' => $this->getMethod(),
83+
'path' => $this->getPath(),
84+
'controller' => $this->getController(),
85+
'name' => $this->getName(),
86+
'middleware' => $this->getMiddleware(),
87+
'domain' => $this->getDomain(),
88+
'uri' => $this->getUri(),
89+
'parameters' => $this->getParameters(),
9090
];
9191
}
9292

src/Services/HttpPublisher.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@
44

55
use Psr\Http\Message\ResponseInterface;
66

7-
/**
8-
* Class HttpPublisher
9-
* HttpPublisher publishes controller responses as over HTTP.
10-
*
11-
* @package MiladRahimi\PhpRouter\Services
12-
* @codeCoverageIgnore
13-
*/
147
class HttpPublisher implements Publisher
158
{
169
/**
1710
* @inheritdoc
1811
*/
1912
public function publish($content): void
2013
{
21-
$content = empty($content) ? '' : $content;
14+
$content = empty($content) ? null : $content;
2215

2316
$output = fopen('php://output', 'a');
2417

0 commit comments

Comments
 (0)