Skip to content
New issue

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

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

Already on GitHub? # to your account

Automatically regenerate the files #245

Merged
merged 1 commit into from
Oct 8, 2020
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"generated/apcu.php",
"generated/array.php",
"generated/bzip2.php",
"generated/calendar.php",
"generated/classobj.php",
"generated/com.php",
"generated/cubrid.php",
Expand Down
11 changes: 11 additions & 0 deletions generated/Exceptions/CalendarException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
namespace Safe\Exceptions;

class CalendarException extends \ErrorException implements SafeExceptionInterface
{
public static function createFromPhpError(): self
{
$error = error_get_last();
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
}
}
27 changes: 27 additions & 0 deletions generated/calendar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Safe;

use Safe\Exceptions\CalendarException;

/**
* This function will return a Unix timestamp corresponding to the
* Julian Day given in jday or FALSE if
* jday is outside of the allowed range. The time returned is
* UTC.
*
* @param int $jday A julian day number between 2440588 and 106751993607888
* on 64bit systems, or between 2440588 and 2465443 on 32bit systems.
* @return int The unix timestamp for the start (midnight, not noon) of the given Julian day.
* @throws CalendarException
*
*/
function jdtounix(int $jday): int
{
error_clear_last();
$result = \jdtounix($jday);
if ($result === false) {
throw CalendarException::createFromPhpError();
}
return $result;
}
1 change: 1 addition & 0 deletions generated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@
'inotify_rm_watch',
'iptcembed',
'iptcparse',
'jdtounix',
'jpeg2wbmp',
'json_decode',
'json_encode',
Expand Down
1 change: 1 addition & 0 deletions rector-migrate-0.7.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
'inotify_rm_watch' => 'Safe\inotify_rm_watch',
'iptcembed' => 'Safe\iptcembed',
'iptcparse' => 'Safe\iptcparse',
'jdtounix' => 'Safe\jdtounix',
'jpeg2wbmp' => 'Safe\jpeg2wbmp',
'json_decode' => 'Safe\json_decode',
'json_encode' => 'Safe\json_encode',
Expand Down