Skip to content

Commit 3c4b4f2

Browse files
committed
style: remove inline docblocks, fix copyright year to 2026 on new files
1 parent fd8f802 commit 3c4b4f2

7 files changed

Lines changed: 7 additions & 85 deletions

File tree

src/OpenConext/EngineBlock/Logger/Processor/CorrelationIdProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

src/OpenConext/EngineBlock/Request/CorrelationId.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
1818

1919
namespace OpenConext\EngineBlock\Request;
2020

21-
/**
22-
* Immutable value object representing a correlation ID for a SAML authentication flow.
23-
*/
2421
final class CorrelationId
2522
{
2623
public function __construct(public readonly string $correlationId)

src/OpenConext/EngineBlock/Request/CorrelationIdRepository.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,13 +21,6 @@
2121
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
2222
use Symfony\Component\HttpFoundation\RequestStack;
2323

24-
/**
25-
* Session-only CRUD for correlation IDs.
26-
*
27-
* Stores and retrieves raw correlation ID strings keyed by SAML request ID.
28-
* Has no knowledge of which correlation ID is currently "active" — that is
29-
* the responsibility of CorrelationIdService + CurrentCorrelationId.
30-
*/
3124
final class CorrelationIdRepository
3225
{
3326
private const SESSION_KEY = 'CorrelationIds';
@@ -36,15 +29,6 @@ public function __construct(private readonly RequestStack $requestStack)
3629
{
3730
}
3831

39-
/**
40-
* Persists a correlation ID for the given request ID.
41-
* No-op when no session is available.
42-
*
43-
* Note: this method unconditionally overwrites any existing entry.
44-
* Callers (e.g. CorrelationIdService::mint()) are responsible for the
45-
* back-button idempotency guard: call find() first and skip store() if
46-
* a value already exists.
47-
*/
4832
public function store(string $requestId, CorrelationId $correlationId): void
4933
{
5034
try {
@@ -58,10 +42,6 @@ public function store(string $requestId, CorrelationId $correlationId): void
5842
$session->set(self::SESSION_KEY, $ids);
5943
}
6044

61-
/**
62-
* Copies the correlation ID from $sourceRequestId to $targetRequestId.
63-
* No-op when source is not found or no session is available.
64-
*/
6545
public function link(string $targetRequestId, string $sourceRequestId): void
6646
{
6747
try {
@@ -80,10 +60,6 @@ public function link(string $targetRequestId, string $sourceRequestId): void
8060
$session->set(self::SESSION_KEY, $ids);
8161
}
8262

83-
/**
84-
* Returns the CorrelationId for $requestId, or null when not found.
85-
* Returns null when no session is available.
86-
*/
8763
public function find(string $requestId): ?CorrelationId
8864
{
8965
try {

src/OpenConext/EngineBlock/Request/CorrelationIdService.php

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,17 +18,6 @@
1818

1919
namespace OpenConext\EngineBlock\Request;
2020

21-
/**
22-
* Orchestrates correlation ID operations across the four SAML legs.
23-
*
24-
* mint() — generate a new ID for a SAML request (back-button safe)
25-
* link() — copy an existing ID to a new SAML request ID (SP→IdP handoff)
26-
* resolve() — look up the ID and push it into CurrentCorrelationId so all
27-
* subsequent log entries carry it
28-
*
29-
* This is the single entry point used by Corto services. The session
30-
* interaction is delegated to CorrelationIdRepository.
31-
*/
3221
final class CorrelationIdService
3322
{
3423
public function __construct(
@@ -37,30 +26,18 @@ public function __construct(
3726
) {
3827
}
3928

40-
/**
41-
* Generates and stores a correlation ID for $requestId if none exists yet.
42-
* Safe to call multiple times for the same ID (back-button guard).
43-
*/
4429
public function mint(string $requestId): void
4530
{
4631
if ($this->repository->find($requestId) === null) {
4732
$this->repository->store($requestId, CorrelationId::mint());
4833
}
4934
}
5035

51-
/**
52-
* Copies the correlation ID from $sourceRequestId to $targetRequestId.
53-
*/
5436
public function link(string $targetRequestId, string $sourceRequestId): void
5537
{
5638
$this->repository->link($targetRequestId, $sourceRequestId);
5739
}
5840

59-
/**
60-
* Looks up the correlation ID for $requestId and sets it as the active ID
61-
* in CurrentCorrelationId so all subsequent log entries carry it.
62-
* No-op when $requestId is null or not found.
63-
*/
6441
public function resolve(?string $requestId): void
6542
{
6643
if ($requestId === null) {

src/OpenConext/EngineBlock/Request/CurrentCorrelationId.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,11 +18,6 @@
1818

1919
namespace OpenConext\EngineBlock\Request;
2020

21-
/**
22-
* Mutable DI singleton that holds the active correlation ID for the current
23-
* HTTP request. Set once per request by CorrelationIdService::resolve().
24-
* Read by CorrelationIdProcessor to stamp every log entry.
25-
*/
2621
final class CurrentCorrelationId
2722
{
2823
private ?string $correlationId = null;

src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Context/LoggingContext.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -22,15 +22,6 @@
2222
use OpenConext\EngineBlockFunctionalTestingBundle\Log\TestLogHandler;
2323
use PHPUnit\Framework\Assert;
2424

25-
/**
26-
* Behat context for asserting on structured log output.
27-
*
28-
* Injects the in-memory TestLogHandler so scenarios can verify that
29-
* log records carry the expected structured fields (e.g. correlation_id).
30-
*
31-
* Does not extend AbstractSubContext because it performs no browser interactions
32-
* and has no need for MinkContext.
33-
*/
3425
class LoggingContext implements Context
3526
{
3627
public function __construct(private readonly TestLogHandler $logHandler)

src/OpenConext/EngineBlockFunctionalTestingBundle/Log/TestLogHandler.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright 2010 SURFnet B.V.
4+
* Copyright 2026 SURFnet B.V.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -22,12 +22,6 @@
2222
use Monolog\Level;
2323
use Monolog\LogRecord;
2424

25-
/**
26-
* In-memory Monolog handler for Behat log assertions.
27-
*
28-
* Collects every log record that passes through it so Behat steps
29-
* can assert on the presence (or absence) of structured log fields.
30-
*/
3125
final class TestLogHandler extends AbstractProcessingHandler
3226
{
3327
/** @var LogRecord[] */
@@ -43,19 +37,11 @@ protected function write(LogRecord $record): void
4337
$this->records[] = $record;
4438
}
4539

46-
/**
47-
* Returns all captured log records since the last reset.
48-
*
49-
* @return LogRecord[]
50-
*/
5140
public function getRecords(): array
5241
{
5342
return $this->records;
5443
}
5544

56-
/**
57-
* Clears all captured log records.
58-
*/
5945
public function reset(): void
6046
{
6147
$this->records = [];

0 commit comments

Comments
 (0)