Skip to content

Commit c06f8c6

Browse files
authored
fixing some build errors (#298)
1 parent 4e8d9bd commit c06f8c6

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

src/Instrumentation/CakePHP/src/Hooks/Cake/Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command;
5+
namespace OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command;
66

77
use OpenTelemetry\API\Trace\Span;
88
use OpenTelemetry\API\Trace\StatusCode;

src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function instrument(): void
4545
$route = $this->getRouteTemplate($request);
4646
$span = \OpenTelemetry\API\Trace\Span::fromContext($scope->context());
4747

48-
if($route && $this->isRoot()) {
48+
if ($route && $this->isRoot()) {
4949
$span->setAttribute(TraceAttributes::HTTP_ROUTE, $route);
5050
}
5151
if ($exception) {

src/Instrumentation/CakePHP/tests/Integration/App/config/app.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@
173173
'skipLog' => [],
174174
'log' => true,
175175
'trace' => true,
176-
'ignoredDeprecationPaths' => [],
176+
'ignoredDeprecationPaths' => [
177+
'/src/I18n/I18n.php',
178+
],
177179
],
178180

179181
/*

src/Instrumentation/Laravel/src/Watchers/LogWatcher.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
use Illuminate\Contracts\Foundation\Application;
88
use Illuminate\Log\Events\MessageLogged;
9+
use Illuminate\Log\LogManager;
910
use OpenTelemetry\API\Instrumentation\CachedInstrumentation;
1011
use OpenTelemetry\API\Logs\LogRecord;
1112
use OpenTelemetry\API\Logs\Map\Psr3;
1213

1314
class LogWatcher extends Watcher
1415
{
16+
private LogManager $logger;
1517
public function __construct(
1618
private CachedInstrumentation $instrumentation,
1719
) {

src/Instrumentation/Psr16/tests/Integration/Psr16InstrumentationTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private function createMemoryCacheAdapter(): CacheInterface
204204

205205
protected function checkKey(string $key):string
206206
{
207-
if(empty($key)) {
207+
if (empty($key)) {
208208
throw new \InvalidArgumentException('cache key is empty');
209209
}
210210

@@ -213,11 +213,11 @@ protected function checkKey(string $key):string
213213

214214
protected function getTTL(DateInterval|int|null $ttl):?int
215215
{
216-
if($ttl instanceof DateInterval) {
216+
if ($ttl instanceof DateInterval) {
217217
return ((new DateTime())->add($ttl)->getTimeStamp() - time());
218218
}
219219

220-
if((is_int($ttl) && $ttl > 0)) {
220+
if ((is_int($ttl) && $ttl > 0)) {
221221
return $ttl;
222222
}
223223

@@ -226,7 +226,7 @@ protected function getTTL(DateInterval|int|null $ttl):?int
226226

227227
protected function fromIterable(iterable $data): array
228228
{
229-
if(is_array($data)) {
229+
if (is_array($data)) {
230230
return $data;
231231
}
232232

@@ -235,8 +235,8 @@ protected function fromIterable(iterable $data): array
235235

236236
protected function checkReturn(array $booleans): bool
237237
{
238-
foreach($booleans as $boolean) {
239-
if(!(bool) $boolean) {
238+
foreach ($booleans as $boolean) {
239+
if (!(bool) $boolean) {
240240
return false;
241241
}
242242
}
@@ -248,8 +248,8 @@ public function get(string $key, mixed $default = null): mixed
248248
{
249249
$key = $this->checkKey($key);
250250

251-
if(isset($this->data[$key])) {
252-
if($this->data[$key]['ttl'] === null || $this->data[$key]['ttl'] > time()) {
251+
if (isset($this->data[$key])) {
252+
if ($this->data[$key]['ttl'] === null || $this->data[$key]['ttl'] > time()) {
253253
return $this->data[$key]['content'];
254254
}
255255

@@ -263,7 +263,7 @@ public function set(string $key, mixed $value, null|int|\DateInterval $ttl = nul
263263
{
264264
$ttl = $this->getTTL($ttl);
265265

266-
if($ttl !== null) {
266+
if ($ttl !== null) {
267267
$ttl = (time() + $ttl);
268268
}
269269

src/Instrumentation/Psr6/tests/Integration/Psr6InstrumentationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private function createMemoryCacheAdapter(): CacheItemPoolInterface
213213

214214
protected function checkKey(string $key):string
215215
{
216-
if(empty($key)) {
216+
if (empty($key)) {
217217
throw new \InvalidArgumentException('cache key is empty');
218218
}
219219

0 commit comments

Comments
 (0)