public function getConversions($unit)
    {
        if (!isset($this->units[$unit]['base'])) {
            throw new OutOfBoundsException('Unit is not set');
        }

        $units = array();

        foreach ($this->units as $key => $value) {
            if (isset($value['base']) && $value['base'] === $this->units[$unit]['base']) {
                array_push($units, $key);
            }
        }

        return $units;
    }
public function getConversions($unit)
    {
        if (!isset($this->units[$unit]['base'])) {
            throw new OutOfBoundsException('Unit is not set');
        }

        $units = array();

        foreach ($this->units as $key => $value) {
            if (isset($value['base']) && $value['base'] === $this->units[$unit]['base']) {
                array_push($units, $key);
            }
        }

        return $units;
    }
public function getConversions ( $ unit ) { if ( ! isset ( $ this -> units [ $ unit ] [ 'base' ] ) ) { throw new OutOfBoundsException ( 'Unit is not set' ) ; } $ units = array ( ) ; foreach ( $ this -> units as $ key => $ value ) { if ( isset ( $ value [ 'base' ] ) && $ value [ 'base' ] === $ this -> units [ $ unit ] [ 'base' ] ) { array_push ( $ units , $ key ) ; } } return $ units ; }
List all available conversion units for given unit
@param string $unit
@return array
@throws OutOfBoundsException
List all available conversion units for given unit