Download the PHP package maliboot/lombok without Composer

On this page you can find all versions of the php package maliboot/lombok. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lombok

Lombok

简介

这是一个通过注解来减少重复代码的工具。 本插件参考了Java库-Lombok奇思妙想编写而成,与其一样,致力于解放开发者的双手☕️~。最后,本插件的名称也以lombok向其致敬。

功能

依赖

安装

使用

1.1 #[Getter]基本使用,#[ToArray]#[ToCollection]同理

1.1.1、在不使用lombok以前,我们实现一个Getter功能, 需要写如下代码:

使用lombok后,我们只需要添加一个Getter注解,皆可省掉以上方法:

1.2 #[Logger]基本使用

1.3 进阶用法

1.3.1、可用注解如下
注解 功能
\MaliBoot\Lombok\Annotation\Getter 生成类属性Getter方法
\MaliBoot\Lombok\Annotation\Setter 生成类属性Setter方法
\MaliBoot\Lombok\Annotation\GetterSetter 集成SetterGetter功能
\MaliBoot\Lombok\Annotation\Logger 生成类属性public \Psr\Log\LoggerInterface $logger
\MaliBoot\Lombok\Annotation\ToArray 生成类方法public static function toArray(object $class): array
\MaliBoot\Lombok\Annotation\ToCollection 生成类方法public static function toCollection(object $class): Collection方法
\MaliBoot\Lombok\Annotation\Of 生成类方法public static function of(array $fieldMap): self方法
\MaliBoot\Lombok\Annotation\Lombok 集成以上所有注解功能
\MaliBoot\Lombok\Annotation\Delegate 生成类委托,可将本类不存在的常量、属性、方法委托给其它interfaceabstract classclass处理(暂不支持含有抽象方法的接口与抽象类)
1.3.2、注解增强

当我们的项目里已有DTO注解,想为此注解支持Getter功能时,可以如下操作

1.3.3、注解增强 - 自定义组合

当然,同时我们需要自定义一个(或者老项目里已有的一个类注解扩展支持)同时拥有Setter,Getter, Logger等多功能的注解,并且可以自定义组合这些功能时。那么同理,只需要在某注解上继续继承相应的注解接口皆可。可用的接口如下

注解接口 功能
\MaliBoot\Lombok\Contract\GetterAnnotationInterface 生成类属性Getter方法
\MaliBoot\Lombok\Contract\SetterAnnotationInterface 生成类属性Setter方法
\MaliBoot\Lombok\Contract\LoggerAnnotationInterface 生成类属性public \Psr\Log\LoggerInterface $logger
\MaliBoot\Lombok\Contract\ToArrayAnnotationInterface 生成类方法public static function toArray(): array
\MaliBoot\Lombok\Contract\ToCollectionAnnotationInterface 生成类方法public static function toCollection(): Collection方法
\MaliBoot\Lombok\Contract\OfAnnotationInterface 生成类方法public static function of(array $fieldMap): self方法
\MaliBoot\Lombok\Contract\DelegateAnnotationInterface 生成类委托,可将本类不存在的常量、属性、方法委托给其它interfaceabstract classclass处理(暂不支持含有抽象方法的接口与抽象类)
1.3.4、自定义lombok注解

当然,我们也可以自己做一个lombok功能。比如,我们给./app/Foo.php扩展一个swap方法。

注意事项


All versions of lombok with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
hyperf/di Version ^3.0
hyperf/logger Version ~3.0.0
hyperf/collection Version ~3.0.0
hyperf/stringable Version ~3.0.0
jetbrains/phpstorm-attributes Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package maliboot/lombok contains the following files

Loading the files please wait ....