2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef incl_HHBBC_CLASS_UTIL_H_
17 #define incl_HHBBC_CLASS_UTIL_H_
19 #include "hphp/hhbbc/misc.h"
20 #include "hphp/hhbbc/representation.h"
22 namespace HPHP
{ namespace HHBBC
{
24 namespace res
{ struct Class
; }
25 namespace php
{ struct Class
; }
28 //////////////////////////////////////////////////////////////////////
31 * Returns whether a res::Class refers to a collection class.
33 bool is_collection(res::Class
);
36 * Returns whether a php::Class is a closure.
38 bool is_closure(const php::Class
&);
41 * Returns whether a Type could hold an object that has a custom
42 * boolean conversion function.
44 bool could_have_magic_bool_conversion(Type
);
47 * Returns method named "name" if it exists.
49 borrowed_ptr
<php::Func
> find_method(borrowed_ptr
<const php::Class
>,
53 * Returns true if `name' is the name of an internal VM special class
54 * method. (Not callable directly by php code.)
56 bool is_special_method_name(SString name
);
59 * Returns true if a class has the __MockClass user attribute. This
60 * attribute allows final methods and final classes to be overridden.
62 bool is_mock_class(borrowed_ptr
<const php::Class
>);
64 //////////////////////////////////////////////////////////////////////