Rename SourceInterface -> NetworkInterface

SourceInterface doesn't make sense really...
This commit is contained in:
Dylan K. Taylor
2018-07-18 11:03:21 +01:00
parent 965f0d670d
commit 4d1e2d1b3a
10 changed files with 45 additions and 45 deletions

View File

@ -39,10 +39,10 @@ class Network{
/** @var Server */
private $server;
/** @var SourceInterface[] */
/** @var NetworkInterface[] */
private $interfaces = [];
/** @var AdvancedSourceInterface[] */
/** @var AdvancedNetworkInterface[] */
private $advancedInterfaces = [];
private $upload = 0;
@ -77,7 +77,7 @@ class Network{
}
/**
* @return SourceInterface[]
* @return NetworkInterface[]
*/
public function getInterfaces() : array{
return $this->interfaces;
@ -89,7 +89,7 @@ class Network{
}
}
public function processInterface(SourceInterface $interface) : void{
public function processInterface(NetworkInterface $interface) : void{
try{
$interface->process();
}catch(\Throwable $e){
@ -107,14 +107,14 @@ class Network{
}
/**
* @param SourceInterface $interface
* @param NetworkInterface $interface
*/
public function registerInterface(SourceInterface $interface) : void{
public function registerInterface(NetworkInterface $interface) : void{
$this->server->getPluginManager()->callEvent($ev = new NetworkInterfaceRegisterEvent($interface));
if(!$ev->isCancelled()){
$interface->start();
$this->interfaces[$hash = spl_object_hash($interface)] = $interface;
if($interface instanceof AdvancedSourceInterface){
if($interface instanceof AdvancedNetworkInterface){
$this->advancedInterfaces[$hash] = $interface;
$interface->setNetwork($this);
}
@ -123,9 +123,9 @@ class Network{
}
/**
* @param SourceInterface $interface
* @param NetworkInterface $interface
*/
public function unregisterInterface(SourceInterface $interface) : void{
public function unregisterInterface(NetworkInterface $interface) : void{
$this->server->getPluginManager()->callEvent(new NetworkInterfaceUnregisterEvent($interface));
unset($this->interfaces[$hash = spl_object_hash($interface)], $this->advancedInterfaces[$hash]);
}