pixel418/ubiq 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pixel418/ubiq

最新稳定版本:v0.5.0

Composer 安装命令:

composer require pixel418/ubiq

包简介

Functions for readable treatment of string, array & object

README 文档

README

Functions for readable treatment of string, array & object.

  1. Let's code
    1.1 Simple
    1.2 Readable
    1.3 Normalized
  2. Documentation
    2.1 String manipulation
    2.2 Array manipulation
    2.3 Object manipulation
  3. How to Install
  4. How to Contribute
  5. Author & Community

Let's code

Simple

With Ubiq, your treatments are simple.

$string = 'example.com/my/path';
\UString::substrBefore( $string, '/' );
// Returns 'example.com'
// Instead of usual implementation: substr( $string, 0, strpos( $string, '/' ) );

↑ top

Readable

With Ubiq, even your complex treatments still readable.

$string = 'example.com/my/path';
\UString::substrBefore( $string, '/' );
// Returns 'example.com'
\UString::substrBefore( $string, [ '/', '.' ] );
// Returns 'example'
\UString::substrBeforeLast( $string, [ '/', '.' ] );
// Returns 'example.com/my'

↑ top

Normalized

Ubiq has consistent and normalized api.

$string = 'my/path';
// Without prefix, the method return the result of the treatment
\UString::startWith( $string, '/' );
// Returns '/my/path'
$string = 'my/path';
// With 'is' prefix, the method return the result of the test
\UString::isStartWith( $string, '/' );
// Returns FALSE
$string = 'my/path';
// With 'do' prefix, the method treat by reference
\UString::doStartWith( $string, '/' );
// $string value is now '/my/path'

↑ top

How to Install

If you don't have composer, you have to install it.

Add or complete the composer.json file at the root of your repository, like this :

{
    "require": {
        "pixel418/ubiq": "0.4.*"
    }
}

Ubiq can now be downloaded via composer.

To use it, you just have to load the composer autoloader :

require_once( './vendor/autoload.php' );

↑ top

How to Contribute

  1. Fork the Ubiq repository
  2. Create a new branch for each feature or improvement
  3. Send a pull request from each feature branch to the develop branch

If you don't know much about pull request, you can read the Github article.

All pull requests must follow the PSR1 standard and be accompanied by passing phpunit tests.

↑ top

Author & Community

Ubiq is under the MIT License.
It is created and maintained by Thomas ZILLIOX.

↑ top

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-01-11