https://github.com/nochso/omni
Helps with every day nuisances like path or EOL handling.
https://github.com/nochso/omni
Last synced: 10 months ago
JSON representation
Helps with every day nuisances like path or EOL handling.
- Host: GitHub
- URL: https://github.com/nochso/omni
- Owner: nochso
- License: other
- Created: 2016-02-27T22:29:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-17T06:56:03.000Z (about 10 years ago)
- Last Synced: 2023-07-26T15:31:16.262Z (almost 3 years ago)
- Language: PHP
- Size: 168 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# nochso/omni
[](https://packagist.org/packages/nochso/omni)
[](https://github.com/nochso/omni/releases)
[](https://travis-ci.org/nochso/omni)
[](https://insight.sensiolabs.com/projects/fbc0e55a-bc4d-4936-9d27-72dfb913c323)
[](https://scrutinizer-ci.com/g/nochso/omni/?branch=master)
[](https://coveralls.io/github/nochso/omni?branch=master)
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](http://semver.org/spec/v2.0.0.html).
- Clean code with [low complexity](https://www.cs.helsinki.fi/u/luontola/tdd-2009/ext/ObjectCalisthenics.pdf).
- No dependencies other than [symfony/polyfill-mbstring](https://packagist.org/packages/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](https://i.imgur.com/SZPjHwz.jpg).
Table of contents:
- [nochso/omni](#nochsoomni)
- [Requirements](#requirements)
- [Installation](#installation)
- [API summary](#api-summary)
- [Change log](#change-log)
- [Contributing](#contributing)
- [License](#license)
# 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`](https://packagist.org/packages/fabpot/php-cs-fixer) is required by namespace `nochso\Omni\PhpCsfixer`.
# Installation
```php
composer require nochso/omni
```
You can now use the namespace `\nochso\Omni`.
# API summary
For full API documentation, see [API.md](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](CHANGELOG.md) for the full history of changes between releases.
## [0.3.8]
### Added
- Add placeholder `%s` for quantity in `Format\Quantity`.
### Changed
- `DurationFormat` can now handle milliseconds.
## [0.3.7] - 2016-04-16
### Fixed
- Fix handling of absolute `scheme://` paths in `Path::combine`
# Contributing
Feedback, bug reports and pull requests are always welcome.
Please read the [contributing guide](CONTRIBUTING.md) for instructions.
# License
This project is released under the MIT license. See [LICENSE.md](LICENSE.md) for the full text.