all files / src/ext/ datetime.js

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36            1× 1×       1×                 1×                   1×          
/*!
 * Copyright (C) 2017 Glayzzle (BSD3 License)
 * @authors https://github.com/glayzzle/php-transpiler/graphs/contributors
 * @url http://glayzzle.com
 */
'use strict';
module.exports = function($php) {
  var datetime = require('locutus/php/datetime');
  /**
   * http://php.net/manual/en/function.microtime.php
   */
  $php.context.function.declare(
    '\\microtime', [
      {name: 'get_as_float', type: 'bool', default: false}
    ],
    'mixed', datetime.microtime
  );
  /**
   * http://php.net/manual/en/function.date.php
   */
  $php.context.function.declare(
    '\\date', [
      {name: 'format', type: 'string'},
      {name: 'int', type: 'timestamp', default: 'expr:time()'},
    ],
    'string', datetime.date
  );
  /**
   * http://php.net/manual/en/function.time.php
   */
  $php.context.function.declare(
    '\\time', [],
    'int', datetime.time
  );
};