承接 tbn/getter-trait-bundle 相关项目开发

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

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

tbn/getter-trait-bundle

最新稳定版本:4.1.0

Composer 安装命令:

composer require tbn/getter-trait-bundle

包简介

README 文档

README

Symfony Bundle that generates getters and setters inside a trait.

Why ? Basics getters brings no information about the class.

The classes are quickly long for no "business" reason.

Having only the redefined method allows to spot the method with business purpose.

Installation

composer require --dev "tbn/getter-trait-bundle"

In config/bundles.php, add the bundle to the dev environment

return [
    ...
    tbn\GetterTraitBundle\GetterTraitBundle::class => ['dev' => true,],
];

Usage

Add the GetSetTrait attribute to your class

use tbn\GetterTraitBundle\Attributes\GetSetTrait; // add this line

#[GetSetTrait] // add this line
class MyClass
{
    private String $name;
}

Run the ./bin/console generate:getter:traits command

A new file is automatically generated in the same folder and contains the getters and setters for the MyClass class.

When a property is modified or added, you have to re-run the command in order to update the traits.

Use the generated trait.

#[GetSetTrait]
class MyClass
{
    use MyClassTrait; // add this line

    private String $name;
}

I need to redefine the method

Just copy/paste the generated code inside your class and update it to your needs.

More examples

Example folder

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固