public function toArray(): array 
    {

        $to_array = function (EncapsulatedEdge $encapsulated): array {
            return $encapsulated->toArray();
        };

        $array = [];

        $array["to"] = [];
        foreach($this->to as $to => $encapsulated) {
            $array["to"][$to] = array_map($to_array, $encapsulated);
        }

        $array["from"] = [];
        foreach($this->from as $from => $encapsulated) {
            $array["from"][$from] = array_map($to_array, $encapsulated);
        }

        $array["in"] = array_map($to_array, $this->in);
        $array["out"] = array_map($to_array, $this->out);

        return $array;
    }
public function toArray(): array 
    {

        $to_array = function (EncapsulatedEdge $encapsulated): array {
            return $encapsulated->toArray();
        };

        $array = [];

        $array["to"] = [];
        foreach($this->to as $to => $encapsulated) {
            $array["to"][$to] = array_map($to_array, $encapsulated);
        }

        $array["from"] = [];
        foreach($this->from as $from => $encapsulated) {
            $array["from"][$from] = array_map($to_array, $encapsulated);
        }

        $array["in"] = array_map($to_array, $this->in);
        $array["out"] = array_map($to_array, $this->out);

        return $array;
    }
public function toArray ( ) : array { $ to_array = function ( EncapsulatedEdge $ encapsulated ) : array { return $ encapsulated -> toArray ( ) ; } ; $ array = [ ] ; $ array [ "to" ] = [ ] ; foreach ( $ this -> to as $ to => $ encapsulated ) { $ array [ "to" ] [ $ to ] = array_map ( $ to_array , $ encapsulated ) ; } $ array [ "from" ] = [ ] ; foreach ( $ this -> from as $ from => $ encapsulated ) { $ array [ "from" ] [ $ from ] = array_map ( $ to_array , $ encapsulated ) ; } $ array [ "in" ] = array_map ( $ to_array , $ this -> in ) ; $ array [ "out" ] = array_map ( $ to_array , $ this -> out ) ; return $ array ; }
Retrieves this object in array format

With all "in" and "out" values in simple string format.
The "to" array can be reconstructed.

@return array
Retrieves this object in array format