定制 fractal/semver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fractal/semver

Composer 安装命令:

composer require fractal/semver

包简介

The package helps to work with semantic versions.

README 文档

README

Coverage and Quality:

Coverage Status Code Coverage Scrutinizer Code Quality Code Intelligence Status codecov.io

Build:

Build Status Build Status

Other:

Latest Stable Version Total Downloads License

Features

  • Simple package for semantic version manipulation.
  • Compare semantic version.
  • Validates semantic version.
  • Throws exceptions if Versions are not instance of each other.

Usage

Fractal\SemVer\SemanticVersion class:

<?php
    
use Fractal\SemVer\SemanticVersion;
    
## Create instance of SemVer
## If SemVer not valid, throws \Fractal\SemVer\Exceptions\ParseVersionException
$version = SemanticVersion::fromString('1.0.0'); # \Fractal\SemVer\Contracts\VersionInterface
$other = SemanticVersion::fromString('0.1.0'); # \Fractal\SemVer\Contracts\VersionInterface

## Version can compare each other
## If compare operator not valid, throws \Fractal\SemVer\Exceptions\InvalidOperatorException
## If version and other version are not instance of each other, throws \Fractal\SemVer\Exceptions\VersionClassNotEqualException
$version->eq($other); # false
$version->gte($other); # true

Fractal\SemVer\Comparator class:

<?php
    
use Fractal\SemVer\SemanticVersion;
use Fractal\SemVer\Comparator;
    
## Create instance of SemVer
## If SemVer not valid, throws \Fractal\SemVer\Exceptions\ParseVersionException
$version = SemanticVersion::fromString('1.0.0'); # \Fractal\SemVer\Contracts\VersionInterface
$other = SemanticVersion::fromString('0.1.0'); # \Fractal\SemVer\Contracts\VersionInterface

## Compare versions with comparator
## If compare operator not valid, throws \Fractal\SemVer\Exceptions\InvalidOperatorException
## If version and other version are not instance of each other, throws \Fractal\SemVer\Exceptions\VersionClassNotEqualException
Comparator::eq($version, $other); # false
Comparator::gte($version, $other); # true

License

The SemVer package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固