Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change private to protected to make inheritance useable #93

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ class Server
/**
* @var EventDispatcherInterface
*/
private $dispatcher;
protected $dispatcher;

/**
* @var ResolverInterface
*/
private $resolver;
protected $resolver;

/**
* @var int
*/
private $port;
protected $port;

/**
* @var string
*/
private $ip;
protected $ip;

/**
* @var LoopInterface
*/
private $loop;
protected $loop;

/**
* Server constructor.
Expand Down Expand Up @@ -137,8 +137,8 @@ public function handleQueryFromStream(string $buffer, ?string $client = null): s
return Encoder::encodeMessage($responseMessage);
} catch (UnsupportedTypeException $e) {
$responseMessage
->setAnswers([])
->getHeader()->setRcode(Header::RCODE_NOT_IMPLEMENTED);
->setAnswers([])
->getHeader()->setRcode(Header::RCODE_NOT_IMPLEMENTED);
$this->dispatch(Events::QUERY_RESPONSE, new QueryResponseEvent($responseMessage));

return Encoder::encodeMessage($responseMessage);
Expand Down Expand Up @@ -182,7 +182,7 @@ public function getIp(): string
*
* @param Message $message
*/
private function needsAdditionalRecords(Message $message): void
protected function needsAdditionalRecords(Message $message): void
{
foreach ($message->getAnswers() as $answer) {
$name = null;
Expand Down Expand Up @@ -225,7 +225,7 @@ private function needsAdditionalRecords(Message $message): void
*
* @return bool
*/
private function isAuthoritative(array $query): bool
protected function isAuthoritative(array $query): bool
{
if (empty($query)) {
return false;
Expand All @@ -245,7 +245,7 @@ private function isAuthoritative(array $query): bool
*
* @return Event|null
*/
private function dispatch($eventName, ?Event $event = null): ?Event
protected function dispatch($eventName, ?Event $event = null): ?Event
{
if (null === $this->dispatcher) {
return null;
Expand Down