Login   Register  
PHP Classes
elePHPant
Icontem

File: Callable.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Alterisio  >  Type Hint Class  >  Callable.php  >  Download  
File: Callable.php
Role: Class source
Content type: text/plain
Description: Callable TypeHint
Class: Type Hint Class
Implement type hinting support for base PHP types
Author: By
Last change: Accessible without user login
Date: 7 years ago
Size: 595 bytes
 

Contents

Class file image Download
<?php
/**
 * @package typehintclass
 */

/**
 * Type hint class for values that are php callables.
 */
final class Callable implements TypeHint {
    
/**
     * Type hint class, cannot be instantiated nor extended.
     */
    
private function __construct() { }
    
    
/**
     * Indicates if this class represents a type hint for provided value.
     * @param mixed $value The value.
     * @return bool True if this class represents a type hint for that value.
     */
    
public static function isTypeHintFor($value) {
        return 
is_callable($value);
    }
}
?>