Skip to content

Commit

Permalink
Format code by the latest cs-fixer. (#6617)
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo authored Mar 23, 2024
1 parent 974b51c commit 2f52ab4
Show file tree
Hide file tree
Showing 40 changed files with 91 additions and 34 deletions.
1 change: 1 addition & 0 deletions class_map/GlobalTracer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace OpenTracing;

use Hyperf\Tracer\TracerContext;
Expand Down
2 changes: 1 addition & 1 deletion class_map/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Zipkin\Propagation;

use ArrayAccess;
Expand Down Expand Up @@ -56,7 +57,6 @@ public function get($carrier, string $key): ?string
}

/**
* {@inheritdoc}
* @param array|ArrayAccess $carrier
*/
public function put(&$carrier, string $key, string $value): void
Expand Down
1 change: 1 addition & 0 deletions class_map/ThriftUdpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Jaeger;

use Hyperf\Context\ApplicationContext;
Expand Down
18 changes: 12 additions & 6 deletions publish/opentracing.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\Tracer\Adapter\JaegerTracerFactory;
use Hyperf\Tracer\Adapter\NoOpTracerFactory;
use Hyperf\Tracer\Adapter\Reporter\Kafka;
use Hyperf\Tracer\Adapter\ZipkinTracerFactory;
use Zipkin\Reporters\Http;
use Zipkin\Reporters\Noop;
use Zipkin\Samplers\BinarySampler;

use function Hyperf\Support\env;
Expand All @@ -30,7 +36,7 @@
],
'tracer' => [
'zipkin' => [
'driver' => Hyperf\Tracer\Adapter\ZipkinTracerFactory::class,
'driver' => ZipkinTracerFactory::class,
'app' => [
'name' => env('APP_NAME', 'skeleton'),
// Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null
Expand All @@ -42,7 +48,7 @@
'reporters' => [
// options for http reporter
'http' => [
'class' => \Zipkin\Reporters\Http::class,
'class' => Http::class,
'constructor' => [
'options' => [
'endpoint_url' => env('ZIPKIN_ENDPOINT_URL', 'http://localhost:9411/api/v2/spans'),
Expand All @@ -52,7 +58,7 @@
],
// options for kafka reporter
'kafka' => [
'class' => \Hyperf\Tracer\Adapter\Reporter\Kafka::class,
'class' => Kafka::class,
'constructor' => [
'options' => [
'topic' => env('ZIPKIN_KAFKA_TOPIC', 'zipkin'),
Expand All @@ -64,13 +70,13 @@
],
],
'noop' => [
'class' => \Zipkin\Reporters\Noop::class,
'class' => Noop::class,
],
],
'sampler' => BinarySampler::createAsAlwaysSample(),
],
'jaeger' => [
'driver' => Hyperf\Tracer\Adapter\JaegerTracerFactory::class,
'driver' => JaegerTracerFactory::class,
'name' => env('APP_NAME', 'skeleton'),
'options' => [
/*
Expand All @@ -90,7 +96,7 @@
],
],
'noop' => [
'driver' => Hyperf\Tracer\Adapter\NoOpTracerFactory::class,
'driver' => NoOpTracerFactory::class,
],
],
'tags' => [
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/HttpClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/JaegerTracerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/NoOpTracerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter;

use Hyperf\Tracer\Contract\NamedFactoryInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Reporter/HttpClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter\Reporter;

use Closure;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Reporter/Kafka.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter\Reporter;

use Psr\Log\LoggerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Reporter/KafkaClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter\Reporter;

use Closure;
Expand Down
4 changes: 3 additions & 1 deletion src/Adapter/Reporter/ReporterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter\Reporter;

use Hyperf\Contract\StdoutLoggerInterface;
use Psr\Container\ContainerInterface;
use RuntimeException;
use Zipkin\Reporter;
use Zipkin\Reporters\Http;

use function Hyperf\Support\make;

Expand All @@ -38,7 +40,7 @@ public function make(array $option = []): Reporter
throw new RuntimeException('Unsupported reporter.');
}

if ($class === \Zipkin\Reporters\Http::class) {
if ($class === Http::class) {
$constructor['requesterFactory'] = $this->container->get(HttpClientFactory::class);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Adapter/ZipkinTracerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Adapter;

use Hyperf\Contract\ConfigInterface;
use Hyperf\Tracer\Adapter\Reporter\ReporterFactory;
use Hyperf\Tracer\Contract\NamedFactoryInterface;
use Zipkin\Endpoint;
use Zipkin\Reporters\Http;
use Zipkin\Samplers\BinarySampler;
use Zipkin\TracingBuilder;
use ZipkinOpenTracing\Tracer;
Expand Down Expand Up @@ -56,7 +58,7 @@ private function parseConfig(): array
]),
$this->getConfig('sampler', BinarySampler::createAsAlwaysSample()),
$this->getConfig('reporters.' . $reporter, [
'class' => \Zipkin\Reporters\Http::class,
'class' => Http::class,
'constructor' => [
'options' => $this->getConfig('options', []),
],
Expand Down
1 change: 1 addition & 0 deletions src/Annotation/Trace.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Annotation;

use Attribute;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/CoroutineAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/CreateTraceContextAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/DbAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\DB\DB;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/ElasticserachAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Elasticsearch\Client;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/GrpcAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Context\Context as CT;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/HttpClientAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use GuzzleHttp\Client;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/JsonRpcAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/MethodAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/RedisAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/RpcAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Context\Context as CT;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/TraceAnnotationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer;

use GuzzleHttp\Client;
Expand Down
5 changes: 4 additions & 1 deletion src/Contract/NamedFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Contract;

use OpenTracing\Tracer;

interface NamedFactoryInterface
{
/**
* Create the object from factory.
*/
public function make(string $name): \OpenTracing\Tracer;
public function make(string $name): Tracer;
}
1 change: 1 addition & 0 deletions src/Exception/ConnectionClosedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Exception;

use RuntimeException;
Expand Down
1 change: 1 addition & 0 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Exception;

class InvalidArgumentException extends \InvalidArgumentException
Expand Down
1 change: 1 addition & 0 deletions src/Exception/TimeoutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Exception;

use RuntimeException;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/DbQueryExecutedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Listener;

use Hyperf\Collection\Arr;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/RequestTraceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Listener;

use Hyperf\Coroutine\Coroutine;
Expand Down
3 changes: 2 additions & 1 deletion src/Middleware/TraceMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer\Middleware;

use Hyperf\Coroutine\Coroutine;
Expand Down Expand Up @@ -48,7 +49,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
defer(function () use ($tracer) {
try {
$tracer->flush();
} catch (\Throwable) {
} catch (Throwable) {
}
});
try {
Expand Down
1 change: 1 addition & 0 deletions src/SpanStarter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions src/SpanTagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer;

class SpanTagManager
Expand Down
1 change: 1 addition & 0 deletions src/SpanTagManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Tracer;

use Hyperf\Contract\ConfigInterface;
Expand Down
Loading

0 comments on commit 2f52ab4

Please sign in to comment.