Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 54 additions & 53 deletions generated/datetime.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
use Safe\Exceptions\DatetimeException;

/**
* Returns associative array with detailed info about given date.
* Returns associative array with detailed info about given date/time.
*
* @param string $format Format accepted by DateTime::createFromFormat.
* @param string $date String representing the date.
* @return array Returns associative array with detailed info about given date.
* @param string $datetime String representing the date/time.
* @return array Returns associative array with detailed info about given date/time.
* @throws DatetimeException
*
*/
function date_parse_from_format(string $format, string $date): array
function date_parse_from_format(string $format, string $datetime): array
{
error_clear_last();
$result = \date_parse_from_format($format, $date);
$result = \date_parse_from_format($format, $datetime);
if ($result === false) {
throw DatetimeException::createFromPhpError();
}
Expand All @@ -27,16 +27,17 @@ function date_parse_from_format(string $format, string $date): array
/**
*
*
* @param string $date Date in format accepted by strtotime.
* @return array Returns array with information about the parsed date
* @param string $datetime Date/time in format accepted by
* DateTimeImmutable::__construct.
* @return array Returns array with information about the parsed date/time
* on success.
* @throws DatetimeException
*
*/
function date_parse(string $date): array
function date_parse(string $datetime): array
{
error_clear_last();
$result = \date_parse($date);
$result = \date_parse($datetime);
if ($result === false) {
throw DatetimeException::createFromPhpError();
}
Expand All @@ -47,7 +48,7 @@ function date_parse(string $date): array
/**
*
*
* @param int $time Timestamp.
* @param int $timestamp Unix timestamp.
* @param float $latitude Latitude in degrees.
* @param float $longitude Longitude in degrees.
* @return array Returns array on success.
Expand All @@ -58,23 +59,23 @@ function date_parse(string $date): array
* sunrise
*
*
* The time of the sunrise (zenith angle = 90°35').
* The timestamp of the sunrise (zenith angle = 90°35').
*
*
*
*
* sunset
*
*
* The time of the sunset (zenith angle = 90°35').
* The timestamp of the sunset (zenith angle = 90°35').
*
*
*
*
* transit
*
*
* The time when the sun is at its zenith, i.e. has reached its topmost
* The timestamp when the sun is at its zenith, i.e. has reached its topmost
* point.
*
*
Expand Down Expand Up @@ -139,10 +140,10 @@ function date_parse(string $date): array
* @throws DatetimeException
*
*/
function date_sun_info(int $time, float $latitude, float $longitude): array
function date_sun_info(int $timestamp, float $latitude, float $longitude): array
{
error_clear_last();
$result = \date_sun_info($time, $latitude, $longitude);
$result = \date_sun_info($timestamp, $latitude, $longitude);
if ($result === false) {
throw DatetimeException::createFromPhpError();
}
Expand All @@ -156,8 +157,8 @@ function date_sun_info(int $time, float $latitude, float $longitude): array
*
* @param int $timestamp The timestamp of the day from which the sunrise
* time is taken.
* @param int $format
* format constants
* @param int $returnFormat
* returnFormat constants
*
*
*
Expand Down Expand Up @@ -221,30 +222,30 @@ function date_sun_info(int $time, float $latitude, float $longitude): array
*
*
*
* @param float $gmt_offset Specified in hours.
* The gmtoffset is ignored, if
* format is
* @param float $utcOffset Specified in hours.
* The utcOffset is ignored, if
* returnFormat is
* SUNFUNCS_RET_TIMESTAMP.
* @return mixed Returns the sunrise time in a specified format on
* @return mixed Returns the sunrise time in a specified returnFormat on
* success. One potential reason for failure is that the
* sun does not rise at all, which happens inside the polar circles for part of
* the year.
* @throws DatetimeException
*
*/
function date_sunrise(int $timestamp, int $format = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $gmt_offset = 0)
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = 0)
{
error_clear_last();
if ($gmt_offset !== 0) {
$result = \date_sunrise($timestamp, $format, $latitude, $longitude, $zenith, $gmt_offset);
if ($utcOffset !== 0) {
$result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
} elseif ($zenith !== null) {
$result = \date_sunrise($timestamp, $format, $latitude, $longitude, $zenith);
$result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith);
} elseif ($longitude !== null) {
$result = \date_sunrise($timestamp, $format, $latitude, $longitude);
$result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude);
} elseif ($latitude !== null) {
$result = \date_sunrise($timestamp, $format, $latitude);
$result = \date_sunrise($timestamp, $returnFormat, $latitude);
} else {
$result = \date_sunrise($timestamp, $format);
$result = \date_sunrise($timestamp, $returnFormat);
}
if ($result === false) {
throw DatetimeException::createFromPhpError();
Expand All @@ -259,8 +260,8 @@ function date_sunrise(int $timestamp, int $format = SUNFUNCS_RET_STRING, float $
*
* @param int $timestamp The timestamp of the day from which the sunset
* time is taken.
* @param int $format
* format constants
* @param int $returnFormat
* returnFormat constants
*
*
*
Expand Down Expand Up @@ -324,30 +325,30 @@ function date_sunrise(int $timestamp, int $format = SUNFUNCS_RET_STRING, float $
*
*
*
* @param float $gmt_offset Specified in hours.
* The gmtoffset is ignored, if
* format is
* @param float $utcOffset Specified in hours.
* The utcOffset is ignored, if
* returnFormat is
* SUNFUNCS_RET_TIMESTAMP.
* @return mixed Returns the sunset time in a specified format on
* @return mixed Returns the sunset time in a specified returnFormat on
* success. One potential reason for failure is that the
* sun does not set at all, which happens inside the polar circles for part of
* the year.
* @throws DatetimeException
*
*/
function date_sunset(int $timestamp, int $format = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $gmt_offset = 0)
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = 0)
{
error_clear_last();
if ($gmt_offset !== 0) {
$result = \date_sunset($timestamp, $format, $latitude, $longitude, $zenith, $gmt_offset);
if ($utcOffset !== 0) {
$result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
} elseif ($zenith !== null) {
$result = \date_sunset($timestamp, $format, $latitude, $longitude, $zenith);
$result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith);
} elseif ($longitude !== null) {
$result = \date_sunset($timestamp, $format, $latitude, $longitude);
$result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude);
} elseif ($latitude !== null) {
$result = \date_sunset($timestamp, $format, $latitude);
$result = \date_sunset($timestamp, $returnFormat, $latitude);
} else {
$result = \date_sunset($timestamp, $format);
$result = \date_sunset($timestamp, $returnFormat);
}
if ($result === false) {
throw DatetimeException::createFromPhpError();
Expand Down Expand Up @@ -512,21 +513,21 @@ function strptime(string $date, string $format): array
* See date_default_timezone_get on the various
* ways to define the default time zone.
*
* @param string $time A date/time string. Valid formats are explained in Date and Time Formats.
* @param string $datetime A date/time string. Valid formats are explained in Date and Time Formats.
* @param int $now The timestamp which is used as a base for the calculation of relative
* dates.
* @return int Returns a timestamp on success, FALSE otherwise. Previous to PHP 5.1.0,
* this function would return -1 on failure.
* @throws DatetimeException
*
*/
function strtotime(string $time, int $now = null): int
function strtotime(string $datetime, int $now = null): int
{
error_clear_last();
if ($now !== null) {
$result = \strtotime($time, $now);
$result = \strtotime($datetime, $now);
} else {
$result = \strtotime($time);
$result = \strtotime($datetime);
}
if ($result === false) {
throw DatetimeException::createFromPhpError();
Expand All @@ -539,27 +540,27 @@ function strtotime(string $time, int $now = null): int
*
*
* @param string $abbr Time zone abbreviation.
* @param int $gmtOffset Offset from GMT in seconds. Defaults to -1 which means that first found
* @param int $utcOffset Offset from GMT in seconds. Defaults to -1 which means that first found
* time zone corresponding to abbr is returned.
* Otherwise exact offset is searched and only if not found then the first
* time zone with any offset is returned.
* @param int $isdst Daylight saving time indicator. Defaults to -1, which means that
* @param int $isDST Daylight saving time indicator. Defaults to -1, which means that
* whether the time zone has daylight saving or not is not taken into
* consideration when searching. If this is set to 1, then the
* gmtOffset is assumed to be an offset with
* daylight saving in effect; if 0, then gmtOffset
* utcOffset is assumed to be an offset with
* daylight saving in effect; if 0, then utcOffset
* is assumed to be an offset without daylight saving in effect. If
* abbr doesn't exist then the time zone is
* searched solely by the gmtOffset and
* isdst.
* searched solely by the utcOffset and
* isDST.
* @return string Returns time zone name on success.
* @throws DatetimeException
*
*/
function timezone_name_from_abbr(string $abbr, int $gmtOffset = -1, int $isdst = -1): string
function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string
{
error_clear_last();
$result = \timezone_name_from_abbr($abbr, $gmtOffset, $isdst);
$result = \timezone_name_from_abbr($abbr, $utcOffset, $isDST);
if ($result === false) {
throw DatetimeException::createFromPhpError();
}
Expand Down
6 changes: 3 additions & 3 deletions generated/filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ function filesize(string $filename): int
*
*
* It is also possible to add LOCK_NB as a bitmask to one
* of the above operations if you don't want flock to
* block while locking.
* of the above operations, if flock should not
* block during the locking attempt.
* @param int|null $wouldblock The optional third argument is set to 1 if the lock would block
* (EWOULDBLOCK errno condition).
* @throws FilesystemException
Expand Down Expand Up @@ -975,7 +975,7 @@ function fwrite($handle, string $string, int $length = null): int
*
*
*
* GLOB_MARK - Adds a slash to each directory returned
* GLOB_MARK - Adds a slash (a backslash on Windows) to each directory returned
*
*
*
Expand Down
24 changes: 12 additions & 12 deletions generated/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ function imagecolordeallocate($image, int $color): void
/**
* Makes the colors of the palette version of an image more closely match the true color version.
*
* @param resource $image1 A truecolor image link resource.
* @param resource $image2 A palette image link resource pointing to an image that has the same
* @param resource $image1 A truecolor image resource.
* @param resource $image2 A palette image resource pointing to an image that has the same
* size as image1.
* @throws ImageException
*
Expand Down Expand Up @@ -452,8 +452,8 @@ function imageconvolution($image, array $matrix, float $div, float $offset): voi
* onto the x,y coordinates, dst_x and
* dst_y.
*
* @param resource $dst_im Destination image link resource.
* @param resource $src_im Source image link resource.
* @param resource $dst_im Destination image resource.
* @param resource $src_im Source image resource.
* @param int $dst_x x-coordinate of destination point.
* @param int $dst_y y-coordinate of destination point.
* @param int $src_x x-coordinate of source point.
Expand Down Expand Up @@ -482,8 +482,8 @@ function imagecopy($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $sr
* onto the x,y coordinates, dst_x and
* dst_y.
*
* @param resource $dst_im Destination image link resource.
* @param resource $src_im Source image link resource.
* @param resource $dst_im Destination image resource.
* @param resource $src_im Source image resource.
* @param int $dst_x x-coordinate of destination point.
* @param int $dst_y y-coordinate of destination point.
* @param int $src_x x-coordinate of source point.
Expand Down Expand Up @@ -522,8 +522,8 @@ function imagecopymerge($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, in
* that when merging it preserves the hue of the source by converting
* the destination pixels to gray scale before the copy operation.
*
* @param resource $dst_im Destination image link resource.
* @param resource $src_im Source image link resource.
* @param resource $dst_im Destination image resource.
* @param resource $src_im Source image resource.
* @param int $dst_x x-coordinate of destination point.
* @param int $dst_y y-coordinate of destination point.
* @param int $src_x x-coordinate of source point.
Expand Down Expand Up @@ -571,8 +571,8 @@ function imagecopymergegray($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x
* src_image) but if the regions overlap the
* results will be unpredictable.
*
* @param resource $dst_image Destination image link resource.
* @param resource $src_image Source image link resource.
* @param resource $dst_image Destination image resource.
* @param resource $src_image Source image resource.
* @param int $dst_x x-coordinate of destination point.
* @param int $dst_y y-coordinate of destination point.
* @param int $src_x x-coordinate of source point.
Expand Down Expand Up @@ -616,8 +616,8 @@ function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int
* src_image) but if the regions overlap the
* results will be unpredictable.
*
* @param resource $dst_image Destination image link resource.
* @param resource $src_image Source image link resource.
* @param resource $dst_image Destination image resource.
* @param resource $src_image Source image resource.
* @param int $dst_x x-coordinate of destination point.
* @param int $dst_y y-coordinate of destination point.
* @param int $src_x x-coordinate of source point.
Expand Down
2 changes: 1 addition & 1 deletion generated/mbstring.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ function mb_ord(string $str, string $encoding = null): int
* @throws MbstringException
*
*/
function mb_parse_str(string $encoded_string, ?array &$result = null): void
function mb_parse_str(string $encoded_string, ?array &$result): void
{
error_clear_last();
$result = \mb_parse_str($encoded_string, $result);
Expand Down
2 changes: 2 additions & 0 deletions generated/outcontrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ function ob_end_flush(): void
* url_rewriter.hosts php.ini
* parameters.
*
* Note that this function can be successfully called at most once per request.
*
* @param string $name The variable name.
* @param string $value The variable value.
* @throws OutcontrolException
Expand Down