original_string: static function arrayExtract(array $keys, array $array, array $callbacks = []) {
      // Set extracted
      $extracted = [];
      // Loop through keys
      foreach ($keys as $key) {
        // Add to extracted, only if it exists
        if (array_key_exists($key, $array)) {
          // Set item
          $item = $array[$key];
          // If there's a callback
          if (isset($callbacks[$key]) && is_callable($callbacks[$key])) {
            // Call it
            $item = call_user_func_array($callbacks[$key], [$item]);
          }
          // Add to extracted
          $extracted[$key] = $item;
        }
      }
      // Return extracted
      return $extracted;
    }
code: static function arrayExtract(array $keys, array $array, array $callbacks = []) {
      // Set extracted
      $extracted = [];
      // Loop through keys
      foreach ($keys as $key) {
        // Add to extracted, only if it exists
        if (array_key_exists($key, $array)) {
          // Set item
          $item = $array[$key];
          // If there's a callback
          if (isset($callbacks[$key]) && is_callable($callbacks[$key])) {
            // Call it
            $item = call_user_func_array($callbacks[$key], [$item]);
          }
          // Add to extracted
          $extracted[$key] = $item;
        }
      }
      // Return extracted
      return $extracted;
    }
code_tokens: static function arrayExtract ( array $ keys , array $ array , array $ callbacks = [ ] ) { // Set extracted $ extracted = [ ] ; // Loop through keys foreach ( $ keys as $ key ) { // Add to extracted, only if it exists if ( array_key_exists ( $ key , $ array ) ) { // Set item $ item = $ array [ $ key ] ; // If there's a callback if ( isset ( $ callbacks [ $ key ] ) && is_callable ( $ callbacks [ $ key ] ) ) { // Call it $ item = call_user_func_array ( $ callbacks [ $ key ] , [ $ item ] ) ; } // Add to extracted $ extracted [ $ key ] = $ item ; } } // Return extracted return $ extracted ; }
docstring: Extract array from array with keys
docstring_tokens: Extract array from array with keys