Debian Codegraph @

vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php

raw
1 <?php
2 /**
3 * This file is part of the ramsey/uuid library
4 *
5 * For the full copyright and license information, please view the LICENSE
6 * file that was distributed with this source code.
7 *
8 * @copyright Copyright (c) Ben Ramsey <[email protected]>
9 * @license http://opensource.org/licenses/MIT MIT
10 * @link https://benramsey.com/projects/ramsey-uuid/ Documentation
11 * @link https://packagist.org/packages/ramsey/uuid Packagist
12 * @link https://github.com/ramsey/uuid GitHub
13 */
14
15 namespace Ramsey\Uuid\Converter\Time;
16
17 use Ramsey\Uuid\Converter\TimeConverterInterface;
18 use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
19
20 /**
21 * DegradedTimeConverter throws `UnsatisfiedDependencyException` exceptions
22 * if attempting to use time conversion functionality in an environment that
23 * does not support large integers (i.e. when moontoast/math is not available)
24 */
25 class DegradedTimeConverter implements TimeConverterInterface
26 {
27 /**
28 * Throws an `UnsatisfiedDependencyException`
29 *
30 * @param string $seconds
31 * @param string $microSeconds
32 * @return void
33 * @throws UnsatisfiedDependencyException if called on a 32-bit system and `Moontoast\Math\BigNumber` is not present
34 */
35 public function calculateTime($seconds, $microSeconds)
36 {
37 throw new UnsatisfiedDependencyException(
38 'When calling ' . __METHOD__ . ' on a 32-bit system, '
39 . 'Moontoast\Math\BigNumber must be present.'
40 );
41 }
42 }