-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04cb07d
commit e3b8dde
Showing
16 changed files
with
736 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,58 @@ | ||
# Is Thirteen | ||
An PHP package to check if a number is equal to 13. | ||
An PHP package to check if a number is equal to 13. Ispirate by jezen/is-thirteen library. | ||
|
||
### Installation | ||
```` | ||
composer require fatkulnurk/is-thirteen | ||
```` | ||
|
||
### Usage | ||
In use, we provide several options. first option using objects from class Is and the second option using the is () function which can be called globally. | ||
|
||
```` | ||
<?php | ||
use Fatkulnurk\IsThirteen\Is; | ||
var_dump((new Is(13))->thirteen()); //true | ||
echo "\r\n"; | ||
var_dump((new Is(12.8))->roughly()->thirteen()); // true | ||
echo "\r\n"; | ||
var_dump((new Is(6))->within(10)->of()->thirteen()); // true | ||
echo "\r\n"; | ||
var_dump((new Is(2007))->yearOfBirth()); // true | ||
echo "\r\n"; | ||
// now with elegant syntax. | ||
echo (new Is(13))->thirteen(); //true | ||
echo (new Is(12.8))->roughly()->thirteen(); // true | ||
echo (new Is(6))->within(10)->of()->thirteen(); // true | ||
echo (new Is(2007))->yearOfBirth(); // true | ||
echo "Math"; | ||
echo "\r\n"; | ||
var_dump((new Is(4))->plus(5)->thirteen()); // false | ||
echo "\r\n"; | ||
var_dump((new Is(12))->plus(1)->thirteen()); // true | ||
echo "\r\n"; | ||
var_dump((new Is(4))->minus(12)->thirteen()); // false | ||
echo "\r\n"; | ||
var_dump((new Is(14))->minus(1)->thirteen()); // true | ||
echo "\r\n"; | ||
var_dump((new Is(1))->times(8)->thirteen()); // false | ||
echo "\r\n"; | ||
var_dump((new Is(26))->divideby(2)->thirteen()); // true | ||
echo "\r\n"; | ||
```` | ||
echo (new Is(4))->plus(5)->thirteen(); // false | ||
echo (new Is(12))->plus(1)->thirteen(); // true | ||
echo (new Is(4))->minus(12)->thirteen(); // false | ||
echo (new Is(14))->minus(1)->thirteen(); // true | ||
echo (new Is(1))->times(8)->thirteen(); // false | ||
echo (new Is(26))->divideby(2)->thirteen(); // true | ||
```` | ||
|
||
|
||
### Example | ||
|
||
is-thirteen with (new) : | ||
```` | ||
<?php | ||
include "vendor/autoload.php"; | ||
use Fatkulnurk\IsThirteen\Is; | ||
if((new Is(13))->thirteen()) { | ||
echo "is thirteen"; | ||
} | ||
```` | ||
|
||
is-thirteen with helper function : | ||
```` | ||
<?php | ||
include "vendor/autoload.php"; | ||
use Fatkulnurk\IsThirteen\Is; | ||
if(is(13))->thirteen()) { | ||
echo "is thirteen"; | ||
} | ||
```` | ||
|
||
--- | ||
Created by fatkulnurk@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
if (!function_exists('is')) { | ||
function is($value) | ||
{ | ||
return new \Fatkulnurk\IsThirteen\Is($value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
// autoload.php @generated by Composer | ||
|
||
require_once __DIR__ . '/composer/autoload_real.php'; | ||
|
||
return ComposerAutoloaderInit846024932cc7e0fb8d13d5038ae20a85::getLoader(); |
Oops, something went wrong.