khaled-alshamaa / ar-php

Set of functionalities enable Arabic website developers to serve professional search, present and process Arabic content in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implicit conversion from `float` to `int` when using `getPrayTime()` method

DrAliRagab opened this issue · comments

Screenshot 2023-09-23 132752

When using $arabic->getPrayTime(), I got this warning.

I think this is because these 3 lines:

$g = $g % 360 + ($g - ceil($g) + 1);

$q = $q % 360 + ($q - ceil($q) + 1);

$L = $L % 360 + ($L - ceil($L) + 1);

As php documentation says "Operands of modulo are converted to int before processing. For floating-point modulo, see fmod()"
Arithmetic Operators

We can use fmod() function
fmod

$g = fmod($g, 360) + ($g - ceil($g) + 1);

$q = fmod($q, 360) + ($q - ceil($q) + 1);

$L = fmod($L, 360) + ($L - ceil($L) + 1);