Skip to content

Commit

Permalink
✨ Add support of PHP 8.3 (#6)
Browse files Browse the repository at this point in the history
* ✨ Add support of PHP 8.3

* ⬆️ Upgrade Psalm to v5
  • Loading branch information
chapa authored May 6, 2024
1 parent 594b9e0 commit 17f7d6f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -53,6 +54,7 @@ jobs:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.3.2 (unreleased)

### ✨ New features

* Add support of PHP 8.3

## v0.3.1 (December 15, 2022)

### ✨ New features
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
}
],
"require": {
"php": "8.0.* || 8.1.* || 8.2.*",
"php": "8.0.* || 8.1.* || 8.2.* || 8.3.*",
"php-opencloud/openstack": "^3.1",
"league/flysystem": "^3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"league/flysystem-adapter-test-utilities": "^3.0",
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.16.1",
"vimeo/psalm": "^4.9"
"psalm/plugin-phpunit": "^0.19.0",
"vimeo/psalm": "^5.24"
},
"scripts": {
"phpunit": "phpunit",
Expand Down
6 changes: 6 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand All @@ -12,4 +14,8 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>

<issueHandlers>
<MissingClassConstType errorLevel="suppress" />
</issueHandlers>
</psalm>
5 changes: 4 additions & 1 deletion src/OpenStackSwiftAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ private function createFileAttributesFrom(StorageObject $object): FileAttributes
if ($lastModified instanceof \DateTimeInterface) {
$lastModified = $lastModified->getTimestamp();
} else {
$lastModified = strtotime($lastModified) ?: null;
$lastModified = strtotime($lastModified);
if (!($lastModified > 0)) {
$lastModified = null;
}
}

$mimeType = empty($object->contentType) ? null : $object->contentType;
Expand Down

0 comments on commit 17f7d6f

Please sign in to comment.