donurks/php-typed-array 问题修复 & 功能扩展

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

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

donurks/php-typed-array

Composer 安装命令:

composer require donurks/php-typed-array

包简介

A base class for typed arrays.

README 文档

README

Build Status Latest Stable Version Total Downloads License

php-typed-array

A PHP class for type safe arrays. This project is based on PHPs ArrayObject.

Features

  • type safe arrays
  • arrays for PHP language types
    • boolean
    • integer
    • string
    • float

Installation (with Composer)

Command line

composer require donurks/php-typed-array

Usage

Classes

<?php
chdir(dirname(__DIR__));
require_once "vendor/autoload.php";

class MyOwnType extends \Donurks\AbstractTypedArray
{
    protected $type = \stdClass::class;
}

$myOwnType = new MyOwnType([
    new \stdClass(),
    new \stdClass(),
    new \stdClass(),
]);

PHP language types

<?php
chdir(dirname(__DIR__));
require_once "vendor/autoload.php";

$strings = new \Donurks\TypedArray\TypeString([
    'string1',
    'string2',
    'string3'
]);

$booleans = new \Donurks\TypedArray\TypeBoolean([
    true,
    false,
    true
]);

$integers = new \Donurks\TypedArray\TypeInteger([
    1,
    124,
    3434
]);

$floats = new \Donurks\TypedArray\TypeFloat([
    1.234,
    1.2e3,
    7E-10
]);

Exception

<?php
chdir(dirname(__DIR__));
require_once "vendor/autoload.php";

$strings = new \Donurks\TypedArray\TypeString([
    'string1',
    'string2',
    'string3'
]);

$booleans = new \Donurks\TypedArray\TypeBoolean([]);
$booleans[] = true;

try {
    $booleans[] = 'not-a-boolean';    
} catch (\Donurks\TypedArray\Exception $e) {
    die($e->getMessage());
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固