Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • AbstractFilter
  • ExplodeName
  • LowerCase
  • Phone
  • SanitizeUrl
  • ToInt
  • Trim

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * Jyxo PHP Library
 5:  *
 6:  * LICENSE
 7:  *
 8:  * This source file is subject to the new BSD license that is bundled
 9:  * with this package in the file license.txt.
10:  * It is also available through the world-wide-web at this URL:
11:  * https://github.com/jyxo/php/blob/master/license.txt
12:  */
13: 
14: namespace Jyxo\Input\Filter;
15: 
16: /**
17:  * Filter for converting to integers.
18:  *
19:  * @category Jyxo
20:  * @package Jyxo\Input
21:  * @subpackage Filter
22:  * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
23:  * @license https://github.com/jyxo/php/blob/master/license.txt
24:  * @author Jakub Tománek
25:  */
26: class ToInt extends \Jyxo\Input\Filter\AbstractFilter
27: {
28:     /**
29:      * Base we are converting to.
30:      *
31:      * @var integer
32:      */
33:     private $base;
34: 
35:     /**
36:      * Constructor.
37:      *
38:      * @param integer $base
39:      */
40:     public function __construct($base = 10)
41:     {
42:         $this->base = $base;
43:     }
44: 
45:     /**
46:      * Filters a value.
47:      *
48:      * @param mixed $in Input value
49:      * @return mixed
50:      */
51:     protected function filterValue($in)
52:     {
53:         return intval($in, $this->base);
54:     }
55: }
56: 
Jyxo PHP Library API documentation generated by ApiGen 2.3.0