当前位置: 首页>>代码示例>>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;未经允许,请勿转载。