Multibyte strings as objects

Overview

Opis String

Tests Latest Stable Version Latest Unstable Version License

Multibyte strings

Opis String is a tiny library that allows you to work with multibyte encoded strings in an object-oriented manner. The library has no dependencies to mb_string or similar PHP extensions.

Documentation

The full documentation for this library can be found here.

License

Opis String is licensed under the Apache License, Version 2.0.

Requirements

  • PHP ^7.4 || ^8.0
  • ext-json
  • ext-iconv

Installation

Opis String is available on Packagist and it can be installed from a command line interface by using Composer.

composer require opis/string

Or you could directly reference it into your composer.json file as a dependency

{
    "require": {
        "opis/string": "^2.0"
    }
}
You might also like...
Parse DSN strings into value objects to make them easier to use, pass around and manipulate

DSN parser Parse DSN strings into value objects to make them easier to use, pass around and manipulate. Install Via Composer composer require nyholm/d

A PHP string manipulation library with multibyte support

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')-toTitleCase()-ensureRight('y') ==

:accept: Stringy - A PHP string manipulation library with multibyte support, performance optimized

πŸ‰‘ Stringy A PHP string manipulation library with multibyte support. Compatible with PHP 7+ 100% compatible with the original "Stringy" library, but t

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM.

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')-toTitleCase()-ensureRight('y') ==

Stringy - A PHP string manipulation library with multibyte support, performance optimized

Stringy - A PHP string manipulation library with multibyte support, performance optimized

PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.

πŸ“’ Yell PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects. Requirement

Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.DeepEqual().

Deeper Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.De

Generate Data Transfer Objects directly from JSON objects
Generate Data Transfer Objects directly from JSON objects

Json 2 DTO Spatie's Data Transfer Object library is awesome, but typing out DTOs can quickly become a chore. Inspired by Json2Typescript style tools,

CakeDC Auth Objects is a refactor of the existing Auth objects present in the CakeDC Users Plugin, to let anyone else use them in their projects.

CakeDC Auth Objects is a refactor of the existing Auth objects present in the CakeDC Users Plugin, to let anyone else use them in their projects.

Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

Super Simple DTO Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

A library for generating random numbers and strings

RandomLib A library for generating random numbers and strings of various strengths. This library is useful in security contexts. Install Via Composer

Convert strings between 13 naming conventions: Snake case, Camel case, Kebab case, Pascal case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Title case, Sentence case and Dot notation.

Case converter Use this library to convert string between: Name Method Output example πŸͺ Camel case toCamel() myNameIsBond πŸ‘¨β€πŸ« Pascal case toPascal(

Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way.

String Component The String component provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a un

Eloquent Filter is a package for filter data of models by the query strings. Easy to use and fully dynamic.
Eloquent Filter is a package for filter data of models by the query strings. Easy to use and fully dynamic.

Eloquent Filter Eloquent Filter adds custom filters to your Eloquent Models in Laravel. It's easy to use and fully dynamic. Table of Content Introduct

A Laravel Larex plugin to import/export localization strings from/to Crowdin
A Laravel Larex plugin to import/export localization strings from/to Crowdin

Laravel Larex: Crowdin Plugin A Laravel Larex plugin to import/export localization strings from/to Crowdin πŸ“‹ Requirements PHP 7.4 | 8.0 Laravel β‰₯ 7 L

Goldbach Algorithms Mask is a PHP library developed for Symfony for apply a mask to strings.

Goldbach Algorithms Mask (fondly nicknamed GoldMask) is a PHP library developed for Symfony for apply a mask to strings.

Easily define tokens and options that can be replaced in strings.

Token Replace This simple package allows you to define tokens that can be replaced in strings. Instead of a simple str_replace, Token Replace lets you

Decimal handling as value object instead of plain strings.

Decimal Object Decimal value object for PHP. Background When working with monetary values, normal data types like int or float are not suitable for ex

Comments
  • Add missing return type for UnicodeString implementation

    Add missing return type for UnicodeString implementation

    While upgrading to Symfony 5.4 I noticed the follow reported deprecations:

    1x: Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Opis\String\UnicodeString" now to avoid errors or add an explicit @return annotation to suppress this message.

    1x: Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Opis\String\UnicodeString" now to avoid errors or add an explicit @return annotation to suppress this message.

    Maybe it is enough to explicitly add void return type to the UnicodeString::offsetUnset() and UnicodeString::offsetSet() methods?

    opened by matiux 1
  • Add more testings and set correct .travis settings

    Add more testings and set correct .travis settings

    Changed log

    • Add the .editorconfig to unify the coding style.
    • Set the different dist for PHP ```5.3`` to complete the travis build. It can refer this post.
    • Remove the --dev option from Composer CLI because it is the default option now.
    • Remove the --ignore-platform-reqs because it needs to check the dependency issue for the different PHP version.
    • Add more testings.
    • To throw the specified exception, set the @ for the iconv function. It will return false value and it will not throw the iconv error.
    • Add the code coverage service, like codecov or coveralls(if possible).
    opened by peter279k 0
Releases(2.0.1)
Owner
Opis
A fantastic collection of well crafted, developer-focused, open source libraries
Opis
A PHP string manipulation library with multibyte support

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')->toTitleCase()->ensureRight('y') ==

Daniel St. Jules 2.5k Jan 3, 2023
:accept: Stringy - A PHP string manipulation library with multibyte support, performance optimized

?? Stringy A PHP string manipulation library with multibyte support. Compatible with PHP 7+ 100% compatible with the original "Stringy" library, but t

Lars Moelleken 144 Dec 12, 2022
A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM.

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')->toTitleCase()->ensureRight('y') ==

Daniel St. Jules 2.5k Dec 28, 2022
Convert strings between 13 naming conventions: Snake case, Camel case, Kebab case, Pascal case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Title case, Sentence case and Dot notation.

Case converter Use this library to convert string between: Name Method Output example ?? Camel case toCamel() myNameIsBond ??‍?? Pascal case toPascal(

Jawira Portugal 147 Dec 24, 2022
Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way.

String Component The String component provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a un

Symfony 1.3k Dec 29, 2022
PHP library to detect and manipulate indentation of strings and files

indentation PHP library to detect and manipulate the indentation of files and strings Installation composer require --dev colinodell/indentation Usage

Colin O'Dell 34 Nov 28, 2022
Enables type-safe comparisons of objects in PHPUnit.

Strict PHPUnit Enables type-safe comparisons of objects in PHPUnit. Problem PHPUnit has a very powerful comparison system that helps you comparing obj

Webmozarts GmbH 17 Aug 29, 2022
Identifies objects in an image using Machine Learning.

laravel-object-detection This package identifies objects in an image using Machine Learning, TensorFlow and the coco-ssd model. Installation You can i

Fredrik 91 Oct 23, 2022
Multibyte strings as objects

Opis String Multibyte strings Opis String is a tiny library that allows you to work with multibyte encoded strings in an object-oriented manner. The l

Opis 58 Oct 6, 2022
Strings Package provide a fluent, object-oriented interface for working with multibyte string

Strings Package provide a fluent, object-oriented interface for working with multibyte string, allowing you to chain multiple string operations together using a more readable syntax compared to traditional PHP strings functions.

Glowy PHP 14 Mar 12, 2022