public function requiredPorts()
    {
        $ports = [];

        foreach ($this->getServiceInstances() as $info) {
            if (!isset($info['instance'])) {
                continue;
            }
            $instance = $info['instance'];

            if ($instance instanceof ServiceInterface) {
                $ports = array_merge($ports, $instance->getHostPorts());
            }
        }
        $ports = array_unique($ports);

        return array_values($ports);
    }
public function requiredPorts()
    {
        $ports = [];

        foreach ($this->getServiceInstances() as $info) {
            if (!isset($info['instance'])) {
                continue;
            }
            $instance = $info['instance'];

            if ($instance instanceof ServiceInterface) {
                $ports = array_merge($ports, $instance->getHostPorts());
            }
        }
        $ports = array_unique($ports);

        return array_values($ports);
    }
public function requiredPorts ( ) { $ ports = [ ] ; foreach ( $ this -> getServiceInstances ( ) as $ info ) { if ( ! isset ( $ info [ 'instance' ] ) ) { continue ; } $ instance = $ info [ 'instance' ] ; if ( $ instance instanceof ServiceInterface ) { $ ports = array_merge ( $ ports , $ instance -> getHostPorts ( ) ) ; } } $ ports = array_unique ( $ ports ) ; return array_values ( $ ports ) ; }
Get required ports based on services.

@return array
An array of unique ports required by defined services.
Get required ports based on services .