Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed Apr 22, 2024
1 parent 0845348 commit d696772
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
23 changes: 19 additions & 4 deletions src/SDK/Common/Time/ClockFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,31 @@

namespace OpenTelemetry\SDK\Common\Time;

use OpenTelemetry\API\Common\Time\ClockInterface;
use OpenTelemetry\API\Common\Time as API;

/**
* @deprecated Use OpenTelemetry\API\Common\Time\ClockFactory
* @codeCoverageIgnore
*/
class ClockFactory
class ClockFactory implements API\ClockFactoryInterface
{
public static function getDefault(): ClockInterface
public static function getDefault(): API\ClockInterface
{
return \OpenTelemetry\API\Common\Time\ClockFactory::getDefault();
return API\ClockFactory::getDefault();
}

public static function create(): API\ClockFactoryInterface
{
return API\ClockFactory::create();
}

public function build(): API\ClockInterface
{
return (new API\ClockFactory())->build();
}

public static function setDefault(?API\ClockInterface $clock): void
{
API\ClockFactory::setDefault($clock);
}
}
14 changes: 14 additions & 0 deletions src/SDK/Common/Time/ClockFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace OpenTelemetry\SDK\Common\Time;

use OpenTelemetry\API\Common\Time\ClockFactoryInterface as API;

/**
* @deprecated Use OpenTelemetry\API\Common\Time\ClockFactoryInterface
*/
interface ClockFactoryInterface extends API
{
}
14 changes: 14 additions & 0 deletions src/SDK/Common/Time/ClockInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace OpenTelemetry\SDK\Common\Time;

use OpenTelemetry\API\Common\Time as API;

/**
* @deprecated Use OpenTelemetry\API\Common\Time\ClockInterface
*/
interface ClockInterface extends API\ClockInterface
{
}
10 changes: 5 additions & 5 deletions src/SDK/Common/Time/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace OpenTelemetry\SDK\Common\Time;

use OpenTelemetry\API\Common\Time\Util as API;
use OpenTelemetry\API\Common\Time as API;

/**
* @deprecated Use OpenTelemetry\API\Common\Time\Util
Expand All @@ -14,21 +14,21 @@ class Util
{
public static function nanosToMicros(int $nanoseconds): int
{
return API::nanosToMicros($nanoseconds);
return API\Util::nanosToMicros($nanoseconds);
}

public static function nanosToMillis(int $nanoseconds): int
{
return API::nanosToMillis($nanoseconds);
return API\Util::nanosToMillis($nanoseconds);
}

public static function secondsToNanos(int $seconds): int
{
return API::secondsToNanos($seconds);
return API\Util::secondsToNanos($seconds);
}

public static function millisToNanos(int $milliSeconds): int
{
return API::millisToNanos($milliSeconds);
return API\Util::millisToNanos($milliSeconds);
}
}

0 comments on commit d696772

Please sign in to comment.