Skip to content

Commit

Permalink
Change namespace to Elastic\Apm
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKleyman committed Feb 26, 2020
1 parent fecb45e commit d74c532
Show file tree
Hide file tree
Showing 44 changed files with 204 additions and 193 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
},
"autoload": {
"psr-4": {
"ElasticApm\\": "./src/ElasticApm/"
"Elastic\\Apm\\": "./src/ElasticApm/"
}
},
"autoload-dev": {
"psr-4": {
"ElasticApmTests\\": "./tests/ElasticApmTests/",
"ElasticApmExamples\\": "./examples/ElasticApmExamples/"
"Elastic\\Apm\\Tests\\": "./tests/ElasticApmTests/",
"Elastic\\Apm\\Examples\\": "./examples/ElasticApmExamples/"
}
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

declare(strict_types=1);

namespace ElasticApmExamples\UsingPublicApi;
namespace Elastic\Apm\Examples\UsingPublicApi;

use ElasticApm\Impl\TracerBuilder;
use ElasticApm\TransactionInterface;
use ElasticApmTests\Util\MockReporter;
use ElasticApmTests\Util\TestCaseBase;
use Elastic\Apm\Impl\TracerBuilder;
use Elastic\Apm\TransactionInterface;
use Elastic\Apm\Tests\Util\MockReporter;
use Elastic\Apm\Tests\Util\TestCaseBase;

class ExampleUsingPublicApi extends TestCaseBase
{
Expand Down
2 changes: 1 addition & 1 deletion examples/ElasticApmExamples/UsingPublicApi/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace ElasticApmExamples\UsingPublicApi;
namespace Elastic\Apm\Examples\UsingPublicApi;

require __DIR__ . '/../../../vendor/autoload.php';

Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/ElasticApm.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

declare(strict_types=1);

namespace ElasticApm;
namespace Elastic\Apm;

use Closure;
use ElasticApm\Impl\GlobalTracerHolder;
use ElasticApm\Impl\Util\StaticClassTrait;
use Elastic\Apm\Impl\GlobalTracerHolder;
use Elastic\Apm\Impl\Util\StaticClassTrait;

/**
* Class ElasticApm is a facade (as in Facade design pattern) to the rest of Elastic APM public API.
Expand Down
2 changes: 1 addition & 1 deletion src/ElasticApm/ExecutionSegmentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

declare(strict_types=1);

namespace ElasticApm;
namespace Elastic\Apm;

use Closure;

Expand Down
8 changes: 4 additions & 4 deletions src/ElasticApm/Impl/Clock.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\Impl\Util\CachedSingletonInstanceTrait;
use ElasticApm\Impl\Util\TimeUtil;
use Elastic\Apm\Impl\Util\LazySingletonInstanceTrait;
use Elastic\Apm\Impl\Util\TimeUtil;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand All @@ -14,7 +14,7 @@
*/
final class Clock implements ClockInterface
{
use CachedSingletonInstanceTrait;
use LazySingletonInstanceTrait;

/** @inheritDoc */
public function getSystemClockCurrentTime(): float
Expand Down
2 changes: 1 addition & 1 deletion src/ElasticApm/Impl/ClockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
8 changes: 4 additions & 4 deletions src/ElasticApm/Impl/ExecutionSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use Closure;
use ElasticApm\ExecutionSegmentInterface;
use ElasticApm\Impl\Util\IdGenerator;
use ElasticApm\Impl\Util\TimeUtil;
use Elastic\Apm\ExecutionSegmentInterface;
use Elastic\Apm\Impl\Util\IdGenerator;
use Elastic\Apm\Impl\Util\TimeUtil;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/Impl/GlobalTracerHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\Impl\Util\StaticClassTrait;
use ElasticApm\TracerInterface;
use Elastic\Apm\Impl\Util\StaticClassTrait;
use Elastic\Apm\TracerInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/Impl/NoopExecutionSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use Closure;
use ElasticApm\ExecutionSegmentInterface;
use ElasticApm\SpanInterface;
use Elastic\Apm\ExecutionSegmentInterface;
use Elastic\Apm\SpanInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
8 changes: 4 additions & 4 deletions src/ElasticApm/Impl/NoopReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\Impl\Util\NoopObjectTrait;
use ElasticApm\SpanInterface;
use ElasticApm\TransactionInterface;
use Elastic\Apm\Impl\Util\NoopObjectTrait;
use Elastic\Apm\SpanInterface;
use Elastic\Apm\TransactionInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/Impl/NoopSpan.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\Impl\Util\NoopObjectTrait;
use ElasticApm\SpanInterface;
use Elastic\Apm\Impl\Util\NoopObjectTrait;
use Elastic\Apm\SpanInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
8 changes: 4 additions & 4 deletions src/ElasticApm/Impl/NoopTracer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use Closure;
use ElasticApm\Impl\Util\NoopObjectTrait;
use ElasticApm\TracerInterface;
use ElasticApm\TransactionInterface;
use Elastic\Apm\Impl\Util\NoopObjectTrait;
use Elastic\Apm\TracerInterface;
use Elastic\Apm\TransactionInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
8 changes: 4 additions & 4 deletions src/ElasticApm/Impl/NoopTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use Closure;
use ElasticApm\Impl\Util\NoopObjectTrait;
use ElasticApm\SpanInterface;
use ElasticApm\TransactionInterface;
use Elastic\Apm\Impl\Util\NoopObjectTrait;
use Elastic\Apm\SpanInterface;
use Elastic\Apm\TransactionInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/Impl/ReporterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\SpanInterface;
use ElasticApm\TransactionInterface;
use Elastic\Apm\SpanInterface;
use Elastic\Apm\TransactionInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/Impl/Span.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\Impl\Util\TimeUtil;
use ElasticApm\SpanInterface;
use Elastic\Apm\Impl\Util\TimeUtil;
use Elastic\Apm\SpanInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
6 changes: 3 additions & 3 deletions src/ElasticApm/Impl/Tracer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use Closure;
use ElasticApm\TracerInterface;
use ElasticApm\TransactionInterface;
use Elastic\Apm\TracerInterface;
use Elastic\Apm\TransactionInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
17 changes: 8 additions & 9 deletions src/ElasticApm/Impl/TracerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use ElasticApm\TracerInterface;
use Elastic\Apm\Impl\Util\HiddenConstructorTrait;
use Elastic\Apm\TracerInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand All @@ -13,6 +14,11 @@
*/
final class TracerBuilder
{
/**
* Constructor is hidden because startNew() should be used instead
*/
use HiddenConstructorTrait;

/** @var bool */
private $isEnabled = true;

Expand All @@ -22,13 +28,6 @@ final class TracerBuilder
/** @var ReporterInterface|null */
private $reporter;

/**
* Constructor is hidden because startNew() should be used instead.
*/
private function __construct()
{
}

public static function startNew(): self
{
return new self();
Expand Down
8 changes: 4 additions & 4 deletions src/ElasticApm/Impl/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

declare(strict_types=1);

namespace ElasticApm\Impl;
namespace Elastic\Apm\Impl;

use Closure;
use ElasticApm\Impl\Util\IdGenerator;
use ElasticApm\SpanInterface;
use ElasticApm\TransactionInterface;
use Elastic\Apm\Impl\Util\IdGenerator;
use Elastic\Apm\SpanInterface;
use Elastic\Apm\TransactionInterface;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
32 changes: 0 additions & 32 deletions src/ElasticApm/Impl/Util/CachedSingletonInstanceTrait.php

This file was deleted.

21 changes: 21 additions & 0 deletions src/ElasticApm/Impl/Util/HiddenConstructorTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace Elastic\Apm\Impl\Util;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
*
* @internal
*/
trait HiddenConstructorTrait
{
/**
* Constructor is hidden
*/
/** @noinspection PhpUnused */
private function __construct()
{
}
}
2 changes: 1 addition & 1 deletion src/ElasticApm/Impl/Util/IdGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace ElasticApm\Impl\Util;
namespace Elastic\Apm\Impl\Util;

/**
* Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
Expand Down
Loading

0 comments on commit d74c532

Please sign in to comment.