Download the PHP package lfyw/lfyw-enum without Composer

On this page you can find all versions of the php package lfyw/lfyw-enum. 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 lfyw-enum

lfyw-enum

A php8.1 enum helper..

StyleCI build status

Installing

Usage

创建枚举类

枚举类会创建在 app/Enums 目录下

生成文件内容如下,可以在其中继续添加枚举值:

使用方法

UserType::getValues()

获取所有枚举值,如果不是一个回退枚举回返回一个空数组

UserType::getNames()

获取所有枚举名

UserType::getDescriptions()

获取所有注释。

UserType::getDescriptionByValue($value):string

根据值获取注释

UserType::getDescriptionByName(string $name):string

根据名称获取注释

UserType::USER()

调用UserType::User->value,如果不是回退枚举返回null

UserType::hasValue($value, bool $strict = false)

检查枚举中是否包含某个值。

UserType::ADMIN->getDescription()

获取注释。如果不是回退枚举且没有覆盖默认的getDescriptions()方法会抛出一个异常。

UserType::ADMIN->getName()

获取名称

UserType::ADMIN->getValue()

获取值。必须是一个回退枚举,否则会抛出一个异常。

表单验证

License

MIT


All versions of lfyw-enum with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 lfyw/lfyw-enum contains the following files

Loading the files please wait ....