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


PHP Closure::call方法代码示例

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


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

示例1: testCorrect

 /**
  * @param string $type
  * @param \Closure $generateImage
  * @param \Closure $checkOutput
  * @param array $logLevels
  * @dataProvider imageProvider
  */
 public function testCorrect(string $type, \Closure $generateImage, \Closure $checkOutput, array $logLevels = [])
 {
     $validator = new ImageValidator($type, '');
     $validator->setLogger($this);
     $checkOutput->call($this, $validator->correct($generateImage()));
     $this->assertEquals($logLevels, $this->logLevels);
 }
开发者ID:esperecyan,项目名称:dictionary-php,代码行数:14,代码来源:ImageValidatorTest.php

示例2: __call

 /**
  * @param string $name
  * @param array $Args
  * @return Client|string
  * @throws \Exception
  */
 public function __call($name, array $Args = [])
 {
     if (is_null($this->namespace)) {
         $this->namespace = Src::frcm($name, '-');
         return $this;
     }
     try {
         $Bridge = (new Bridge($this->url, Bridge::RM_POST))->withToken($this->token)->withMethod($name)->withNamespace($this->namespace)->withParams($Args);
         if (count($this->Watchers) > 0) {
             foreach ($this->Watchers as $Watcher) {
                 $Bridge->with($Watcher->getKey(), $Watcher->watch());
             }
         }
         return !is_null($this->Wrapper) ? $this->Wrapper->call($this, $Bridge->send()) : $Bridge->send();
     } finally {
         $this->namespace = null;
     }
 }
开发者ID:eggbe,项目名称:delegapi-client,代码行数:24,代码来源:Client.php

示例3: renderJson

 /**
  * Send immediately
  */
 public function renderJson()
 {
     $totalCount = $this->getDatasource()->totalCount();
     $rows = $this->getDatasource()->listRows();
     $tmpData = [];
     foreach ($rows as $row) {
         $tmp = [];
         $this->currentRow = new DefaultRow();
         if ($this->rowCallback instanceof \Closure) {
             $this->rowCallback->call($this, $row);
         }
         foreach ($this->getColumns() as $key => $column) {
             $this->currentColumn = $key;
             $tmp[$column->getName()] = $column->format($row);
         }
         $tmpData[] = $tmp;
     }
     $data = ['draw' => $this->getRequest()->get('draw'), 'recordsTotal' => $totalCount, 'recordsFiltered' => $totalCount, 'data' => $tmpData];
     header('Content-Type: application/json');
     echo json_encode($data);
     die;
 }
开发者ID:abbert,项目名称:datagrid,代码行数:25,代码来源:Datagrid.php

示例4: execute

 public function execute(\Closure $closure)
 {
     return $closure->call($this->restrictedEnvironment);
 }
开发者ID:egorbenko,项目名称:practice,代码行数:4,代码来源:Runner.php

示例5: invokeClosure

 /**
  * @param \Closure $closure
  *
  * @return TransformInterface
  */
 protected final function invokeClosure(\Closure $closure) : TransformInterface
 {
     $bindTo = $this->isMutable() ? $this : clone $this;
     $result = $closure->call($bindTo, $bindTo);
     return $this->readyResult($result);
 }
开发者ID:src-run,项目名称:augustus-utility-library,代码行数:11,代码来源:AbstractTransform.php

示例6: handle

 /**
  * @param array $path
  * @return array
  */
 public function handle(array $path) : array
 {
     return $this->closure->call($this, $path);
 }
开发者ID:label305,项目名称:dug,代码行数:8,代码来源:ClosureDataProvider.php

示例7: __construct

 public function __construct(string $dir, string $sourceDir, string $routePath = null, \Closure $fn = null)
 {
     $this->docDir = $dir;
     $this->source = $sourceDir;
     if (!is_dir($sourceDir)) {
         throw new \Error("Source directory does not exist, or it is not a directory!");
     }
     if (!empty($routePath)) {
         $this->setRoutePath($routePath);
     }
     if (isset($fn)) {
         $fn->call($this);
     }
 }
开发者ID:janpoem,项目名称:kephp,代码行数:14,代码来源:DocMen.php


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