承接 dharmvijay/constant-class-for-enum 相关项目开发

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

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

dharmvijay/constant-class-for-enum

Composer 安装命令:

composer require dharmvijay/constant-class-for-enum

包简介

Base constant class to create constants for enum and different other general purposes with some other features like check exist ,get values ,get keys... etc.

README 文档

README

Base constant class to create constants for enum and different other general purposes with some other features like check exist ,get values ,get keys... etc.

Installation

Require this package with composer:

composer require dharmvijay/constant-class-for-enum

Usage

Create Enum Constant Class


<?php
/**
 * Created by PhpStorm.
 * User: Dharmvijay
 * Date: 27-07-2018
 * Time: 12:21 PM
 */

namespace App\Http\Enum;

use Dharmvijay\ConstantClassForEnum\BaseEnum;

class UnitTest extends BaseEnum
{
    const LATEST_API_VERSION = "v2";
}


Get value by key


$version = UnitTest::getValueByKey('LATEST_API_VERSION');

Use constant and get Value


$version = UnitTest::LATEST_API_VERSION;

Check it has a specific key


$version = $value = UnitTest::hasKey('LATEST_API_VERSION');

Check it has a specific value


$version = $value = UnitTest::hasValue('v2');

Get all keys


$keys = $value = UnitTest::getKeys();

Get all values


$values = $value = UnitTest::getValues();

Get all constants with keys and values


$constants = UnitTest::toDictionary();

Get all constants with keys and values in ascending order by key


$constants = UnitTest::getClassConstantsInAscendingOrder();

Get all constants with keys and values in descending order by key


$constants = UnitTest::getClassConstantsInDescendingOrder();

Checks if a key exists in constant names if yes then return value else return false.


$constants = UnitTest::getValueIfHasKey('LATEST_API_VERSION');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固