承接 twindigital/instantiator 相关项目开发

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

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

twindigital/instantiator

最新稳定版本:1.0.0

Composer 安装命令:

composer require twindigital/instantiator

包简介

README 文档

README

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version License

Lightweight instantiator.

Installation

Install using composer require stratadox/instantiator

What is this?

The Instantiator module provides a most simplistic way of producing empty instances.

An Instantiator is configured to produce instances of a specific class. In this way it differs from most other instantiator packages, which usually specify the class to instantiate as method parameter.

Basic usage

<?php
use Stratadox\Instantiator\ObjectInstantiator;

$provideFoo = ObjectInstantiator::forThe(Foo::class);

assert($provideFoo->instance() instanceof Foo);
assert(Foo::class === $provideFoo->class());

How does it work?

The ObjectInstantiator class basically just extends ReflectionClass in order to alias its newInstanceWithoutConstructor method. In cases where this instantiation method fails, for instance when a final class inherits from an internal class, deserialization is used instead.

Alternatively, this module includes a PredefinedInstanceProvider. This one isn't really an instantiator, but rather an iterator, but that does not stop it from implementing the Instantiator interface.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固