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


PHP Closure::__invoke方法代码示例

本文整理汇总了PHP中Closure::__invoke方法的典型用法代码示例。如果您正苦于以下问题:PHP Closure::__invoke方法的具体用法?PHP Closure::__invoke怎么用?PHP Closure::__invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Closure的用法示例。


在下文中一共展示了Closure::__invoke方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: entityManager

 public static final function entityManager()
 {
     if (self::$entityManager === null) {
         self::$entityManager = self::$entityManagerFactory->__invoke();
     }
     return self::$entityManager;
 }
开发者ID:elfchat,项目名称:elfchat,代码行数:7,代码来源:Entity.php

示例2: __invoke

 /**
  * {@inheritdoc}
  */
 public function __invoke($input, $index)
 {
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @noinspection PhpVoidFunctionResultUsedInspection */
     return $this->function->__invoke($input, $index);
 }
开发者ID:peekandpoke,项目名称:psi,代码行数:10,代码来源:BinaryClosure.php

示例3: evaluate

 /**
  * Evaluates the underyling closure and returns its result.
  *
  * The given Options instance is passed to the closure as first argument.
  * The previous default value set in the constructor is passed as second
  * argument.
  *
  * @param Options $options The container with all concrete options.
  *
  * @return mixed The result of the closure.
  */
 public function evaluate(Options $options)
 {
     if ($this->previousValue instanceof self) {
         $this->previousValue = $this->previousValue->evaluate($options);
     }
     return $this->closure->__invoke($options, $this->previousValue);
 }
开发者ID:laubosslink,项目名称:lab,代码行数:18,代码来源:LazyOption.php

示例4: _activateDependency

 /**
  * Activate the dependency and set it in the object.
  *
  * @return object The real dependency object
  * @api
  */
 public function _activateDependency()
 {
     $realDependency = $this->builder->__invoke();
     foreach ($this->propertyVariables as &$propertyVariable) {
         $propertyVariable = $realDependency;
     }
     return $realDependency;
 }
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:14,代码来源:DependencyProxy.php

示例5: process

 /**
  * @inheritdoc
  */
 public function process()
 {
     if ($this->processType == self::PROCESS_TYPE_CLOSURE) {
         return $this->process->__invoke($this->getParent());
     } elseif ($this->processType == self::PROCESS_TYPE_CALLABLE) {
         return call_user_func($this->process, $this->getParent());
     }
     return true;
 }
开发者ID:new-inventor,项目名称:form,代码行数:12,代码来源:Handler.php

示例6: isAllowed

 /**
  * {@inheritDoc}
  */
 public function isAllowed($resource, $privilege = null, $role = null)
 {
     $this->loaded && $this->loaded->__invoke();
     try {
         return $this->acl->isAllowed($role ?: $this->identity, $resource, $privilege);
     } catch (InvalidArgumentException $e) {
         return false;
     }
 }
开发者ID:coolms,项目名称:acl,代码行数:12,代码来源:AuthorizationService.php

示例7: log

 /**
  * @param string $msg
  * @param bool $writeln
  */
 public function log($msg, $writeln = true)
 {
     $prefixed = '';
     foreach ($this->logPrefixes as $prefix) {
         $prefixed .= $prefixed ? ' ' . $prefix : $prefix;
     }
     $msg = $prefixed ? $prefixed . ' ' . $msg : $msg;
     $this->logger->__invoke($msg, $writeln);
 }
开发者ID:warmans,项目名称:pipeline,代码行数:13,代码来源:Context.php

示例8: valid

 public function valid()
 {
     if (count($this->batch) < 1) {
         $this->batch = $this->provider->__invoke($this->key, $this->batch_size);
         if ($this->batch && $this->batch instanceof \Traversable) {
             $this->batch = iterator_to_array($this->batch);
         }
     }
     return count($this->batch) > 0;
 }
开发者ID:thijsw,项目名称:ics-large,代码行数:10,代码来源:CalendarEventList.php

示例9: invoke

 /**
  * Invokes the advice method
  *
  * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point which is passed to the advice method
  * @return mixed Result of the advice method
  */
 public function invoke(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
 {
     if ($this->runtimeEvaluator !== null && $this->runtimeEvaluator->__invoke($joinPoint, $this->objectManager) === false) {
         return;
     }
     $adviceObject = $this->objectManager->get($this->aspectObjectName);
     $methodName = $this->adviceMethodName;
     $adviceObject->{$methodName}($joinPoint);
     $this->emitAdviceInvoked($adviceObject, $methodName, $joinPoint);
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:16,代码来源:AbstractAdvice.php

示例10: isValid

 /** @inheritdoc */
 public function isValid($value)
 {
     $this->lastValidated = $value;
     try {
         if (isset($this->customValidateMethod)) {
             $this->customValidateMethod->__invoke($this->objectName, $value);
         }
         return $this->validateValue($value);
     } catch (\Exception $e) {
         $this->error = $e->getMessage();
         return false;
     }
 }
开发者ID:new-inventor,项目名称:form,代码行数:14,代码来源:AbstractValidator.php

示例11: triggerRedirectIfApplicable

 /**
  * Searches for an applicable redirection record in the $redirectionRepository and sends redirect headers if one was found
  *
  * @param HttpRequest $request
  * @return void
  * @api
  */
 public function triggerRedirectIfApplicable(HttpRequest $request)
 {
     try {
         $redirection = $this->redirectionRepository->findOneByRequest($request);
     } catch (\Exception $exception) {
         // skip triggering the redirect if there was an error accessing the database (wrong credentials, ...)
         return;
     }
     if ($redirection === NULL) {
         return;
     }
     $this->sendRedirectHeaders($request, $redirection);
     $this->exit->__invoke();
 }
开发者ID:bwaidelich,项目名称:Wwwision.Redirects,代码行数:21,代码来源:RedirectService.php

示例12: getCell

 /**
  * @return Html
  */
 public function getCell()
 {
     if ($this->cell === NULL) {
         $this->cell = $this->cellFactory->__invoke();
     }
     return $this->cell;
 }
开发者ID:peterzadori,项目名称:movi,代码行数:10,代码来源:Column.php

示例13: getHandler

 /**
  * @return \Closure|string
  */
 public function getHandler($invoke = \true)
 {
     if ($invoke === \true && $this->handler instanceof \Closure) {
         return $this->handler->__invoke();
     }
     return $this->handler;
 }
开发者ID:control-corp,项目名称:brands,代码行数:10,代码来源:Route.php

示例14: myCapture

function myCapture(Closure $closure)
{
    ob_start();
    $closure->__invoke();
    $contents = ob_get_contents();
    ob_end_clean();
    return $contents;
}
开发者ID:serendip811,项目名称:patio42,代码行数:8,代码来源:phpunit.php

示例15: getExportName

 public function getExportName(Option $option)
 {
     if ($option->isUnnamed) {
         return $this->unnamedMapper->__invoke($option->name);
     } else {
         return $this->namedMapper->__invoke($option->name);
     }
 }
开发者ID:php-yaoi,项目名称:php-yaoi,代码行数:8,代码来源:RequestMapper.php


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