AlphaLabs Common
, (*1)
Toolbox which let's you play with ease with primitive types and common objects, (*2)
This library offers some tools to deal with some primitives and/or some common objects., (*3)
For the moment, few tools are provided for the following types:, (*4)
-
Numbers: Intergers, floats...
-
Strings: Detect slug patterns...
Installation
Adds the library in your composer.json
file:, (*5)
"require": {
"alphalabs/common": "1.0@dev"
}
Don't forget to update your dependencies with composer update
, (*6)
Usage
Adds the use
statement for the tools you want to use, and call the static methods directly:, (*7)
<?php
namespace Foo\Bar;
use AlphaLabs\Common\Number\Number;
class MyClass
{
public function foo()
{
$number = "-3";
Number::isStrictlyPositiveInteger($number) // False
}
}
To come
- Collections
- (propose your ideas)
Credits
License
MIT, (*8)