Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 683692f

Browse files
author
Fenix
committed
Added process of null and numbers
1 parent 6ef2a37 commit 683692f

File tree

11 files changed

+216
-59
lines changed

11 files changed

+216
-59
lines changed

‎README.md

Lines changed: 26 additions & 0 deletions
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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 54 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /