当前位置: 首页>>代码示例>>PHP>>正文


PHP ReflectionObject::implementsInterface方法代码示例

本文整理汇总了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;
 }
开发者ID:NiR-,项目名称:rad-security,代码行数:8,代码来源:IsOwnerVoter.php

示例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;
 }
开发者ID:flagshipcompany,项目名称:flagship-for-woocommerce,代码行数:19,代码来源:ComponentFactory.php

示例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;
 }
开发者ID:rchicoria,项目名称:epp-drs,代码行数:19,代码来源:class.PaymentModuleFactory.php

示例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;
 }
开发者ID:baptouuuu,项目名称:tower,代码行数:18,代码来源:Application.php

示例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);
 }
开发者ID:hvasoares,项目名称:phplombok,代码行数:14,代码来源:ChildClassGenerator.php

示例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');
 }
开发者ID:rdohms,项目名称:phergie,代码行数:11,代码来源:ConfigTest.php

示例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');
 }
开发者ID:jellydoughnut,项目名称:phergie,代码行数:11,代码来源:HandlerTest.php

示例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
开发者ID:rchicoria,项目名称:epp-drs,代码行数:31,代码来源:index.php

示例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');
 }
开发者ID:Bittarman,项目名称:phergie,代码行数:11,代码来源:HandlerTest.php

示例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;
     }
 }
开发者ID:MajideB,项目名称:np-gravatar,代码行数:24,代码来源:Profiles.php

示例11: testImplementsPsr7ResponseInterface

 /**
  * @group http
  */
 public function testImplementsPsr7ResponseInterface()
 {
     $r = new \ReflectionObject($this->response);
     $this->assertTrue($r->implementsInterface('Psr\\Http\\Message\\ResponseInterface'));
 }
开发者ID:dragoonis,项目名称:framework,代码行数:8,代码来源:ResponseTest.php


注:本文中的ReflectionObject::implementsInterface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。