-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed interface of Conveyor Server - so it becomes easier integrati…
…ng it with other projects.
- Loading branch information
1 parent
236992e
commit 5fd9f09
Showing
4 changed files
with
120 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
namespace Conveyor\Traits; | ||
|
||
use Conveyor\Config\ConveyorOptions; | ||
use Conveyor\SubProtocols\Conveyor\Persistence\Interfaces\GenericPersistenceInterface; | ||
|
||
trait HasProperties | ||
{ | ||
public function host(string $host): static | ||
{ | ||
$this->host = $host; | ||
|
||
return $this; | ||
} | ||
|
||
public function port(int $port): static | ||
{ | ||
$this->port = $port; | ||
|
||
return $this; | ||
} | ||
|
||
public function mode(int $mode): static | ||
{ | ||
$this->mode = $mode; | ||
|
||
return $this; | ||
} | ||
|
||
public function socketType(int $socketType): static | ||
{ | ||
$this->socketType = $socketType; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param array<mixed> $serverOptions | ||
* @return $this | ||
*/ | ||
public function serverOptions(array $serverOptions): static | ||
{ | ||
$this->serverOptions = $serverOptions; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param array<mixed>|ConveyorOptions $conveyorOptions | ||
* @return $this | ||
*/ | ||
public function conveyorOptions(array|ConveyorOptions $conveyorOptions): static | ||
{ | ||
$this->conveyorOptions = $conveyorOptions; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param array<callable|array<string>> $eventListeners | ||
* @return $this | ||
*/ | ||
public function eventListeners(array $eventListeners): static | ||
{ | ||
$this->eventListeners = $eventListeners; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param array<GenericPersistenceInterface> $persistence | ||
* @return $this | ||
*/ | ||
public function persistence(array $persistence): static | ||
{ | ||
$this->persistence = $persistence; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters