savinmikhail/primitive_wrappers 问题修复 & 功能扩展

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

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

savinmikhail/primitive_wrappers

最新稳定版本:v1.2.0

Composer 安装命令:

composer require savinmikhail/primitive_wrappers

包简介

The object wrappers and static helpers for php primitive types

README 文档

README

EO principles respected here Code Coverage Quality Score

Object-Oriented Primitive Wrappers

This PHP library provides object-oriented wrappers for primitive data types, aiming to improve code readability, maintainability, and error handling compared to traditional procedural approaches.

Worth to mention, that some other programming languages like Java, Python etc have it built-in.

Features

  • Object-Oriented Design: The library offers object-oriented wrappers for primitive types, allowing developers to work with primitives in a less imperative style.

  • Enhanced Error Handling: The library provides more robust error handling mechanisms, so you don't have to remember to check whether some json_decode returned false, or null, or empty string, or threw Error or Exception.

  • Improved Readability: Clear and descriptive method names enhance code readability and maintainability, so you don't have to worry whether function calls str_split or strSplit or split. Either to remember what some strpbrk mean

  • Advanced Methods: You can convert cases (e.g. from camel to snake) fluently, or get words from a string, and many more!

Installation

Run

composer require savinmikhail/primitive_wrappers

Example Usage

use Mikhail\PrimitiveWrappers\Str;

// Create a string wrapper
$str = new Str('Hello, world!');

// Get the length of the string
$length = $str->length();

// Use methods as a builder
$lowercaseCapitalized = $str->toLower()->capitalize();

//use some more advanced methods
$snake = (new Str('Lorem ipsum dolor sit amet'))->snake(); //lorem_ipsum_dolor_sit_amet

Similar projects

Symfony string

Illuminate Str

Primitive objects

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on GitHub.

License

This library is released under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固