Skip to content

Commit

Permalink
Merge pull request #245 from thecodingmachine/create-pull-request/reg…
Browse files Browse the repository at this point in the history
…enerate-files

Automatically regenerate the files
  • Loading branch information
Kharhamel authored Oct 8, 2020
2 parents 1114828 + 6462a5c commit a6b795a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
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

0 comments on commit a6b795a

Please # to comment.