Skip to content

Commit 2ebff1a

Browse files
committed
Merge branch 'master' into 5.6
2 parents 8affa02 + 7013d1b commit 2ebff1a

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

README.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Laravel-specific and pure PHP helper functions.
2828
composer require "illuminated/helper-functions:5.6.*"
2929
```
3030

31-
2. That's it! Now you can use any of provided helper functions.
31+
2. Use any of the provided helper functions.
3232

3333
## Available functions
3434

@@ -86,7 +86,7 @@ Laravel-specific and pure PHP helper functions.
8686

8787
#### `array_except_value()`
8888

89-
Removes the given values from array:
89+
Remove the given values from the array:
9090

9191
```php
9292
$array = ['foo', 'bar', 'baz'];
@@ -104,7 +104,7 @@ $array = array_except_value($array, ['bar', 'baz']);
104104

105105
#### `multiarray_set()`
106106

107-
Sets a value for each item of multidimensional array using "dot" notation:
107+
Set a value for each item of the multidimensional array using "dot" notation:
108108

109109
```php
110110
$array = [
@@ -124,7 +124,7 @@ multiarray_set($array, 'details.country', 'Germany');
124124
125125
#### `multiarray_sort_by()`
126126
127-
Sorts multidimensional array by multiple fields:
127+
Sort the multidimensional array by few fields:
128128
129129
```php
130130
$array = [
@@ -143,7 +143,7 @@ $sorted = multiarray_sort_by($array, 'name', 'model');
143143
// ]
144144
```
145145
146-
Optionally, you can set required sort order:
146+
You can set required sort order:
147147
148148
```php
149149
$array = [
@@ -166,15 +166,15 @@ $sorted = multiarray_sort_by($array, 'name', SORT_ASC, 'model', SORT_DESC);
166166
167167
#### `call_in_background()`
168168
169-
Calls artisan console command in background. Code execution continues immediately, without waiting for results.
169+
Call artisan console command in the background. Code execution continues immediately, without waiting for results.
170170
171171
```php
172172
call_in_background('report');
173173
174174
// "php artisan report" would be called in background
175175
```
176176
177-
Optional `before` and `after` sub-commands can be set as a second and third parameters:
177+
Optional `before` and `after` sub-commands can be set as a second and third parameter:
178178
179179
```php
180180
call_in_background('report:monthly subscriptions', 'sleep 0.3');
@@ -186,7 +186,7 @@ call_in_background('report:monthly subscriptions', 'sleep 0.3');
186186
187187
#### `db_is_sqlite()`
188188
189-
Checks if default database connection driver is `sqlite` or not:
189+
Check if the default database connection driver is `sqlite` or not:
190190
191191
```php
192192
if (db_is_sqlite()) {
@@ -196,7 +196,7 @@ if (db_is_sqlite()) {
196196
197197
#### `db_is_mysql()`
198198
199-
Checks if default database connection driver is `mysql` or not:
199+
Check if the default database connection driver is `mysql` or not:
200200
201201
```php
202202
if (db_is_mysql()) {
@@ -206,7 +206,7 @@ if (db_is_mysql()) {
206206
207207
#### `db_mysql_now()`
208208
209-
Returns database datetime, using `mysql` connection:
209+
Get database datetime, using `mysql` connection:
210210
211211
```php
212212
$now = db_mysql_now();
@@ -216,7 +216,7 @@ $now = db_mysql_now();
216216
217217
#### `db_mysql_variable()`
218218
219-
Returns value of specified `mysql` variable, or `false` if variable doesn't exist:
219+
Get the value of specified `mysql` variable, or `false` if the variable doesn't exist:
220220
221221
```php
222222
$hostname = db_mysql_variable('hostname');
@@ -228,7 +228,7 @@ $hostname = db_mysql_variable('hostname');
228228
229229
#### `to_default_timezone()`
230230
231-
Converts passed datetime string to default timezone, which is `app.timezone` config setting:
231+
Convert passed datetime string to the default timezone, which is `app.timezone` config setting:
232232
233233
```php
234234
$date = to_default_timezone('2017-02-28T14:05:01Z');
@@ -240,7 +240,7 @@ $date = to_default_timezone('2017-02-28T14:05:01Z');
240240
241241
#### `backtrace_as_string()`
242242
243-
Returns backtrace without arguments as string:
243+
Get backtrace without arguments, as a string:
244244
245245
```php
246246
$backtrace = backtrace_as_string();
@@ -252,7 +252,7 @@ $backtrace = backtrace_as_string();
252252
253253
#### `minimized_backtrace_as_string()`
254254
255-
Returns minimized backtrace as string:
255+
Get minimized backtrace as a string:
256256
257257
```php
258258
$backtrace = minimized_backtrace_as_string();
@@ -266,7 +266,7 @@ $backtrace = minimized_backtrace_as_string();
266266
267267
#### `is_email()`
268268
269-
Checks if specified string is valid email address or not:
269+
Check if the specified string is a valid email address or not:
270270
271271
```php
272272
$isEmail = is_email('john.doe@example.com');
@@ -276,7 +276,7 @@ $isEmail = is_email('john.doe@example.com');
276276
277277
#### `to_rfc2822_email()`
278278
279-
Converts addresses data to [RFC 2822](http://www.faqs.org/rfcs/rfc2822.html) string, suitable for PHP [mail()](http://ua2.php.net/manual/en/function.mail.php) function:
279+
Convert addresses data to [RFC 2822](http://www.faqs.org/rfcs/rfc2822.html) string, suitable for PHP [mail()](http://ua2.php.net/manual/en/function.mail.php) function:
280280
281281
```php
282282
$address = to_rfc2822_email([
@@ -297,7 +297,7 @@ $address = to_rfc2822_email(['address' => 'john.doe@example.com', 'name' => 'Joh
297297
298298
#### `to_swiftmailer_emails()`
299299
300-
Converts addresses data to format, which is suitable for [SwiftMailer library](http://swiftmailer.org/docs/messages.html):
300+
Convert addresses data to format, which is suitable for [SwiftMailer library](http://swiftmailer.org/docs/messages.html):
301301
302302
```php
303303
$addresses = to_swiftmailer_emails([
@@ -320,15 +320,15 @@ $address = to_swiftmailer_emails(['address' => 'john.doe@example.com', 'name' =>
320320
321321
#### `relative_path()`
322322
323-
Returns the relative path of a directory given another one:
323+
Get the relative path for two directories:
324324
325325
```php
326326
$path = relative_path('/var/www/htdocs', '/var/www/htdocs/example')
327327
328328
// '../'
329329
```
330330
331-
You can pass relative paths as a parameters:
331+
You can pass relative path as a parameter too:
332332
333333
```php
334334
$path = relative_path('/var/www/htdocs/example/public/../../', '/var/')
@@ -340,7 +340,7 @@ $path = relative_path('/var/www/htdocs/example/public/../../', '/var/')
340340
341341
#### `get_dump()`
342342
343-
Returns nicely formatted string representation of the variable, using [Symfony VarDumper Component](http://symfony.com/doc/current/components/var_dumper/introduction.html) with all of it's benefits:
343+
Get nicely formatted string representation of the variable, using [Symfony VarDumper Component](http://symfony.com/doc/current/components/var_dumper/introduction.html):
344344
345345
```php
346346
$array = [
@@ -363,7 +363,7 @@ $dump = get_dump($array);
363363
364364
#### `format_bytes()`
365365
366-
Formats bytes into kilobytes, megabytes, gigabytes or terabytes, with specified precision:
366+
Format bytes into kilobytes, megabytes, gigabytes or terabytes, with specified precision:
367367
368368
```php
369369
$formatted = format_bytes(3333333);
@@ -373,7 +373,7 @@ $formatted = format_bytes(3333333);
373373
374374
#### `format_xml()`
375375
376-
Formats xml string using new lines and indents:
376+
Format XML string using new lines and indents:
377377
378378
```php
379379
$formatted = format_xml('<?xml version="1.0"?><root><task priority="low"><to>John</to><from>Jane</from><title>Go to the shop</title></task><task priority="medium"><to>John</to><from>Paul</from><title>Finish the report</title></task><task priority="high"><to>Jane</to><from>Jeff</from><title>Clean the house</title></task></root>');
@@ -402,15 +402,15 @@ $formatted = format_xml('<?xml version="1.0"?><root><task priority="low"><to>Joh
402402
403403
#### `is_json()`
404404
405-
Checks if specified variable is valid json-encoded string or not:
405+
Check if specified variable is a valid JSON-encoded string or not:
406406
407407
```php
408408
$isJson = is_json('{"foo":1,"bar":2,"baz":3}');
409409
410410
// true
411411
```
412412
413-
Function can return decoded json, if you pass the second `return` argument as `true`:
413+
It can return decoded JSON if you pass the second argument as `true`:
414414
415415
```php
416416
$decoded = is_json('{"foo":1,"bar":2,"baz":3}', true);
@@ -422,7 +422,7 @@ $decoded = is_json('{"foo":1,"bar":2,"baz":3}', true);
422422
423423
#### `str_lower()`
424424
425-
Converts string to lowercase, using `mb_strtolower` in `UTF-8` encoding:
425+
Convert string to lowercase, using `mb_strtolower` in `UTF-8` encoding:
426426
427427
```php
428428
$lower = str_lower('TeSt');
@@ -432,7 +432,7 @@ $lower = str_lower('TeSt');
432432
433433
#### `str_upper()`
434434
435-
Converts string to uppercase, using `mb_strtoupper` in `UTF-8` encoding:
435+
Convert string to uppercase, using `mb_strtoupper` in `UTF-8` encoding:
436436
437437
```php
438438
$upper = str_upper('TeSt');
@@ -444,7 +444,7 @@ $upper = str_upper('TeSt');
444444
445445
#### `is_windows_os()`
446446
447-
Checks if php is running on Windows OS or not:
447+
Check if PHP is running on Windows OS or not:
448448
449449
```php
450450
$isWindowsOs = is_windows_os();
@@ -456,7 +456,7 @@ $isWindowsOs = is_windows_os();
456456
457457
#### `xml_to_array()`
458458
459-
Converts xml string to array:
459+
Convert XML string to the array:
460460
461461
```php
462462
$array = xml_to_array('<?xml version="1.0"?>
@@ -490,11 +490,11 @@ $array = xml_to_array('<?xml version="1.0"?>
490490
// ]
491491
```
492492
493-
Alternatively, you can pass an instance of `SimpleXMLElement` object, to get the same results.
493+
Alternatively, you can pass an instance of a `SimpleXMLElement` object, to get the same results.
494494
495495
#### `array_to_xml()`
496496
497-
Converts array to xml string using [spatie/array-to-xml](https://github.com/spatie/array-to-xml) package:
497+
Convert array to XML string using [spatie/array-to-xml](https://github.com/spatie/array-to-xml) package:
498498
499499
```php
500500
$array = [

0 commit comments

Comments
 (0)