承接 zloynick/joole-containers 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

zloynick/joole-containers

Composer 安装命令:

composer require zloynick/joole-containers

包简介

README 文档

README

Joole Containers is a library for storing objects. At its core, it is an implementation of PSR-12 and its complement.

Getting started

  • Install it with using composer:
composer require zloynick/joole-containers

Using

  • Create a container object:

use joole\containers\Container;

$container = new Container();
...

  • Register your object to created container:
...
class MyCustomPeople{

    private string $age;
    private string $name;

    public function __construct(
        $name,
        $age
    )
    {
        $this->name = $name;
        $this->age = $age;
    }

    public function getName(): string
    {
        return $this->name;
    }

}

$container->register(MyCustomPeople::class, ['name' => 'Alex', 'age' => 22]);
...

Now we can use the object from the container


...
echo $container->get(MyCustomPeople::class)->getName();// Alex
...

Addition functional

  • You can get number of object in container: $count = count($container);
  • Multiple push:

$container->multiplePush(['param1' => [1, 2, 3], 'param2' => new stdClass()], Class1::class, Class2::class);

Note: the keys of the array of parameters must correspond to the name of the variables of the constructor classthe keys of the array of parameters must correspond to the name of the variables of the constructor class.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2022-04-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固