Skip to content

Commit 7b52064

Browse files
Merge pull request #7 from jaumarar/process-number-null
Added process of null and numbers
2 parents 6ef2a37 + 683692f commit 7b52064

11 files changed

+216
-59
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ DATABASE_DNS=mysql:host=localhost;dbname=test;
2424
DATABASE_USER="root"
2525
DATABASE_PASSWORD=root
2626
MODULE_ENABLED=true
27+
NUMBER_LITERAL=0
28+
NULL_VALUE=null
2729
```
2830

2931
## Load the variables
@@ -57,6 +59,20 @@ var_dump(getenv('DATABASE_USER'));
5759
* bool(true)
5860
*/
5961
var_dump(getenv('MODULE_ENABLED'));
62+
63+
/**
64+
* Process the numeric value:
65+
*
66+
* int(0)
67+
*/
68+
var_dump(getenv('NUMBER_LITERAL'));
69+
70+
/**
71+
* Check for literal null values:
72+
*
73+
* NULL
74+
*/
75+
var_dump(getenv('NULL_VALUE'));
6076
```
6177

6278
Ideal for small project
@@ -76,3 +92,13 @@ NOTE: ``VARIABLE="true"`` will be processed to ```string(4) "true"```
7692
## QuotedProcessor
7793

7894
``VARIABLE="anything"`` will be processed to ```string(8) "anything"```
95+
96+
## NullProcessor
97+
98+
``VARIABLE=null`` will be processed to ```NULL```
99+
100+
## NumberProcessor
101+
102+
``VARIABLE=0`` will be processed to ```int(0)```
103+
104+
``VARIABLE=0.1`` will be processed to ```float(0.1)```

composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
"Test\\DevCoder\\": "tests"
1616
}
1717
},
18+
"scripts": {
19+
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --testdox",
20+
"test:coverage": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --testdox --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
21+
},
1822
"require": {
1923
"php": ">=7.4"
2024
},
2125
"require-dev": {
22-
"phpunit/phpunit": "^9.4"
26+
"phpunit/phpunit": "9.6.3"
2327
}
2428
}

composer.lock

+54-54
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)