ellipse/resolvable-callable 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ellipse/resolvable-callable

Composer 安装命令:

composer require ellipse/resolvable-callable

包简介

Resolvable callable factory allowing to execute callables using a Psr-11 container

README 文档

README

This package provides a resolvable callable factory allowing to execute callables using a Psr-11 container.

Require php >= 7.0

Installation composer require ellipse/resolvable-callable

Run tests ./vendor/bin/kahlan

Resolve a callable

This package provides a factory producing instances of Ellipse\Resolvable\ResolvableCallable from callables. Those resolvable callable values can then be produced by calling the ->value() method with a Psr-11 container and an array of placeholder values.

<?php

namespace App;

use Some\Psr11Container;

use Ellipse\Resolvable\DefaultResolvableCallableFactory;

// The callable to resolve.
$callable = function (SomeClass $p1, int $p2 = 0, int $p3, string $p4 = 'p4') {

    // $p1 is the instance returned by $container->get(SomeClass::class);
    // $p2 value is 2
    // $p3 value is 3
    // $p3 value is 'p4'

    return 'result';

};

// Some Psr-11 container.
$container = new Psr11Container;

// Resolve the callable. $resolved value is 'result'.
$factory = new DefaultResolvableCallableFactory;

$resolved = $factory($callable)->value($container, [2, 3]);

统计信息

  • 总下载量: 191
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固