本文整理汇总了PHP中ReflectionObject::implementsInterface方法的典型用法代码示例。如果您正苦于以下问题:PHP ReflectionObject::implementsInterface方法的具体用法?PHP ReflectionObject::implementsInterface怎么用?PHP ReflectionObject::implementsInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReflectionObject
的用法示例。
在下文中一共展示了ReflectionObject::implementsInterface方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: supportsClass
public function supportsClass($class)
{
if (is_object($class)) {
$refl = new \ReflectionObject($class);
return $refl->implementsInterface('Knp\\Rad\\Security\\OwnableInterface');
}
return false;
}
示例2: createComponent
protected function createComponent($class)
{
$configuration = $this->ctx->getConfiguration();
$object = $this->createObject($configuration, $class);
$reflected = new \ReflectionObject($object);
if ($reflected->implementsInterface('\\FS\\Components\\Factory\\ComponentPostConstructInterface')) {
$object->postConstruct();
}
if ($reflected->implementsInterface('\\FS\\Context\\ApplicationContextAwareInterface')) {
$object->setApplicationContext($this->ctx);
}
if ($reflected->implementsInterface('\\FS\\Components\\Factory\\ComponentFactoryAwareInterface')) {
$object->setComponentFactory($this);
}
if ($reflected->implementsInterface('\\FS\\Components\\Factory\\ComponentInitializingInterface')) {
$object->afterPropertiesSet();
}
return $object;
}
示例3: GetModuleInstanceByContext
/**
* Return module instance by context
*
* @param array $request
* @return true
*/
public function GetModuleInstanceByContext($request)
{
foreach ($this->ListModules() as $module_name) {
$m =& $this->GetModuleObjectByName($module_name);
$reflectionobject = new ReflectionObject($m);
if ($reflectionobject->implementsInterface("IPostBackPaymentModule")) {
if ($m->CheckSignature($request)) {
return $m;
}
}
}
return false;
}
示例4: loadCommands
/**
* Looks for all *Command.php files to load all commands
*
* @return Twr\Application
*/
public function loadCommands()
{
$services = $this->container->findTaggedServiceIds('command');
foreach ($services as $id => $attributes) {
$command = $this->container->get($id);
$refl = new \ReflectionObject($command);
if ($refl->implementsInterface('Symfony\\Component\\DependencyInjection\\ContainerAwareInterface')) {
$command->setContainer($this->container);
}
$this->console->add($command);
}
return $this;
}
示例5: generate
public function generate($obj)
{
$refObj = new \ReflectionObject($obj);
if ($refObj->implementsInterface("\\hvasoares\\phplombok\\GeneratedClass")) {
return $obj;
}
$oldClassName = array_pop(explode("\\", $refObj->getName()));
$newClassName = $oldClassName . (time() + rand());
if (!$this->c->classExists(get_class($obj))) {
$this->c->generateAndLoadClassFile(get_class($obj), $this->t->generateInheritedClass($newClassName, $obj));
$this->f->configure($refObj->getName(), $refObj->getNamespaceName() . "\\" . $newClassName);
}
return $this->f->get($obj);
}
示例6: testImplementsArrayAccess
/**
* Tests that the configuration object can be accessed using array
* syntax.
*
* @return void
*/
public function testImplementsArrayAccess()
{
$reflector = new ReflectionObject($this->config);
$this->assertTrue($reflector->implementsInterface('ArrayAccess'), 'Config instance does not implement ArrayAccess');
}
示例7: testImplementsCountable
/**
* Tests countability of the plugin handler.
*
* @return void
*/
public function testImplementsCountable()
{
$reflection = new ReflectionObject($this->handler);
$this->assertTrue($reflection->implementsInterface('Countable'), 'Handler does not implement Countable');
$this->assertType('int', count($this->handler), 'count() must return an integer');
}
示例8: ReflectionObject
{
// If Total = 0 then mark all invoices in order as paid
if ($Order->GetTotal() == 0)
{
// Invoice automaticly mark as paid after creation if Total == 0;
//$Order->MarkAsPaid($payment_module);
CoreUtils::Redirect("pdt.php");
}
else
{
$PaymentForm = $payment_module->GetPaymentForm();
if ($PaymentForm == false)
{
$reflect = new ReflectionObject($payment_module);
if ($reflect->implementsInterface("IPostBackPaymentModule"))
{
$payment_module->RedirectToGateway(
$Order,
$userinfo
);
}
else
{
$res = $payment_module->ProcessPayment(
$Order,
$userinfo
);
if ($res)
$payment_module->NotifyObservers(PAYMENT_STATUS::SUCCESS);
else
示例9: testImplementsIterator
/**
* Ensures that we can iterate over the handler
*
* @return void
*/
public function testImplementsIterator()
{
$reflection = new ReflectionObject($this->handler);
$this->assertTrue($reflection->implementsInterface('IteratorAggregate'));
$this->assertType('Iterator', $this->handler->getIterator(), 'getIterator() must actually return an Iterator');
}
示例10: getProfileInfo
/**
* Gets profile info of some Gravatar's user, based on his/her
* email address. Return value is NP_Gravatar_Profile instance,
* in case $_responseFormat implements
* NP_Service_Gravatar_Profiles_ResponseFormat_ParserInterface
* interface. Otherwise, or in case $rawResponse flag is set to
* boolean true, Zend_Http_Response instance is returned.
*
* @param string $email
* @param bool $rawResponse Whether raw response object should be returned.
* @return NP_Gravatar_Profile|Zend_Http_Response
*/
public function getProfileInfo($email, $rawResponse = false)
{
$email = strtolower(trim((string) $email));
$hash = NP_Service_Gravatar_Utility::emailHash($email);
$response = $this->getHttpClient()->setMethod(Zend_Http_Client::GET)->setUri(self::GRAVATAR_SERVER . '/' . $hash . '.' . $this->_responseFormat)->request();
$reflected = new ReflectionObject($this->_responseFormat);
if ($reflected->implementsInterface('NP_Service_Gravatar_Profiles_ResponseFormat_ParserInterface') && !$rawResponse) {
return $this->_responseFormat->profileFromHttpResponse($response);
} else {
return $response;
}
}
示例11: testImplementsPsr7ResponseInterface
/**
* @group http
*/
public function testImplementsPsr7ResponseInterface()
{
$r = new \ReflectionObject($this->response);
$this->assertTrue($r->implementsInterface('Psr\\Http\\Message\\ResponseInterface'));
}