aboutsummaryrefslogtreecommitdiff
path: root/classes/helpers/CinisisHttpHelper.php
blob: eae8a8d86a7e396419f4901343f180018874b6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

/**
 * Http helper for test scripts.
 */
class CinisisHttpHelper {
  /**
   * Get a numeric argument.
   *
   * @param $name
   *   Argument name.
   *
   * @return
   *   Argument value.
   */
  static function get_numeric_arg($name) {
    // Get the query parameter.
    if (isset($_GET[$name]) && ! empty($_GET[$name])) {
      $arg = (int) $_GET[$name];
    }
    else {
      $arg = 1;
    }  

    return $arg;
  }
}