public function get(string $name = '')
    {
        switch (true) {
            case ('' == $name):
                $result = $this->ports;
                break;
            case $this->has($name):
                $result = $this->ports[$name];
                break;
            default:
                throw new PortException("The port {$name} does not exist!");
        }

        return $result;
    }
public function get(string $name = '')
    {
        switch (true) {
            case ('' == $name):
                $result = $this->ports;
                break;
            case $this->has($name):
                $result = $this->ports[$name];
                break;
            default:
                throw new PortException("The port {$name} does not exist!");
        }

        return $result;
    }
public function get ( string $ name = '' ) { switch ( true ) { case ( '' == $ name ) : $ result = $ this -> ports ; break ; case $ this -> has ( $ name ) : $ result = $ this -> ports [ $ name ] ; break ; default : throw new PortException ( "The port {$name} does not exist!" ) ; } return $ result ; }
Return one or all ports.

@param string $name
@return PortInterface[]|PortInterface
@throws PortException
Return one or all ports .