承接 vdhicts/keepachangelog-parser 相关项目开发

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

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

vdhicts/keepachangelog-parser

Composer 安装命令:

composer require vdhicts/keepachangelog-parser

包简介

Parser for the Keep A Changelog standard

README 文档

README

Parser for the Keep A Changelog standard.

Requirements

This package requires at least PHP 8.2 or newer.

Installation

You can install the package via composer:

composer require vdhicts/keepachangelog-parser

Usage

This package is intended to be easy to use.

Parsing the changelog

$content = file_get_contents('CHANGELOG.md');

$parser = new \Vdhicts\KeepAChangelog\Parser();
$changelog = $parser->parse($content);

Using a different date format

The parser will parse the releases with the Y-m-d format by default. If you would like to use another format, you can just pass the format to the setDateFormat function.

$content = file_get_contents('CHANGELOG.md');

$parser = new \Vdhicts\KeepAChangelog\Parser();
$changelog = $parser
    ->setDateFormat('Y-m-d H:i:s')
    ->parse($content);

Accessing the changelog

The parser will return a Changelog models, with contains a collection of Release models. The Release model contains a collection of Section models.

The changelog has several methods the retrieve information:

// Get the description of the changelog, which returns an array of lines
$descriptionHtml = implode('<br>', $changelog->getDescription());

// Determine if the changelog has any releases
$changelog->hasReleases();

// Get the unreleased section
$unreleased = $changelog->getUnreleased();

// Get the latest release
$latestRelease = $changelog->getLatestRelease();

When all releases are retrieved, the newest will be the first and the unreleased will be the last one when present.

The release has several methods to get information about the release:

// Determine if the current one is the unreleased section
$isUnreleased = $release->isUnreleased();

// Get the version for the release
$version = $release->getVersion();

// Get the release date, will be null when not released or a date isn't provided
$data = $release->getReleasedAt();

// Get the tag reference, usually something like https://github.com/vdhicts/keepachangelog-parser/compare/v0.0.1...v1.0.0
$tagReference = $release->getTagReference();

// Get a specific section of the release
$added = $release->getSection(Section::ADDED);

// Get the collection of sections for the release
$sections = $release->getSections();

The section consists of a type (like Added, etc.) and an array of entries:

$type = $section->getType();
$entries = $section->getEntries();

$entriesHtml = implode('<br>', $entries);

Tests

Unit tests are available in the tests folder. Run with:

composer test

When you want a code coverage report which will be generated in the build/report folder. Run with:

composer test-coverage

Contribution

Any contribution is welcome, but it should meet the PSR-12 standard and please create one pull request per feature/bug. In exchange, you will be credited as contributor on this page.

Security

If you discover any security related issues in this or other packages of Vdhicts, please email security@vdhicts.nl instead of using the issue tracker.

Support

If you encounter a problem with this parser or has a question about it, feel free to open an issue on GitHub.

License

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

vdhicts/keepachangelog-parser 适用场景与选型建议

vdhicts/keepachangelog-parser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.78k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「parser」 「changelog」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 vdhicts/keepachangelog-parser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 vdhicts/keepachangelog-parser 我们能提供哪些服务?
定制开发 / 二次开发

基于 vdhicts/keepachangelog-parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-15