定制 vjik/linkify 二次开发

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

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

vjik/linkify

最新稳定版本:1.0.0

Composer 安装命令:

composer require vjik/linkify

包简介

Matches things like email addresses, web URLs, etc. in the text and makes them clickable links.

README 文档

README

Latest Stable Version Total Downloads Build status Mutation testing badge static analysis

The package provide Linkify class that matches things like email addresses, web URLs, etc. in the text and makes them clickable links.

Requirements

  • PHP 7.4 or higher.

Installation

The package could be installed with composer:

composer require vjik/linkify --prefer-dist

General usage

$linkify = new \Vjik\Linkify\Linkify(
    new \Vjik\Linkify\HttpPattern(),
    new \Vjik\Linkify\EmailPattern(),
); 

$text = 'Contacts: https://example.com, info@example.com.';

$result = $linkify->process($text);

$result will be:

Contacts: <a href="https://example.com">example.com</a>, <a href="mailto:info@example.com">info@example.com</a>.

Testing

Unit testing

The package is tested with PHPUnit. To run tests:

./vendor/bin/phpunit

Mutation testing

The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:

./vendor/bin/roave-infection-static-analysis-plugin

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

License

The Linkify is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-02-17