Composer updates (#126)

* Correct average typo

* Update to PHP CS FIxer V3.21
This commit is contained in:
Bruce Wells 2023-07-10 16:36:57 -04:00 committed by GitHub
parent e1cca194c5
commit 2a65673cae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -69,7 +69,7 @@ $config
// Replace core functions calls returning constants with the constants.
'function_to_constant' => true,
// Ensure single space between function's argument and its typehint.
'function_typehint_space' => true,
'type_declaration_spaces' => true,
// Renames PHPDoc tags.
'general_phpdoc_tag_rename' => true,
// Function `implode` must be called with 2 arguments in the documented order.
@ -229,7 +229,7 @@ $config
// A PHP file without end tag must always end with a single empty line feed.
'single_blank_line_at_eof' => true,
// There should be exactly one blank line before a namespace declaration.
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => ['max_line_breaks' => 2, 'min_line_breaks' => 2],
// There MUST NOT be more than one property or constant declared per statement.
'single_class_element_per_statement' => true,
// There MUST be one use keyword per declaration.

View file

@ -97,9 +97,9 @@ $executor->calculate('round(17.119, 2)'); // 17.12
```
Variable number of parameters:
```php
$executor->addFunction('avarage', function(...$args) {return array_sum($args) / count($args);});
$executor->calculate('avarage(1,3)'); // 2
$executor->calculate('avarage(1, 3, 4, 8)'); // 4
$executor->addFunction('average', function(...$args) {return array_sum($args) / count($args);});
$executor->calculate('average(1,3)'); // 2
$executor->calculate('average(1, 3, 4, 8)'); // 4
```
## Operators: