nochso / omni
Helps with every day nuisances like path or EOL handling.
Requires
- php: ^5.6 || ^7.0
- symfony/polyfill-mbstring: ^1.1
Requires (Dev)
- fabpot/php-cs-fixer: ^1.11
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^5.2
Suggests
- fabpot/php-cs-fixer: Automatically fix PHP code style issues. See namespace \nochso\Omni\PhpCsFixer
README
nochso/omni helps with every day nuisances like path or EOL handling.
- Simple solutions: This is not an alternative for more specific packages.
- Fully tested.
- Strictly follows Semantic Versioning 2.0.0.
- Clean code with low complexity.
- No dependencies other than symfony/polyfill-mbstring.
- Not a framework.
- Not another object-based wrapper around the standard PHP library.
- One less reason to stumble upon the PHP.net comment section or have a Stackoverflow deja-vu.
Table of contents:
Requirements
PHP 5.6.0, 7.0 or higher.
Installation and autoloading via Composer is recommended. You're free to use any other PSR-4 compatible autoloader on folder src/
.
Optional requirements
fabpot/php-cs-fixer
is required by namespace nochso\Omni\PhpCsfixer
.
Installation
composer require nochso/omni
You can now use the namespace \nochso\Omni
.
API summary
For full API documentation, see API.md.
This is a short summary of namespaces, classes, interfaces and traits.
N
nochso\Omni
C
ArrayCollection
wraps an array, providing common collection methods.C
Arrays
class provides methods for array manipulation missing from default PHP.C
Dot
allows easy access to multi-dimensional arrays using dot notation.C
DotArray
holds a multi-dimensional array and wraps the static API of\nochso\Omni\Dot
.C
EOL
detects, converts and returns information about line-endings.C
Exec
creates objects that help manage\exec()
calls.C
Folder
handles file system folders.C
Multiline
string class for working with lines of text.C
Numeric
validates and converts mixed types to numeric types.C
OS
OS.C
Path
helps keep the directory separator/implode/trim/replace madness away.C
Strings
class provides methods for string handling missing from default PHP.C
Type
returns PHP type information.C
VcsVersionInfo
enriches an internal VersionInfo with the latest tag and current repository state.C
VersionInfo
consists of a package name and version.
N
nochso\Omni\Format
C
Bytes
formats a quantity of bytes using different suffixes and binary or decimal base.C
Duration
formats seconds or DateInterval objects as human readable strings.C
Quantity
formats a string depending on quantity (many, one or zero).
N
nochso\Omni\PhpCsFixer
C
DefaultFinder
respects ignore files for Git, Mercurial and Darcs.C
PrettyPSR
lies inbetween FixerInterface's PSR2 and Symfony level.
Change log
See CHANGELOG.md for the full history of changes between releases.
[0.3.8]
Added
- Add placeholder
%s
for quantity inFormat\Quantity
.
Changed
DurationFormat
can now handle milliseconds.
[0.3.7] - 2016-04-16
Fixed
- Fix handling of absolute
scheme://
paths inPath::combine
Contributing
Feedback, bug reports and pull requests are always welcome.
Please read the contributing guide for instructions.
License
This project is released under the MIT license. See LICENSE.md for the full text.