public static function getAllPermutations($number) {
    $permutations = [];
    $permutation = static::getFirstPermutation($number);
    $permutations[] = $permutation;
    while($permutation = static::getNextPermutation($permutation)) {
      $permutations[] = $permutation;
    }
    return $permutations;
  }