Overview

Namespaces

  • PHP
  • PhpOptions
    • Types

Classes

  • AType
  • CharType
  • DatetimeType
  • DateType
  • DirectoryType
  • EmailType
  • EnumType
  • FileType
  • InifileType
  • IntegerType
  • RealType
  • SeriesType
  • StringType
  • TimeType
  • Types
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: /**
 4:  * PhpOptions
 5:  * @link https://github.com/masicek/PhpOptions
 6:  * @author Viktor Mašíček <viktor@masicek.net>
 7:  * @license "New" BSD License
 8:  */
 9: 
10: namespace PhpOptions\Types;
11: 
12: require_once __DIR__ . '/AType.php';
13: 
14: /**
15:  * Char type
16:  *
17:  * @author Viktor Mašíček <viktor@masicek.net>
18:  */
19: class CharType extends AType
20: {
21: 
22: 
23:     /**
24:      * Check type of value.
25:      *
26:      * @param mixed $value Checked value
27:      *
28:      * @return bool
29:      */
30:     public function check($value)
31:     {
32:         return (bool)(strlen($value) == 1);
33:     }
34: 
35: 
36: }
37: 
PhpOptions API documentation generated by ApiGen.
Generated using the TokenReflection library.