Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\request;
15
16/**
17* An interface for type cast operations.
18*/
19interface type_cast_helper_interface
20{
21    /**
22    * Set variable $result to a particular type.
23    *
24    * @param mixed    &$result    The variable to fill
25    * @param mixed    $var        The contents to fill with
26    * @param mixed    $type        The variable type. Will be used with {@link settype()}
27    * @param bool    $multibyte    Indicates whether string values may contain UTF-8 characters.
28    *                             Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
29    */
30    public function set_var(&$result, $var, $type, $multibyte = false);
31
32    /**
33    * Recursively sets a variable to a given type using {@link set_var set_var}.
34    *
35    * @param    string    $var        The value which shall be sanitised (passed by reference).
36    * @param    mixed    $default    Specifies the type $var shall have.
37    *                                 If it is an array and $var is not one, then an empty array is returned.
38    *                                 Otherwise var is cast to the same type, and if $default is an array all
39    *                                 keys and values are cast recursively using this function too.
40    * @param    bool    $multibyte    Indicates whether string keys and values may contain UTF-8 characters.
41    *                                 Default is false, causing all bytes outside the ASCII range (0-127) to
42    *                                 be replaced with question marks.
43    */
44    public function recursive_set_var(&$var, $default, $multibyte);
45}