Skip to content

Conversation

@alpha0010
Copy link

Resolves 541da2d did not use the new spec file.

Fixed patch to apply, then ran the generate and lint-fix scripts.

See also: beluga-php/docker-php#103

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR regenerates the Docker API client from the Docker 1.45 API specification. The previous commit (541da2d) did not correctly use the new spec file, so this PR applies the proper patch and regenerates the code using the generate and lint-fix scripts.

Key changes:

  • Removes Symfony Kernel version checking and conditional class definitions
  • Standardizes class references to use ::class syntax instead of string literals
  • Adds new model classes and updates existing ones for Docker API 1.45
  • Refactors normalizer methods to use consistent parameter naming and type handling

Reviewed changes

Copilot reviewed 197 out of 346 changed files in this pull request and generated 2 comments.

File Description
src/Normalizer/*.php (multiple) Removes legacy Symfony version checks, standardizes class references with ::class, and updates method signatures to modern PHP standards
src/Model/TaskSpecContainerSpecPrivilegesAppArmor.php Adds new model class for AppArmor privileges configuration
src/Model/ContainerStatus.php Fixes class name from TaskStatusContainerStatus to ContainerStatus

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$data[$key] = $value;
}
if (\array_key_exists('Start', $data) && null !== $data['Start']) {
$object->setStart(\DateTime::createFromFormat('Y-m-d\TH:i:s.uuP', $data['Start']));
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The datetime format string uses an unescaped \T which may not work as intended. In the removed code, it was 'Y-m-d\\TH:i:s.uuP' with a double backslash. The single backslash \T in a single-quoted string represents the literal characters backslash and T, not a tab character, but for consistency with the original code and clarity, consider using 'Y-m-d\\TH:i:s.uuP'.

Suggested change
$object->setStart(\DateTime::createFromFormat('Y-m-d\TH:i:s.uuP', $data['Start']));
$object->setStart(\DateTime::createFromFormat('Y-m-d\\TH:i:s.uuP', $data['Start']));

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var_dump(
  DateTime::createFromFormat(
    'Y-m-d\TH:i:s.uuP', "2020-01-06T09:07:59.461876391Z"
  )
);

returns

object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2020-01-06 09:07:59.391000"
  ["timezone_type"]=>
  int(2)
  ["timezone"]=>
  string(1) "Z"
}

which matches expected behavior.


also Docker uses RFC 3339 format with nano-seconds which is mapped by PHP's DateTimeInterface constants:

{
$dataArray = [];
if ($data->isInitialized('start') && null !== $data->getStart()) {
$dataArray['Start'] = $data->getStart()?->format('Y-m-d\TH:i:sP');
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The datetime format string uses \T but the removed code used 'Y-m-d\\TH:i:sP' with a double backslash. For consistency with PHP datetime format strings and the previous implementation, use 'Y-m-d\\TH:i:sP'.

Suggested change
$dataArray['Start'] = $data->getStart()?->format('Y-m-d\TH:i:sP');
$dataArray['Start'] = $data->getStart()?->format('Y-m-d\\TH:i:sP');

Copilot uses AI. Check for mistakes.
@flavioheleno flavioheleno merged commit a287d09 into beluga-php:main Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants