original_string: public static function prepare_for_javascript($dependencies) {
          $result = [];
          foreach ($dependencies as $d) {
              if (!isset($result[$d->dependenton])) {
                  $result[$d->dependenton] = [];
              }
              if (!isset($result[$d->dependenton][$d->condition])) {
                  $result[$d->dependenton][$d->condition] = [];
              }
              if (!isset($result[$d->dependenton][$d->condition][$d->value])) {
                  $result[$d->dependenton][$d->condition][$d->value] = [];
              }
              $result[$d->dependenton][$d->condition][$d->value][] = $d->settingname;
          }
          return $result;
      }
code: public static function prepare_for_javascript($dependencies) {
          $result = [];
          foreach ($dependencies as $d) {
              if (!isset($result[$d->dependenton])) {
                  $result[$d->dependenton] = [];
              }
              if (!isset($result[$d->dependenton][$d->condition])) {
                  $result[$d->dependenton][$d->condition] = [];
              }
              if (!isset($result[$d->dependenton][$d->condition][$d->value])) {
                  $result[$d->dependenton][$d->condition][$d->value] = [];
              }
              $result[$d->dependenton][$d->condition][$d->value][] = $d->settingname;
          }
          return $result;
      }
code_tokens: public static function prepare_for_javascript ( $ dependencies ) { $ result = [ ] ; foreach ( $ dependencies as $ d ) { if ( ! isset ( $ result [ $ d -> dependenton ] ) ) { $ result [ $ d -> dependenton ] = [ ] ; } if ( ! isset ( $ result [ $ d -> dependenton ] [ $ d -> condition ] ) ) { $ result [ $ d -> dependenton ] [ $ d -> condition ] = [ ] ; } if ( ! isset ( $ result [ $ d -> dependenton ] [ $ d -> condition ] [ $ d -> value ] ) ) { $ result [ $ d -> dependenton ] [ $ d -> condition ] [ $ d -> value ] = [ ] ; } $ result [ $ d -> dependenton ] [ $ d -> condition ] [ $ d -> value ] [ ] = $ d -> settingname ; } return $ result ; }
docstring: Gather together all the dependencies in a format suitable for initialising javascript
  @param admin_settingdependency[] $dependencies
  @return array
docstring_tokens: Gather together all the dependencies in a format suitable for initialising javascript