承接 drupol/anonymize 相关项目开发

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

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

drupol/anonymize

Composer 安装命令:

composer require drupol/anonymize

包简介

Converts an object/class into an anonymous class.

README 文档

README

Latest Stable Version GitHub stars Total Downloads Build Status Scrutinizer code quality Code Coverage Mutation testing badge License Say Thanks! Donate!

Anonymize

Description

Convert a regular class into an anonymous class.

Features

  • Converts public properties and methods into dynamic classes and properties.

Requirements

  • PHP >= 7.1.3

Installation

composer require drupol/anonymize

Usage

Using the object:

<?php

include 'vendor/autoload.php';

class Hello
{
    public $property = 'YES!';

    public function say()
    {
        echo 'Hello ' . $this->world();
    }

    private function world()
    {
        return 'world!';
    }
}

$class = new Hello();
$class->say(); // Hello world!

$anonymizedClass = \drupol\Anonymize\Anonymize::convertToAnonymous($class);

$anonymizedClass::addDynamicMethod('say', function () use ($anonymizedClass) {
    echo 'Goodbye ' . $anonymizedClass->world();
});

$anonymizedClass::addDynamicMethod('world', function () {
    return 'universe!';
});

$anonymizedClass->say(); // Goodbye universe!

API

<?php

/**
 * Convert an object into an anonymous object.
 *
 * @param \stdClass $object
 *   The object to convert.  
 *
 * @return Anonymize
 */
AnonymizeTrait::convertToAnonymous($object);

The rest of the library API relies and inherit from DynamicObjects.

Code quality, tests and benchmarks

Every time changes are introduced into the library, Travis CI run the tests and the benchmarks.

The library has tests written with PHPSpec. Feel free to check them out in the spec directory. Run composer phpspec to trigger the tests.

Before each commit some inspections are executed with GrumPHP, run ./vendor/bin/grumphp run to check manually.

PHPInfection is used to ensure that your code is properly tested, run composer infection to test your code.

Contributing

Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)

Sponsors

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固