當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ReflectionClass::export方法代碼示例

本文整理匯總了PHP中ReflectionClass::export方法的典型用法代碼示例。如果您正苦於以下問題:PHP ReflectionClass::export方法的具體用法?PHP ReflectionClass::export怎麽用?PHP ReflectionClass::export使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ReflectionClass的用法示例。


在下文中一共展示了ReflectionClass::export方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: f

<?php

class A
{
    private static $a = 0;
    protected static $b = 1;
    public static $c = 2;
    private function f()
    {
    }
    private static function sf()
    {
    }
}
class C extends A
{
}
ReflectionClass::export("C");
開發者ID:badlamer,項目名稱:hhvm,代碼行數:18,代碼來源:bug45571.php

示例2: __construct

<?php

class Base
{
    public final function __construct()
    {
    }
}
class Works extends Base
{
}
class Extended extends Base
{
    public function Extended()
    {
    }
}
ReflectionClass::export('Extended');
開發者ID:badlamer,項目名稱:hhvm,代碼行數:18,代碼來源:final_ctor1.php

示例3: A

#!/usr/bin/env php
<?php 
class A
{
    public $field = 'value';
}
$a = new A();
$reflection = new ReflectionClass('A');
// echo $reflection;
echo ReflectionClass::export('A', true);
開發者ID:aminzadeh,項目名稱:php-protocol-buffers,代碼行數:10,代碼來源:test.php

示例4:

<?php

ReflectionClass::export('Countable');
開發者ID:badlamer,項目名稱:hhvm,代碼行數:3,代碼來源:countable_class_basic1.php

示例5: export

 /**
  * Exports a ReflectionClass instance.
  *
  * Returns the output if TRUE is specified for $return, printing it otherwise.
  * This is purely a wrapper method, which calls the corresponding method of
  * the parent class (ReflectionClass::export()).
  * @param ReflectionClass|string $class
  *        ReflectionClass object or name of the class
  * @param boolean $return
  *        Whether to return (TRUE) or print (FALSE) the output
  * @return mixed
  */
 public static function export($class, $return = false)
 {
     return parent::export($class, $return);
 }
開發者ID:zetacomponents,項目名稱:reflection,代碼行數:16,代碼來源:class.php

示例6: testExport

 public function testExport()
 {
     self::assertEquals(ReflectionClass::export('TestWebservice', true), ezcReflectionClass::export('TestWebservice', true));
 }
開發者ID:zetacomponents,項目名稱:reflection,代碼行數:4,代碼來源:class_test.php

示例7: methJ

    public function methJ()
    {
    }
    public function methK()
    {
    }
    private function methB()
    {
    }
}
class C
{
}
$rb = new ReflectionClass("B");
print "--- export() ---\n";
var_dump($rb->export('B', true));
print "\n";
print "--- getConstant() ---\n";
var_dump($rb->getConstant('C0'));
var_dump($rb->getConstant('C1'));
print "\n";
print "--- getConstants() ---\n";
var_dump($rb->getConstants());
print "\n";
print "--- getConstructor() ---\n";
var_dump($rb->getConstructor());
print "\n";
print "--- getDocComment() ---\n";
var_dump($rb->getDocComment());
print "\n";
print "--- getStartLine() ---\n";
開發者ID:alphaxxl,項目名稱:hhvm,代碼行數:31,代碼來源:reflection.php

示例8: testToString

 /**
  * Tests export.
  */
 public function testToString()
 {
     $tests = array('lines', 'docComment', 'noDocComment', 'constants', 'noConstants', 'properties', 'noProperties', 'doubleProperties', 'publicConstructor', 'privateConstructor', 'publicClone', 'privateClone', 'methods', 'noMethods', 'instances', 'abstract', 'abstractImplicit', 'noAbstract', 'final', 'noFinal', 'interface', 'noInterface', 'interfaces', 'noInterfaces', 'iterator', 'noIterator', 'parent', 'noParent', 'userDefined', 'noNamespace');
     if (PHP_VERSION_ID >= 50400) {
         // Test traits only on PHP >= 5.4
         $tests[] = 'traits';
     }
     foreach ($tests as $test) {
         $rfl = $this->getClassReflection($test);
         $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
         $this->assertSame(InternalReflectionClass::export($this->getClassName($test), true), ReflectionClass::export($this->getBroker(), $this->getClassName($test), true));
         // Test loading from a string
         $rfl = $this->getClassReflection($test, true);
         $this->assertSame($rfl->internal->__toString(), $rfl->token->__toString());
     }
     $this->assertSame(InternalReflectionClass::export('ReflectionClass', true), ReflectionClass::export($this->getBroker(), 'ReflectionClass', true));
     $this->assertSame(InternalReflectionClass::export(new InternalReflectionClass('ReflectionClass'), true), ReflectionClass::export($this->getBroker(), new InternalReflectionClass('ReflectionClass'), true));
 }
開發者ID:eduardobenito10,項目名稱:jenkins-php-quickstart,代碼行數:21,代碼來源:ReflectionClassTest.php

示例9: Func

<?php

class Foo
{
    public $prop;
    function Func($name)
    {
        echo "Hello {$name}";
    }
}
ReflectionClass::export('Foo');
//output: Class [ class Foo ] { @@ /home/cg/root/main.php 3-10 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [ public $prop ] } - Methods [1] { Method [ public method Func ] { @@ /home/cg/root/main.php 7 - 9 - Parameters [1] { Parameter #0 [ $name ] } } } }
ReflectionObject::export(new Foo());
// output: Object of class [ class Foo ] { @@ /home/cg/root/main.php 3-10 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [ public $prop ] } - Dynamic properties [0] { } - Methods [1] { Method [ public method Func ] { @@ /home/cg/root/main.php 7 - 9 - Parameters [1] { Parameter #0 [ $name ] } } } }
ReflectionMethod::export('Foo', 'func');
// output:  Method [ public method Func ] { @@ /home/cg/root/main.php 7 - 9 - Parameters [1] { Parameter #0 [ $name ] } }
ReflectionProperty::export('Foo', 'prop');
//output: Property [ public $prop ]
ReflectionExtension::export('standard');
//output: Extension [ extension #15 standard version 5.5.18 ] ...
開發者ID:KB-WEB-DEVELOPMENT,項目名稱:Kami_Barut_PHP_projects,代碼行數:20,代碼來源:Reflection+API+example.php

示例10: __construct

 public function __construct()
 {
     parent::create(func_get_args());
     $this->refelection = ReflectionClass::export('Apple', true);
 }
開發者ID:frdl,項目名稱:webfan,代碼行數:5,代碼來源:TestElement.php

示例11: foo

<?php

class foo
{
    public function foo()
    {
    }
}
class bar extends foo
{
}
ReflectionClass::export("bar");
開發者ID:badlamer,項目名稱:hhvm,代碼行數:12,代碼來源:bug38942.php

示例12: foo

<?php

interface a
{
    function foo();
    function bar();
}
interface b
{
    function foo();
}
abstract class c
{
    function bar()
    {
    }
}
class x extends c implements a, b
{
    function foo()
    {
    }
}
ReflectionClass::export('x');
開發者ID:badlamer,項目名稱:hhvm,代碼行數:24,代碼來源:bug43200.php


注:本文中的ReflectionClass::export方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。