Skip to content

Commit 4f399ca

Browse files
authored
adding documentation
Added documentation for the library
2 parents 42f4b78 + aed6512 commit 4f399ca

File tree

2 files changed

+75
-3
lines changed

2 files changed

+75
-3
lines changed

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,73 @@
99

1010
## About ✍️
1111

12-
- This Is A JavaScript Library To Make Your Work Easier/Faster,<br />
13-
You Can See Functionalty.js Website From Here
12+
- This Is A Php Library To Make Your Work Easier/Faster,<br />
13+
You Can See Functionalty.php Website From Here
1414
- Project Created In 15 / 6 / 2022
15+
16+
## Installation 📦
17+
18+
- Using Composer
19+
```bash
20+
composer require functionality-library/functionality.php
21+
```
22+
- Now You Can Use Functionality.php Library In Your Project
23+
- Example
24+
```php
25+
require_once 'vendor/autoload.php';
26+
use Functionality\FunctionalityPhp\Functionality;
27+
28+
echo Functionality::randomColor(); // Random Color
29+
```
30+
## Usage 📚
31+
- Randoms functions
32+
- `Functionality::randomColor()` - Generate Random Color
33+
- `Functionality::randomBoolean()` - Generate Random Boolean
34+
- `Functionality::randomNumber()` - Generate Random Number
35+
- `Functionality::randomString()` - Generate Random String
36+
- `Functionality::randomHsl()` - Generate Random Hsl Color
37+
- `Functionality::randomHexColor()` - Generate Random Hex Color
38+
- Numbers functions
39+
- `Functionality::getAvg(float $a, float $b)` - Get Average butween two numbers
40+
- `Functionality::isEven(float $number)` - Check If Number Is Even
41+
- `Functionality::isOdd(float $number)` - Check If Number Is Odd
42+
- `Functionality::isPrime(int $number)` - Check If Number Is Prime
43+
- `Functionality::reverseNumber(float $number)` - Reverse a number (e.g. 12345 -> 54321)
44+
- Strings functions
45+
- `Functionality::isPalindrome(string $string)` - Check If String Is Palindrome
46+
- `Functionality::capitalize(string $string)` - Capitalize First Letter Of Words In String
47+
- `Functionality::reverseString(string $string)` - Reverse a string (e.g. abcdef -> fedcba)
48+
- Arrays functions
49+
- `Functionality::filter(array $array, callable $callable)` - Filter Array By Callable
50+
- `Functionality::getFactors(int $number)` - Get Factors Of Number
51+
- `Functionality::maxArray(array $array)` - Get Max Value Of Array
52+
- `Functionality::minArray(array $array)` - Get Min Value Of Array
53+
- `Functionality::sumArray(array $array)` - Get Sum Of Array
54+
- `Functionality::randomElementFromArray(array $array)` - Get Random Element From Array
55+
- `Functionality::removeDuplicatesFromArray(array $array)` - Remove Duplicates From Array
56+
- `Functionality::shuffle(array $array)` - Sort Array Randomly
57+
58+
## To Get Started Contributing ☕
59+
60+
- First Clone The Repository
61+
62+
```bash
63+
git clone https://github.com/functionality-library/functionality.php.git
64+
```
65+
66+
- Then Install Packages
67+
68+
```bash
69+
composer install
70+
```
71+
72+
- Run Tests using `phpunit`
73+
74+
```bash
75+
composer run-script test
76+
```
77+
78+
- Feel Free To Add What You Want!
79+
- If there is any issue, please open an issue on GitHub
80+
- If you have any suggestion, please open an issue on GitHub
81+
- If you have any question, please open an issue on GitHub

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"name": "functionality/functionality.php",
2+
"name": "functionality-library/functionality.php",
3+
"description": "This Is A Php Library To Make Your Work Easier/Faster",
4+
"version": "1.0.0",
35
"type": "library",
46
"license": "MIT",
7+
"scripts": {
8+
"test": "phpunit --verbose tests"
9+
},
510
"autoload": {
611
"psr-4": {
712
"Functionality\\FunctionalityPhp\\": "src/"

0 commit comments

Comments
 (0)