承接 f2/getset 相关项目开发

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

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

f2/getset

Composer 安装命令:

composer require f2/getset

包简介

A trait `F2\GetSet` that implements getters and setters with public, protected and private visibility and type checking.

README 文档

README

Simple library that enables creating getters and setters with PHP in a consistent manner. Supports visibility and type hinting.

Simple getter and setter

<?php
class MyClass {
    use F2\GetSet;

    private $secret_value = "Initial value";

    /**
     * Any method that starts with "get_" is automatically a getter
     *
     * public, protected and private visibility is accepted and enforced.
     * Type checking is enforced by PHP automatically.
     */
    public function get_value(): string {
        return $this->secret_value;
    }

    /**
     * Any method that starts with "set_" is automatically a getter
     *
     * public, protected and private visibility is accepted and enforced.
     * Type checking is enforced by PHP automatically.
     */
    public function set_value(string $value): void {
        $this->secret_value = $value;
    }
}

$instance = new MyClass();

$instance->value .= ' and some more';
// Log: The property 'value' was read
// Log: The property 'value' was set to 'Initial value and some more'

## No dependencies

This library has no dependencies (except a development dependency f2/asserty)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固