Ferreteria/v0.6/clade/IO/Aspect/Connx/aux/Jack
Jump to navigation
Jump to search
|
The item documented here has been removed and is no longer in use. It has been replaced by Cable.
|
About
This clade was briefly a replacement for IO\Aspect\Connx\Plug, but I ended up replacing it in turn with \IO\Aspect\aux\Cable.
Code
Entire contents of file just before removal on 2026-01-31:
<?php namespace Woozalia\Ferret\IO\Aspect\Connx\aux;
/**
* PURPOSE: trait to make an endpoint for a connection
* can be opened/closed (because Connx) and connect to another Jack
* HISTORY:
* 2026-01-22 created as a more-carefully-thought-through replacement for Plug.php
* The idea is not that a Jack should be a separate utility thing, but rather that any class can be a Jack (by having Jack as a parent).
* Any Jack object can be a Client (must Connect() to a Server), a Server (must Connect() to a Client) or both.
*/
/* Base* [ca,i] */ use Woozalia\Ferret\IO\Aspect\{ caConnx as BaseClass, iConnx as BaseIface };
/* SelfIface */ use Woozalia\Ferret\IO\Aspect\Connx\aux\ixJack as SelfIface;
interface ixJack {
function Connect(?SelfIface $oClient, ?SelfIface $oServer);
}
trait txJack {
private $oClient=NULL;
private $oServer=NULL;
public function Connect(?SelfIface $oClient, ?SelfIface $oServer) {
$this->oClient = $oClient;
$this->oServer = $oServer;
}
}
/*
interface iJack extends BaseIface, ixJack {}
class cJack extends BaseClass implements iJack {
use txJack;
}
*/