From 71da77fefa934cf366edf9c1fdef0e5b9c840926 Mon Sep 17 00:00:00 2001 From: ildyria Date: Thu, 20 Jun 2024 21:45:32 +0200 Subject: [PATCH] add tests --- composer.lock | 356 +++++++++--------- lib/PHPExif/Mapper/Exiftool.php | 7 + lib/PHPExif/Mapper/ImageMagick.php | 7 + lib/PHPExif/Mapper/Native.php | 12 +- tests/PHPExif/Mapper/ExiftoolMapperTest.php | 4 + .../PHPExif/Mapper/ImageMagickMapperTest.php | 12 +- tests/PHPExif/Mapper/NativeMapperTest.php | 126 ++++--- 7 files changed, 295 insertions(+), 229 deletions(-) diff --git a/composer.lock b/composer.lock index 09e2704..4475f64 100644 --- a/composer.lock +++ b/composer.lock @@ -412,16 +412,16 @@ }, { "name": "symfony/cache", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "48e3508338987d63b0114a00c208c4cbb76e5303" + "reference": "760294dc7158372699dccd077965c16c328f8719" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/48e3508338987d63b0114a00c208c4cbb76e5303", - "reference": "48e3508338987d63b0114a00c208c4cbb76e5303", + "url": "https://api.github.com/repos/symfony/cache/zipball/760294dc7158372699dccd077965c16c328f8719", + "reference": "760294dc7158372699dccd077965c16c328f8719", "shasum": "" }, "require": { @@ -429,6 +429,7 @@ "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/service-contracts": "^2.5|^3", "symfony/var-exporter": "^6.4|^7.0" }, @@ -488,7 +489,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.0.7" + "source": "https://github.com/symfony/cache/tree/v7.1.1" }, "funding": [ { @@ -504,7 +505,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/cache-contracts", @@ -651,16 +652,16 @@ }, { "name": "symfony/process", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0" + "reference": "febf90124323a093c7ee06fdb30e765ca3c20028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3839e56b94dd1dbd13235d27504e66baf23faba0", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0", + "url": "https://api.github.com/repos/symfony/process/zipball/febf90124323a093c7ee06fdb30e765ca3c20028", + "reference": "febf90124323a093c7ee06fdb30e765ca3c20028", "shasum": "" }, "require": { @@ -692,7 +693,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.7" + "source": "https://github.com/symfony/process/tree/v7.1.1" }, "funding": [ { @@ -708,7 +709,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/service-contracts", @@ -795,16 +796,16 @@ }, { "name": "symfony/var-exporter", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "cdecc0022e40e90340ba1a59a3d5ccf069777078" + "reference": "db82c2b73b88734557cfc30e3270d83fa651b712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/cdecc0022e40e90340ba1a59a3d5ccf069777078", - "reference": "cdecc0022e40e90340ba1a59a3d5ccf069777078", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/db82c2b73b88734557cfc30e3270d83fa651b712", + "reference": "db82c2b73b88734557cfc30e3270d83fa651b712", "shasum": "" }, "require": { @@ -851,7 +852,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.0.7" + "source": "https://github.com/symfony/var-exporter/tree/v7.1.1" }, "funding": [ { @@ -867,7 +868,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "thecodingmachine/safe", @@ -1167,16 +1168,16 @@ }, { "name": "composer/pcre", - "version": "3.1.3", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + "reference": "04229f163664973f68f38f6f73d917799168ef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", "shasum": "" }, "require": { @@ -1218,7 +1219,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.3" + "source": "https://github.com/composer/pcre/tree/3.1.4" }, "funding": [ { @@ -1234,7 +1235,7 @@ "type": "tidelift" } ], - "time": "2024-03-19T10:26:25+00:00" + "time": "2024-05-27T13:40:54+00:00" }, { "name": "composer/semver", @@ -1516,16 +1517,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.57.2", + "version": "v3.59.3", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "22f7f3145606df92b02fb1bd22c30abfce956d3c" + "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/22f7f3145606df92b02fb1bd22c30abfce956d3c", - "reference": "22f7f3145606df92b02fb1bd22c30abfce956d3c", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", "shasum": "" }, "require": { @@ -1555,16 +1556,16 @@ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.0", - "infection/infection": "^0.27.11", + "facile-it/paraunit": "^1.3 || ^2.3", + "infection/infection": "^0.29.5", "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^2.1", "mikey179/vfsstream": "^1.6.11", "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, @@ -1579,7 +1580,10 @@ "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1604,7 +1608,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.57.2" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" }, "funding": [ { @@ -1612,7 +1616,7 @@ "type": "github" } ], - "time": "2024-05-20T20:41:57+00:00" + "time": "2024-06-16T14:17:03+00:00" }, { "name": "infection/abstract-testframework-adapter", @@ -2043,16 +2047,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -2060,11 +2064,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -2090,7 +2095,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -2098,7 +2103,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nette/utils", @@ -2647,16 +2652,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.2", + "version": "1.11.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec" + "reference": "490f0ae1c92b082f154681d7849aee776a7c1443" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/490f0ae1c92b082f154681d7849aee776a7c1443", + "reference": "490f0ae1c92b082f154681d7849aee776a7c1443", "shasum": "" }, "require": { @@ -2701,7 +2706,7 @@ "type": "github" } ], - "time": "2024-05-24T13:23:04+00:00" + "time": "2024-06-17T15:10:54+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -3424,28 +3429,28 @@ }, { "name": "react/dns", - "version": "v1.12.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/reactphp/dns.git", - "reference": "c134600642fa615b46b41237ef243daa65bb64ec" + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/c134600642fa615b46b41237ef243daa65bb64ec", - "reference": "c134600642fa615b46b41237ef243daa65bb64ec", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "shasum": "" }, "require": { "php": ">=5.3.0", "react/cache": "^1.0 || ^0.6 || ^0.5", "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7 || ^1.2.1" + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", - "react/promise-timer": "^1.9" + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -3488,7 +3493,7 @@ ], "support": { "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.12.0" + "source": "https://github.com/reactphp/dns/tree/v1.13.0" }, "funding": [ { @@ -3496,7 +3501,7 @@ "type": "open_collective" } ], - "time": "2023-11-29T12:41:06+00:00" + "time": "2024-06-13T14:18:03+00:00" }, { "name": "react/event-loop", @@ -3725,16 +3730,16 @@ }, { "name": "react/stream", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66" + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/6fbc9672905c7d5a885f2da2fc696f65840f4a66", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { @@ -3744,7 +3749,7 @@ }, "require-dev": { "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -3791,7 +3796,7 @@ ], "support": { "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.3.0" + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, "funding": [ { @@ -3799,7 +3804,7 @@ "type": "open_collective" } ], - "time": "2023-06-16T10:52:11+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { "name": "sanmai/later", @@ -3867,16 +3872,16 @@ }, { "name": "sanmai/pipeline", - "version": "v6.10", + "version": "v6.11", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "cbd2ea30ba8bef596b8dad1adb9c92fb2987e430" + "reference": "a5fa2a6c6ca93efa37e7c24aab72f47448a6b110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/cbd2ea30ba8bef596b8dad1adb9c92fb2987e430", - "reference": "cbd2ea30ba8bef596b8dad1adb9c92fb2987e430", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/a5fa2a6c6ca93efa37e7c24aab72f47448a6b110", + "reference": "a5fa2a6c6ca93efa37e7c24aab72f47448a6b110", "shasum": "" }, "require": { @@ -3920,7 +3925,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.10" + "source": "https://github.com/sanmai/pipeline/tree/v6.11" }, "funding": [ { @@ -3928,7 +3933,7 @@ "type": "github" } ], - "time": "2024-03-16T01:33:30+00:00" + "time": "2024-06-15T03:11:19+00:00" }, { "name": "sebastian/cli-parser", @@ -4895,28 +4900,28 @@ }, { "name": "slam/phpstan-extensions", - "version": "v6.3.0", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/Slamdunk/phpstan-extensions.git", - "reference": "483baf9c969c596088e86ac22dd810b8632d8b7e" + "reference": "e485ec42d76f3dcdbbb6bd10ef3333ae1b1ec6f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Slamdunk/phpstan-extensions/zipball/483baf9c969c596088e86ac22dd810b8632d8b7e", - "reference": "483baf9c969c596088e86ac22dd810b8632d8b7e", + "url": "https://api.github.com/repos/Slamdunk/phpstan-extensions/zipball/e485ec42d76f3dcdbbb6bd10ef3333ae1b1ec6f0", + "reference": "e485ec42d76f3dcdbbb6bd10ef3333ae1b1ec6f0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18.0 || ^5.0.0", + "nikic/php-parser": "^4.19.1 || ^5.0.2", "php": "~8.2.0 || ~8.3.0", - "phpstan/phpstan": "^1.10.59" + "phpstan/phpstan": "^1.11.4" }, "require-dev": { - "nette/di": "^3.2.0", + "nette/di": "^3.2.2", "nette/neon": "^3.4.1", - "phpstan/phpstan-phpunit": "^1.3.16", - "phpunit/phpunit": "^11.0.3", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpunit/phpunit": "^11.2.1", "slam/php-cs-fixer-extensions": "^3.10.0" }, "type": "phpstan-extension", @@ -4946,7 +4951,7 @@ "description": "Slam extension of phpstan", "support": { "issues": "https://github.com/Slamdunk/phpstan-extensions/issues", - "source": "https://github.com/Slamdunk/phpstan-extensions/tree/v6.3.0" + "source": "https://github.com/Slamdunk/phpstan-extensions/tree/v6.4.0" }, "funding": [ { @@ -4958,7 +4963,7 @@ "type": "github" } ], - "time": "2024-02-28T06:31:58+00:00" + "time": "2024-06-11T10:06:12+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -5042,22 +5047,22 @@ }, { "name": "symfony/config", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f66f908a975500aa4594258bf454dc66e3939eac" + "reference": "2210fc99fa42a259eb6c89d1f724ce0c4d62d5d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f66f908a975500aa4594258bf454dc66e3939eac", - "reference": "f66f908a975500aa4594258bf454dc66e3939eac", + "url": "https://api.github.com/repos/symfony/config/zipball/2210fc99fa42a259eb6c89d1f724ce0c4d62d5d2", + "reference": "2210fc99fa42a259eb6c89d1f724ce0c4d62d5d2", "shasum": "" }, "require": { "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^6.4|^7.0", + "symfony/filesystem": "^7.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -5097,7 +5102,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v7.0.7" + "source": "https://github.com/symfony/config/tree/v7.1.1" }, "funding": [ { @@ -5113,20 +5118,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/console", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c981e0e9380ce9f146416bde3150c79197ce9986" + "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c981e0e9380ce9f146416bde3150c79197ce9986", - "reference": "c981e0e9380ce9f146416bde3150c79197ce9986", + "url": "https://api.github.com/repos/symfony/console/zipball/9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", + "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", "shasum": "" }, "require": { @@ -5190,7 +5195,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.7" + "source": "https://github.com/symfony/console/tree/v7.1.1" }, "funding": [ { @@ -5206,27 +5211,27 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "4db1314337f4dd864113f88e08c9a7f98b1c1324" + "reference": "77c636dfd86c0b60c5d184b2fd2ddf8dd11c309c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/4db1314337f4dd864113f88e08c9a7f98b1c1324", - "reference": "4db1314337f4dd864113f88e08c9a7f98b1c1324", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/77c636dfd86c0b60c5d184b2fd2ddf8dd11c309c", + "reference": "77c636dfd86c0b60c5d184b2fd2ddf8dd11c309c", "shasum": "" }, "require": { "php": ">=8.2", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^3.3", + "symfony/service-contracts": "^3.5", "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { @@ -5270,7 +5275,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.0.7" + "source": "https://github.com/symfony/dependency-injection/tree/v7.1.1" }, "funding": [ { @@ -5286,20 +5291,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", "shasum": "" }, "require": { @@ -5350,7 +5355,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.1.1" }, "funding": [ { @@ -5366,7 +5371,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5446,22 +5451,24 @@ }, { "name": "symfony/filesystem", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5" + "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/cc168be6fbdcdf3401f50ae863ee3818ed4338f5", - "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/802e87002f919296c9f606457d9fa327a0b3d6b2", + "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2", "shasum": "" }, "require": { "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { "symfony/process": "^6.4|^7.0" }, "type": "library", @@ -5490,7 +5497,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.7" + "source": "https://github.com/symfony/filesystem/tree/v7.1.1" }, "funding": [ { @@ -5506,20 +5513,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/finder", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c" + "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4d58f0f4fe95a30d7b538d71197135483560b97c", - "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c", + "url": "https://api.github.com/repos/symfony/finder/zipball/fbb0ba67688b780efbc886c1a0a0948dcf7205d6", + "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6", "shasum": "" }, "require": { @@ -5554,7 +5561,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.0.7" + "source": "https://github.com/symfony/finder/tree/v7.1.1" }, "funding": [ { @@ -5570,20 +5577,20 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa" + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", "shasum": "" }, "require": { @@ -5621,7 +5628,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.7" + "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" }, "funding": [ { @@ -5637,20 +5644,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -5700,7 +5707,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -5716,20 +5723,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -5778,7 +5785,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -5794,20 +5801,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -5859,7 +5866,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -5875,20 +5882,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -5939,7 +5946,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -5955,20 +5962,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -6019,7 +6026,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -6035,20 +6042,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", "shasum": "" }, "require": { @@ -6095,7 +6102,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" }, "funding": [ { @@ -6111,20 +6118,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/stopwatch", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", "shasum": "" }, "require": { @@ -6157,7 +6164,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" + "source": "https://github.com/symfony/stopwatch/tree/v7.1.1" }, "funding": [ { @@ -6173,20 +6180,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/string", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2", + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2", "shasum": "" }, "require": { @@ -6200,6 +6207,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { + "symfony/emoji": "^7.1", "symfony/error-handler": "^6.4|^7.0", "symfony/http-client": "^6.4|^7.0", "symfony/intl": "^6.4|^7.0", @@ -6243,7 +6251,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.7" + "source": "https://github.com/symfony/string/tree/v7.1.1" }, "funding": [ { @@ -6259,7 +6267,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-06-04T06:40:14+00:00" }, { "name": "symplify/phpstan-rules", diff --git a/lib/PHPExif/Mapper/Exiftool.php b/lib/PHPExif/Mapper/Exiftool.php index 816330f..869bb56 100644 --- a/lib/PHPExif/Mapper/Exiftool.php +++ b/lib/PHPExif/Mapper/Exiftool.php @@ -240,6 +240,13 @@ public function mapRawData(array $data): array $timezone = null; } $value = new DateTime($value, $timezone); + } elseif (isset($data['ExifIFD:OffsetTime'])) { + try { + $timezone = new \DateTimeZone($data['ExifIFD:OffsetTime']); + } catch (\Exception $e) { + $timezone = null; + } + $value = new DateTime($value, $timezone); } else { $value = new DateTime($value); } diff --git a/lib/PHPExif/Mapper/ImageMagick.php b/lib/PHPExif/Mapper/ImageMagick.php index 6eb7716..45b5316 100644 --- a/lib/PHPExif/Mapper/ImageMagick.php +++ b/lib/PHPExif/Mapper/ImageMagick.php @@ -155,6 +155,13 @@ public function mapRawData(array $data): array $timezone = null; } $value = new DateTime($value, $timezone); + } elseif (isset($data['exif:OffsetTime'])) { + try { + $timezone = new \DateTimeZone($data['exif:OffsetTime']); + } catch (\Exception $e) { + $timezone = null; + } + $value = new DateTime($value, $timezone); } else { $value = new DateTime($value); } diff --git a/lib/PHPExif/Mapper/Native.php b/lib/PHPExif/Mapper/Native.php index 84a7298..42be15c 100644 --- a/lib/PHPExif/Mapper/Native.php +++ b/lib/PHPExif/Mapper/Native.php @@ -171,8 +171,8 @@ public function mapRawData(array $data): array if (preg_match('/^0000[-:]00[-:]00.00:00:00/', $value) === 1) { continue 2; } - // Check if OffsetTimeOriginal (0x9011) is available try { + // Check if OffsetTimeOriginal (0x9011) is available if (isset($data['UndefinedTag:0x9011'])) { try { $timezone = new \DateTimeZone($data['UndefinedTag:0x9011']); @@ -180,11 +180,19 @@ public function mapRawData(array $data): array $timezone = null; } $value = new DateTime($value, $timezone); + // Check if OffsetTime (0x9010) is available + } elseif (isset($data['UndefinedTag:0x9010'])) { + try { + $timezone = new \DateTimeZone($data['UndefinedTag:0x9010']); + } catch (\Exception $e) { + $timezone = null; + } + $value = new DateTime($value, $timezone); } else { $value = new DateTime($value); } } catch (\Exception $e) { - // Provided DateTimeOriginal or OffsetTimeOriginal invalid + // Provided DateTimeOriginal or OffsetTimeOriginal or OffsetTime invalid continue 2; } break; diff --git a/tests/PHPExif/Mapper/ExiftoolMapperTest.php b/tests/PHPExif/Mapper/ExiftoolMapperTest.php index 70dd0c4..63ab163 100644 --- a/tests/PHPExif/Mapper/ExiftoolMapperTest.php +++ b/tests/PHPExif/Mapper/ExiftoolMapperTest.php @@ -168,6 +168,10 @@ public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone() Exiftool::DATETIMEORIGINAL => '2015:04:01 12:11:09', 'ExifIFD:OffsetTimeOriginal' => '+0200', ), + array( + Exiftool::DATETIMEORIGINAL => '2015:04:01 12:11:09', + 'ExifIFD:OffsetTime' => '+0200', + ), array( Exiftool::DATETIMEORIGINAL_APPLE => '2015-04-01T12:11:09+0200', Exiftool::DATETIMEORIGINAL => '2015:04:01 12:11:09', diff --git a/tests/PHPExif/Mapper/ImageMagickMapperTest.php b/tests/PHPExif/Mapper/ImageMagickMapperTest.php index 293c402..f612116 100644 --- a/tests/PHPExif/Mapper/ImageMagickMapperTest.php +++ b/tests/PHPExif/Mapper/ImageMagickMapperTest.php @@ -113,12 +113,16 @@ public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone() ImageMagick::DATETIMEORIGINAL => '2015:04:01 12:11:09+0200', ), array( - ImageMagick::DATETIMEORIGINAL => '2015:04:01 12:11:09', - 'exif:OffsetTimeOriginal' => '+0200', + ImageMagick::DATETIMEORIGINAL => '2015:04:01 12:11:09', + 'exif:OffsetTimeOriginal' => '+0200', ), array( - ImageMagick::DATETIMEORIGINAL => '2015:04:01 12:11:09', - 'exif:OffsetTimeOriginal' => '+0200', + ImageMagick::DATETIMEORIGINAL => '2015:04:01 12:11:09', + 'exif:OffsetTime' => '+0200', + ), + array( + ImageMagick::DATETIMEORIGINAL => '2015:04:01 12:11:09', + 'exif:OffsetTimeOriginal' => '+0200', ) ); diff --git a/tests/PHPExif/Mapper/NativeMapperTest.php b/tests/PHPExif/Mapper/NativeMapperTest.php index 8778e35..023a7ea 100644 --- a/tests/PHPExif/Mapper/NativeMapperTest.php +++ b/tests/PHPExif/Mapper/NativeMapperTest.php @@ -93,61 +93,89 @@ public function testMapRawDataCorrectlyFormatsDateTimeOriginal() } - /** - * @group mapper - */ - public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone() - { - $rawData = array( - Native::DATETIMEORIGINAL => '2015:04:01 12:11:09+0200', - ); + /** + * @group mapper + */ + public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone() + { + $rawData = array( + Native::DATETIMEORIGINAL => '2015:04:01 12:11:09+0200', + ); - $mapped = $this->mapper->mapRawData($rawData); + $mapped = $this->mapper->mapRawData($rawData); - $result = reset($mapped); - $this->assertInstanceOf('\\DateTime', $result); - $this->assertEquals( - '2015:04:01 12:11:09', - $result->format('Y:m:d H:i:s') - ); - $this->assertEquals( - 7200, - $result->getOffset() - ); - $this->assertEquals( - '+02:00', - $result->getTimezone()->getName() - ); - } + $result = reset($mapped); + $this->assertInstanceOf('\\DateTime', $result); + $this->assertEquals( + '2015:04:01 12:11:09', + $result->format('Y:m:d H:i:s') + ); + $this->assertEquals( + 7200, + $result->getOffset() + ); + $this->assertEquals( + '+02:00', + $result->getTimezone()->getName() + ); + } - /** - * @group mapper - */ - public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone2() - { - $rawData = array( - Native::DATETIMEORIGINAL => '2015:04:01 12:11:09', - 'UndefinedTag:0x9011' => '+0200', - ); + /** + * @group mapper + */ + public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone2() + { + $rawData = array( + Native::DATETIMEORIGINAL => '2015:04:01 12:11:09', + 'UndefinedTag:0x9011' => '+0200', + ); - $mapped = $this->mapper->mapRawData($rawData); + $mapped = $this->mapper->mapRawData($rawData); - $result = reset($mapped); - $this->assertInstanceOf('\\DateTime', $result); - $this->assertEquals( - '2015:04:01 12:11:09', - $result->format('Y:m:d H:i:s') - ); - $this->assertEquals( - 7200, - $result->getOffset() - ); - $this->assertEquals( - '+02:00', - $result->getTimezone()->getName() - ); - } + $result = reset($mapped); + $this->assertInstanceOf('\\DateTime', $result); + $this->assertEquals( + '2015:04:01 12:11:09', + $result->format('Y:m:d H:i:s') + ); + $this->assertEquals( + 7200, + $result->getOffset() + ); + $this->assertEquals( + '+02:00', + $result->getTimezone()->getName() + ); + } + + /** + * @group mapper + */ + public function testMapRawDataCorrectlyFormatsCreationDateWithTimeZone3() + { + $rawData = array( + Native::DATETIMEORIGINAL => '2015:04:01 12:11:09', + 'UndefinedTag:0x9010' => '+0200', + ); + + $mapped = $this->mapper->mapRawData($rawData); + $result = reset($mapped); + $this->assertInstanceOf('\\DateTime', $result); + $this->assertEquals( + '2015:04:01 12:11:09', + $result->format('Y:m:d H:i:s') + ); + $this->assertEquals( + 7200, + $result->getOffset() + ); + $this->assertEquals( + '+02:00', + $result->getTimezone()->getName() + ); + } + /** * @group mapper */