Skip to content

Commit e53b08b

Browse files
committed
refactor(helper): Remove debug logging from getContainersData for cleaner code
- Eliminated unnecessary debug logging statements in getContainersData to streamline the function. - Improved readability by focusing on essential logic and reducing clutter.
1 parent 48c2376 commit e53b08b

1 file changed

Lines changed: 1 addition & 30 deletions

File tree

examples/dotcms-laravel/app/Helpers/DotCmsHelpers.php

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,7 @@ public function getContainersData($containers, $container)
1919
// First try to get the container data using the SDK helper
2020
$containerData = DotCmsHelper::getContainerData($containers, $container);
2121

22-
// Debug the input data
23-
Log::debug('Container Input', [
24-
'container' => $container,
25-
'containers' => $containers
26-
]);
27-
2822
if (!$containerData) {
29-
Log::warning('No container data found', [
30-
'identifier' => $container['identifier'] ?? 'unknown',
31-
'uuid' => $container['uuid'] ?? 'unknown'
32-
]);
3323
return [
3424
'contentlets' => [],
3525
'acceptTypes' => '',
@@ -41,23 +31,9 @@ public function getContainersData($containers, $container)
4131
$identifier = $container['identifier'] ?? '';
4232
$uuid = $container['uuid'] ?? '';
4333

44-
// Debug the container data
45-
Log::debug('Container Data', [
46-
'containerData' => $containerData,
47-
'identifier' => $identifier,
48-
'uuid' => $uuid
49-
]);
50-
5134
$structures = $containerData['containerStructures'] ?? [];
5235
$container = $containerData['container'] ?? [];
5336

54-
// Debug the contentlets structure
55-
Log::debug('Contentlets Structure', [
56-
'contentlets' => $containerData['contentlets'] ?? [],
57-
'uuid-key' => "uuid-$uuid",
58-
'dotParser-key' => "uuid-dotParser_$uuid"
59-
]);
60-
6137
$contentlets = $containerData['contentlets']["uuid-$uuid"]
6238
?? $containerData['contentlets']["uuid-dotParser_$uuid"]
6339
?? [];
@@ -66,17 +42,12 @@ public function getContainersData($containers, $container)
6642
Log::warning("No contentlets found for container: $identifier, uuid: $uuid");
6743
}
6844

69-
$result = [
45+
return [
7046
...$container,
7147
'acceptTypes' => implode(',', array_column($structures, 'contentTypeVar')),
7248
'contentlets' => $contentlets,
7349
'variantId' => $container['parentPermissionable']['variantId'] ?? null
7450
];
75-
76-
// Debug the final result
77-
Log::debug('Final Result', $result);
78-
79-
return $result;
8051
}
8152

8253
/**

0 commit comments

Comments
 (0)