Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt constant expressions #447

Closed
wants to merge 2 commits into from
Closed

adapt constant expressions #447

wants to merge 2 commits into from

Conversation

xerc
Copy link
Contributor

@xerc xerc commented Feb 15, 2022

@aimeos
Copy link
Owner

aimeos commented Feb 15, 2022

Why is the backslash before PHP functions necessary?

@xerc
Copy link
Contributor Author

xerc commented Feb 15, 2022

for safety; "ensure that the function called is from the global namespace, even if there is a function by the same name in the current namespace" https://stackoverflow.com/questions/4790020/#answer-4790031

@xerc
Copy link
Contributor Author

xerc commented Feb 15, 2022

(?<![\w\.\\>:])(abs|acosh|acos|array_chunk|array_column|array_count_values|array_diff_assoc|array_diff_key|array_diff|array_fill_keys|array_fill|array_flip|array_intersect_assoc|array_intersect_key|array_intersect|array_key_exists|array_key_first|array_key_last|array_keys|array_merge_recursive|array_merge|array_pad|array_product|array_replace_recursive|array_replace|array_reverse|array_search|array_slice|array_sum|array_unique|array_values|asinh|asin|atan2|atanh|atan|boolval|ceil|checkdate|chr|cosh|cos|count|decbin|dechex|decoct|deg2rad|doubleval|expm1|exp|floatval|floor|fmod|gettype|gmmktime|hash_algos|hypot|in_array|intdiv|intval|is_array|is_bool|is_countable|is_double|is_finite|is_float|is_infinite|is_integer|is_int|is_iterable|is_long|is_nan|is_null|is_numeric|is_object|is_real|is_resource|is_scalar|is_string|log10|log1p|log|max|min|pi|pow|rad2deg|range|round|sinh|sin|sizeof|sqrt|tanh|tan)(?=\s*\()
=> \\$1

@aimeos
Copy link
Owner

aimeos commented Feb 15, 2022

This is not necessary because there are almost no functions in Aimeos and if yes, they are prefixed by ai.
In general, we are currently trying to simplify the code base as much as possible and avoid anything which is not really necessary.

@xerc
Copy link
Contributor Author

xerc commented Feb 15, 2022

ok ; than you should check for negations as in 32c0c3e

@xerc xerc closed this Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants