Skip to content

Conversation

@stobrien89
Copy link
Member

@stobrien89 stobrien89 commented Aug 28, 2025

Description of changes:
Fixes PHP 8.5 deprecation warnings and adds 8.5 to test runs, adds Windows unit test workflow, adds JIT to applicable workflows, adds separate Codecov coverage workflow that runs weekly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@stobrien89 stobrien89 changed the title chore: add 8.5 to workflows chore: add 8.5 support Aug 28, 2025
@stobrien89 stobrien89 force-pushed the 8.5-support branch 26 times, most recently from fc5c30c to 116c59b Compare September 4, 2025 19:41
@stobrien89 stobrien89 force-pushed the 8.5-support branch 17 times, most recently from 449cc4e to 4caa0f3 Compare November 26, 2025 21:01
Copy link
Contributor

@yenfryherrerafeliz yenfryherrerafeliz left a comment

Choose a reason for hiding this comment

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

I think falling back to empty string in every array access could be problematic, but we can leave this open for discussion.

public function get($key)
{
$key = $key ?? '';
if (!isset($this->items[$key])) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer the idea of evaluating if the key is null and not fallback to make the key an empty string. Why?, because an empty string is also a valid array key and this could cause unexpected behaviors. Also, when setting the key you also fallback to make it empty.

Copy link
Contributor

Choose a reason for hiding this comment

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

For example:

if ($key == null || !isset($this->items[$key])) {
    return null;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't particularly like falling back to an empty string either, but it's official guidance from the deprecation guide:

Using null as an array offset
Using null as an array offset or when calling array_key_exists() is now deprecated. Instead an empty string should be used.

I'll try to come up with a better way around this

Copy link
Member Author

Choose a reason for hiding this comment

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

dug into this a bit further- avoided in areas where checks could be performed in another way, but in this class and MultiRegionClient, we break backward-compatibility if we do anything else. From the PHP Manual:

Null will be cast to the empty string, i.e. the key null will actually be stored under "".

In those classes we were setting/getting '' keys and that's behavior we should retain.

Comment on lines 180 to 181
return !empty($context)
&& !empty($context['errno'])
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the extra condition could be redundant?, unless $context may be null?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed in the latest update

Comment on lines +552 to +553
file_put_contents($awsDir . '/mycreds', $ini);
putenv("AWS_SHARED_CREDENTIALS_FILE={$awsDir}/mycreds");
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is redundant. The same thing happens after line 561, unless I am missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

slightly different format: for Linux, it's wrapped in an outer string

public function testDownloadsObjectsWithAccessPointArn()
{
if (PHP_OS_FAMILY === 'Windows') {
$this->markTestSkipped('S3 access point ARN downloads have path handling issues on Windows');
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this mean?, customers can't do downloads using access points ARNs on Windows then?

Copy link
Member Author

Choose a reason for hiding this comment

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

possibly. Will need to add to the backlog to investigate. I tried for a while to get this working

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.

3 participants