Browse Source

sunguidong

zhangguidong 2 years ago
parent
commit
836b4d7606
56 changed files with 2659 additions and 1627 deletions
  1. 1 0
      application/store/controller/Activity.php
  2. 1 1
      composer.json
  3. 0 59
      vendor/composer/autoload_classmap.php
  4. 1 2
      vendor/composer/autoload_files.php
  5. 0 1
      vendor/composer/autoload_namespaces.php
  6. 0 1
      vendor/composer/autoload_psr4.php
  7. 1 73
      vendor/composer/autoload_static.php
  8. 57 262
      vendor/composer/installed.json
  9. 15 42
      vendor/composer/installed.php
  10. 4 1
      vendor/endroid/qr-code/.travis.yml
  11. 51 78
      vendor/endroid/qr-code/README.md
  12. 10 18
      vendor/endroid/qr-code/composer.json
  13. 72 70
      vendor/endroid/qr-code/src/Factory/QrCodeFactory.php
  14. 1273 273
      vendor/endroid/qr-code/src/QrCode.php
  15. 9 21
      vendor/endroid/qr-code/tests/Bundle/Controller/QrCodeControllerTest.php
  16. 2 2
      vendor/endroid/qr-code/tests/Bundle/EndroidQrCodeBundleTest.php
  17. 2 2
      vendor/endroid/qr-code/tests/Bundle/app/AppKernel.php
  18. 4 0
      vendor/endroid/qr-code/tests/Bundle/app/bootstrap.php
  19. 1 3
      vendor/endroid/qr-code/tests/Bundle/app/config/config.yml
  20. 2 1
      vendor/endroid/qr-code/tests/Bundle/app/config/routing.yml
  21. 86 86
      vendor/endroid/qr-code/tests/QrCodeTest.php
  22. 2 2
      vendor/myclabs/php-enum/LICENSE
  23. 12 22
      vendor/myclabs/php-enum/README.md
  24. 3 4
      vendor/myclabs/php-enum/composer.json
  25. 22 136
      vendor/myclabs/php-enum/src/Enum.php
  26. 11 0
      vendor/qiniu/php-sdk/CHANGELOG.md
  27. 4 0
      vendor/qiniu/php-sdk/autoload.php
  28. 2 1
      vendor/qiniu/php-sdk/composer.json
  29. 5 1
      vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php
  30. 7 2
      vendor/qiniu/php-sdk/examples/rs_batch_change_type.php
  31. 5 3
      vendor/qiniu/php-sdk/examples/rs_change_mime.php
  32. 5 3
      vendor/qiniu/php-sdk/examples/rs_change_status.php
  33. 6 4
      vendor/qiniu/php-sdk/examples/rs_change_type.php
  34. 5 3
      vendor/qiniu/php-sdk/examples/rs_copy.php
  35. 5 3
      vendor/qiniu/php-sdk/examples/rs_delete.php
  36. 5 3
      vendor/qiniu/php-sdk/examples/rs_delete_after_days.php
  37. 5 3
      vendor/qiniu/php-sdk/examples/rs_move.php
  38. 5 3
      vendor/qiniu/php-sdk/examples/rs_prefetch.php
  39. 105 39
      vendor/qiniu/php-sdk/src/Qiniu/Auth.php
  40. 7 1
      vendor/qiniu/php-sdk/src/Qiniu/Config.php
  41. 1 21
      vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php
  42. 36 10
      vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php
  43. 87 44
      vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php
  44. 13 4
      vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php
  45. 30 16
      vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php
  46. 13 11
      vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php
  47. 174 0
      vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php
  48. 187 40
      vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php
  49. 4 3
      vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php
  50. 17 0
      vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php
  51. 106 0
      vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php
  52. 1 1
      vendor/qiniu/php-sdk/tests/bootstrap.php
  53. 6 0
      vendor/symfony/options-resolver/CHANGELOG.md
  54. 1 1
      vendor/symfony/options-resolver/LICENSE
  55. 168 240
      vendor/symfony/options-resolver/OptionsResolver.php
  56. 2 7
      vendor/symfony/options-resolver/composer.json

+ 1 - 0
application/store/controller/Activity.php

@@ -149,6 +149,7 @@ class Activity extends Controller
     }
     }
     public function Qrcode(){
     public function Qrcode(){
 
 
+
     }
     }
 
 
 
 

+ 1 - 1
composer.json

@@ -16,7 +16,7 @@
     "ext-iconv": "*",
     "ext-iconv": "*",
     "ext-openssl": "*",
     "ext-openssl": "*",
     "ext-mbstring": "*",
     "ext-mbstring": "*",
-    "endroid/qr-code": "^2.5",
+    "endroid/qr-code": "^1.9",
     "topthink/framework": "5.1.*",
     "topthink/framework": "5.1.*",
     "zoujingli/ip2region": "^1.0",
     "zoujingli/ip2region": "^1.0",
     "zoujingli/think-library": "5.1.x-dev",
     "zoujingli/think-library": "5.1.x-dev",

+ 0 - 59
vendor/composer/autoload_classmap.php

@@ -11,67 +11,8 @@ return array(
     'Ip2Region' => $vendorDir . '/zoujingli/ip2region/Ip2Region.php',
     'Ip2Region' => $vendorDir . '/zoujingli/ip2region/Ip2Region.php',
     'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
     'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
     'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
     'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
-    'QrReader' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/QrReader.php',
     'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
     'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
     'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
     'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
     'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
     'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
     'We' => $vendorDir . '/zoujingli/wechat-developer/We.php',
     'We' => $vendorDir . '/zoujingli/wechat-developer/We.php',
-    'Zxing\\Binarizer' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Binarizer.php',
-    'Zxing\\BinaryBitmap' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/BinaryBitmap.php',
-    'Zxing\\ChecksumException' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/ChecksumException.php',
-    'Zxing\\Common\\BitArray' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/BitArray.php',
-    'Zxing\\Common\\BitMatrix' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/BitMatrix.php',
-    'Zxing\\Common\\BitSource' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/BitSource.php',
-    'Zxing\\Common\\CharacterSetECI' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/CharacterSetEci.php',
-    'Zxing\\Common\\CharacterSetEci\\AbstractEnum\\AbstractEnum' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/AbstractEnum.php',
-    'Zxing\\Common\\DecoderResult' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/DecoderResult.php',
-    'Zxing\\Common\\DefaultGridSampler' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/DefaultGridSampler.php',
-    'Zxing\\Common\\DetectorResult' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/DetectorResult.php',
-    'Zxing\\Common\\Detector\\MathUtils' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/detector/MathUtils.php',
-    'Zxing\\Common\\Detector\\MonochromeRectangleDetector' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/detector/MonochromeRectangleDetector.php',
-    'Zxing\\Common\\GlobalHistogramBinarizer' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/GlobalHistogramBinarizer.php',
-    'Zxing\\Common\\GridSampler' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/GridSampler.php',
-    'Zxing\\Common\\HybridBinarizer' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/HybridBinarizer.php',
-    'Zxing\\Common\\PerspectiveTransform' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/PerspectiveTransform.php',
-    'Zxing\\Common\\Reedsolomon\\GenericGF' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/GenericGF.php',
-    'Zxing\\Common\\Reedsolomon\\GenericGFPoly' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/GenericGFPoly.php',
-    'Zxing\\Common\\Reedsolomon\\ReedSolomonDecoder' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/ReedSolomonDecoder.php',
-    'Zxing\\Common\\Reedsolomon\\ReedSolomonException' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/ReedSolomonException.php',
-    'Zxing\\FormatException' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/FormatException.php',
-    'Zxing\\GDLuminanceSource' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/GDLuminanceSource.php',
-    'Zxing\\IMagickLuminanceSource' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/IMagickLuminanceSource.php',
-    'Zxing\\LuminanceSource' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/LuminanceSource.php',
-    'Zxing\\NotFoundException' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/NotFoundException.php',
-    'Zxing\\PlanarYUVLuminanceSource' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/PlanarYUVLuminanceSource.php',
-    'Zxing\\Qrcode\\Decoder\\BitMatrixParser' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/BitMatrixParser.php',
-    'Zxing\\Qrcode\\Decoder\\DataBlock' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataBlock.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask000' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask001' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask010' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask011' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask100' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask101' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask110' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DataMask111' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-    'Zxing\\Qrcode\\Decoder\\DecodedBitStreamParser' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DecodedBitStreamParser.php',
-    'Zxing\\Qrcode\\Decoder\\Decoder' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Decoder.php',
-    'Zxing\\Qrcode\\Decoder\\ECB' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Version.php',
-    'Zxing\\Qrcode\\Decoder\\ECBlocks' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Version.php',
-    'Zxing\\Qrcode\\Decoder\\ErrorCorrectionLevel' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/ErrorCorrectionLevel.php',
-    'Zxing\\Qrcode\\Decoder\\FormatInformation' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/FormatInformation.php',
-    'Zxing\\Qrcode\\Decoder\\Mode' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Mode.php',
-    'Zxing\\Qrcode\\Decoder\\Version' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Version.php',
-    'Zxing\\Qrcode\\Detector\\AlignmentPattern' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/AlignmentPattern.php',
-    'Zxing\\Qrcode\\Detector\\AlignmentPatternFinder' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/AlignmentPatternFinder.php',
-    'Zxing\\Qrcode\\Detector\\Detector' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/Detector.php',
-    'Zxing\\Qrcode\\Detector\\FinderPattern' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/FinderPattern.php',
-    'Zxing\\Qrcode\\Detector\\FinderPatternFinder' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/FinderPatternFinder.php',
-    'Zxing\\Qrcode\\Detector\\FinderPatternInfo' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/FinderPatternInfo.php',
-    'Zxing\\Qrcode\\QRCodeReader' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/QRCodeReader.php',
-    'Zxing\\RGBLuminanceSource' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/RGBLuminanceSource.php',
-    'Zxing\\Reader' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Reader.php',
-    'Zxing\\ReaderException' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/ReaderException.php',
-    'Zxing\\Result' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Result.php',
-    'Zxing\\ResultPoint' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/ResultPoint.php',
 );
 );

+ 1 - 2
vendor/composer/autoload_files.php

@@ -11,15 +11,14 @@ return array(
     'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
     'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
     '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
     '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
     'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
     'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
-    '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
     '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
     '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
+    '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
     'd767e4fc2dc52fe66584ab8c6684783e' => $vendorDir . '/adbario/php-dot-notation/src/helpers.php',
     'd767e4fc2dc52fe66584ab8c6684783e' => $vendorDir . '/adbario/php-dot-notation/src/helpers.php',
     '65fec9ebcfbb3cbb4fd0d519687aea01' => $vendorDir . '/danielstjules/stringy/src/Create.php',
     '65fec9ebcfbb3cbb4fd0d519687aea01' => $vendorDir . '/danielstjules/stringy/src/Create.php',
     'b067bc7112e384b61c701452d53a14a8' => $vendorDir . '/mtdowling/jmespath.php/src/JmesPath.php',
     'b067bc7112e384b61c701452d53a14a8' => $vendorDir . '/mtdowling/jmespath.php/src/JmesPath.php',
     '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
     '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
     '66453932bc1be9fb2f910a27947d11b6' => $vendorDir . '/alibabacloud/client/src/Functions.php',
     '66453932bc1be9fb2f910a27947d11b6' => $vendorDir . '/alibabacloud/client/src/Functions.php',
     '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
     '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
-    '626dcc41390ebdaa619faa02d99943b0' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/common/customFunctions.php',
     '841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
     '841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
     'f0e7e63bbb278a92db02393536748c5f' => $vendorDir . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
     'f0e7e63bbb278a92db02393536748c5f' => $vendorDir . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
     '6747f579ad6817f318cc3a7e7a0abb93' => $vendorDir . '/overtrue/wechat/src/Kernel/Helpers.php',
     '6747f579ad6817f318cc3a7e7a0abb93' => $vendorDir . '/overtrue/wechat/src/Kernel/Helpers.php',

+ 0 - 1
vendor/composer/autoload_namespaces.php

@@ -9,5 +9,4 @@ return array(
     'Pimple' => array($vendorDir . '/pimple/pimple/src'),
     'Pimple' => array($vendorDir . '/pimple/pimple/src'),
     'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes'),
     'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes'),
     'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
     'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
-    'BaconQrCode' => array($vendorDir . '/bacon/bacon-qr-code/src'),
 );
 );

+ 0 - 1
vendor/composer/autoload_psr4.php

@@ -25,7 +25,6 @@ return array(
     'Symfony\\Contracts\\Cache\\' => array($vendorDir . '/symfony/cache-contracts'),
     'Symfony\\Contracts\\Cache\\' => array($vendorDir . '/symfony/cache-contracts'),
     'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
     'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
     'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'),
     'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'),
-    'Symfony\\Component\\PropertyAccess\\' => array($vendorDir . '/symfony/property-access'),
     'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'),
     'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'),
     'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
     'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
     'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
     'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),

+ 1 - 73
vendor/composer/autoload_static.php

@@ -12,15 +12,14 @@ class ComposerStaticInit4d241e9f8bb10d006cd7432f945fdb5b
         'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
         'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
         '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
         '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
         'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
         'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
-        '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
         '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
         '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
+        '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
         'd767e4fc2dc52fe66584ab8c6684783e' => __DIR__ . '/..' . '/adbario/php-dot-notation/src/helpers.php',
         'd767e4fc2dc52fe66584ab8c6684783e' => __DIR__ . '/..' . '/adbario/php-dot-notation/src/helpers.php',
         '65fec9ebcfbb3cbb4fd0d519687aea01' => __DIR__ . '/..' . '/danielstjules/stringy/src/Create.php',
         '65fec9ebcfbb3cbb4fd0d519687aea01' => __DIR__ . '/..' . '/danielstjules/stringy/src/Create.php',
         'b067bc7112e384b61c701452d53a14a8' => __DIR__ . '/..' . '/mtdowling/jmespath.php/src/JmesPath.php',
         'b067bc7112e384b61c701452d53a14a8' => __DIR__ . '/..' . '/mtdowling/jmespath.php/src/JmesPath.php',
         '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
         '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
         '66453932bc1be9fb2f910a27947d11b6' => __DIR__ . '/..' . '/alibabacloud/client/src/Functions.php',
         '66453932bc1be9fb2f910a27947d11b6' => __DIR__ . '/..' . '/alibabacloud/client/src/Functions.php',
         '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
         '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
-        '626dcc41390ebdaa619faa02d99943b0' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/customFunctions.php',
         '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
         '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
         'f0e7e63bbb278a92db02393536748c5f' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
         'f0e7e63bbb278a92db02393536748c5f' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
         '6747f579ad6817f318cc3a7e7a0abb93' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Helpers.php',
         '6747f579ad6817f318cc3a7e7a0abb93' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Helpers.php',
@@ -67,7 +66,6 @@ class ComposerStaticInit4d241e9f8bb10d006cd7432f945fdb5b
             'Symfony\\Contracts\\Cache\\' => 24,
             'Symfony\\Contracts\\Cache\\' => 24,
             'Symfony\\Component\\Yaml\\' => 23,
             'Symfony\\Component\\Yaml\\' => 23,
             'Symfony\\Component\\VarExporter\\' => 30,
             'Symfony\\Component\\VarExporter\\' => 30,
-            'Symfony\\Component\\PropertyAccess\\' => 33,
             'Symfony\\Component\\OptionsResolver\\' => 34,
             'Symfony\\Component\\OptionsResolver\\' => 34,
             'Symfony\\Component\\HttpFoundation\\' => 33,
             'Symfony\\Component\\HttpFoundation\\' => 33,
             'Symfony\\Component\\EventDispatcher\\' => 34,
             'Symfony\\Component\\EventDispatcher\\' => 34,
@@ -213,10 +211,6 @@ class ComposerStaticInit4d241e9f8bb10d006cd7432f945fdb5b
         array (
         array (
             0 => __DIR__ . '/..' . '/symfony/var-exporter',
             0 => __DIR__ . '/..' . '/symfony/var-exporter',
         ),
         ),
-        'Symfony\\Component\\PropertyAccess\\' => 
-        array (
-            0 => __DIR__ . '/..' . '/symfony/property-access',
-        ),
         'Symfony\\Component\\OptionsResolver\\' => 
         'Symfony\\Component\\OptionsResolver\\' => 
         array (
         array (
             0 => __DIR__ . '/..' . '/symfony/options-resolver',
             0 => __DIR__ . '/..' . '/symfony/options-resolver',
@@ -371,13 +365,6 @@ class ComposerStaticInit4d241e9f8bb10d006cd7432f945fdb5b
                 0 => __DIR__ . '/..' . '/ezyang/htmlpurifier/library',
                 0 => __DIR__ . '/..' . '/ezyang/htmlpurifier/library',
             ),
             ),
         ),
         ),
-        'B' => 
-        array (
-            'BaconQrCode' => 
-            array (
-                0 => __DIR__ . '/..' . '/bacon/bacon-qr-code/src',
-            ),
-        ),
     );
     );
 
 
     public static $classMap = array (
     public static $classMap = array (
@@ -386,69 +373,10 @@ class ComposerStaticInit4d241e9f8bb10d006cd7432f945fdb5b
         'Ip2Region' => __DIR__ . '/..' . '/zoujingli/ip2region/Ip2Region.php',
         'Ip2Region' => __DIR__ . '/..' . '/zoujingli/ip2region/Ip2Region.php',
         'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
         'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
         'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
         'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
-        'QrReader' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/QrReader.php',
         'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
         'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
         'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
         'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
         'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
         'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
         'We' => __DIR__ . '/..' . '/zoujingli/wechat-developer/We.php',
         'We' => __DIR__ . '/..' . '/zoujingli/wechat-developer/We.php',
-        'Zxing\\Binarizer' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Binarizer.php',
-        'Zxing\\BinaryBitmap' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/BinaryBitmap.php',
-        'Zxing\\ChecksumException' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/ChecksumException.php',
-        'Zxing\\Common\\BitArray' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/BitArray.php',
-        'Zxing\\Common\\BitMatrix' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/BitMatrix.php',
-        'Zxing\\Common\\BitSource' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/BitSource.php',
-        'Zxing\\Common\\CharacterSetECI' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/CharacterSetEci.php',
-        'Zxing\\Common\\CharacterSetEci\\AbstractEnum\\AbstractEnum' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/AbstractEnum.php',
-        'Zxing\\Common\\DecoderResult' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/DecoderResult.php',
-        'Zxing\\Common\\DefaultGridSampler' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/DefaultGridSampler.php',
-        'Zxing\\Common\\DetectorResult' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/DetectorResult.php',
-        'Zxing\\Common\\Detector\\MathUtils' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/detector/MathUtils.php',
-        'Zxing\\Common\\Detector\\MonochromeRectangleDetector' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/detector/MonochromeRectangleDetector.php',
-        'Zxing\\Common\\GlobalHistogramBinarizer' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/GlobalHistogramBinarizer.php',
-        'Zxing\\Common\\GridSampler' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/GridSampler.php',
-        'Zxing\\Common\\HybridBinarizer' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/HybridBinarizer.php',
-        'Zxing\\Common\\PerspectiveTransform' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/PerspectiveTransform.php',
-        'Zxing\\Common\\Reedsolomon\\GenericGF' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/GenericGF.php',
-        'Zxing\\Common\\Reedsolomon\\GenericGFPoly' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/GenericGFPoly.php',
-        'Zxing\\Common\\Reedsolomon\\ReedSolomonDecoder' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/ReedSolomonDecoder.php',
-        'Zxing\\Common\\Reedsolomon\\ReedSolomonException' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/common/reedsolomon/ReedSolomonException.php',
-        'Zxing\\FormatException' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/FormatException.php',
-        'Zxing\\GDLuminanceSource' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/GDLuminanceSource.php',
-        'Zxing\\IMagickLuminanceSource' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/IMagickLuminanceSource.php',
-        'Zxing\\LuminanceSource' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/LuminanceSource.php',
-        'Zxing\\NotFoundException' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/NotFoundException.php',
-        'Zxing\\PlanarYUVLuminanceSource' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/PlanarYUVLuminanceSource.php',
-        'Zxing\\Qrcode\\Decoder\\BitMatrixParser' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/BitMatrixParser.php',
-        'Zxing\\Qrcode\\Decoder\\DataBlock' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataBlock.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask000' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask001' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask010' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask011' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask100' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask101' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask110' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DataMask111' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DataMask.php',
-        'Zxing\\Qrcode\\Decoder\\DecodedBitStreamParser' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/DecodedBitStreamParser.php',
-        'Zxing\\Qrcode\\Decoder\\Decoder' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Decoder.php',
-        'Zxing\\Qrcode\\Decoder\\ECB' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Version.php',
-        'Zxing\\Qrcode\\Decoder\\ECBlocks' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Version.php',
-        'Zxing\\Qrcode\\Decoder\\ErrorCorrectionLevel' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/ErrorCorrectionLevel.php',
-        'Zxing\\Qrcode\\Decoder\\FormatInformation' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/FormatInformation.php',
-        'Zxing\\Qrcode\\Decoder\\Mode' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Mode.php',
-        'Zxing\\Qrcode\\Decoder\\Version' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/decoder/Version.php',
-        'Zxing\\Qrcode\\Detector\\AlignmentPattern' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/AlignmentPattern.php',
-        'Zxing\\Qrcode\\Detector\\AlignmentPatternFinder' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/AlignmentPatternFinder.php',
-        'Zxing\\Qrcode\\Detector\\Detector' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/Detector.php',
-        'Zxing\\Qrcode\\Detector\\FinderPattern' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/FinderPattern.php',
-        'Zxing\\Qrcode\\Detector\\FinderPatternFinder' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/FinderPatternFinder.php',
-        'Zxing\\Qrcode\\Detector\\FinderPatternInfo' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/detector/FinderPatternInfo.php',
-        'Zxing\\Qrcode\\QRCodeReader' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/qrcode/QRCodeReader.php',
-        'Zxing\\RGBLuminanceSource' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/RGBLuminanceSource.php',
-        'Zxing\\Reader' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Reader.php',
-        'Zxing\\ReaderException' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/ReaderException.php',
-        'Zxing\\Result' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Result.php',
-        'Zxing\\ResultPoint' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/ResultPoint.php',
     );
     );
 
 
     public static function getInitializer(ClassLoader $loader)
     public static function getInitializer(ClassLoader $loader)

+ 57 - 262
vendor/composer/installed.json

@@ -458,65 +458,6 @@
             "install-path": "../aliyuncs/oss-sdk-php"
             "install-path": "../aliyuncs/oss-sdk-php"
         },
         },
         {
         {
-            "name": "bacon/bacon-qr-code",
-            "version": "1.0.3",
-            "version_normalized": "1.0.3.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/Bacon/BaconQrCode.git",
-                "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee",
-                "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "ext-iconv": "*",
-                "php": "^5.4|^7.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.8"
-            },
-            "suggest": {
-                "ext-gd": "to generate QR code images"
-            },
-            "time": "2017-10-17T09:59:25+00:00",
-            "type": "library",
-            "installation-source": "dist",
-            "autoload": {
-                "psr-0": {
-                    "BaconQrCode": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-2-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Ben Scholzen 'DASPRiD'",
-                    "email": "mail@dasprids.de",
-                    "homepage": "http://www.dasprids.de",
-                    "role": "Developer"
-                }
-            ],
-            "description": "BaconQrCode is a QR code generator for PHP.",
-            "homepage": "https://github.com/Bacon/BaconQrCode",
-            "support": {
-                "issues": "https://github.com/Bacon/BaconQrCode/issues",
-                "source": "https://github.com/Bacon/BaconQrCode/tree/master"
-            },
-            "install-path": "../bacon/bacon-qr-code"
-        },
-        {
             "name": "clagiordano/weblibs-configmanager",
             "name": "clagiordano/weblibs-configmanager",
             "version": "v1.5.0",
             "version": "v1.5.0",
             "version_normalized": "1.5.0.0",
             "version_normalized": "1.5.0.0",
@@ -708,17 +649,17 @@
         },
         },
         {
         {
             "name": "endroid/qr-code",
             "name": "endroid/qr-code",
-            "version": "2.5.1",
-            "version_normalized": "2.5.1.0",
+            "version": "1.9.3",
+            "version_normalized": "1.9.3.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/endroid/qr-code.git",
                 "url": "https://github.com/endroid/qr-code.git",
-                "reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7"
+                "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/endroid/qr-code/zipball/6062677d3404e0ded40647b8f62ec55ff9722eb7",
-                "reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7",
+                "url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
+                "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
                 "shasum": "",
                 "shasum": "",
                 "mirrors": [
                 "mirrors": [
                     {
                     {
@@ -728,30 +669,22 @@
                 ]
                 ]
             },
             },
             "require": {
             "require": {
-                "bacon/bacon-qr-code": "^1.0.3",
                 "ext-gd": "*",
                 "ext-gd": "*",
-                "khanamiryan/qrcode-detector-decoder": "1",
-                "myclabs/php-enum": "^1.5",
-                "php": ">=5.6",
-                "symfony/options-resolver": "^2.7",
-                "symfony/property-access": "^2.7"
+                "php": ">=5.4",
+                "symfony/options-resolver": "^2.3|^3.0"
             },
             },
             "require-dev": {
             "require-dev": {
-                "phpunit/phpunit": "^5.7",
-                "symfony/asset": "^2.7",
-                "symfony/browser-kit": "^2.7",
-                "symfony/finder": "^2.7",
-                "symfony/framework-bundle": "^2.7",
-                "symfony/http-kernel": "^2.7",
-                "symfony/templating": "^2.7",
-                "symfony/twig-bundle": "^2.7",
-                "symfony/yaml": "^2.7"
-            },
-            "time": "2018-05-09T20:26:30+00:00",
-            "type": "symfony-bundle",
+                "phpunit/phpunit": "^4.0|^5.0",
+                "sensio/framework-extra-bundle": "^3.0",
+                "symfony/browser-kit": "^2.3|^3.0",
+                "symfony/framework-bundle": "^2.3|^3.0",
+                "symfony/http-kernel": "^2.3|^3.0"
+            },
+            "time": "2017-04-08T09:13:59+00:00",
+            "type": "library",
             "extra": {
             "extra": {
                 "branch-alias": {
                 "branch-alias": {
-                    "dev-master": "2.x-dev"
+                    "dev-master": "1.x-dev"
                 }
                 }
             },
             },
             "installation-source": "dist",
             "installation-source": "dist",
@@ -777,14 +710,13 @@
                 "bundle",
                 "bundle",
                 "code",
                 "code",
                 "endroid",
                 "endroid",
-                "flex",
                 "qr",
                 "qr",
                 "qrcode",
                 "qrcode",
                 "symfony"
                 "symfony"
             ],
             ],
             "support": {
             "support": {
                 "issues": "https://github.com/endroid/qr-code/issues",
                 "issues": "https://github.com/endroid/qr-code/issues",
-                "source": "https://github.com/endroid/qr-code/tree/2.5.1"
+                "source": "https://github.com/endroid/qr-code/tree/1.9.3"
             },
             },
             "install-path": "../endroid/qr-code"
             "install-path": "../endroid/qr-code"
         },
         },
@@ -1334,69 +1266,6 @@
             "install-path": "../hg/apidoc"
             "install-path": "../hg/apidoc"
         },
         },
         {
         {
-            "name": "khanamiryan/qrcode-detector-decoder",
-            "version": "1",
-            "version_normalized": "1.0.0.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git",
-                "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/96d5f80680b04803c4f1b69d6e01735e876b80c7",
-                "reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "php": "^5.6|^7.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^5.7"
-            },
-            "time": "2017-01-13T09:11:46+00:00",
-            "type": "library",
-            "installation-source": "dist",
-            "autoload": {
-                "files": [
-                    "lib/common/customFunctions.php"
-                ],
-                "classmap": [
-                    "lib/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Ashot Khanamiryan",
-                    "email": "a.khanamiryan@gmail.com",
-                    "homepage": "https://github.com/khanamiryan",
-                    "role": "Developer"
-                }
-            ],
-            "description": "QR code decoder / reader",
-            "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder",
-            "keywords": [
-                "barcode",
-                "qr",
-                "zxing"
-            ],
-            "support": {
-                "issues": "https://github.com/khanamiryan/php-qrcode-detector-decoder/issues",
-                "source": "https://github.com/khanamiryan/php-qrcode-detector-decoder/tree/master"
-            },
-            "install-path": "../khanamiryan/qrcode-detector-decoder"
-        },
-        {
             "name": "maennchen/zipstream-php",
             "name": "maennchen/zipstream-php",
             "version": "2.1.0",
             "version": "2.1.0",
             "version_normalized": "2.1.0.0",
             "version_normalized": "2.1.0.0",
@@ -1784,17 +1653,17 @@
         },
         },
         {
         {
             "name": "myclabs/php-enum",
             "name": "myclabs/php-enum",
-            "version": "1.8.3",
-            "version_normalized": "1.8.3.0",
+            "version": "1.6.6",
+            "version_normalized": "1.6.6.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/myclabs/php-enum.git",
                 "url": "https://github.com/myclabs/php-enum.git",
-                "reference": "b942d263c641ddb5190929ff840c68f78713e937"
+                "reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937",
-                "reference": "b942d263c641ddb5190929ff840c68f78713e937",
+                "url": "https://api.github.com/repos/myclabs/php-enum/zipball/32c4202886c51fbe5cc3a7c34ec5c9a4a790345e",
+                "reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e",
                 "shasum": "",
                 "shasum": "",
                 "mirrors": [
                 "mirrors": [
                     {
                     {
@@ -1805,14 +1674,13 @@
             },
             },
             "require": {
             "require": {
                 "ext-json": "*",
                 "ext-json": "*",
-                "php": "^7.3 || ^8.0"
+                "php": ">=5.4"
             },
             },
             "require-dev": {
             "require-dev": {
-                "phpunit/phpunit": "^9.5",
-                "squizlabs/php_codesniffer": "1.*",
-                "vimeo/psalm": "^4.6.2"
+                "phpunit/phpunit": "^4.8.35|^5.7|^6.0",
+                "squizlabs/php_codesniffer": "1.*"
             },
             },
-            "time": "2021-07-05T08:18:36+00:00",
+            "time": "2019-02-04T21:18:49+00:00",
             "type": "library",
             "type": "library",
             "installation-source": "dist",
             "installation-source": "dist",
             "autoload": {
             "autoload": {
@@ -1837,18 +1705,8 @@
             ],
             ],
             "support": {
             "support": {
                 "issues": "https://github.com/myclabs/php-enum/issues",
                 "issues": "https://github.com/myclabs/php-enum/issues",
-                "source": "https://github.com/myclabs/php-enum/tree/1.8.3"
+                "source": "https://github.com/myclabs/php-enum/tree/master"
             },
             },
-            "funding": [
-                {
-                    "url": "https://github.com/mnapoli",
-                    "type": "github"
-                },
-                {
-                    "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
-                    "type": "tidelift"
-                }
-            ],
             "install-path": "../myclabs/php-enum"
             "install-path": "../myclabs/php-enum"
         },
         },
         {
         {
@@ -2746,17 +2604,17 @@
         },
         },
         {
         {
             "name": "qiniu/php-sdk",
             "name": "qiniu/php-sdk",
-            "version": "v7.4.1",
-            "version_normalized": "7.4.1.0",
+            "version": "v7.6.0",
+            "version_normalized": "7.6.0.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/qiniu/php-sdk.git",
                 "url": "https://github.com/qiniu/php-sdk.git",
-                "reference": "10c7ead8357743b4b987a335c14964fb07700d57"
+                "reference": "57033fab64c92f8c7ae165222dd958553741e711"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/10c7ead8357743b4b987a335c14964fb07700d57",
-                "reference": "10c7ead8357743b4b987a335c14964fb07700d57",
+                "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/57033fab64c92f8c7ae165222dd958553741e711",
+                "reference": "57033fab64c92f8c7ae165222dd958553741e711",
                 "shasum": "",
                 "shasum": "",
                 "mirrors": [
                 "mirrors": [
                     {
                     {
@@ -2766,6 +2624,7 @@
                 ]
                 ]
             },
             },
             "require": {
             "require": {
+                "myclabs/php-enum": "1.6.6",
                 "php": ">=5.3.3"
                 "php": ">=5.3.3"
             },
             },
             "require-dev": {
             "require-dev": {
@@ -2773,7 +2632,7 @@
                 "phpunit/phpunit": "~4.0",
                 "phpunit/phpunit": "~4.0",
                 "squizlabs/php_codesniffer": "~3.6"
                 "squizlabs/php_codesniffer": "~3.6"
             },
             },
-            "time": "2021-09-24T09:39:16+00:00",
+            "time": "2022-06-08T10:05:47+00:00",
             "type": "library",
             "type": "library",
             "installation-source": "dist",
             "installation-source": "dist",
             "autoload": {
             "autoload": {
@@ -2805,7 +2664,7 @@
             ],
             ],
             "support": {
             "support": {
                 "issues": "https://github.com/qiniu/php-sdk/issues",
                 "issues": "https://github.com/qiniu/php-sdk/issues",
-                "source": "https://github.com/qiniu/php-sdk/tree/v7.4.1"
+                "source": "https://github.com/qiniu/php-sdk/tree/v7.6.0"
             },
             },
             "install-path": "../qiniu/php-sdk"
             "install-path": "../qiniu/php-sdk"
         },
         },
@@ -3398,17 +3257,17 @@
         },
         },
         {
         {
             "name": "symfony/options-resolver",
             "name": "symfony/options-resolver",
-            "version": "v2.8.52",
-            "version_normalized": "2.8.52.0",
+            "version": "v3.4.47",
+            "version_normalized": "3.4.47.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/symfony/options-resolver.git",
                 "url": "https://github.com/symfony/options-resolver.git",
-                "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b"
+                "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
-                "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
+                "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744",
+                "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744",
                 "shasum": "",
                 "shasum": "",
                 "mirrors": [
                 "mirrors": [
                     {
                     {
@@ -3418,15 +3277,10 @@
                 ]
                 ]
             },
             },
             "require": {
             "require": {
-                "php": ">=5.3.9"
+                "php": "^5.5.9|>=7.0.8"
             },
             },
-            "time": "2018-11-11T11:18:13+00:00",
+            "time": "2020-10-24T10:57:07+00:00",
             "type": "library",
             "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.8-dev"
-                }
-            },
             "installation-source": "dist",
             "installation-source": "dist",
             "autoload": {
             "autoload": {
                 "psr-4": {
                 "psr-4": {
@@ -3458,8 +3312,22 @@
                 "options"
                 "options"
             ],
             ],
             "support": {
             "support": {
-                "source": "https://github.com/symfony/options-resolver/tree/v2.8.50"
+                "source": "https://github.com/symfony/options-resolver/tree/v3.4.47"
             },
             },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
             "install-path": "../symfony/options-resolver"
             "install-path": "../symfony/options-resolver"
         },
         },
         {
         {
@@ -3826,79 +3694,6 @@
             "install-path": "../symfony/polyfill-php80"
             "install-path": "../symfony/polyfill-php80"
         },
         },
         {
         {
-            "name": "symfony/property-access",
-            "version": "v2.8.52",
-            "version_normalized": "2.8.52.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/property-access.git",
-                "reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/property-access/zipball/c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
-                "reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "php": ">=5.3.9",
-                "symfony/polyfill-ctype": "~1.8"
-            },
-            "time": "2018-11-11T11:18:13+00:00",
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.8-dev"
-                }
-            },
-            "installation-source": "dist",
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\PropertyAccess\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony PropertyAccess Component",
-            "homepage": "https://symfony.com",
-            "keywords": [
-                "access",
-                "array",
-                "extraction",
-                "index",
-                "injection",
-                "object",
-                "property",
-                "property path",
-                "reflection"
-            ],
-            "support": {
-                "source": "https://github.com/symfony/property-access/tree/v2.8.50"
-            },
-            "install-path": "../symfony/property-access"
-        },
-        {
             "name": "symfony/psr-http-message-bridge",
             "name": "symfony/psr-http-message-bridge",
             "version": "v2.1.2",
             "version": "v2.1.2",
             "version_normalized": "2.1.2.0",
             "version_normalized": "2.1.2.0",

+ 15 - 42
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'zoujingli/thinkadmin',
         'name' => 'zoujingli/thinkadmin',
         'pretty_version' => 'dev-master',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '413f0d6043e32cdf228c790a0a2f3e38869a607d',
+        'reference' => '5c98da63be4cc674b13c12a1bc6f069db6d69acc',
         'type' => 'project',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
         'aliases' => array(),
@@ -1054,15 +1054,6 @@
             'aliases' => array(),
             'aliases' => array(),
             'dev_requirement' => false,
             'dev_requirement' => false,
         ),
         ),
-        'bacon/bacon-qr-code' => array(
-            'pretty_version' => '1.0.3',
-            'version' => '1.0.3.0',
-            'reference' => '5a91b62b9d37cee635bbf8d553f4546057250bee',
-            'type' => 'library',
-            'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
-            'aliases' => array(),
-            'dev_requirement' => false,
-        ),
         'clagiordano/weblibs-configmanager' => array(
         'clagiordano/weblibs-configmanager' => array(
             'pretty_version' => 'v1.5.0',
             'pretty_version' => 'v1.5.0',
             'version' => '1.5.0.0',
             'version' => '1.5.0.0',
@@ -1091,10 +1082,10 @@
             'dev_requirement' => false,
             'dev_requirement' => false,
         ),
         ),
         'endroid/qr-code' => array(
         'endroid/qr-code' => array(
-            'pretty_version' => '2.5.1',
-            'version' => '2.5.1.0',
-            'reference' => '6062677d3404e0ded40647b8f62ec55ff9722eb7',
-            'type' => 'symfony-bundle',
+            'pretty_version' => '1.9.3',
+            'version' => '1.9.3.0',
+            'reference' => 'c9644bec2a9cc9318e98d1437de3c628dcd1ef93',
+            'type' => 'library',
             'install_path' => __DIR__ . '/../endroid/qr-code',
             'install_path' => __DIR__ . '/../endroid/qr-code',
             'aliases' => array(),
             'aliases' => array(),
             'dev_requirement' => false,
             'dev_requirement' => false,
@@ -1153,15 +1144,6 @@
             'aliases' => array(),
             'aliases' => array(),
             'dev_requirement' => false,
             'dev_requirement' => false,
         ),
         ),
-        'khanamiryan/qrcode-detector-decoder' => array(
-            'pretty_version' => '1',
-            'version' => '1.0.0.0',
-            'reference' => '96d5f80680b04803c4f1b69d6e01735e876b80c7',
-            'type' => 'library',
-            'install_path' => __DIR__ . '/../khanamiryan/qrcode-detector-decoder',
-            'aliases' => array(),
-            'dev_requirement' => false,
-        ),
         'maennchen/zipstream-php' => array(
         'maennchen/zipstream-php' => array(
             'pretty_version' => '2.1.0',
             'pretty_version' => '2.1.0',
             'version' => '2.1.0.0',
             'version' => '2.1.0.0',
@@ -1208,9 +1190,9 @@
             'dev_requirement' => false,
             'dev_requirement' => false,
         ),
         ),
         'myclabs/php-enum' => array(
         'myclabs/php-enum' => array(
-            'pretty_version' => '1.8.3',
-            'version' => '1.8.3.0',
-            'reference' => 'b942d263c641ddb5190929ff840c68f78713e937',
+            'pretty_version' => '1.6.6',
+            'version' => '1.6.6.0',
+            'reference' => '32c4202886c51fbe5cc3a7c34ec5c9a4a790345e',
             'type' => 'library',
             'type' => 'library',
             'install_path' => __DIR__ . '/../myclabs/php-enum',
             'install_path' => __DIR__ . '/../myclabs/php-enum',
             'aliases' => array(),
             'aliases' => array(),
@@ -1376,9 +1358,9 @@
             ),
             ),
         ),
         ),
         'qiniu/php-sdk' => array(
         'qiniu/php-sdk' => array(
-            'pretty_version' => 'v7.4.1',
-            'version' => '7.4.1.0',
-            'reference' => '10c7ead8357743b4b987a335c14964fb07700d57',
+            'pretty_version' => 'v7.6.0',
+            'version' => '7.6.0.0',
+            'reference' => '57033fab64c92f8c7ae165222dd958553741e711',
             'type' => 'library',
             'type' => 'library',
             'install_path' => __DIR__ . '/../qiniu/php-sdk',
             'install_path' => __DIR__ . '/../qiniu/php-sdk',
             'aliases' => array(),
             'aliases' => array(),
@@ -1460,9 +1442,9 @@
             'dev_requirement' => false,
             'dev_requirement' => false,
         ),
         ),
         'symfony/options-resolver' => array(
         'symfony/options-resolver' => array(
-            'pretty_version' => 'v2.8.52',
-            'version' => '2.8.52.0',
-            'reference' => '7aaab725bb58f0e18aa12c61bdadd4793ab4c32b',
+            'pretty_version' => 'v3.4.47',
+            'version' => '3.4.47.0',
+            'reference' => 'c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744',
             'type' => 'library',
             'type' => 'library',
             'install_path' => __DIR__ . '/../symfony/options-resolver',
             'install_path' => __DIR__ . '/../symfony/options-resolver',
             'aliases' => array(),
             'aliases' => array(),
@@ -1504,15 +1486,6 @@
             'aliases' => array(),
             'aliases' => array(),
             'dev_requirement' => false,
             'dev_requirement' => false,
         ),
         ),
-        'symfony/property-access' => array(
-            'pretty_version' => 'v2.8.52',
-            'version' => '2.8.52.0',
-            'reference' => 'c8f10191183be9bb0d5a1b8364d3891f1bde07b6',
-            'type' => 'library',
-            'install_path' => __DIR__ . '/../symfony/property-access',
-            'aliases' => array(),
-            'dev_requirement' => false,
-        ),
         'symfony/psr-http-message-bridge' => array(
         'symfony/psr-http-message-bridge' => array(
             'pretty_version' => 'v2.1.2',
             'pretty_version' => 'v2.1.2',
             'version' => '2.1.2.0',
             'version' => '2.1.2.0',
@@ -1588,7 +1561,7 @@
         'zoujingli/thinkadmin' => array(
         'zoujingli/thinkadmin' => array(
             'pretty_version' => 'dev-master',
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '413f0d6043e32cdf228c790a0a2f3e38869a607d',
+            'reference' => '5c98da63be4cc674b13c12a1bc6f069db6d69acc',
             'type' => 'project',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
             'aliases' => array(),

+ 4 - 1
vendor/endroid/qr-code/.travis.yml

@@ -1,15 +1,18 @@
 language: php
 language: php
 
 
 php:
 php:
+  - 5.4
+  - 5.5
   - 5.6
   - 5.6
   - 7.0
   - 7.0
   - 7.1
   - 7.1
+  - hhvm
 
 
 matrix:
 matrix:
   fast_finish: true
   fast_finish: true
 
 
 before_install:
 before_install:
-  - phpenv config-rm xdebug.ini
+  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
   - composer self-update && composer install --no-interaction
   - composer self-update && composer install --no-interaction
 
 
 script: bin/phpunit
 script: bin/phpunit

+ 51 - 78
vendor/endroid/qr-code/README.md

@@ -9,8 +9,7 @@ QR Code
 [![Monthly Downloads](http://img.shields.io/packagist/dm/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode)
 [![Monthly Downloads](http://img.shields.io/packagist/dm/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode)
 [![License](http://img.shields.io/packagist/l/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode)
 [![License](http://img.shields.io/packagist/l/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode)
 
 
-This library helps you generate QR codes in an easy way and provides a Symfony
-bundle for rapid integration in your project.
+This library based on QRcode Perl CGI & PHP scripts by Y. Swetake helps you generate images containing a QR code.
 
 
 ## Installation
 ## Installation
 
 
@@ -20,61 +19,40 @@ Use [Composer](https://getcomposer.org/) to install the library.
 $ composer require endroid/qrcode
 $ composer require endroid/qrcode
 ```
 ```
 
 
-## Basic usage
+## Usage
 
 
 ```php
 ```php
 use Endroid\QrCode\QrCode;
 use Endroid\QrCode\QrCode;
 
 
-$qrCode = new QrCode('Life is too short to be generating QR codes');
-
-header('Content-Type: '.$qrCode->getContentType());
-echo $qrCode->writeString();
-```
-
-## Advanced usage
-
-```php
-use Endroid\QrCode\ErrorCorrectionLevel;
-use Endroid\QrCode\LabelAlignment;
-use Endroid\QrCode\QrCode;
-use Symfony\Component\HttpFoundation\Response;
-
-// Create a basic QR code
-$qrCode = new QrCode('Life is too short to be generating QR codes');
-$qrCode->setSize(300);
-
-// Set advanced options
+$qrCode = new QrCode();
 $qrCode
 $qrCode
-    ->setWriterByName('png')
-    ->setMargin(10)
-    ->setEncoding('UTF-8')
-    ->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH)
-    ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0])
-    ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255])
-    ->setLabel('Scan the code', 16, __DIR__.'/../assets/noto_sans.otf', LabelAlignment::CENTER)
-    ->setLogoPath(__DIR__.'/../assets/symfony.png')
-    ->setLogoWidth(150)
-    ->setValidateResult(false)
+    ->setText('Life is too short to be generating QR codes')
+    ->setSize(300)
+    ->setPadding(10)
+    ->setErrorCorrection('high')
+    ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0])
+    ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0])
+    ->setLabel('Scan the code')
+    ->setLabelFontSize(16)
+    ->setImageType(QrCode::IMAGE_TYPE_PNG)
 ;
 ;
 
 
-// Directly output the QR code
+// now we can directly output the qrcode
 header('Content-Type: '.$qrCode->getContentType());
 header('Content-Type: '.$qrCode->getContentType());
-echo $qrCode->writeString();
+$qrCode->render();
 
 
-// Save it to a file
-$qrCode->writeFile(__DIR__.'/qrcode.png');
+// save it to a file
+$qrCode->save('qrcode.png');
 
 
-// Create a response object
-$response = new Response($qrCode->writeString(), Response::HTTP_OK, ['Content-Type' => $qrCode->getContentType()]);
+// or create a response object
+$response = new Response($qrCode->get(), 200, ['Content-Type' => $qrCode->getContentType()]);
 ```
 ```
 
 
-![QR Code](http://endroid.nl/qrcode/Dit%20is%20een%20test.png)
+![QR Code](http://endroid.nl/qrcode/Life%20is%20too%20short%20to%20be%20generating%20QR%20codes.png?label=Scan%20the%20code)
 
 
 ## Symfony integration
 ## Symfony integration
 
 
-When you use Symfony Flex, the bundle is automatically registered and the
-configuration and routes are automatically created when you installed the
-package. In other scenarios you can register the bundle as follows.
+Register the Symfony bundle in the kernel.
 
 
 ```php
 ```php
 // app/AppKernel.php
 // app/AppKernel.php
@@ -83,68 +61,63 @@ public function registerBundles()
 {
 {
     $bundles = [
     $bundles = [
         // ...
         // ...
-        new Endroid\QrCode\Bundle\QrCodeBundle\EndroidQrCodeBundle(),
+        new Endroid\QrCode\Bundle\EndroidQrCodeBundle(),
     ];
     ];
 }
 }
 ```
 ```
 
 
-The bundle makes use of a factory to create QR codes. The default parameters
-applied by the factory can optionally be overridden via the configuration.
+The default parameters can be overridden via the configuration.  
+Alpha channel available range is [0, 127] in foreground and background colors.
 
 
 ```yaml
 ```yaml
 endroid_qr_code:
 endroid_qr_code:
-    writer: 'png'
-    size: 300
-    margin: 10
-    foreground_color: { r: 0, g: 0, b: 0 }
-    background_color: { r: 255, g: 255, b: 255 }
-    error_correction_level: low # low, medium, quartile or high
-    encoding: UTF-8
-    label: Scan the code
-    label_font_size: 20
-    label_alignment: left # left, center or right
-    label_margin: { b: 20 }
-    logo_path: '%kernel.root_dir%/../vendor/endroid/qrcode/assets/symfony.png'
-    logo_width: 150
-    validate_result: false # checks if the result is readable
+    size: 100
+    padding: 10
+    extension: gif
+    error_correction_level: high
+    foreground_color: { r: 0, g: 0, b: 0, a: 0 }
+    background_color: { r: 255, g: 255, b: 255, a: 0 }
+    label: 'My label'
+    label_font_size: 16
 ```
 ```
 
 
-The readability of a QR code is primarily determined by the size, the input
-length, the error correction level and any possible logo over the image. The
-`validate_result` option uses a built-in reader to validate the resulting
-image. This does not guarantee that the code will be readable by all readers
-but this helps you provide a minimum level of quality. Take note that the
-validator can consume quite an amount of resources and is disabled by default.
-
-Now you can retrieve the factory from the service container and create a QR
-code. For instance in your controller this would look like this.
+Now you can retrieve the factory as follows.
 
 
 ```php
 ```php
-$qrCode = $this->get('endroid.qrcode.factory')->create('QR Code', ['size' => 200]);
+$factory = $this->get('endroid.qrcode.factory');
+$factory->createQrCode();
 ```
 ```
 
 
 Add the following section to your routing to be able to handle QR code URLs.
 Add the following section to your routing to be able to handle QR code URLs.
-This step can be skipped if you only use data URIs to display your images.
+This step can be skipped when you only use data URIs to display your images.
 
 
 ``` yml
 ``` yml
 EndroidQrCodeBundle:
 EndroidQrCodeBundle:
-    resource: "@EndroidQrCodeBundle/Resources/config/routing.yml"
+    resource: "@EndroidQrCodeBundle/Controller/"
+    type:     annotation
     prefix:   /qrcode
     prefix:   /qrcode
 ```
 ```
 
 
 After installation and configuration, QR codes can be generated by appending
 After installation and configuration, QR codes can be generated by appending
-the QR code text to the url followed by any of the supported extensions.
+the QR code text to the url as mounted, followed by .png, .jpg or .gif.
 
 
 ## Twig extension
 ## Twig extension
 
 
-The bundle provides a Twig extension for generating a QR code URL, path or data
-URI. You can use the second argument of any of these functions to override any
-defaults defined by the bundle or set via your configuration.
+The bundle also provides a Twig extension for quickly generating QR code urls.
+Optional parameters are extension, size, padding and errorCorrectionLevel. When
+a parameter is omitted, the value in the bundle configuration is used.
+
+``` twig
+<img src="{{ qrcode_url(message) }}" />
+<img src="{{ qrcode_url(message, { extension: 'png' }) }}" />
+<img src="{{ qrcode_url(message, { size: 150 }) }}" />
+```
+
+You can also use the data URI helper to embed the QR code within your HTML
+instead of requiring a separate HTTP request to load your image.
 
 
 ``` twig
 ``` twig
-<img src="{{ qrcode_path(message) }}" />
-<img src="{{ qrcode_url(message, { writer: 'eps' }) }}" />
-<img src="{{ qrcode_data_uri(message, { writer: 'svg', size: 150 }) }}" />
+<img src="{{ qrcode_data_uri(message, { size: 200, padding: 10 }) }}" />
 ```
 ```
 
 
 ## Versioning
 ## Versioning

+ 10 - 18
vendor/endroid/qr-code/composer.json

@@ -1,9 +1,9 @@
 {
 {
     "name": "endroid/qrcode",
     "name": "endroid/qrcode",
     "description": "Endroid QR Code",
     "description": "Endroid QR Code",
-    "keywords": ["endroid", "qrcode", "qr", "code", "bundle", "symfony", "flex"],
+    "keywords": ["endroid", "qrcode", "qr", "code", "bundle", "symfony"],
     "homepage": "https://github.com/endroid/QrCode",
     "homepage": "https://github.com/endroid/QrCode",
-    "type": "symfony-bundle",
+    "type": "library",
     "license": "MIT",
     "license": "MIT",
     "authors": [
     "authors": [
         {
         {
@@ -13,24 +13,16 @@
         }
         }
     ],
     ],
     "require": {
     "require": {
-        "php": ">=5.6",
+        "php": ">=5.4",
         "ext-gd": "*",
         "ext-gd": "*",
-        "symfony/options-resolver": "^2.7",
-        "bacon/bacon-qr-code": "^1.0.3",
-        "khanamiryan/qrcode-detector-decoder": "1",
-        "symfony/property-access": "^2.7",
-        "myclabs/php-enum": "^1.5"
+        "symfony/options-resolver": "^2.3|^3.0"
     },
     },
     "require-dev": {
     "require-dev": {
-        "symfony/asset": "^2.7",
-        "symfony/browser-kit": "^2.7",
-        "symfony/finder": "^2.7",
-        "symfony/framework-bundle": "^2.7",
-        "symfony/http-kernel": "^2.7",
-        "symfony/templating": "^2.7",
-        "symfony/twig-bundle": "^2.7",
-        "symfony/yaml": "^2.7",
-        "phpunit/phpunit": "^5.7"
+        "symfony/browser-kit": "^2.3|^3.0",
+        "symfony/framework-bundle": "^2.3|^3.0",
+        "symfony/http-kernel": "^2.3|^3.0",
+        "sensio/framework-extra-bundle": "^3.0",
+        "phpunit/phpunit": "^4.0|^5.0"
     },
     },
     "autoload": {
     "autoload": {
         "psr-4": {
         "psr-4": {
@@ -47,7 +39,7 @@
     },
     },
     "extra": {
     "extra": {
         "branch-alias": {
         "branch-alias": {
-            "dev-master": "2.x-dev"
+            "dev-master": "1.x-dev"
         }
         }
     }
     }
 }
 }

+ 72 - 70
vendor/endroid/qr-code/src/Factory/QrCodeFactory.php

@@ -10,111 +10,113 @@
 namespace Endroid\QrCode\Factory;
 namespace Endroid\QrCode\Factory;
 
 
 use Endroid\QrCode\QrCode;
 use Endroid\QrCode\QrCode;
-use Endroid\QrCode\WriterRegistryInterface;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 use Symfony\Component\OptionsResolver\OptionsResolver;
-use Symfony\Component\PropertyAccess\PropertyAccess;
 
 
 class QrCodeFactory
 class QrCodeFactory
 {
 {
     /**
     /**
-     * @var array
-     */
-    protected $definedOptions = [
-        'writer',
-        'size',
-        'margin',
-        'foreground_color',
-        'background_color',
-        'encoding',
-        'error_correction_level',
-        'logo_path',
-        'logo_width',
-        'label',
-        'label_font_size',
-        'label_font_path',
-        'label_alignment',
-        'label_margin',
-        'validate_result',
-    ];
-
-    /**
-     * @var array
-     */
-    protected $defaultOptions;
-
-    /**
-     * @var WriterRegistryInterface
-     */
-    protected $writerRegistry;
-
-    /**
      * @var OptionsResolver
      * @var OptionsResolver
      */
      */
     protected $optionsResolver;
     protected $optionsResolver;
 
 
     /**
     /**
-     * @param array                   $defaultOptions
-     * @param WriterRegistryInterface $writerRegistry
+     * Creates a new instance.
+     *
+     * @param array $defaults
      */
      */
-    public function __construct(array $defaultOptions = [], WriterRegistryInterface $writerRegistry = null)
+    public function __construct(array $defaults = [])
     {
     {
-        $this->defaultOptions = $defaultOptions;
-        $this->writerRegistry = $writerRegistry;
+        $defaults = array_merge($this->getAvailableOptions(), $defaults);
+        $this->optionsResolver = new OptionsResolver();
+        $this->optionsResolver->setDefaults($defaults);
     }
     }
 
 
     /**
     /**
-     * @param string $text
-     * @param array  $options
+     * Creates a QR code.
+     *
+     * @param array $options
      *
      *
      * @return QrCode
      * @return QrCode
      */
      */
-    public function create($text = '', array $options = [])
+    public function createQrCode(array $options = [])
     {
     {
-        $options = $this->getOptionsResolver()->resolve($options);
-        $accessor = PropertyAccess::createPropertyAccessor();
+        $options = $this->optionsResolver->resolve($options);
+
+        $qrCode = new QrCode();
+
+        if (isset($options['text']) && !is_null($options['text'])) {
+            $qrCode->setText($options['text']);
+        }
+
+        if (isset($options['size']) && !is_null($options['size'])) {
+            $qrCode->setSize($options['size']);
+        }
 
 
-        $qrCode = new QrCode($text);
+        if (isset($options['padding']) && !is_null($options['padding'])) {
+            $qrCode->setPadding($options['padding']);
+        }
+
+        if (isset($options['extension']) && !is_null($options['extension'])) {
+            $qrCode->setExtension($options['extension']);
+        }
+
+        if (isset($options['error_correction_level']) && !is_null($options['error_correction_level'])) {
+            $qrCode->setErrorCorrection($options['error_correction_level']);
+        }
+
+        if (isset($options['foreground_color']) && !is_null($options['foreground_color'])) {
+            $qrCode->setForegroundColor($options['foreground_color']);
+        }
+
+        if (isset($options['background_color']) && !is_null($options['background_color'])) {
+            $qrCode->setBackgroundColor($options['background_color']);
+        }
+
+        if (isset($options['label']) && !is_null($options['label'])) {
+            $qrCode->setLabel($options['label']);
+        }
 
 
-        if ($this->writerRegistry instanceof WriterRegistryInterface) {
-            $qrCode->setWriterRegistry($this->writerRegistry);
+        if (isset($options['label_font_size']) && !is_null($options['label_font_size'])) {
+            $qrCode->setLabelFontSize($options['label_font_size']);
         }
         }
 
 
-        foreach ($this->definedOptions as $option) {
-            if (isset($options[$option])) {
-                if ('writer' === $option) {
-                    $options['writer_by_name'] = $options[$option];
-                    $option = 'writer_by_name';
-                }
-                $accessor->setValue($qrCode, $option, $options[$option]);
-            }
+        if (isset($options['label_font_path']) && !is_null($options['label_font_path'])) {
+            $qrCode->setLabelFontPath($options['label_font_path']);
         }
         }
 
 
         return $qrCode;
         return $qrCode;
     }
     }
 
 
     /**
     /**
-     * @return OptionsResolver
+     * Returns all available options.
+     *
+     * @return array
      */
      */
-    protected function getOptionsResolver()
+    public function getAvailableOptions()
     {
     {
-        if (!$this->optionsResolver instanceof OptionsResolver) {
-            $this->optionsResolver = $this->createOptionsResolver();
-        }
-
-        return $this->optionsResolver;
+        $options = [
+            'text' => null,
+            'size' => null,
+            'extension' => null,
+            'error_correction_level' => null,
+            'foreground_color' => null,
+            'background_color' => null,
+            'padding' => null,
+            'label' => null,
+            'label_font_size' => null,
+            'label_font_path' => null,
+        ];
+
+        return $options;
     }
     }
 
 
     /**
     /**
-     * @return OptionsResolver
+     * Returns the current defaults.
+     *
+     * @return array
      */
      */
-    protected function createOptionsResolver()
+    public function getDefaultOptions()
     {
     {
-        $optionsResolver = new OptionsResolver();
-        $optionsResolver
-            ->setDefaults($this->defaultOptions)
-            ->setDefined($this->definedOptions)
-        ;
-
-        return $optionsResolver;
+        return $this->optionsResolver->resolve();
     }
     }
 }
 }

+ 1273 - 273
vendor/endroid/qr-code/src/QrCode.php

@@ -9,348 +9,549 @@
 
 
 namespace Endroid\QrCode;
 namespace Endroid\QrCode;
 
 
-use Endroid\QrCode\Exception\InvalidPathException;
-use Endroid\QrCode\Exception\InvalidWriterException;
-use Endroid\QrCode\Exception\UnsupportedExtensionException;
-use Endroid\QrCode\Writer\WriterInterface;
-
-class QrCode implements QrCodeInterface
+use Endroid\QrCode\Exceptions\DataDoesntExistsException;
+use Endroid\QrCode\Exceptions\FreeTypeLibraryMissingException;
+use Endroid\QrCode\Exceptions\ImageFunctionFailedException;
+use Endroid\QrCode\Exceptions\ImageTypeInvalidException;
+use Endroid\QrCode\Exceptions\VersionTooLargeException;
+use Endroid\QrCode\Exceptions\ImageSizeTooLargeException;
+use Endroid\QrCode\Exceptions\ImageFunctionUnknownException;
+use ReflectionFunction;
+
+/**
+ * Generate QR Code.
+ */
+class QrCode
 {
 {
-    const LABEL_FONT_PATH_DEFAULT = __DIR__.'/../assets/noto_sans.otf';
+    /** @const int Error Correction Level Low (7%) */
+    const LEVEL_LOW = 1;
 
 
-    /**
-     * @var string
-     */
-    protected $text;
+    /** @const int Error Correction Level Medium (15%) */
+    const LEVEL_MEDIUM = 0;
 
 
-    /**
-     * @var int
-     */
-    protected $size = 300;
+    /** @const int Error Correction Level Quartile (25%) */
+    const LEVEL_QUARTILE = 3;
 
 
-    /**
-     * @var int
-     */
-    protected $margin = 10;
+    /** @const int Error Correction Level High (30%) */
+    const LEVEL_HIGH = 2;
 
 
-    /**
-     * @var array
-     */
-    protected $foregroundColor = [
-        'r' => 0,
-        'g' => 0,
-        'b' => 0,
+    /** @const string Image type png */
+    const IMAGE_TYPE_PNG = 'png';
+
+    /** @const string Image type gif */
+    const IMAGE_TYPE_GIF = 'gif';
+
+    /** @const string Image type jpeg */
+    const IMAGE_TYPE_JPEG = 'jpeg';
+
+    /** @const string Image type wbmp */
+    const IMAGE_TYPE_WBMP = 'wbmp';
+
+    /** @const int Horizontal label alignment to the center of image */
+    const LABEL_HALIGN_CENTER = 0;
+
+    /** @const int Horizontal label alignment to the left side of image */
+    const LABEL_HALIGN_LEFT = 1;
+
+    /** @const int Horizontal label alignment to the left border of QR Code */
+    const LABEL_HALIGN_LEFT_BORDER = 2;
+
+    /** @const int Horizontal label alignment to the left side of QR Code */
+    const LABEL_HALIGN_LEFT_CODE = 3;
+
+    /** @const int Horizontal label alignment to the right side of image */
+    const LABEL_HALIGN_RIGHT = 4;
+
+    /** @const int Horizontal label alignment to the right border of QR Code */
+    const LABEL_HALIGN_RIGHT_BORDER = 5;
+
+    /** @const int Horizontal label alignment to the right side of QR Code */
+    const LABEL_HALIGN_RIGHT_CODE = 6;
+
+    /** @const int Vertical label alignment to the top */
+    const LABEL_VALIGN_TOP = 1;
+
+    /** @const int Vertical label alignment to the top and hide border */
+    const LABEL_VALIGN_TOP_NO_BORDER = 2;
+
+    /** @const int Vertical label alignment to the middle*/
+    const LABEL_VALIGN_MIDDLE = 3;
+
+    /** @const int Vertical label alignment to the bottom */
+    const LABEL_VALIGN_BOTTOM = 4;
+
+    /** @var string */
+    protected $logo = null;
+
+    protected $logo_size = 48;
+
+    /** @var string */
+    protected $text = '';
+
+    /** @var int */
+    protected $size = 0;
+
+    /** @var int */
+    protected $padding = 16;
+
+    /** @var bool */
+    protected $draw_quiet_zone = false;
+
+    /** @var bool */
+    protected $draw_border = false;
+
+    /** @var array */
+    protected $color_foreground = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0];
+
+    /** @var array */
+    protected $color_background = ['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0];
+
+    /** @var string */
+    protected $label = '';
+
+    /** @var int */
+    protected $label_font_size = 16;
+
+    /** @var string */
+    protected $label_font_path = '';
+
+    /** @var int */
+    protected $label_halign = self::LABEL_HALIGN_CENTER;
+
+    /** @var int */
+    protected $label_valign = self::LABEL_VALIGN_MIDDLE;
+
+    /** @var resource */
+    protected $image = null;
+
+    /** @var int */
+    protected $version;
+
+    /** @var int */
+    protected $error_correction = self::LEVEL_MEDIUM;
+
+    /** @var array */
+    protected $error_corrections_available = [
+        self::LEVEL_LOW,
+        self::LEVEL_MEDIUM,
+        self::LEVEL_QUARTILE,
+        self::LEVEL_HIGH,
     ];
     ];
 
 
-    /**
-     * @var array
-     */
-    protected $backgroundColor = [
-        'r' => 255,
-        'g' => 255,
-        'b' => 255,
+    /** @var int */
+    protected $module_size;
+
+    /** @var string */
+    protected $image_type = self::IMAGE_TYPE_PNG;
+
+    /** @var array */
+    protected $image_types_available = [
+        self::IMAGE_TYPE_GIF,
+        self::IMAGE_TYPE_PNG,
+        self::IMAGE_TYPE_JPEG,
+        self::IMAGE_TYPE_WBMP,
     ];
     ];
 
 
-    /**
-     * @var string
-     */
-    protected $encoding = 'UTF-8';
+    /** @var string */
+    protected $image_path;
 
 
-    /**
-     * @var ErrorCorrectionLevel
-     */
-    protected $errorCorrectionLevel;
+    /** @var string */
+    protected $path;
 
 
-    /**
-     * @var string
-     */
-    protected $logoPath;
+    /** @var int */
+    protected $structure_append_n;
 
 
-    /**
-     * @var int
-     */
-    protected $logoWidth;
+    /** @var int */
+    protected $structure_append_m;
+
+    /** @var int */
+    protected $structure_append_parity;
+
+    /** @var string */
+    protected $structure_append_original_data;
 
 
     /**
     /**
-     * @var string
+     * Class constructor.
+     *
+     * @param string $text
      */
      */
-    protected $label;
+    public function __construct($text = '')
+    {
+        $this->setPath(__DIR__.'/../assets/data');
+        $this->setImagePath(__DIR__.'/../assets/image');
+        $this->setLabelFontPath(__DIR__.'/../assets/font/opensans.ttf');
+        $this->setText($text);
+    }
 
 
     /**
     /**
-     * @var int
+     * Set structure append.
+     *
+     * @param int    $n
+     * @param int    $m
+     * @param int    $parity        Parity
+     * @param string $original_data Original data
+     *
+     * @return QrCode
      */
      */
-    protected $labelFontSize = 16;
+    public function setStructureAppend($n, $m, $parity, $original_data)
+    {
+        $this->structure_append_n = $n;
+        $this->structure_append_m = $m;
+        $this->structure_append_parity = $parity;
+        $this->structure_append_original_data = $original_data;
+
+        return $this;
+    }
 
 
     /**
     /**
-     * @var string
+     * Set QR Code version.
+     *
+     * @param int $version QR Code version
+     *
+     * @return QrCode
      */
      */
-    protected $labelFontPath = self::LABEL_FONT_PATH_DEFAULT;
+    public function setVersion($version)
+    {
+        if ($version <= 40 && $version >= 0) {
+            $this->version = $version;
+        }
+
+        return $this;
+    }
 
 
     /**
     /**
-     * @var LabelAlignment
+     * Return QR Code version.
+     *
+     * @return int
      */
      */
-    protected $labelAlignment;
+    public function getVersion()
+    {
+        return $this->version;
+    }
 
 
     /**
     /**
-     * @var array
+     * Set QR Code error correction level.
+     *
+     * @param mixed $error_correction Error Correction Level
+     *
+     * @return QrCode
      */
      */
-    protected $labelMargin = [
-        't' => 0,
-        'r' => 10,
-        'b' => 10,
-        'l' => 10,
-    ];
+    public function setErrorCorrection($error_correction)
+    {
+        if (!is_numeric($error_correction)) {
+            $level_constant = 'Endroid\QrCode\QrCode::LEVEL_'.strtoupper($error_correction);
+            $error_correction = constant($level_constant);
+        }
+
+        if (in_array($error_correction, $this->error_corrections_available)) {
+            $this->error_correction = $error_correction;
+        }
+
+        return $this;
+    }
 
 
     /**
     /**
-     * @var WriterRegistryInterface
+     * Return QR Code error correction level.
+     *
+     * @return int
      */
      */
-    protected $writerRegistry;
+    public function getErrorCorrection()
+    {
+        return $this->error_correction;
+    }
 
 
     /**
     /**
-     * @var WriterInterface
+     * Set QR Code module size.
+     *
+     * @param int $module_size Module size
+     *
+     * @return QrCode
      */
      */
-    protected $writer;
+    public function setModuleSize($module_size)
+    {
+        $this->module_size = $module_size;
+
+        return $this;
+    }
 
 
     /**
     /**
-     * @var bool
+     * Return QR Code module size.
+     *
+     * @return int
      */
      */
-    protected $validateResult = false;
+    public function getModuleSize()
+    {
+        return $this->module_size;
+    }
 
 
     /**
     /**
-     * @param string $text
+     * Set image type for rendering.
+     *
+     * @param string $image_type Image type
+     *
+     * @return QrCode
+     *
+     * @throws ImageTypeInvalidException
      */
      */
-    public function __construct($text = '')
+    public function setImageType($image_type)
     {
     {
-        $this->text = $text;
+        if (!in_array($image_type, $this->image_types_available)) {
+            throw new ImageTypeInvalidException('QRCode: image type '.$image_type.' is invalid.');
+        }
 
 
-        $this->errorCorrectionLevel = new ErrorCorrectionLevel(ErrorCorrectionLevel::LOW);
-        $this->labelAlignment = new LabelAlignment(LabelAlignment::CENTER);
+        $this->image_type = $image_type;
 
 
-        $this->writerRegistry = new StaticWriterRegistry();
+        return $this;
     }
     }
 
 
     /**
     /**
-     * @param string $text
+     * Return image type for rendering.
      *
      *
-     * @return $this
+     * @return string
      */
      */
-    public function setText($text)
+    public function getImageType()
     {
     {
-        $this->text = $text;
-
-        return $this;
+        return $this->image_type;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Set image type for rendering via extension.
+     *
+     * @param string $extension Image extension
+     *
+     * @return QrCode
      */
      */
-    public function getText()
+    public function setExtension($extension)
     {
     {
-        return $this->text;
+        if ($extension == 'jpg') {
+            $this->setImageType('jpeg');
+        } else {
+            $this->setImageType($extension);
+        }
+
+        return $this;
     }
     }
 
 
     /**
     /**
-     * @param int $size
+     * Set path to the images directory.
+     *
+     * @param string $image_path Image directory
      *
      *
-     * @return $this
+     * @return QrCode
      */
      */
-    public function setSize($size)
+    public function setImagePath($image_path)
     {
     {
-        $this->size = $size;
+        $this->image_path = $image_path;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return path to the images directory.
+     *
+     * @return string
      */
      */
-    public function getSize()
+    public function getImagePath()
     {
     {
-        return $this->size;
+        return $this->image_path;
     }
     }
 
 
     /**
     /**
-     * @param int $margin
+     * Set path to the data directory.
      *
      *
-     * @return $this
+     * @param string $path Data directory
+     *
+     * @return QrCode
      */
      */
-    public function setMargin($margin)
+    public function setPath($path)
     {
     {
-        $this->margin = $margin;
+        $this->path = $path;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return path to the data directory.
+     *
+     * @return string
      */
      */
-    public function getMargin()
+    public function getPath()
     {
     {
-        return $this->margin;
+        return $this->path;
     }
     }
 
 
     /**
     /**
-     * @param array $foregroundColor
+     * Set logo in QR Code.
      *
      *
-     * @return $this
+     * @param string $logo Logo Path
+     *
+     * @throws Exceptions\DataDoesntExistsException
+     *
+     * @return QrCode
      */
      */
-    public function setForegroundColor($foregroundColor)
+    public function setLogo($logo)
     {
     {
-        $this->foregroundColor = $foregroundColor;
+        if (!file_exists($logo)) {
+            throw new DataDoesntExistsException("$logo file does not exist");
+        }
+
+        $this->logo = $logo;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Set logo size in QR Code(default 48).
+     *
+     * @param int $logo_size Logo Size
+     *
+     * @return QrCode
      */
      */
-    public function getForegroundColor()
+    public function setLogoSize($logo_size)
     {
     {
-        return $this->foregroundColor;
+        $this->logo_size = $logo_size;
+
+        return $this;
     }
     }
 
 
     /**
     /**
-     * @param array $backgroundColor
+     * Set text to hide in QR Code.
      *
      *
-     * @return $this
+     * @param string $text Text to hide
+     *
+     * @return QrCode
      */
      */
-    public function setBackgroundColor($backgroundColor)
+    public function setText($text)
     {
     {
-        $this->backgroundColor = $backgroundColor;
+        $this->text = $text;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return text that will be hid in QR Code.
+     *
+     * @return string
      */
      */
-    public function getBackgroundColor()
+    public function getText()
     {
     {
-        return $this->backgroundColor;
+        return $this->text;
     }
     }
 
 
     /**
     /**
-     * @param string $encoding
+     * Set QR Code size (width).
      *
      *
-     * @return $this
+     * @param int $size Width of the QR Code
+     *
+     * @return QrCode
      */
      */
-    public function setEncoding($encoding)
+    public function setSize($size)
     {
     {
-        $this->encoding = $encoding;
+        $this->size = $size;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return QR Code size (width).
+     *
+     * @return int
      */
      */
-    public function getEncoding()
+    public function getSize()
     {
     {
-        return $this->encoding;
+        return $this->size;
     }
     }
 
 
     /**
     /**
-     * @param string $errorCorrectionLevel
+     * Set padding around the QR Code.
      *
      *
-     * @return $this
+     * @param int $padding Padding around QR Code
+     *
+     * @return QrCode
      */
      */
-    public function setErrorCorrectionLevel($errorCorrectionLevel)
+    public function setPadding($padding)
     {
     {
-        $this->errorCorrectionLevel = new ErrorCorrectionLevel($errorCorrectionLevel);
+        $this->padding = $padding;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return padding around the QR Code.
+     *
+     * @return int
      */
      */
-    public function getErrorCorrectionLevel()
+    public function getPadding()
     {
     {
-        return $this->errorCorrectionLevel->getValue();
+        return $this->padding;
     }
     }
 
 
     /**
     /**
-     * @param string $logoPath
+     * Set draw required four-module wide margin.
      *
      *
-     * @return $this
+     * @param bool $draw_quiet_zone State of required four-module wide margin drawing
      *
      *
-     * @throws InvalidPathException
+     * @return QrCode
      */
      */
-    public function setLogoPath($logoPath)
+    public function setDrawQuietZone($draw_quiet_zone)
     {
     {
-        $logoPath = realpath($logoPath);
-
-        if (!is_file($logoPath)) {
-            throw new InvalidPathException('Invalid logo path: '.$logoPath);
-        }
-
-        $this->logoPath = $logoPath;
+        $this->draw_quiet_zone = $draw_quiet_zone;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return draw required four-module wide margin.
+     *
+     * @return bool
      */
      */
-    public function getLogoPath()
+    public function getDrawQuietZone()
     {
     {
-        return $this->logoPath;
+        return $this->draw_quiet_zone;
     }
     }
 
 
     /**
     /**
-     * @param int $logoWidth
+     * Set draw border around QR Code.
      *
      *
-     * @return $this
+     * @param bool $draw_border State of border drawing
+     *
+     * @return QrCode
      */
      */
-    public function setLogoWidth($logoWidth)
+    public function setDrawBorder($draw_border)
     {
     {
-        $this->logoWidth = $logoWidth;
+        $this->draw_border = $draw_border;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return draw border around QR Code.
+     *
+     * @return bool
      */
      */
-    public function getLogoWidth()
+    public function getDrawBorder()
     {
     {
-        return $this->logoWidth;
+        return $this->draw_border;
     }
     }
 
 
     /**
     /**
-     * @param string $label
-     * @param int    $labelFontSize
-     * @param string $labelFontPath
-     * @param string $labelAlignment
-     * @param array  $labelMargin
+     * Set QR Code label (text).
+     *
+     * @param int|string $label Label to print under QR code
      *
      *
-     * @return $this
+     * @return QrCode
      */
      */
-    public function setLabel($label, $labelFontSize = null, $labelFontPath = null, $labelAlignment = null, $labelMargin = null)
+    public function setLabel($label)
     {
     {
         $this->label = $label;
         $this->label = $label;
 
 
-        if (null !== $labelFontSize) {
-            $this->setLabelFontSize($labelFontSize);
-        }
-
-        if (null !== $labelFontPath) {
-            $this->setLabelFontPath($labelFontPath);
-        }
-
-        if (null !== $labelAlignment) {
-            $this->setLabelAlignment($labelAlignment);
-        }
-
-        if (null !== $labelMargin) {
-            $this->setLabelMargin($labelMargin);
-        }
-
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return QR Code label (text).
+     *
+     * @return string
      */
      */
     public function getLabel()
     public function getLabel()
     {
     {
@@ -358,234 +559,1033 @@ class QrCode implements QrCodeInterface
     }
     }
 
 
     /**
     /**
-     * @param int $labelFontSize
+     * Set QR Code label font size.
+     *
+     * @param int $label_font_size Font size of the QR code label
      *
      *
-     * @return $this
+     * @return QrCode
      */
      */
-    public function setLabelFontSize($labelFontSize)
+    public function setLabelFontSize($label_font_size)
     {
     {
-        $this->labelFontSize = $labelFontSize;
+        $this->label_font_size = $label_font_size;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return QR Code label font size.
+     *
+     * @return int
      */
      */
     public function getLabelFontSize()
     public function getLabelFontSize()
     {
     {
-        return $this->labelFontSize;
+        return $this->label_font_size;
     }
     }
 
 
     /**
     /**
-     * @param string $labelFontPath
+     * Set QR Code label font path.
      *
      *
-     * @return $this
+     * @param int $label_font_path Path to the QR Code label's TTF font file
      *
      *
-     * @throws InvalidPathException
+     * @return QrCode
      */
      */
-    public function setLabelFontPath($labelFontPath)
+    public function setLabelFontPath($label_font_path)
     {
     {
-        $labelFontPath = realpath($labelFontPath);
-
-        if (!is_file($labelFontPath)) {
-            throw new InvalidPathException('Invalid label font path: '.$labelFontPath);
-        }
-
-        $this->labelFontPath = $labelFontPath;
+        $this->label_font_path = $label_font_path;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return path to the QR Code label's TTF font file.
+     *
+     * @return string
      */
      */
     public function getLabelFontPath()
     public function getLabelFontPath()
     {
     {
-        return $this->labelFontPath;
+        return $this->label_font_path;
     }
     }
 
 
     /**
     /**
-     * @param string $labelAlignment
+     * Set label horizontal alignment.
+     *
+     * @param int $label_halign Label horizontal alignment
      *
      *
-     * @return $this
+     * @return QrCode
      */
      */
-    public function setLabelAlignment($labelAlignment)
+    public function setLabelHalign($label_halign)
     {
     {
-        $this->labelAlignment = new LabelAlignment($labelAlignment);
+        $this->label_halign = $label_halign;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return label horizontal alignment.
+     *
+     * @return int
      */
      */
-    public function getLabelAlignment()
+    public function getLabelHalign()
     {
     {
-        return $this->labelAlignment->getValue();
+        return $this->label_halign;
     }
     }
 
 
     /**
     /**
-     * @param int[] $labelMargin
+     * Set label vertical alignment.
+     *
+     * @param int $label_valign Label vertical alignment
      *
      *
-     * @return $this
+     * @return QrCode
      */
      */
-    public function setLabelMargin(array $labelMargin)
+    public function setLabelValign($label_valign)
     {
     {
-        $this->labelMargin = array_merge($this->labelMargin, $labelMargin);
+        $this->label_valign = $label_valign;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Return label vertical alignment.
+     *
+     * @return int
      */
      */
-    public function getLabelMargin()
+    public function getLabelValign()
     {
     {
-        return $this->labelMargin;
+        return $this->label_valign;
     }
     }
 
 
     /**
     /**
-     * @param WriterRegistryInterface $writerRegistry
+     * Set foreground color of the QR Code.
      *
      *
-     * @return $this
+     * @param array $color_foreground RGB color
+     *
+     * @return QrCode
      */
      */
-    public function setWriterRegistry(WriterRegistryInterface $writerRegistry)
+    public function setForegroundColor($color_foreground)
     {
     {
-        $this->writerRegistry = $writerRegistry;
+        if (!isset($color_foreground['a'])) {
+            $color_foreground['a'] = 0;
+        }
+
+        $this->color_foreground = $color_foreground;
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * @param WriterInterface $writer
+     * Return foreground color of the QR Code.
      *
      *
-     * @return $this
+     * @return array
      */
      */
-    public function setWriter(WriterInterface $writer)
+    public function getForegroundColor()
     {
     {
-        $this->writer = $writer;
-
-        return $this;
+        return $this->color_foreground;
     }
     }
 
 
     /**
     /**
-     * @param WriterInterface $name
+     * Set background color of the QR Code.
+     *
+     * @param array $color_background RGB color
      *
      *
-     * @return WriterInterface
+     * @return QrCode
      */
      */
-    public function getWriter($name = null)
+    public function setBackgroundColor($color_background)
     {
     {
-        if (!is_null($name)) {
-            return $this->writerRegistry->getWriter($name);
+        if (!isset($color_background['a'])) {
+            $color_background['a'] = 0;
         }
         }
 
 
-        if ($this->writer instanceof WriterInterface) {
-            return $this->writer;
-        }
+        $this->color_background = $color_background;
 
 
-        return $this->writerRegistry->getDefaultWriter();
+        return $this;
     }
     }
 
 
     /**
     /**
-     * @param string $name
-     *
-     * @return $this
+     * Return background color of the QR Code.
      *
      *
-     * @throws InvalidWriterException
+     * @return array
      */
      */
-    public function setWriterByName($name)
+    public function getBackgroundColor()
     {
     {
-        $this->writer = $this->writerRegistry->getWriter($name);
-
-        return $this;
+        return $this->color_background;
     }
     }
 
 
     /**
     /**
-     * @param string $path
+     * Return the image resource.
      *
      *
-     * @return $this
+     * @return resource
      */
      */
-    public function setWriterByPath($path)
+    public function getImage()
     {
     {
-        $extension = pathinfo($path, PATHINFO_EXTENSION);
-
-        $this->setWriterByExtension($extension);
+        if (empty($this->image)) {
+            $this->create();
+        }
 
 
-        return $this;
+        return $this->image;
     }
     }
 
 
     /**
     /**
-     * @param string $extension
-     *
-     * @return $this
+     * Return the data URI.
      *
      *
-     * @throws UnsupportedExtensionException
+     * @return string
      */
      */
-    public function setWriterByExtension($extension)
+    public function getDataUri()
     {
     {
-        foreach ($this->writerRegistry->getWriters() as $writer) {
-            if ($writer->supportsExtension($extension)) {
-                $this->writer = $writer;
-
-                return $this;
-            }
+        if (empty($this->image)) {
+            $this->create();
         }
         }
 
 
-        throw new UnsupportedExtensionException('Missing writer for extension "'.$extension.'"');
+        ob_start();
+        call_user_func('image'.$this->image_type, $this->image);
+        $contents = ob_get_clean();
+
+        return 'data:image/'.$this->image_type.';base64,'.base64_encode($contents);
     }
     }
 
 
     /**
     /**
-     * @param bool $validateResult
+     * Render the QR Code then save it to given file name.
+     *
+     * @param string $filename File name of the QR Code
      *
      *
-     * @return $this
+     * @return QrCode
      */
      */
-    public function setValidateResult($validateResult)
+    public function save($filename)
     {
     {
-        $this->validateResult = $validateResult;
+        $this->render($filename);
 
 
         return $this;
         return $this;
     }
     }
 
 
     /**
     /**
-     * {@inheritdoc}
+     * Render the QR Code then save it to given file name or
+     * output it to the browser when file name omitted.
+     *
+     * @param null|string $filename File name of the QR Code
+     * @param null|string $format   Format of the file (png, jpeg, jpg, gif, wbmp)
+     *
+     * @throws ImageFunctionUnknownException
+     * @throws ImageFunctionFailedException
+     *
+     * @return QrCode
      */
      */
-    public function getValidateResult()
+    public function render($filename = null, $format = 'png')
     {
     {
-        return $this->validateResult;
+        $this->create();
+
+        if ($format == 'jpg') {
+            $format = 'jpeg';
+        }
+
+        if (!in_array($format, $this->image_types_available)) {
+            $format = $this->image_type;
+        }
+
+        if (!function_exists('image'.$format)) {
+            throw new ImageFunctionUnknownException('QRCode: function image'.$format.' does not exists.');
+        }
+
+        if ($filename === null) {
+            $success = call_user_func('image'.$format, $this->image);
+        } else {
+            $success = call_user_func_array('image'.$format, [$this->image, $filename]);
+        }
+
+        if ($success === false) {
+            throw new ImageFunctionFailedException('QRCode: function image'.$format.' failed.');
+        }
+
+        return $this;
     }
     }
 
 
     /**
     /**
+     * Returns the content type corresponding to the image type.
+     *
      * @return string
      * @return string
      */
      */
-    public function writeString()
+    public function getContentType()
     {
     {
-        return $this->getWriter()->writeString($this);
+        $contentType = 'image/'.$this->image_type;
+
+        return $contentType;
     }
     }
 
 
     /**
     /**
+     * Create QR Code and return its content.
+     *
+     * @param string|null $format Image type (gif, png, wbmp, jpeg)
+     *
+     * @throws ImageFunctionUnknownException
+     * @throws ImageFunctionFailedException
+     *
      * @return string
      * @return string
      */
      */
-    public function writeDataUri()
+    public function get($format = null)
     {
     {
-        return $this->getWriter()->writeDataUri($this);
-    }
+        $this->create();
 
 
-    /**
-     * @param string $path
-     */
-    public function writeFile($path)
-    {
-        return $this->getWriter()->writeFile($this, $path);
+        if ($format == 'jpg') {
+            $format = 'jpeg';
+        }
+
+        if (!in_array($format, $this->image_types_available)) {
+            $format = $this->image_type;
+        }
+
+        if (!function_exists('image'.$format)) {
+            throw new ImageFunctionUnknownException('QRCode: function image'.$format.' does not exists.');
+        }
+
+        ob_start();
+        $success = call_user_func('image'.$format, $this->image);
+
+        if ($success === false) {
+            throw new ImageFunctionFailedException('QRCode: function image'.$format.' failed.');
+        }
+
+        $content = ob_get_clean();
+
+        return $content;
     }
     }
 
 
     /**
     /**
-     * @return string
+     * Create the image.
      *
      *
-     * @throws InvalidWriterException
+     * @throws Exceptions\DataDoesntExistsException
+     * @throws Exceptions\VersionTooLargeException
+     * @throws Exceptions\ImageSizeTooLargeException
+     * @throws \OverflowException
      */
      */
-    public function getContentType()
+    public function create()
     {
     {
-        return $this->getWriter()->getContentType();
+        $image_path = $this->image_path;
+        $path = $this->path;
+
+        $version_ul = 40;
+
+        $qrcode_data_string = $this->text;//Previously from $_GET["d"];
+
+        $qrcode_error_correct = $this->error_correction;//Previously from $_GET["e"];
+        $qrcode_module_size = $this->module_size;//Previously from $_GET["s"];
+        $qrcode_version = $this->version;//Previously from $_GET["v"];
+        $qrcode_image_type = $this->image_type;//Previously from $_GET["t"];
+
+        $qrcode_structureappend_n = $this->structure_append_n;//Previously from $_GET["n"];
+        $qrcode_structureappend_m = $this->structure_append_m;//Previously from $_GET["m"];
+        $qrcode_structureappend_parity = $this->structure_append_parity;//Previously from $_GET["p"];
+        $qrcode_structureappend_originaldata = $this->structure_append_original_data;//Previously from $_GET["o"];
+
+        if ($qrcode_module_size > 0) {
+        } else {
+            if ($qrcode_image_type == 'jpeg') {
+                $qrcode_module_size = 8;
+            } else {
+                $qrcode_module_size = 4;
+            }
+        }
+        $data_length = strlen($qrcode_data_string);
+        if ($data_length <= 0) {
+            throw new DataDoesntExistsException('QRCode: data does not exist.');
+        }
+        $data_counter = 0;
+        if ($qrcode_structureappend_n > 1
+         && $qrcode_structureappend_n <= 16
+         && $qrcode_structureappend_m > 0
+         && $qrcode_structureappend_m <= 16) {
+            $data_value[0] = 3;
+            $data_bits[0] = 4;
+
+            $data_value[1] = $qrcode_structureappend_m - 1;
+            $data_bits[1] = 4;
+
+            $data_value[2] = $qrcode_structureappend_n - 1;
+            $data_bits[2] = 4;
+
+            $originaldata_length = strlen($qrcode_structureappend_originaldata);
+            if ($originaldata_length > 1) {
+                $qrcode_structureappend_parity = 0;
+                $i = 0;
+                while ($i < $originaldata_length) {
+                    $qrcode_structureappend_parity = ($qrcode_structureappend_parity ^ ord(substr($qrcode_structureappend_originaldata, $i, 1)));
+                    ++$i;
+                }
+            }
+
+            $data_value[3] = $qrcode_structureappend_parity;
+            $data_bits[3] = 8;
+
+            $data_counter = 4;
+        }
+
+        $data_bits[$data_counter] = 4;
+
+        /*  --- determine encode mode */
+
+        if (preg_match('/[^0-9]/', $qrcode_data_string) != 0) {
+            if (preg_match("/[^0-9A-Z \$\*\%\+\.\/\:\-]/", $qrcode_data_string) != 0) {
+                /*  --- 8bit byte mode */
+
+                $codeword_num_plus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8];
+
+                $data_value[$data_counter] = 4;
+                ++$data_counter;
+                $data_value[$data_counter] = $data_length;
+                $data_bits[$data_counter] = 8;   /* #version 1-9 */
+                $codeword_num_counter_value = $data_counter;
+
+                ++$data_counter;
+                $i = 0;
+                while ($i < $data_length) {
+                    $data_value[$data_counter] = ord(substr($qrcode_data_string, $i, 1));
+                    $data_bits[$data_counter] = 8;
+                    ++$data_counter;
+                    ++$i;
+                }
+            } else {
+                /* ---- alphanumeric mode */
+
+                $codeword_num_plus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4];
+
+                $data_value[$data_counter] = 2;
+                ++$data_counter;
+                $data_value[$data_counter] = $data_length;
+                $data_bits[$data_counter] = 9;  /* #version 1-9 */
+                $codeword_num_counter_value = $data_counter;
+
+                $alphanumeric_character_hash = ['0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4,
+        '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14,
+        'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22, 'N' => 23,
+        'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31,
+        'W' => 32, 'X' => 33, 'Y' => 34, 'Z' => 35, ' ' => 36, '$' => 37, '%' => 38, '*' => 39,
+        '+' => 40, '-' => 41, '.' => 42, '/' => 43, ':' => 44];
+
+                $i = 0;
+                ++$data_counter;
+                while ($i < $data_length) {
+                    if (($i % 2) == 0) {
+                        $data_value[$data_counter] = $alphanumeric_character_hash[substr($qrcode_data_string, $i, 1)];
+                        $data_bits[$data_counter] = 6;
+                    } else {
+                        $data_value[$data_counter] = $data_value[$data_counter] * 45 + $alphanumeric_character_hash[substr($qrcode_data_string, $i, 1)];
+                        $data_bits[$data_counter] = 11;
+                        ++$data_counter;
+                    }
+                    ++$i;
+                }
+            }
+        } else {
+            /* ---- numeric mode */
+
+            $codeword_num_plus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4];
+
+            $data_value[$data_counter] = 1;
+            ++$data_counter;
+            $data_value[$data_counter] = $data_length;
+            $data_bits[$data_counter] = 10;   /* #version 1-9 */
+            $codeword_num_counter_value = $data_counter;
+
+            $i = 0;
+            ++$data_counter;
+            while ($i < $data_length) {
+                if (($i % 3) == 0) {
+                    $data_value[$data_counter] = substr($qrcode_data_string, $i, 1);
+                    $data_bits[$data_counter] = 4;
+                } else {
+                    $data_value[$data_counter] = $data_value[$data_counter] * 10 + substr($qrcode_data_string, $i, 1);
+                    if (($i % 3) == 1) {
+                        $data_bits[$data_counter] = 7;
+                    } else {
+                        $data_bits[$data_counter] = 10;
+                        ++$data_counter;
+                    }
+                }
+                ++$i;
+            }
+        }
+        if (array_key_exists($data_counter, $data_bits) && $data_bits[$data_counter] > 0) {
+            ++$data_counter;
+        }
+        $i = 0;
+        $total_data_bits = 0;
+        while ($i < $data_counter) {
+            $total_data_bits += $data_bits[$i];
+            ++$i;
+        }
+
+        $ecc_character_hash = [
+            'L' => '1',
+            'l' => '1',
+            'M' => '0',
+            'm' => '0',
+            'Q' => '3',
+            'q' => '3',
+            'H' => '2',
+            'h' => '2',
+        ];
+
+        if (!is_numeric($qrcode_error_correct)) {
+            $ec = @$ecc_character_hash[$qrcode_error_correct];
+        } else {
+            $ec = $qrcode_error_correct;
+        }
+
+        if (!$ec) {
+            $ec = 0;
+        }
+
+        $max_data_bits = 0;
+
+        $max_data_bits_array = [
+            0, 128, 224, 352, 512, 688, 864, 992, 1232, 1456, 1728,
+            2032, 2320, 2672, 2920, 3320, 3624, 4056, 4504, 5016, 5352,
+            5712, 6256, 6880, 7312, 8000, 8496, 9024, 9544, 10136, 10984,
+            11640, 12328, 13048, 13800, 14496, 15312, 15936, 16816, 17728, 18672,
+
+            152, 272, 440, 640, 864, 1088, 1248, 1552, 1856, 2192,
+            2592, 2960, 3424, 3688, 4184, 4712, 5176, 5768, 6360, 6888,
+            7456, 8048, 8752, 9392, 10208, 10960, 11744, 12248, 13048, 13880,
+            14744, 15640, 16568, 17528, 18448, 19472, 20528, 21616, 22496, 23648,
+
+            72, 128, 208, 288, 368, 480, 528, 688, 800, 976,
+            1120, 1264, 1440, 1576, 1784, 2024, 2264, 2504, 2728, 3080,
+            3248, 3536, 3712, 4112, 4304, 4768, 5024, 5288, 5608, 5960,
+            6344, 6760, 7208, 7688, 7888, 8432, 8768, 9136, 9776, 10208,
+
+            104, 176, 272, 384, 496, 608, 704, 880, 1056, 1232,
+            1440, 1648, 1952, 2088, 2360, 2600, 2936, 3176, 3560, 3880,
+            4096, 4544, 4912, 5312, 5744, 6032, 6464, 6968, 7288, 7880,
+            8264, 8920, 9368, 9848, 10288, 10832, 11408, 12016, 12656, 13328
+        ];
+        if (!is_numeric($qrcode_version)) {
+            $qrcode_version = 0;
+        }
+        if (!$qrcode_version) {
+            /* #--- auto version select */
+            $i = 1 + 40 * $ec;
+            $j = $i + 39;
+            $qrcode_version = 1;
+            while ($i <= $j) {
+                if (($max_data_bits_array[$i]) >= $total_data_bits + $codeword_num_plus[$qrcode_version]) {
+                    $max_data_bits = $max_data_bits_array[$i];
+                    break;
+                }
+                ++$i;
+                ++$qrcode_version;
+            }
+        } else {
+            $max_data_bits = $max_data_bits_array[$qrcode_version + 40 * $ec];
+        }
+        if ($qrcode_version > $version_ul) {
+            throw new VersionTooLargeException('QRCode : version too large');
+        }
+
+        $total_data_bits += $codeword_num_plus[$qrcode_version];
+        $data_bits[$codeword_num_counter_value] += $codeword_num_plus[$qrcode_version];
+
+        $max_codewords_array = [0, 26, 44, 70, 100, 134, 172, 196, 242,
+        292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156,
+        1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465,
+        2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706];
+
+        $max_codewords = $max_codewords_array[$qrcode_version];
+        $max_modules_1side = 17 + ($qrcode_version << 2);
+
+        $matrix_remain_bit = [0, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3,
+        4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0];
+
+        /* ---- read version ECC data file */
+
+        $byte_num = $matrix_remain_bit[$qrcode_version] + ($max_codewords << 3);
+        $filename = $path.'/qrv'.$qrcode_version.'_'.$ec.'.dat';
+        $fp1 = fopen($filename, 'rb');
+        $matx = fread($fp1, $byte_num);
+        $maty = fread($fp1, $byte_num);
+        $masks = fread($fp1, $byte_num);
+        $fi_x = fread($fp1, 15);
+        $fi_y = fread($fp1, 15);
+        $rs_ecc_codewords = ord(fread($fp1, 1));
+        $rso = fread($fp1, 128);
+        fclose($fp1);
+
+        $matrix_x_array = unpack('C*', $matx);
+        $matrix_y_array = unpack('C*', $maty);
+        $mask_array = unpack('C*', $masks);
+
+        $rs_block_order = unpack('C*', $rso);
+
+        $format_information_x2 = unpack('C*', $fi_x);
+        $format_information_y2 = unpack('C*', $fi_y);
+
+        $format_information_x1 = [0, 1, 2, 3, 4, 5, 7, 8, 8, 8, 8, 8, 8, 8, 8];
+        $format_information_y1 = [8, 8, 8, 8, 8, 8, 8, 8, 7, 5, 4, 3, 2, 1, 0];
+
+        $max_data_codewords = ($max_data_bits >> 3);
+
+        $filename = $path.'/rsc'.$rs_ecc_codewords.'.dat';
+        $fp0 = fopen($filename, 'rb');
+        $i = 0;
+        $rs_cal_table_array = [];
+        while ($i < 256) {
+            $rs_cal_table_array[$i] = fread($fp0, $rs_ecc_codewords);
+            ++$i;
+        }
+        fclose($fp0);
+
+        /*  --- set terminator */
+
+        if ($total_data_bits <= $max_data_bits - 4) {
+            $data_value[$data_counter] = 0;
+            $data_bits[$data_counter] = 4;
+        } else {
+            if ($total_data_bits < $max_data_bits) {
+                $data_value[$data_counter] = 0;
+                $data_bits[$data_counter] = $max_data_bits - $total_data_bits;
+            } else {
+                if ($total_data_bits > $max_data_bits) {
+                    throw new \OverflowException('QRCode: overflow error');
+                }
+            }
+        }
+
+        /* ----divide data by 8bit */
+
+        $i = 0;
+        $codewords_counter = 0;
+        $codewords[0] = 0;
+        $remaining_bits = 8;
+
+        while ($i <= $data_counter) {
+            $buffer = @$data_value[$i];
+            $buffer_bits = @$data_bits[$i];
+
+            $flag = 1;
+            while ($flag) {
+                if ($remaining_bits > $buffer_bits) {
+                    $codewords[$codewords_counter] = ((@$codewords[$codewords_counter] << $buffer_bits) | $buffer);
+                    $remaining_bits -= $buffer_bits;
+                    $flag = 0;
+                } else {
+                    $buffer_bits -= $remaining_bits;
+                    $codewords[$codewords_counter] = (($codewords[$codewords_counter] << $remaining_bits) | ($buffer >> $buffer_bits));
+
+                    if ($buffer_bits == 0) {
+                        $flag = 0;
+                    } else {
+                        $buffer = ($buffer & ((1 << $buffer_bits) - 1));
+                        $flag = 1;
+                    }
+
+                    ++$codewords_counter;
+                    if ($codewords_counter < $max_data_codewords - 1) {
+                        $codewords[$codewords_counter] = 0;
+                    }
+                    $remaining_bits = 8;
+                }
+            }
+            ++$i;
+        }
+        if ($remaining_bits != 8) {
+            $codewords[$codewords_counter] = $codewords[$codewords_counter] << $remaining_bits;
+        } else {
+            --$codewords_counter;
+        }
+
+        /* ----  set padding character */
+
+        if ($codewords_counter < $max_data_codewords - 1) {
+            $flag = 1;
+            while ($codewords_counter < $max_data_codewords - 1) {
+                ++$codewords_counter;
+                if ($flag == 1) {
+                    $codewords[$codewords_counter] = 236;
+                } else {
+                    $codewords[$codewords_counter] = 17;
+                }
+                $flag = $flag * (-1);
+            }
+        }
+
+        /* ---- RS-ECC prepare */
+
+        $i = 0;
+        $j = 0;
+        $rs_block_number = 0;
+        $rs_temp[0] = '';
+
+        while ($i < $max_data_codewords) {
+            $rs_temp[$rs_block_number] .= chr($codewords[$i]);
+            ++$j;
+
+            if ($j >= $rs_block_order[$rs_block_number + 1] - $rs_ecc_codewords) {
+                $j = 0;
+                ++$rs_block_number;
+                $rs_temp[$rs_block_number] = '';
+            }
+            ++$i;
+        }
+
+        /*
+        #
+        # RS-ECC main
+        #
+        */
+
+        $rs_block_number = 0;
+        $rs_block_order_num = count($rs_block_order);
+
+        while ($rs_block_number < $rs_block_order_num) {
+            $rs_codewords = $rs_block_order[$rs_block_number + 1];
+            $rs_data_codewords = $rs_codewords - $rs_ecc_codewords;
+
+            $rstemp = $rs_temp[$rs_block_number].str_repeat(chr(0), $rs_ecc_codewords);
+            $padding_data = str_repeat(chr(0), $rs_data_codewords);
+
+            $j = $rs_data_codewords;
+            while ($j > 0) {
+                $first = ord(substr($rstemp, 0, 1));
+
+                if ($first) {
+                    $left_chr = substr($rstemp, 1);
+                    $cal = $rs_cal_table_array[$first].$padding_data;
+                    $rstemp = $left_chr ^ $cal;
+                } else {
+                    $rstemp = substr($rstemp, 1);
+                }
+
+                --$j;
+            }
+
+            $codewords = array_merge($codewords, unpack('C*', $rstemp));
+
+            ++$rs_block_number;
+        }
+
+        /* ---- flash matrix */
+        $matrix_content = [];
+        $i = 0;
+        while ($i < $max_modules_1side) {
+            $j = 0;
+            while ($j < $max_modules_1side) {
+                $matrix_content[$j][$i] = 0;
+                ++$j;
+            }
+            ++$i;
+        }
+
+        /* --- attach data */
+
+        $i = 0;
+        while ($i < $max_codewords) {
+            $codeword_i = $codewords[$i];
+            $j = 8;
+            while ($j >= 1) {
+                $codeword_bits_number = ($i << 3) +  $j;
+                $matrix_content[ $matrix_x_array[$codeword_bits_number] ][ $matrix_y_array[$codeword_bits_number] ] = ((255 * ($codeword_i & 1)) ^ $mask_array[$codeword_bits_number]);
+                $codeword_i = $codeword_i >> 1;
+                --$j;
+            }
+            ++$i;
+        }
+
+        $matrix_remain = $matrix_remain_bit[$qrcode_version];
+        while ($matrix_remain) {
+            $remain_bit_temp = $matrix_remain + ($max_codewords << 3);
+            $matrix_content[ $matrix_x_array[$remain_bit_temp] ][ $matrix_y_array[$remain_bit_temp] ] = (255 ^ $mask_array[$remain_bit_temp]);
+            --$matrix_remain;
+        }
+
+        #--- mask select
+
+        $min_demerit_score = 0;
+        $hor_master = '';
+        $ver_master = '';
+        $k = 0;
+        while ($k < $max_modules_1side) {
+            $l = 0;
+            while ($l < $max_modules_1side) {
+                $hor_master = $hor_master.chr($matrix_content[$l][$k]);
+                $ver_master = $ver_master.chr($matrix_content[$k][$l]);
+                ++$l;
+            }
+            ++$k;
+        }
+        $i = 0;
+        $all_matrix = $max_modules_1side * $max_modules_1side;
+        $mask_number = 0;
+        while ($i < 8) {
+            $demerit_n1 = 0;
+            $ptn_temp = [];
+            $bit = 1 << $i;
+            $bit_r = (~$bit) & 255;
+            $bit_mask = str_repeat(chr($bit), $all_matrix);
+            $hor = $hor_master & $bit_mask;
+            $ver = $ver_master & $bit_mask;
+
+            $ver_shift1 = $ver.str_repeat(chr(170), $max_modules_1side);
+            $ver_shift2 = str_repeat(chr(170), $max_modules_1side).$ver;
+            $ver_shift1_0 = $ver.str_repeat(chr(0), $max_modules_1side);
+            $ver_shift2_0 = str_repeat(chr(0), $max_modules_1side).$ver;
+            $ver_or = chunk_split(~($ver_shift1 | $ver_shift2), $max_modules_1side, chr(170));
+            $ver_and = chunk_split(~($ver_shift1_0 & $ver_shift2_0), $max_modules_1side, chr(170));
+
+            $hor = chunk_split(~$hor, $max_modules_1side, chr(170));
+            $ver = chunk_split(~$ver, $max_modules_1side, chr(170));
+            $hor = $hor.chr(170).$ver;
+
+            $n1_search = '/'.str_repeat(chr(255), 5).'+|'.str_repeat(chr($bit_r), 5).'+/';
+            $n3_search = chr($bit_r).chr(255).chr($bit_r).chr($bit_r).chr($bit_r).chr(255).chr($bit_r);
+
+            $demerit_n3 = substr_count($hor, $n3_search) * 40;
+            $demerit_n4 = floor(abs(((100 * (substr_count($ver, chr($bit_r)) / ($byte_num))) - 50) / 5)) * 10;
+
+            $n2_search1 = '/'.chr($bit_r).chr($bit_r).'+/';
+            $n2_search2 = '/'.chr(255).chr(255).'+/';
+            $demerit_n2 = 0;
+            preg_match_all($n2_search1, $ver_and, $ptn_temp);
+            foreach ($ptn_temp[0] as $str_temp) {
+                $demerit_n2 += (strlen($str_temp) - 1);
+            }
+            $ptn_temp = [];
+            preg_match_all($n2_search2, $ver_or, $ptn_temp);
+            foreach ($ptn_temp[0] as $str_temp) {
+                $demerit_n2 += (strlen($str_temp) - 1);
+            }
+            $demerit_n2 *= 3;
+
+            $ptn_temp = [];
+
+            preg_match_all($n1_search, $hor, $ptn_temp);
+            foreach ($ptn_temp[0] as $str_temp) {
+                $demerit_n1 += (strlen($str_temp) - 2);
+            }
+
+            $demerit_score = $demerit_n1 + $demerit_n2 + $demerit_n3 + $demerit_n4;
+
+            if ($demerit_score <= $min_demerit_score || $i == 0) {
+                $mask_number = $i;
+                $min_demerit_score = $demerit_score;
+            }
+
+            ++$i;
+        }
+
+        $mask_content = 1 << $mask_number;
+
+        # --- format information
+
+        $format_information_value = (($ec << 3) | $mask_number);
+        $format_information_array = ['101010000010010', '101000100100101',
+        '101111001111100', '101101101001011', '100010111111001', '100000011001110',
+        '100111110010111', '100101010100000', '111011111000100', '111001011110011',
+        '111110110101010', '111100010011101', '110011000101111', '110001100011000',
+        '110110001000001', '110100101110110', '001011010001001', '001001110111110',
+        '001110011100111', '001100111010000', '000011101100010', '000001001010101',
+        '000110100001100', '000100000111011', '011010101011111', '011000001101000',
+        '011111100110001', '011101000000110', '010010010110100', '010000110000011',
+        '010111011011010', '010101111101101'];
+        $i = 0;
+        while ($i < 15) {
+            $content = substr($format_information_array[$format_information_value], $i, 1);
+
+            $matrix_content[$format_information_x1[$i]][$format_information_y1[$i]] = $content * 255;
+            $matrix_content[$format_information_x2[$i + 1]][$format_information_y2[$i + 1]] = $content * 255;
+            ++$i;
+        }
+
+        $mib = $max_modules_1side;
+        if ($this->draw_quiet_zone) {
+            $mib += 8;
+        }
+
+        if ($this->size == 0) {
+            $this->size = $mib * $qrcode_module_size;
+            if ($this->size > 1480) {
+                throw new ImageSizeTooLargeException('QRCode: image size too large');
+            }
+        }
+
+        $image_width = $this->size + $this->padding * 2;
+        $image_height = $this->size + $this->padding * 2;
+
+        if (!empty($this->label)) {
+            if (!function_exists('imagettfbbox')) {
+                throw new FreeTypeLibraryMissingException('QRCode: missing function "imagettfbbox". Did you install the FreeType library?');
+            }
+            $font_box = imagettfbbox($this->label_font_size, 0, $this->label_font_path, $this->label);
+            $label_width = (int) $font_box[2] - (int) $font_box[0];
+            $label_height = (int) $font_box[0] - (int) $font_box[7];
+
+            if ($this->label_valign == self::LABEL_VALIGN_MIDDLE) {
+                $image_height += $label_height + $this->padding;
+            } else {
+                $image_height += $label_height;
+            }
+        }
+
+        $output_image = imagecreate($image_width, $image_height);
+        imagecolorallocate($output_image, 255, 255, 255);
+
+        $image_path = $image_path.'/qrv'.$qrcode_version.'.png';
+
+        $base_image = imagecreatefrompng($image_path);
+        $code_size = $this->size;
+        $module_size = function ($size = 1) use ($code_size, $base_image) {
+            return round($code_size / imagesx($base_image) * $size);
+        };
+
+        $col[1] = imagecolorallocate($base_image, 0, 0, 0);
+        $col[0] = imagecolorallocate($base_image, 255, 255, 255);
+
+        $i = 4;
+        $mxe = 4 + $max_modules_1side;
+        $ii = 0;
+        while ($i < $mxe) {
+            $j = 4;
+            $jj = 0;
+            while ($j < $mxe) {
+                if ($matrix_content[$ii][$jj] & $mask_content) {
+                    imagesetpixel($base_image, $i, $j, $col[1]);
+                }
+                ++$j;
+                ++$jj;
+            }
+            ++$i;
+            ++$ii;
+        }
+
+        if ($this->draw_quiet_zone == true) {
+            imagecopyresampled($output_image, $base_image, $this->padding, $this->padding, 0, 0, $this->size, $this->size, $mib, $mib);
+        } else {
+            imagecopyresampled($output_image, $base_image, $this->padding, $this->padding, 4, 4, $this->size, $this->size, $mib, $mib);
+        }
+
+        if ($this->draw_border == true) {
+            $border_width = $this->padding;
+            $border_height = $this->size + $this->padding - 1;
+            $border_color = imagecolorallocate($output_image, 0, 0, 0);
+            imagerectangle($output_image, $border_width, $border_width, $border_height, $border_height, $border_color);
+        }
+
+        if (!empty($this->label)) {
+            // Label horizontal alignment
+            switch ($this->label_halign) {
+                case self::LABEL_HALIGN_LEFT:
+                    $font_x = 0;
+                    break;
+
+                case self::LABEL_HALIGN_LEFT_BORDER:
+                    $font_x = $this->padding;
+                    break;
+
+                case self::LABEL_HALIGN_LEFT_CODE:
+                    if ($this->draw_quiet_zone == true) {
+                        $font_x = $this->padding + $module_size(4);
+                    } else {
+                        $font_x = $this->padding;
+                    }
+                    break;
+
+                case self::LABEL_HALIGN_RIGHT:
+                    $font_x = $this->size + ($this->padding * 2) - $label_width;
+                    break;
+
+                case self::LABEL_HALIGN_RIGHT_BORDER:
+                    $font_x = $this->size + $this->padding - $label_width;
+                    break;
+
+                case self::LABEL_HALIGN_RIGHT_CODE:
+                    if ($this->draw_quiet_zone == true) {
+                        $font_x = $this->size + $this->padding - $label_width - $module_size(4);
+                    } else {
+                        $font_x = $this->size + $this->padding - $label_width;
+                    }
+                    break;
+
+                default:
+                    $font_x = floor($image_width - $label_width) / 2;
+            }
+
+            // Label vertical alignment
+            switch ($this->label_valign) {
+                case self::LABEL_VALIGN_TOP_NO_BORDER:
+                    $font_y = $image_height - $this->padding - 1;
+                    break;
+
+                case self::LABEL_VALIGN_BOTTOM:
+                    $font_y = $image_height;
+                    break;
+
+                default:
+                    $font_y = $image_height - $this->padding;
+            }
+
+            $label_bg_x1 = $font_x - $module_size(2);
+            $label_bg_y1 = $font_y - $label_height;
+            $label_bg_x2 = $font_x + $label_width + $module_size(2);
+            $label_bg_y2 = $font_y;
+
+            $color = imagecolorallocate($output_image, 0, 0, 0);
+            $label_bg_color = imagecolorallocate($output_image, 255, 255, 255);
+
+            imagefilledrectangle($output_image, $label_bg_x1, $label_bg_y1, $label_bg_x2, $label_bg_y2, $label_bg_color);
+            imagettftext($output_image, $this->label_font_size, 0, $font_x, $font_y, $color, $this->label_font_path, $this->label);
+        }
+
+        $imagecolorset_function = new ReflectionFunction('imagecolorset');
+        $allow_alpha = $imagecolorset_function->getNumberOfParameters() == 6;
+
+        if ($this->color_background != null) {
+            $index = imagecolorclosest($output_image, 255, 255, 255);
+            if ($allow_alpha) {
+                imagecolorset($output_image, $index, $this->color_background['r'], $this->color_background['g'], $this->color_background['b'], $this->color_background['a']);
+            } else {
+                imagecolorset($output_image, $index, $this->color_background['r'], $this->color_background['g'], $this->color_background['b']);
+            }
+        }
+
+        if ($this->color_foreground != null) {
+            $index = imagecolorclosest($output_image, 0, 0, 0);
+            if ($allow_alpha) {
+                imagecolorset($output_image, $index, $this->color_foreground['r'], $this->color_foreground['g'], $this->color_foreground['b'], $this->color_foreground['a']);
+            } else {
+                imagecolorset($output_image, $index, $this->color_foreground['r'], $this->color_foreground['g'], $this->color_foreground['b']);
+            }
+        }
+
+        if (!empty($this->logo)) {
+            $output_image_org = $output_image;
+            $output_image = imagecreatetruecolor($image_width, $image_height);
+            imagecopy($output_image, $output_image_org, 0, 0, 0, 0, $image_width, $image_height);
+
+            $image_info = getimagesize($this->logo);
+
+            if ($image_info !== false) {
+                $image_type = strtolower(substr(image_type_to_extension($image_info [2]), 1));
+                $logo_image = call_user_func('imagecreatefrom'.$image_type, $this->logo);
+            } else {
+                $logo_image = call_user_func('imagecreatefrom'.$this->image_type, $this->logo);
+            }
+
+            if (!$logo_image) {
+                throw new ImageFunctionFailedException('imagecreatefrom'.$this->image_type.' '.$this->logo.' failed');
+            }
+            $src_w = imagesx($logo_image);
+            $src_h = imagesy($logo_image);
+
+            $dst_x = ($image_width - $this->logo_size) / 2;
+            $dst_y = ($this->size + $this->padding * 2 - $this->logo_size) / 2;
+
+            $successful = imagecopyresampled($output_image, $logo_image, $dst_x, $dst_y, 0, 0, $this->logo_size, $this->logo_size, $src_w, $src_h);
+            if (!$successful) {
+                throw new ImageFunctionFailedException('add logo [image'.$this->format.'] failed.');
+            }
+            imagedestroy($logo_image);
+        }
+        $this->image = $output_image;
     }
     }
 }
 }

+ 9 - 21
vendor/endroid/qr-code/tests/Bundle/Controller/QrCodeControllerTest.php

@@ -10,36 +10,24 @@
 namespace Endroid\QrCode\Tests\Bundle\Controller;
 namespace Endroid\QrCode\Tests\Bundle\Controller;
 
 
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
-use Symfony\Component\HttpFoundation\Response;
 
 
 class QrCodeControllerTest extends WebTestCase
 class QrCodeControllerTest extends WebTestCase
 {
 {
-    public function testGenerateAction()
+    /**
+     * Tests if the QR code generation route returns a success response.
+     */
+    public function testCreateQrCode()
     {
     {
         $client = static::createClient();
         $client = static::createClient();
-        $client->request('GET', $client->getContainer()->get('router')->generate('endroid_qrcode_generate', [
+
+        $client->request('GET', $client->getContainer()->get('router')->generate('endroid_qrcode', [
             'text' => 'Life is too short to be generating QR codes',
             'text' => 'Life is too short to be generating QR codes',
             'extension' => 'png',
             'extension' => 'png',
-            'size' => 200,
-            'margin' => 10,
-            'label' => 'Scan the code',
+            'size' => 150,
+            'label' => 'Dit is een label',
             'label_font_size' => 16,
             'label_font_size' => 16,
         ]));
         ]));
 
 
-        $response = $client->getResponse();
-        $image = imagecreatefromstring($response->getContent());
-
-        $this->assertTrue(220 == imagesx($image));
-        $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
-    }
-
-    public function testTwigFunctionsAction()
-    {
-        $client = static::createClient();
-        $client->request('GET', $client->getContainer()->get('router')->generate('endroid_qrcode_twig_functions'));
-
-        $response = $client->getResponse();
-
-        $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
+        $this->assertEquals(200, $client->getResponse()->getStatusCode());
     }
     }
 }
 }

+ 2 - 2
vendor/endroid/qr-code/tests/Bundle/EndroidQrCodeBundleTest.php

@@ -9,9 +9,9 @@
 
 
 namespace Endroid\QrCode\Tests\Bundle;
 namespace Endroid\QrCode\Tests\Bundle;
 
 
-use PHPUnit\Framework\TestCase;
+use PHPUnit_Framework_TestCase;
 
 
-class EndroidQrCodeBundleTest extends TestCase
+class EndroidQrCodeBundleTest extends PHPUnit_Framework_TestCase
 {
 {
     public function testNoTestsYet()
     public function testNoTestsYet()
     {
     {

+ 2 - 2
vendor/endroid/qr-code/tests/Bundle/app/AppKernel.php

@@ -19,8 +19,8 @@ class AppKernel extends Kernel
     {
     {
         $bundles = [
         $bundles = [
             new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
             new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
-            new Symfony\Bundle\TwigBundle\TwigBundle(),
-            new Endroid\QrCode\Bundle\QrCodeBundle\EndroidQrCodeBundle(),
+            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+            new Endroid\QrCode\Bundle\EndroidQrCodeBundle(),
         ];
         ];
 
 
         return $bundles;
         return $bundles;

+ 4 - 0
vendor/endroid/qr-code/tests/Bundle/app/bootstrap.php

@@ -1,3 +1,7 @@
 <?php
 <?php
 
 
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
 $loader = require __DIR__.'/../../../vendor/autoload.php';
 $loader = require __DIR__.'/../../../vendor/autoload.php';
+
+AnnotationRegistry::registerLoader([$loader, 'loadClass']);

+ 1 - 3
vendor/endroid/qr-code/tests/Bundle/app/config/config.yml

@@ -1,8 +1,6 @@
 framework:
 framework:
     test: ~
     test: ~
     secret: ThisTokenIsNotSoSecretChangeIt
     secret: ThisTokenIsNotSoSecretChangeIt
-    templating:
-        engines: ['twig']
     router:
     router:
         resource: "%kernel.root_dir%/config/routing.yml"
         resource: "%kernel.root_dir%/config/routing.yml"
-        strict_requirements: ~
+        strict_requirements: ~

+ 2 - 1
vendor/endroid/qr-code/tests/Bundle/app/config/routing.yml

@@ -1,3 +1,4 @@
 EndroidQrCodeBundle:
 EndroidQrCodeBundle:
-    resource: "@EndroidQrCodeBundle/Resources/config/routing.yml"
+    resource: "@EndroidQrCodeBundle/Controller/"
+    type: annotation
     prefix: /qrcode
     prefix: /qrcode

+ 86 - 86
vendor/endroid/qr-code/tests/QrCodeTest.php

@@ -7,116 +7,116 @@
  * with this source code in the file LICENSE.
  * with this source code in the file LICENSE.
  */
  */
 
 
-namespace Endroid\QrCode\Tests;
+namespace Endroid\Tests\QrCode;
 
 
-use Endroid\QrCode\Factory\QrCodeFactory;
+use Endroid\QrCode\Exceptions\ImageFunctionFailedException;
+use Endroid\QrCode\Exceptions\ImageFunctionUnknownException;
 use Endroid\QrCode\QrCode;
 use Endroid\QrCode\QrCode;
-use PHPUnit\Framework\TestCase;
+use PHPUnit_Framework_TestCase;
 
 
-class QrCodeTest extends TestCase
+class QrCodeTest extends PHPUnit_Framework_TestCase
 {
 {
-    public function testReadable()
+    /**
+     * @var QrCode
+     */
+    protected $qrCode;
+
+    /**
+     * Tests if a valid data uri is returned.
+     */
+    public function testGetDataUri()
     {
     {
-        $messages = [
-            'Tiny',
-            'This one has spaces',
-            'd2llMS9uU01BVmlvalM2YU9BUFBPTTdQMmJabHpqdndt',
-            'http://this.is.an/url?with=query&string=attached',
-            '11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111',
-            '{"i":"serialized.data","v":1,"t":1,"d":"4AEPc9XuIQ0OjsZoSRWp9DRWlN6UyDvuMlyOYy8XjOw="}',
-            'Spëci&al ch@ract3rs',
-            '有限公司',
-        ];
-
-        foreach ($messages as $message) {
-            $qrCode = new QrCode($message);
-            $qrCode->setSize(300);
-            $qrCode->setValidateResult(true);
-            $pngData = $qrCode->writeString();
-            $this->assertTrue(is_string($pngData));
-        }
+        $qrCode = $this->getQrCode();
+        $dataUri = $qrCode->getDataUri();
+
+        $this->assertTrue(is_string($dataUri));
     }
     }
 
 
-    public function testFactory()
+    /**
+     * Tests if a valid image string is returned.
+     *
+     * @throws ImageFunctionFailedException
+     * @throws ImageFunctionUnknownException
+     */
+    public function testGetImageString()
     {
     {
-        $qrCodeFactory = new QrCodeFactory();
-        $qrCode = $qrCodeFactory->create('QR Code', [
-            'writer' => 'png',
-            'size' => 300,
-            'margin' => 10,
-        ]);
-
-        $pngData = $qrCode->writeString();
-        $this->assertTrue(is_string($pngData));
+        $qrCode = $this->getQrCode();
+        $imageString = $qrCode->get('png');
+
+        $this->assertTrue(is_string($imageString));
     }
     }
 
 
-    public function testWriteQrCode()
+    /**
+     * Tests if a valid image string is returned.
+     *
+     * @throws ImageFunctionFailedException
+     * @throws ImageFunctionUnknownException
+     */
+    public function testGetQrCodeWithLogoString()
     {
     {
-        $qrCode = new QrCode('QrCode');
-
-        $qrCode->setWriterByName('binary');
-        $binData = $qrCode->writeString();
-        $this->assertTrue(is_string($binData));
-
-        $qrCode->setWriterByName('debug');
-        $debugData = $qrCode->writeString();
-        $this->assertTrue(is_string($debugData));
-
-        $qrCode->setWriterByName('eps');
-        $epsData = $qrCode->writeString();
-        $this->assertTrue(is_string($epsData));
-
-        $qrCode->setWriterByName('png');
-        $pngData = $qrCode->writeString();
-        $this->assertTrue(is_string($pngData));
-        $pngDataUriData = $qrCode->writeDataUri();
-        $this->assertTrue(0 === strpos($pngDataUriData, 'data:image/png;base64'));
-
-        $qrCode->setWriterByName('svg');
-        $svgData = $qrCode->writeString();
-        $this->assertTrue(is_string($svgData));
-        $svgDataUriData = $qrCode->writeDataUri();
-        $this->assertTrue(0 === strpos($svgDataUriData, 'data:image/svg+xml;base64'));
+        $qrCode = $this->createQrCodeWithLogo();
+        $imageString = $qrCode->get('png');
+
+        $this->assertTrue(is_string($imageString));
     }
     }
 
 
-    public function testSetSize()
+    /**
+     * For https://github.com/endroid/QrCode/issues/49.
+     */
+    public function testRenderHttpAddress()
     {
     {
-        $size = 400;
-        $margin = 10;
+        $qrCode = new QrCode();
+        $qrCode
+            ->setText('http://www.example.com/it/it/contact/qr/hit/id/1  ')
+            ->setExtension('png')
+            ->setSize(300)
+            ->setPadding(10)
+            ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0])
+            ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0])
+            ->setErrorCorrection(QrCode::LEVEL_MEDIUM);
 
 
-        $qrCode = new QrCode('QrCode');
-        $qrCode->setSize($size);
-        $qrCode->setMargin($margin);
+        $qrCode->get('png');
+    }
 
 
-        $pngData = $qrCode->writeString();
-        $image = imagecreatefromstring($pngData);
+    /**
+     * Returns a QR code.
+     */
+    protected function getQrCode()
+    {
+        if (!$this->qrCode) {
+            $this->qrCode = $this->createQrCode();
+        }
 
 
-        $this->assertTrue(imagesx($image) === $size + 2 * $margin);
-        $this->assertTrue(imagesy($image) === $size + 2 * $margin);
+        return $this->qrCode;
     }
     }
 
 
-    public function testSetLabel()
+    /**
+     * Creates a QR code.
+     *
+     * @return QrCode
+     */
+    protected function createQrCode()
     {
     {
-        $qrCode = new QrCode('QrCode');
-        $qrCode
-            ->setSize(300)
-            ->setLabel('Scan the code', 15)
-        ;
+        $qrCode = new QrCode();
+        $qrCode->setText('Life is too short to be generating QR codes');
+        $qrCode->setSize(300);
 
 
-        $pngData = $qrCode->writeString();
-        $this->assertTrue(is_string($pngData));
+        return $qrCode;
     }
     }
 
 
-    public function testSetLogo()
+    /**
+     * Creates a QR code with a logo.
+     *
+     * @return QrCode
+     */
+    protected function createQrCodeWithLogo()
     {
     {
-        $qrCode = new QrCode('QrCode');
-        $qrCode
-            ->setSize(400)
-            ->setLogoPath(__DIR__.'/../assets/symfony.png')
-            ->setLogoWidth(150)
-            ->setValidateResult(true);
+        $qrCode = new QrCode();
+        $qrCode->setText('Life is too short to be generating QR codes')
+        ->setSize(300)
+        ->setLogo(dirname(__DIR__).'/assets/image/logo.png')
+        ->setLogoSize(60);
 
 
-        $pngData = $qrCode->writeString();
-        $this->assertTrue(is_string($pngData));
+        return $qrCode;
     }
     }
 }
 }

+ 2 - 2
vendor/myclabs/php-enum/LICENSE

@@ -1,6 +1,6 @@
-The MIT License (MIT)
+php-enum - PHP Enum implementation http://github.com/myclabs/php-enum
 
 
-Copyright (c) 2015 My C-Labs
+Copyright (C) 2015 My C-Labs
 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 associated documentation files (the "Software"), to deal in the Software without restriction,
 associated documentation files (the "Software"), to deal in the Software without restriction,

+ 12 - 22
vendor/myclabs/php-enum/README.md

@@ -3,18 +3,14 @@
 [![Build Status](https://travis-ci.org/myclabs/php-enum.png?branch=master)](https://travis-ci.org/myclabs/php-enum)
 [![Build Status](https://travis-ci.org/myclabs/php-enum.png?branch=master)](https://travis-ci.org/myclabs/php-enum)
 [![Latest Stable Version](https://poser.pugx.org/myclabs/php-enum/version.png)](https://packagist.org/packages/myclabs/php-enum)
 [![Latest Stable Version](https://poser.pugx.org/myclabs/php-enum/version.png)](https://packagist.org/packages/myclabs/php-enum)
 [![Total Downloads](https://poser.pugx.org/myclabs/php-enum/downloads.png)](https://packagist.org/packages/myclabs/php-enum)
 [![Total Downloads](https://poser.pugx.org/myclabs/php-enum/downloads.png)](https://packagist.org/packages/myclabs/php-enum)
-[![psalm](https://shepherd.dev/github/myclabs/php-enum/coverage.svg)](https://shepherd.dev/github/myclabs/php-enum)
-
-Maintenance for this project is [supported via Tidelift](https://tidelift.com/subscription/pkg/packagist-myclabs-php-enum?utm_source=packagist-myclabs-php-enum&utm_medium=referral&utm_campaign=readme).
 
 
 ## Why?
 ## Why?
 
 
-First, and mainly, `SplEnum` is not integrated to PHP, you have to install the extension separately.
+First, and mainly, `SplEnum` is not integrated to PHP, you have to install it separately.
 
 
 Using an enum instead of class constants provides the following advantages:
 Using an enum instead of class constants provides the following advantages:
 
 
-- You can use an enum as a parameter type: `function setAction(Action $action) {`
-- You can use an enum as a return type: `function getAction() : Action {`
+- You can type-hint: `function setAction(Action $action) {`
 - You can enrich the enum with methods (e.g. `format`, `parse`, …)
 - You can enrich the enum with methods (e.g. `format`, `parse`, …)
 - You can extend the enum to add new values (make your enum `final` to prevent it)
 - You can extend the enum to add new values (make your enum `final` to prevent it)
 - You can get a list of all the possible values (see below)
 - You can get a list of all the possible values (see below)
@@ -35,29 +31,27 @@ use MyCLabs\Enum\Enum;
 /**
 /**
  * Action enum
  * Action enum
  */
  */
-final class Action extends Enum
+class Action extends Enum
 {
 {
     private const VIEW = 'view';
     private const VIEW = 'view';
     private const EDIT = 'edit';
     private const EDIT = 'edit';
 }
 }
 ```
 ```
 
 
+Note the `private` keyword requires PHP > 7.1, you can omit it on PHP 7.0.
+
 ## Usage
 ## Usage
 
 
 ```php
 ```php
-$action = Action::VIEW();
+$action = new Action(Action::VIEW);
 
 
-// or with a dynamic key:
-$action = Action::$key();
-// or with a dynamic value:
-$action = Action::from($value);
 // or
 // or
-$action = new Action($value);
+$action = Action::VIEW();
 ```
 ```
 
 
 As you can see, static methods are automatically implemented to provide quick access to an enum value.
 As you can see, static methods are automatically implemented to provide quick access to an enum value.
 
 
-One advantage over using class constants is to be able to use an enum as a parameter type:
+One advantage over using class constants is to be able to type-hint enum values:
 
 
 ```php
 ```php
 function setAction(Action $action) {
 function setAction(Action $action) {
@@ -75,19 +69,17 @@ function setAction(Action $action) {
 
 
 Static methods:
 Static methods:
 
 
-- `from()` Creates an Enum instance, checking that the value exist in the enum
 - `toArray()` method Returns all possible values as an array (constant name in key, constant value in value)
 - `toArray()` method Returns all possible values as an array (constant name in key, constant value in value)
 - `keys()` Returns the names (keys) of all constants in the Enum class
 - `keys()` Returns the names (keys) of all constants in the Enum class
 - `values()` Returns instances of the Enum class of all Enum constants (constant name in key, Enum instance in value)
 - `values()` Returns instances of the Enum class of all Enum constants (constant name in key, Enum instance in value)
 - `isValid()` Check if tested value is valid on enum set
 - `isValid()` Check if tested value is valid on enum set
 - `isValidKey()` Check if tested key is valid on enum set
 - `isValidKey()` Check if tested key is valid on enum set
-- `assertValidValue()` Assert the value is valid on enum set, throwing exception otherwise
 - `search()` Return key for searched value
 - `search()` Return key for searched value
 
 
 ### Static methods
 ### Static methods
 
 
 ```php
 ```php
-final class Action extends Enum
+class Action extends Enum
 {
 {
     private const VIEW = 'view';
     private const VIEW = 'view';
     private const EDIT = 'edit';
     private const EDIT = 'edit';
@@ -103,7 +95,7 @@ Static method helpers are implemented using [`__callStatic()`](http://www.php.ne
 If you care about IDE autocompletion, you can either implement the static methods yourself:
 If you care about IDE autocompletion, you can either implement the static methods yourself:
 
 
 ```php
 ```php
-final class Action extends Enum
+class Action extends Enum
 {
 {
     private const VIEW = 'view';
     private const VIEW = 'view';
 
 
@@ -123,7 +115,7 @@ or you can use phpdoc (this is supported in PhpStorm for example):
  * @method static Action VIEW()
  * @method static Action VIEW()
  * @method static Action EDIT()
  * @method static Action EDIT()
  */
  */
-final class Action extends Enum
+class Action extends Enum
 {
 {
     private const VIEW = 'view';
     private const VIEW = 'view';
     private const EDIT = 'edit';
     private const EDIT = 'edit';
@@ -133,6 +125,4 @@ final class Action extends Enum
 ## Related projects
 ## Related projects
 
 
 - [Doctrine enum mapping](https://github.com/acelaya/doctrine-enum-type)
 - [Doctrine enum mapping](https://github.com/acelaya/doctrine-enum-type)
-- [Symfony ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter)
-- [PHPStan integration](https://github.com/timeweb/phpstan-enum)
-- [Yii2 enum mapping](https://github.com/KartaviK/yii2-enum)
+- [Symfony 2/3 ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter)

+ 3 - 4
vendor/myclabs/php-enum/composer.json

@@ -22,12 +22,11 @@
         }
         }
     },
     },
     "require": {
     "require": {
-        "php": "^7.3 || ^8.0",
+        "php": ">=5.4",
         "ext-json": "*"
         "ext-json": "*"
     },
     },
     "require-dev": {
     "require-dev": {
-        "phpunit/phpunit": "^9.5",
-        "squizlabs/php_codesniffer": "1.*",
-        "vimeo/psalm": "^4.6.2"
+        "phpunit/phpunit": "^4.8.35|^5.7|^6.0",
+        "squizlabs/php_codesniffer": "1.*"
     }
     }
 }
 }

+ 22 - 136
vendor/myclabs/php-enum/src/Enum.php

@@ -14,10 +14,6 @@ namespace MyCLabs\Enum;
  * @author Matthieu Napoli <matthieu@mnapoli.fr>
  * @author Matthieu Napoli <matthieu@mnapoli.fr>
  * @author Daniel Costa <danielcosta@gmail.com>
  * @author Daniel Costa <danielcosta@gmail.com>
  * @author Mirosław Filip <mirfilip@gmail.com>
  * @author Mirosław Filip <mirfilip@gmail.com>
- *
- * @psalm-template T
- * @psalm-immutable
- * @psalm-consistent-constructor
  */
  */
 abstract class Enum implements \JsonSerializable
 abstract class Enum implements \JsonSerializable
 {
 {
@@ -25,88 +21,40 @@ abstract class Enum implements \JsonSerializable
      * Enum value
      * Enum value
      *
      *
      * @var mixed
      * @var mixed
-     * @psalm-var T
      */
      */
     protected $value;
     protected $value;
 
 
     /**
     /**
-     * Enum key, the constant name
-     *
-     * @var string
-     */
-    private $key;
-
-    /**
      * Store existing constants in a static cache per object.
      * Store existing constants in a static cache per object.
      *
      *
-     *
      * @var array
      * @var array
-     * @psalm-var array<class-string, array<string, mixed>>
      */
      */
     protected static $cache = [];
     protected static $cache = [];
 
 
     /**
     /**
-     * Cache of instances of the Enum class
-     *
-     * @var array
-     * @psalm-var array<class-string, array<string, static>>
-     */
-    protected static $instances = [];
-
-    /**
      * Creates a new value of some type
      * Creates a new value of some type
      *
      *
-     * @psalm-pure
      * @param mixed $value
      * @param mixed $value
      *
      *
-     * @psalm-param T $value
      * @throws \UnexpectedValueException if incompatible type is given.
      * @throws \UnexpectedValueException if incompatible type is given.
      */
      */
     public function __construct($value)
     public function __construct($value)
     {
     {
         if ($value instanceof static) {
         if ($value instanceof static) {
-           /** @psalm-var T */
-            $value = $value->getValue();
-        }
+            $this->value = $value->getValue();
 
 
-        /** @psalm-suppress ImplicitToStringCast assertValidValueReturningKey returns always a string but psalm has currently an issue here */
-        $this->key = static::assertValidValueReturningKey($value);
-
-        /** @psalm-var T */
-        $this->value = $value;
-    }
-
-    /**
-     * This method exists only for the compatibility reason when deserializing a previously serialized version
-     * that didn't had the key property
-     */
-    public function __wakeup()
-    {
-        /** @psalm-suppress DocblockTypeContradiction key can be null when deserializing an enum without the key */
-        if ($this->key === null) {
-            /**
-             * @psalm-suppress InaccessibleProperty key is not readonly as marked by psalm
-             * @psalm-suppress PossiblyFalsePropertyAssignmentValue deserializing a case that was removed
-             */
-            $this->key = static::search($this->value);
+            return;
         }
         }
-    }
 
 
-    /**
-     * @param mixed $value
-     * @return static
-     */
-    public static function from($value): self
-    {
-        $key = static::assertValidValueReturningKey($value);
+        if (!$this->isValid($value)) {
+            throw new \UnexpectedValueException("Value '$value' is not part of the enum " . \get_called_class());
+        }
 
 
-        return self::__callStatic($key, []);
+        $this->value = $value;
     }
     }
 
 
     /**
     /**
-     * @psalm-pure
      * @return mixed
      * @return mixed
-     * @psalm-return T
      */
      */
     public function getValue()
     public function getValue()
     {
     {
@@ -116,17 +64,14 @@ abstract class Enum implements \JsonSerializable
     /**
     /**
      * Returns the enum key (i.e. the constant name).
      * Returns the enum key (i.e. the constant name).
      *
      *
-     * @psalm-pure
-     * @return string
+     * @return mixed
      */
      */
     public function getKey()
     public function getKey()
     {
     {
-        return $this->key;
+        return static::search($this->value);
     }
     }
 
 
     /**
     /**
-     * @psalm-pure
-     * @psalm-suppress InvalidCast
      * @return string
      * @return string
      */
      */
     public function __toString()
     public function __toString()
@@ -135,27 +80,20 @@ abstract class Enum implements \JsonSerializable
     }
     }
 
 
     /**
     /**
-     * Determines if Enum should be considered equal with the variable passed as a parameter.
-     * Returns false if an argument is an object of different class or not an object.
+     * Compares one Enum with another.
      *
      *
      * This method is final, for more information read https://github.com/myclabs/php-enum/issues/4
      * This method is final, for more information read https://github.com/myclabs/php-enum/issues/4
      *
      *
-     * @psalm-pure
-     * @psalm-param mixed $variable
-     * @return bool
+     * @return bool True if Enums are equal, false if not equal
      */
      */
-    final public function equals($variable = null): bool
+    final public function equals(Enum $enum = null)
     {
     {
-        return $variable instanceof self
-            && $this->getValue() === $variable->getValue()
-            && static::class === \get_class($variable);
+        return $enum !== null && $this->getValue() === $enum->getValue() && \get_called_class() === \get_class($enum);
     }
     }
 
 
     /**
     /**
      * Returns the names (keys) of all constants in the Enum class
      * Returns the names (keys) of all constants in the Enum class
      *
      *
-     * @psalm-pure
-     * @psalm-return list<string>
      * @return array
      * @return array
      */
      */
     public static function keys()
     public static function keys()
@@ -166,15 +104,12 @@ abstract class Enum implements \JsonSerializable
     /**
     /**
      * Returns instances of the Enum class of all Enum constants
      * Returns instances of the Enum class of all Enum constants
      *
      *
-     * @psalm-pure
-     * @psalm-return array<string, static>
      * @return static[] Constant name in key, Enum instance in value
      * @return static[] Constant name in key, Enum instance in value
      */
      */
     public static function values()
     public static function values()
     {
     {
         $values = array();
         $values = array();
 
 
-        /** @psalm-var T $value */
         foreach (static::toArray() as $key => $value) {
         foreach (static::toArray() as $key => $value) {
             $values[$key] = new static($value);
             $values[$key] = new static($value);
         }
         }
@@ -185,20 +120,13 @@ abstract class Enum implements \JsonSerializable
     /**
     /**
      * Returns all possible values as an array
      * Returns all possible values as an array
      *
      *
-     * @psalm-pure
-     * @psalm-suppress ImpureStaticProperty
-     *
-     * @psalm-return array<string, mixed>
      * @return array Constant name in key, constant value in value
      * @return array Constant name in key, constant value in value
      */
      */
     public static function toArray()
     public static function toArray()
     {
     {
-        $class = static::class;
-
+        $class = \get_called_class();
         if (!isset(static::$cache[$class])) {
         if (!isset(static::$cache[$class])) {
-            /** @psalm-suppress ImpureMethodCall this reflection API usage has no side-effects here */
             $reflection            = new \ReflectionClass($class);
             $reflection            = new \ReflectionClass($class);
-            /** @psalm-suppress ImpureMethodCall this reflection API usage has no side-effects here */
             static::$cache[$class] = $reflection->getConstants();
             static::$cache[$class] = $reflection->getConstants();
         }
         }
 
 
@@ -209,9 +137,7 @@ abstract class Enum implements \JsonSerializable
      * Check if is valid enum value
      * Check if is valid enum value
      *
      *
      * @param $value
      * @param $value
-     * @psalm-param mixed $value
-     * @psalm-pure
-     * @psalm-assert-if-true T $value
+     *
      * @return bool
      * @return bool
      */
      */
     public static function isValid($value)
     public static function isValid($value)
@@ -220,40 +146,10 @@ abstract class Enum implements \JsonSerializable
     }
     }
 
 
     /**
     /**
-     * Asserts valid enum value
-     *
-     * @psalm-pure
-     * @psalm-assert T $value
-     * @param mixed $value
-     */
-    public static function assertValidValue($value): void
-    {
-        self::assertValidValueReturningKey($value);
-    }
-
-    /**
-     * Asserts valid enum value
-     *
-     * @psalm-pure
-     * @psalm-assert T $value
-     * @param mixed $value
-     * @return string
-     */
-    private static function assertValidValueReturningKey($value): string
-    {
-        if (false === ($key = static::search($value))) {
-            throw new \UnexpectedValueException("Value '$value' is not part of the enum " . static::class);
-        }
-
-        return $key;
-    }
-
-    /**
      * Check if is valid enum key
      * Check if is valid enum key
      *
      *
      * @param $key
      * @param $key
-     * @psalm-param string $key
-     * @psalm-pure
+     *
      * @return bool
      * @return bool
      */
      */
     public static function isValidKey($key)
     public static function isValidKey($key)
@@ -266,11 +162,9 @@ abstract class Enum implements \JsonSerializable
     /**
     /**
      * Return key for value
      * Return key for value
      *
      *
-     * @param mixed $value
+     * @param $value
      *
      *
-     * @psalm-param mixed $value
-     * @psalm-pure
-     * @return string|false
+     * @return mixed
      */
      */
     public static function search($value)
     public static function search($value)
     {
     {
@@ -285,21 +179,15 @@ abstract class Enum implements \JsonSerializable
      *
      *
      * @return static
      * @return static
      * @throws \BadMethodCallException
      * @throws \BadMethodCallException
-     *
-     * @psalm-pure
      */
      */
     public static function __callStatic($name, $arguments)
     public static function __callStatic($name, $arguments)
     {
     {
-        $class = static::class;
-        if (!isset(self::$instances[$class][$name])) {
-            $array = static::toArray();
-            if (!isset($array[$name]) && !\array_key_exists($name, $array)) {
-                $message = "No static method or enum constant '$name' in class " . static::class;
-                throw new \BadMethodCallException($message);
-            }
-            return self::$instances[$class][$name] = new static($array[$name]);
+        $array = static::toArray();
+        if (isset($array[$name]) || \array_key_exists($name, $array)) {
+            return new static($array[$name]);
         }
         }
-        return clone self::$instances[$class][$name];
+
+        throw new \BadMethodCallException("No static method or enum constant '$name' in class " . \get_called_class());
     }
     }
 
 
     /**
     /**
@@ -308,9 +196,7 @@ abstract class Enum implements \JsonSerializable
      *
      *
      * @return mixed
      * @return mixed
      * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
      * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
-     * @psalm-pure
      */
      */
-    #[\ReturnTypeWillChange]
     public function jsonSerialize()
     public function jsonSerialize()
     {
     {
         return $this->getValue();
         return $this->getValue();

+ 11 - 0
vendor/qiniu/php-sdk/CHANGELOG.md

@@ -1,5 +1,16 @@
 # Changelog
 # Changelog
 
 
+## 7.6.0 (2022-06-08)
+* 对象存储,管理类 API 发送请求时增加 [X-Qiniu-Date](https://developer.qiniu.com/kodo/3924/common-request-headers) (生成请求的时间) header
+## 7.5.0 (2022-04-18)
+* 对象存储,新增支持 [深度归档存储类型](https://developer.qiniu.com/kodo/3956/kodo-category#deep_archive)
+
+## 7.4.3 (2022-04-01)
+* 优化签名算法逻辑
+
+## 7.4.2(2022-03-01)
+* 修复已知关于请求 Header 处理不当问题,比如没有处理为大小写不敏感等问题
+
 ## 7.4.1(2021-09-24)
 ## 7.4.1(2021-09-24)
 * 修复了 分片上传 v2 已知问题,明确给出了参数不合理情况下对应的错误提示信息
 * 修复了 分片上传 v2 已知问题,明确给出了参数不合理情况下对应的错误提示信息
 
 

+ 4 - 0
vendor/qiniu/php-sdk/autoload.php

@@ -1,5 +1,9 @@
 <?php
 <?php
 
 
+if ( file_exists(dirname(__FILE__).'/vendor/autoload.php') ) {
+    require_once dirname(__FILE__).'/vendor/autoload.php';
+}
+
 function classLoader($class)
 function classLoader($class)
 {
 {
     $path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
     $path = str_replace('\\', DIRECTORY_SEPARATOR, $class);

+ 2 - 1
vendor/qiniu/php-sdk/composer.json

@@ -18,7 +18,8 @@
         }
         }
     ],
     ],
     "require": {
     "require": {
-        "php": ">=5.3.3"
+        "php": ">=5.3.3",
+        "myclabs/php-enum": "1.6.6"
     },
     },
     "require-dev": {
     "require-dev": {
         "paragonie/random_compat": ">=2",
         "paragonie/random_compat": ">=2",

+ 5 - 1
vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php

@@ -21,13 +21,17 @@ $name = 'demo';   // 生命周期规则名称
 $prefix = 'test'; // 规则策略中的前缀
 $prefix = 'test'; // 规则策略中的前缀
 $delete_after_days = 80; // 用户新创建的文件将在该设定时间之后自动删除
 $delete_after_days = 80; // 用户新创建的文件将在该设定时间之后自动删除
 $to_line_after_days = 70; // 用户新创建的文件将在该设定的时间之后自动转为低频存储
 $to_line_after_days = 70; // 用户新创建的文件将在该设定的时间之后自动转为低频存储
+$to_archive_after_days = 72; // 用户新创建的文件将在该设定的时间之后自动转为归档存储
+$to_deep_archive_after_days = 74; // 用户新创建的文件将在该设定的时间之后自动转为深度归档存储
 
 
 list($ret, $err) = $bucketManager->bucketLifecycleRule(
 list($ret, $err) = $bucketManager->bucketLifecycleRule(
     $bucket,
     $bucket,
     $name,
     $name,
     $prefix,
     $prefix,
     $delete_after_days,
     $delete_after_days,
-    $to_line_after_days
+    $to_line_after_days,
+    $to_archive_after_days,
+    $to_deep_archive_after_days
 );
 );
 if ($err != null) {
 if ($err != null) {
     var_dump($err);
     var_dump($err);

+ 7 - 2
vendor/qiniu/php-sdk/examples/rs_batch_change_type.php

@@ -25,12 +25,17 @@ $keys = array(
 
 
 $keyTypePairs = array();
 $keyTypePairs = array();
 
 
-// type=0表示普通存储,type=1表示低频存储
+// key 是文件
+// value 是存储类型(fileType)
+// 0 表示普通存储
+// 1 表示低频存储
+// 2 表示归档存储
+// 3 表示深度归档存储
 foreach ($keys as $key) {
 foreach ($keys as $key) {
     $keyTypePairs[$key] = 1;
     $keyTypePairs[$key] = 1;
 }
 }
 
 
-$ops = $bucketManager->buildBatchChangeType($bucket, $keyTypePairs);
+$ops = BucketManager::buildBatchChangeType($bucket, $keyTypePairs);
 list($ret, $err) = $bucketManager->batch($ops);
 list($ret, $err) = $bucketManager->batch($ops);
 if ($err != null) {
 if ($err != null) {
     var_dump($err);
     var_dump($err);

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_change_mime.php

@@ -21,7 +21,9 @@ $bucketManager = new BucketManager($auth, $config);
 $key = 'qiniu.mp4';
 $key = 'qiniu.mp4';
 $newMime = 'video/x-mp4';
 $newMime = 'video/x-mp4';
 
 
-$err = $bucketManager->changeMime($bucket, $key, $newMime);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->changeMime($bucket, $key, $newMime);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_change_status.php

@@ -21,7 +21,9 @@ $status = 1;// 启用:0,禁用:1
 
 
 $key = "qiniu.jpg";
 $key = "qiniu.jpg";
 
 
-$err = $bucketManager->changeStatus($bucket, $key, $status);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->changeStatus($bucket, $key, $status);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 6 - 4
vendor/qiniu/php-sdk/examples/rs_change_type.php

@@ -21,9 +21,11 @@ $bucketManager = new BucketManager($auth, $config);
 // 参考文档:https://developer.qiniu.com/kodo/api/3710/chtype
 // 参考文档:https://developer.qiniu.com/kodo/api/3710/chtype
 
 
 $key = "qiniu.mp4";
 $key = "qiniu.mp4";
-$fileType = 1; // 0 表示标准存储;1 表示低频存储;2 表示归档存储
+$fileType = 1; // 0 表示标准存储;1 表示低频存储;2 表示归档存储;3 表示深度归档存储
 
 
-$err = $bucketManager->changeType($bucket, $key, $fileType);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->changeType($bucket, $key, $fileType);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_copy.php

@@ -25,7 +25,9 @@ $destBucket = $bucket;
 $srcKey = $key;
 $srcKey = $key;
 $destKey = $key . "_copy";
 $destKey = $key . "_copy";
 
 
-$err = $bucketManager->copy($srcBucket, $srcKey, $destBucket, $destKey, true);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->copy($srcBucket, $srcKey, $destBucket, $destKey, true);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_delete.php

@@ -19,7 +19,9 @@ $bucketManager = new BucketManager($auth, $config);
 
 
 $key = "qiniu.mp4_copy";
 $key = "qiniu.mp4_copy";
 
 
-$err = $bucketManager->delete($bucket, $key);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->delete($bucket, $key);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_delete_after_days.php

@@ -18,7 +18,9 @@ $bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
 $key = 'qiniu.mp4';
 $key = 'qiniu.mp4';
 $days = 10; // 设置为 0 表示取消生命周期
 $days = 10; // 设置为 0 表示取消生命周期
 
 
-$err = $bucketManager->deleteAfterDays($bucket, $key, $days);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->deleteAfterDays($bucket, $key, $days);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_move.php

@@ -21,7 +21,9 @@ $destKey = $key . "_move";
 // 资源移动或者重命名
 // 资源移动或者重命名
 // 参考文档:https://developer.qiniu.com/kodo/api/1288/move
 // 参考文档:https://developer.qiniu.com/kodo/api/1288/move
 
 
-$err = $bucketManager->move($srcBucket, $srcKey, $destBucket, $destKey, true);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->move($srcBucket, $srcKey, $destBucket, $destKey, true);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 5 - 3
vendor/qiniu/php-sdk/examples/rs_prefetch.php

@@ -17,7 +17,9 @@ $bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
 // 镜像资源更新
 // 镜像资源更新
 // 参考文档:https://developer.qiniu.com/kodo/api/1293/prefetch
 // 参考文档:https://developer.qiniu.com/kodo/api/1293/prefetch
 
 
-$err = $bucketManager->prefetch($bucket, $key);
-if ($err) {
-    print_r($err);
+list($ret, $err) = $bucketManager->prefetch($bucket, $key);
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
 }
 }

+ 105 - 39
vendor/qiniu/php-sdk/src/Qiniu/Auth.php

@@ -1,17 +1,26 @@
 <?php
 <?php
 namespace Qiniu;
 namespace Qiniu;
 
 
+use Qiniu\Http\Header;
 use Qiniu\Zone;
 use Qiniu\Zone;
 
 
 final class Auth
 final class Auth
 {
 {
     private $accessKey;
     private $accessKey;
     private $secretKey;
     private $secretKey;
+    public $options;
 
 
-    public function __construct($accessKey, $secretKey)
+    public function __construct($accessKey, $secretKey, $options = null)
     {
     {
         $this->accessKey = $accessKey;
         $this->accessKey = $accessKey;
         $this->secretKey = $secretKey;
         $this->secretKey = $secretKey;
+        $defaultOptions = array(
+            'disableQiniuTimestampSignature' => null
+        );
+        if ($options == null) {
+            $options = $defaultOptions;
+        }
+        $this->options = array_merge($defaultOptions, $options);
     }
     }
 
 
     public function getAccessKey()
     public function getAccessKey()
@@ -49,6 +58,80 @@ final class Auth
         return $this->sign($data);
         return $this->sign($data);
     }
     }
 
 
+    /**
+     * @param string $urlString
+     * @param string $method
+     * @param string $body
+     * @param null|Header $headers
+     */
+    public function signQiniuAuthorization($urlString, $method = "GET", $body = "", $headers = null)
+    {
+        $url = parse_url($urlString);
+        if (!$url) {
+            return array(null, new \Exception("parse_url error"));
+        }
+
+        // append method, path and query
+        if ($method === "") {
+            $data = "GET ";
+        } else {
+            $data = $method . " ";
+        }
+        if (isset($url["path"])) {
+            $data .= $url["path"];
+        }
+        if (isset($url["query"])) {
+            $data .= "?" . $url["query"];
+        }
+
+        // append Host
+        $data .= "\n";
+        $data .= "Host: ";
+        if (isset($url["host"])) {
+            $data .= $url["host"];
+        }
+        if (isset($url["port"]) && $url["port"] > 0) {
+            $data .= ":" . $url["port"];
+        }
+
+        // try append content type
+        if ($headers != null && isset($headers["Content-Type"])) {
+            // append content type
+            $data .= "\n";
+            $data .= "Content-Type: " . $headers["Content-Type"];
+        }
+
+        // try append xQiniuHeaders
+        if ($headers != null) {
+            $headerLines = array();
+            $keyPrefix = "X-Qiniu-";
+            foreach ($headers as $k => $v) {
+                if (strlen($k) > strlen($keyPrefix) && strpos($k, $keyPrefix) === 0) {
+                    array_push(
+                        $headerLines,
+                        $k . ": " . $v
+                    );
+                }
+            }
+            if (count($headerLines) > 0) {
+                $data .= "\n";
+                sort($headerLines);
+                $data .= implode("\n", $headerLines);
+            }
+        }
+
+        // append body
+        $data .= "\n\n";
+        if (strlen($body) > 0
+            && isset($headers["Content-Type"])
+            && $headers["Content-Type"] != "application/octet-stream"
+        ) {
+            $data .= $body;
+        }
+
+        return array($this->sign(utf8_encode($data)), null);
+    }
+
     public function verifyCallback($contentType, $originAuthorization, $url, $body)
     public function verifyCallback($contentType, $originAuthorization, $url, $body)
     {
     {
         $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType);
         $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType);
@@ -141,48 +224,31 @@ final class Auth
 
 
     public function authorizationV2($url, $method, $body = null, $contentType = null)
     public function authorizationV2($url, $method, $body = null, $contentType = null)
     {
     {
-        $urlItems = parse_url($url);
-        $host = $urlItems['host'];
-
-        if (isset($urlItems['port'])) {
-            $port = $urlItems['port'];
-        } else {
-            $port = '';
+        $headers = new Header();
+        $result = array();
+        if ($contentType != null) {
+            $headers['Content-Type'] = $contentType;
+            $result['Content-Type'] = $contentType;
         }
         }
 
 
-        $path = $urlItems['path'];
-        if (isset($urlItems['query'])) {
-            $query = $urlItems['query'];
+        $signDate = gmdate('Ymd\THis\Z', time());
+        if ($this->options['disableQiniuTimestampSignature'] !== null) {
+            if (!$this->options['disableQiniuTimestampSignature']) {
+                $headers['X-Qiniu-Date'] = $signDate;
+                $result['X-Qiniu-Date'] = $signDate;
+            }
+        } elseif (getenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE")) {
+            if (strtolower(getenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE")) !== "true") {
+                $headers['X-Qiniu-Date'] = $signDate;
+                $result['X-Qiniu-Date'] = $signDate;
+            }
         } else {
         } else {
-            $query = '';
-        }
-
-        //write request uri
-        $toSignStr = $method . ' ' . $path;
-        if (!empty($query)) {
-            $toSignStr .= '?' . $query;
-        }
-
-        //write host and port
-        $toSignStr .= "\nHost: " . $host;
-        if (!empty($port)) {
-            $toSignStr .= ":" . $port;
-        }
-
-        //write content type
-        if (!empty($contentType)) {
-            $toSignStr .= "\nContent-Type: " . $contentType;
-        }
-
-        $toSignStr .= "\n\n";
-
-        //write body
-        if (!empty($body)) {
-            $toSignStr .= $body;
+            $headers['X-Qiniu-Date'] = $signDate;
+            $result['X-Qiniu-Date'] = $signDate;
         }
         }
 
 
-        $sign = $this->sign($toSignStr);
-        $auth = 'Qiniu ' . $sign;
-        return array('Authorization' => $auth);
+        list($sign) = $this->signQiniuAuthorization($url, $method, $body, $headers);
+        $result['Authorization'] = 'Qiniu ' . $sign;
+        return $result;
     }
     }
 }
 }

+ 7 - 1
vendor/qiniu/php-sdk/src/Qiniu/Config.php

@@ -3,7 +3,7 @@ namespace Qiniu;
 
 
 final class Config
 final class Config
 {
 {
-    const SDK_VER = '7.4.1';
+    const SDK_VER = '7.6.0';
 
 
     const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改
     const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改
 
 
@@ -133,6 +133,12 @@ final class Config
             $this->regionCache[$cacheId] = $region;
             $this->regionCache[$cacheId] = $region;
         } else {
         } else {
             $region = Zone::queryZone($accessKey, $bucket);
             $region = Zone::queryZone($accessKey, $bucket);
+            if (is_array($region)) {
+                list($region, $err) = $region;
+                if ($err != null) {
+                    throw new \Exception($err->message());
+                }
+            }
             $this->regionCache[$cacheId] = $region;
             $this->regionCache[$cacheId] = $region;
         }
         }
         return $region;
         return $region;

+ 1 - 21
vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php

@@ -125,36 +125,16 @@ final class Client
         }
         }
         $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
         $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
         $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
         $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
-        $headers = self::parseHeaders(substr($result, 0, $header_size));
+        $headers = Header::parseRawText(substr($result, 0, $header_size));
         $body = substr($result, $header_size);
         $body = substr($result, $header_size);
         curl_close($ch);
         curl_close($ch);
         return new Response($code, $duration, $headers, $body, null);
         return new Response($code, $duration, $headers, $body, null);
     }
     }
 
 
-    private static function parseHeaders($raw)
-    {
-        $headers = array();
-        $headerLines = explode("\r\n", $raw);
-        foreach ($headerLines as $line) {
-            $headerLine = trim($line);
-            $kv = explode(':', $headerLine);
-            if (count($kv) > 1) {
-                $kv[0] =self::ucwordsHyphen($kv[0]);
-                $headers[$kv[0]] = trim($kv[1]);
-            }
-        }
-        return $headers;
-    }
-
     private static function escapeQuotes($str)
     private static function escapeQuotes($str)
     {
     {
         $find = array("\\", "\"");
         $find = array("\\", "\"");
         $replace = array("\\\\", "\\\"");
         $replace = array("\\\\", "\\\"");
         return str_replace($find, $replace, $str);
         return str_replace($find, $replace, $str);
     }
     }
-
-    private static function ucwordsHyphen($str)
-    {
-        return str_replace('- ', '-', ucwords(str_replace('-', '- ', $str)));
-    }
 }
 }

+ 36 - 10
vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php

@@ -8,7 +8,21 @@ namespace Qiniu\Http;
 final class Response
 final class Response
 {
 {
     public $statusCode;
     public $statusCode;
+    /**
+     * deprecated because of field names case-sensitive.
+     * use $normalizedHeaders instead which field names are case-insensitive.
+     * but be careful not to use $normalizedHeaders with `array_*` functions,
+     * such as `array_key_exists`, `array_keys`, `array_values`.
+     *
+     * use `isset` instead of `array_key_exists`,
+     * and should never use `array_key_exists` at http header.
+     *
+     * use `foreach` instead of `array_keys`, `array_values`.
+     *
+     * @deprecated
+     */
     public $headers;
     public $headers;
+    public $normalizedHeaders;
     public $body;
     public $body;
     public $error;
     public $error;
     private $jsonData;
     private $jsonData;
@@ -87,21 +101,31 @@ final class Response
     {
     {
         $this->statusCode = $code;
         $this->statusCode = $code;
         $this->duration = $duration;
         $this->duration = $duration;
-        $this->headers = $headers;
+        $this->headers = array();
         $this->body = $body;
         $this->body = $body;
         $this->error = $error;
         $this->error = $error;
         $this->jsonData = null;
         $this->jsonData = null;
+
         if ($error !== null) {
         if ($error !== null) {
             return;
             return;
         }
         }
 
 
+        foreach ($headers as $k => $vs) {
+            if (is_array($vs)) {
+                $this->headers[$k] = $vs[count($vs) - 1];
+            } else {
+                $this->headers[$k] = $vs;
+            }
+        }
+        $this->normalizedHeaders = new Header($headers);
+
         if ($body === null) {
         if ($body === null) {
             if ($code >= 400) {
             if ($code >= 400) {
                 $this->error = self::$statusTexts[$code];
                 $this->error = self::$statusTexts[$code];
             }
             }
             return;
             return;
         }
         }
-        if (self::isJson($headers)) {
+        if (self::isJson($this->normalizedHeaders)) {
             try {
             try {
                 $jsonData = self::bodyJson($body);
                 $jsonData = self::bodyJson($body);
                 if ($code >= 400) {
                 if ($code >= 400) {
@@ -128,8 +152,11 @@ final class Response
         return $this->jsonData;
         return $this->jsonData;
     }
     }
 
 
-    public function headers()
+    public function headers($normalized = false)
     {
     {
+        if ($normalized) {
+            return $this->normalizedHeaders;
+        }
         return $this->headers;
         return $this->headers;
     }
     }
 
 
@@ -145,24 +172,24 @@ final class Response
 
 
     public function xVia()
     public function xVia()
     {
     {
-        $via = $this->headers['X-Via'];
+        $via = $this->normalizedHeaders['X-Via'];
         if ($via === null) {
         if ($via === null) {
-            $via = $this->headers['X-Px'];
+            $via = $this->normalizedHeaders['X-Px'];
         }
         }
         if ($via === null) {
         if ($via === null) {
-            $via = $this->headers['Fw-Via'];
+            $via = $this->normalizedHeaders['Fw-Via'];
         }
         }
         return $via;
         return $via;
     }
     }
 
 
     public function xLog()
     public function xLog()
     {
     {
-        return $this->headers['X-Log'];
+        return $this->normalizedHeaders['X-Log'];
     }
     }
 
 
     public function xReqId()
     public function xReqId()
     {
     {
-        return $this->headers['X-Reqid'];
+        return $this->normalizedHeaders['X-Reqid'];
     }
     }
 
 
     public function ok()
     public function ok()
@@ -180,7 +207,6 @@ final class Response
 
 
     private static function isJson($headers)
     private static function isJson($headers)
     {
     {
-        return array_key_exists('content-type', $headers) || array_key_exists('Content-Type', $headers) &&
-        strpos($headers['Content-Type'], 'application/json') === 0;
+        return isset($headers['Content-Type']) && strpos($headers['Content-Type'], 'application/json') === 0;
     }
     }
 }
 }

+ 87 - 44
vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php

@@ -150,7 +150,7 @@ final class BucketManager
         \Qiniu\setWithoutEmpty($query, 'limit', $limit);
         \Qiniu\setWithoutEmpty($query, 'limit', $limit);
         \Qiniu\setWithoutEmpty($query, 'delimiter', $delimiter);
         \Qiniu\setWithoutEmpty($query, 'delimiter', $delimiter);
         $url = $this->getRsfHost() . '/list?' . http_build_query($query);
         $url = $this->getRsfHost() . '/list?' . http_build_query($query);
-        return $this->get($url);
+        return $this->getV2($url);
     }
     }
 
 
     /**
     /**
@@ -182,7 +182,7 @@ final class BucketManager
         \Qiniu\setWithoutEmpty($query, 'skipconfirm', $skipconfirm);
         \Qiniu\setWithoutEmpty($query, 'skipconfirm', $skipconfirm);
         $path = '/v2/list?' . http_build_query($query);
         $path = '/v2/list?' . http_build_query($query);
         $url = $this->getRsfHost() . $path;
         $url = $this->getRsfHost() . $path;
-        $headers = $this->auth->authorization($url, null, 'application/x-www-form-urlencoded');
+        $headers = $this->auth->authorizationV2($url, 'POST', null, 'application/x-www-form-urlencoded');
         $ret = Client::post($url, null, $headers);
         $ret = Client::post($url, null, $headers);
         if (!$ret->ok()) {
         if (!$ret->ok()) {
             return array(null, new Error($url, $ret));
             return array(null, new Error($url, $ret));
@@ -203,14 +203,20 @@ final class BucketManager
      * 大于0表示多少天后删除,需大于 to_line_after_days
      * 大于0表示多少天后删除,需大于 to_line_after_days
      * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示
      * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示
      * 不转低频存储,小于0表示上传的文件立即变低频存储
      * 不转低频存储,小于0表示上传的文件立即变低频存储
+     * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示
+     * 不转归档存储,小于0表示上传的文件立即变归档存储
+     * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示
+     * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储
      * @return array
      * @return array
      */
      */
     public function bucketLifecycleRule(
     public function bucketLifecycleRule(
         $bucket,
         $bucket,
         $name,
         $name,
         $prefix,
         $prefix,
-        $delete_after_days,
-        $to_line_after_days
+        $delete_after_days = null,
+        $to_line_after_days = null,
+        $to_archive_after_days = null,
+        $to_deep_archive_after_days = null
     ) {
     ) {
         $path = '/rules/add';
         $path = '/rules/add';
         $params = array();
         $params = array();
@@ -229,6 +235,12 @@ final class BucketManager
         if ($to_line_after_days) {
         if ($to_line_after_days) {
             $params['to_line_after_days'] = $to_line_after_days;
             $params['to_line_after_days'] = $to_line_after_days;
         }
         }
+        if ($to_archive_after_days) {
+            $params['to_archive_after_days'] = $to_archive_after_days;
+        }
+        if ($to_deep_archive_after_days) {
+            $params['to_deep_archive_after_days'] = $to_deep_archive_after_days;
+        }
         $data = http_build_query($params);
         $data = http_build_query($params);
         $info = $this->ucPost($path, $data);
         $info = $this->ucPost($path, $data);
         return $info;
         return $info;
@@ -245,14 +257,20 @@ final class BucketManager
      * 大于0表示多少天后删除,需大于 to_line_after_days
      * 大于0表示多少天后删除,需大于 to_line_after_days
      * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示不
      * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示不
      * 转低频存储,小于0表示上传的文件立即变低频存储
      * 转低频存储,小于0表示上传的文件立即变低频存储
+     * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示
+     * 不转归档存储,小于0表示上传的文件立即变归档存储
+     * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示
+     * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储
      * @return array
      * @return array
      */
      */
     public function updateBucketLifecycleRule(
     public function updateBucketLifecycleRule(
         $bucket,
         $bucket,
         $name,
         $name,
         $prefix,
         $prefix,
-        $delete_after_days,
-        $to_line_after_days
+        $delete_after_days = null,
+        $to_line_after_days = null,
+        $to_archive_after_days = null,
+        $to_deep_archive_after_days = null
     ) {
     ) {
         $path = '/rules/update';
         $path = '/rules/update';
         $params = array();
         $params = array();
@@ -271,6 +289,12 @@ final class BucketManager
         if ($to_line_after_days) {
         if ($to_line_after_days) {
             $params['to_line_after_days'] = $to_line_after_days;
             $params['to_line_after_days'] = $to_line_after_days;
         }
         }
+        if ($to_archive_after_days) {
+            $params['to_archive_after_days'] = $to_archive_after_days;
+        }
+        if ($to_deep_archive_after_days) {
+            $params['to_deep_archive_after_days'] = $to_deep_archive_after_days;
+        }
         $data = http_build_query($params);
         $data = http_build_query($params);
         return $this->ucPost($path, $data);
         return $this->ucPost($path, $data);
     }
     }
@@ -675,7 +699,7 @@ final class BucketManager
      *
      *
      * @param string $bucket 待操作资源所在空间
      * @param string $bucket 待操作资源所在空间
      * @param string $key 待操作资源文件名
      * @param string $key 待操作资源文件名
-     * @param int $fileType 0 表示标准存储;1 表示低频存储;2 表示归档存储
+     * @param int $fileType 0 表示标准存储;1 表示低频存储;2 表示归档存储;3 表示深度归档存储
      *
      *
      * @return array
      * @return array
      * @link  https://developer.qiniu.com/kodo/api/3710/chtype
      * @link  https://developer.qiniu.com/kodo/api/3710/chtype
@@ -688,6 +712,23 @@ final class BucketManager
     }
     }
 
 
     /**
     /**
+     * 解冻指定资源的存储类型
+     *
+     * @param string $bucket 待操作资源所在空间
+     * @param string $key 待操作资源文件名
+     * @param int $freezeAfterDays 解冻有效时长,取值范围 1~7
+     *
+     * @return array
+     * @link  https://developer.qiniu.com/kodo/api/6380/restore-archive
+     */
+    public function restoreAr($bucket, $key, $freezeAfterDays)
+    {
+        $resource = \Qiniu\entry($bucket, $key);
+        $path = '/restoreAr/' . $resource . '/freezeAfterDays/' . $freezeAfterDays;
+        return $this->rsPost($path);
+    }
+
+    /**
      * 修改文件的存储状态,即禁用状态和启用状态间的的互相转换
      * 修改文件的存储状态,即禁用状态和启用状态间的的互相转换
      *
      *
      * @param string $bucket 待操作资源所在空间
      * @param string $bucket 待操作资源所在空间
@@ -722,10 +763,14 @@ final class BucketManager
         $path = '/fetch/' . $resource . '/to/' . $to;
         $path = '/fetch/' . $resource . '/to/' . $to;
 
 
         $ak = $this->auth->getAccessKey();
         $ak = $this->auth->getAccessKey();
-        $ioHost = $this->config->getIovipHost($ak, $bucket);
+        try {
+            $ioHost = $this->config->getIovipHost($ak, $bucket);
+        } catch (\Exception $err) {
+            return array(null, $err);
+        }
 
 
         $url = $ioHost . $path;
         $url = $ioHost . $path;
-        return $this->post($url, null);
+        return $this->postV2($url, null);
     }
     }
 
 
     /**
     /**
@@ -776,7 +821,11 @@ final class BucketManager
         $data = json_encode($params);
         $data = json_encode($params);
 
 
         $ak = $this->auth->getAccessKey();
         $ak = $this->auth->getAccessKey();
-        $apiHost = $this->config->getApiHost($ak, $bucket);
+        try {
+            $apiHost = $this->config->getApiHost($ak, $bucket);
+        } catch (\Exception $err) {
+            return array(null, $err);
+        }
         $url = $apiHost . $path;
         $url = $apiHost . $path;
 
 
         return $this->postV2($url, $data);
         return $this->postV2($url, $data);
@@ -801,13 +850,12 @@ final class BucketManager
 
 
         $url = $scheme . "api-" . $zone . ".qiniu.com/sisyphus/fetch?id=" . $id;
         $url = $scheme . "api-" . $zone . ".qiniu.com/sisyphus/fetch?id=" . $id;
 
 
-        $response = $this->getV2($url);
+        list($ret, $err) = $this->getV2($url);
 
 
-        if (!$response->ok()) {
-            print("statusCode: " . $response->statusCode);
-            return array(null, new Error($url, $response));
+        if ($err != null) {
+            return array(null, $err);
         }
         }
-        return array($response->json(), null);
+        return array($ret, null);
     }
     }
 
 
 
 
@@ -826,10 +874,14 @@ final class BucketManager
         $path = '/prefetch/' . $resource;
         $path = '/prefetch/' . $resource;
 
 
         $ak = $this->auth->getAccessKey();
         $ak = $this->auth->getAccessKey();
-        $ioHost = $this->config->getIovipHost($ak, $bucket);
+        try {
+            $ioHost = $this->config->getIovipHost($ak, $bucket);
+        } catch (\Exception $err) {
+            return array(null, $err);
+        }
 
 
         $url = $ioHost . $path;
         $url = $ioHost . $path;
-        return $this->post($url, null);
+        return $this->postV2($url, null);
     }
     }
 
 
     /**
     /**
@@ -910,42 +962,42 @@ final class BucketManager
     private function rsPost($path, $body = null)
     private function rsPost($path, $body = null)
     {
     {
         $url = $this->getRsHost() . $path;
         $url = $this->getRsHost() . $path;
-        return $this->post($url, $body);
+        return $this->postV2($url, $body);
     }
     }
 
 
     private function apiPost($path, $body = null)
     private function apiPost($path, $body = null)
     {
     {
         $url = $this->getApiHost() . $path;
         $url = $this->getApiHost() . $path;
-        return $this->post($url, $body);
+        return $this->postV2($url, $body);
     }
     }
 
 
     private function ucPost($path, $body = null)
     private function ucPost($path, $body = null)
     {
     {
         $url = $this->getUcHost() . $path;
         $url = $this->getUcHost() . $path;
-        return $this->post($url, $body);
+        return $this->postV2($url, $body);
     }
     }
 
 
     private function ucGet($path)
     private function ucGet($path)
     {
     {
         $url = $this->getUcHost() . $path;
         $url = $this->getUcHost() . $path;
-        return $this->get($url);
+        return $this->getV2($url);
     }
     }
 
 
     private function apiGet($path)
     private function apiGet($path)
     {
     {
         $url = $this->getApiHost() . $path;
         $url = $this->getApiHost() . $path;
-        return $this->get($url);
+        return $this->getV2($url);
     }
     }
 
 
     private function rsGet($path)
     private function rsGet($path)
     {
     {
         $url = $this->getRsHost() . $path;
         $url = $this->getRsHost() . $path;
-        return $this->get($url);
+        return $this->getV2($url);
     }
     }
 
 
-    private function get($url)
+    private function getV2($url)
     {
     {
-        $headers = $this->auth->authorization($url);
+        $headers = $this->auth->authorizationV2($url, 'GET', null, 'application/x-www-form-urlencoded');
         $ret = Client::get($url, $headers);
         $ret = Client::get($url, $headers);
         if (!$ret->ok()) {
         if (!$ret->ok()) {
             return array(null, new Error($url, $ret));
             return array(null, new Error($url, $ret));
@@ -953,27 +1005,9 @@ final class BucketManager
         return array($ret->json(), null);
         return array($ret->json(), null);
     }
     }
 
 
-    private function getV2($url)
-    {
-        $headers = $this->auth->authorizationV2($url, 'GET');
-        return Client::get($url, $headers);
-    }
-
-    private function post($url, $body)
-    {
-        $headers = $this->auth->authorization($url, $body, 'application/x-www-form-urlencoded');
-        $ret = Client::post($url, $body, $headers);
-        if (!$ret->ok()) {
-            return array(null, new Error($url, $ret));
-        }
-        $r = ($ret->body === null) ? array() : $ret->json();
-        return array($r, null);
-    }
-
     private function postV2($url, $body)
     private function postV2($url, $body)
     {
     {
-        $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json');
-        $headers["Content-Type"] = 'application/json';
+        $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/x-www-form-urlencoded');
         $ret = Client::post($url, $body, $headers);
         $ret = Client::post($url, $body, $headers);
         if (!$ret->ok()) {
         if (!$ret->ok()) {
             return array(null, new Error($url, $ret));
             return array(null, new Error($url, $ret));
@@ -1038,6 +1072,15 @@ final class BucketManager
         return $data;
         return $data;
     }
     }
 
 
+    public static function buildBatchRestoreAr($bucket, $key_restore_days_pairs)
+    {
+        $data = array();
+        foreach ($key_restore_days_pairs as $key => $restore_days) {
+            array_push($data, '/restoreAr/' . \Qiniu\entry($bucket, $key) . '/freezeAfterDays/' . $restore_days);
+        }
+        return $data;
+    }
+
     private static function oneKeyBatch($operation, $bucket, $keys)
     private static function oneKeyBatch($operation, $bucket, $keys)
     {
     {
         $data = array();
         $data = array();

+ 13 - 4
vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php

@@ -2,6 +2,7 @@
 
 
 namespace Qiniu\Storage;
 namespace Qiniu\Storage;
 
 
+use Qiniu\Config;
 use Qiniu\Http\Error;
 use Qiniu\Http\Error;
 use Qiniu\Http\Client;
 use Qiniu\Http\Client;
 
 
@@ -14,7 +15,7 @@ final class FormUploader
      * @param string $upToken 上传凭证
      * @param string $upToken 上传凭证
      * @param string $key 上传文件名
      * @param string $key 上传文件名
      * @param string $data 上传二进制流
      * @param string $data 上传二进制流
-     * @param string $config 上传配置
+     * @param Config $config 上传配置
      * @param string $params 自定义变量,规格参考
      * @param string $params 自定义变量,规格参考
      *                    https://developer.qiniu.com/kodo/manual/1235/vars#xvar
      *                    https://developer.qiniu.com/kodo/manual/1235/vars#xvar
      * @param string $mime 上传数据的mimeType
      * @param string $mime 上传数据的mimeType
@@ -56,7 +57,11 @@ final class FormUploader
             return array(null, $err);
             return array(null, $err);
         }
         }
 
 
-        $upHost = $config->getUpHost($accessKey, $bucket);
+        try {
+            $upHost = $config->getUpHost($accessKey, $bucket);
+        } catch (\Exception $err) {
+            return array(null, $err);
+        }
 
 
         $response = Client::multipartPost($upHost, $fields, 'file', $fname, $data, $mime);
         $response = Client::multipartPost($upHost, $fields, 'file', $fname, $data, $mime);
         if (!$response->ok()) {
         if (!$response->ok()) {
@@ -71,7 +76,7 @@ final class FormUploader
      * @param string $upToken 上传凭证
      * @param string $upToken 上传凭证
      * @param string $key 上传文件名
      * @param string $key 上传文件名
      * @param string $filePath 上传文件的路径
      * @param string $filePath 上传文件的路径
-     * @param string $config 上传配置
+     * @param Config $config 上传配置
      * @param string $params 自定义变量,规格参考
      * @param string $params 自定义变量,规格参考
      *                    https://developer.qiniu.com/kodo/manual/1235/vars#xvar
      *                    https://developer.qiniu.com/kodo/manual/1235/vars#xvar
      * @param string $mime 上传数据的mimeType
      * @param string $mime 上传数据的mimeType
@@ -112,7 +117,11 @@ final class FormUploader
             return array(null, $err);
             return array(null, $err);
         }
         }
 
 
-        $upHost = $config->getUpHost($accessKey, $bucket);
+        try {
+            $upHost = $config->getUpHost($accessKey, $bucket);
+        } catch (\Exception $err) {
+            return array(null, $err);
+        }
 
 
         $response = Client::post($upHost, $fields, $headers);
         $response = Client::post($upHost, $fields, $headers);
         if (!$response->ok()) {
         if (!$response->ok()) {

+ 30 - 16
vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php

@@ -5,6 +5,7 @@ namespace Qiniu\Storage;
 use Qiniu\Config;
 use Qiniu\Config;
 use Qiniu\Http\Client;
 use Qiniu\Http\Client;
 use Qiniu\Http\Error;
 use Qiniu\Http\Error;
+use Qiniu\Enum\SplitUploadVersion;
 
 
 /**
 /**
  * 断点续上传类, 该类主要实现了断点续上传中的分块上传,
  * 断点续上传类, 该类主要实现了断点续上传中的分块上传,
@@ -40,7 +41,7 @@ final class ResumeUploader
      * @param string $size 上传流的大小
      * @param string $size 上传流的大小
      * @param string $params 自定义变量
      * @param string $params 自定义变量
      * @param string $mime 上传数据的mimeType
      * @param string $mime 上传数据的mimeType
-     * @param string $config
+     * @param Config $config
      * @param string $resumeRecordFile 断点续传的已上传的部分信息记录文件
      * @param string $resumeRecordFile 断点续传的已上传的部分信息记录文件
      * @param string $version 分片上传版本 目前支持v1/v2版本 默认v1
      * @param string $version 分片上传版本 目前支持v1/v2版本 默认v1
      * @param string $partSize 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB
      * @param string $partSize 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB
@@ -70,9 +71,14 @@ final class ResumeUploader
         $this->finishedEtags = array("etags"=>array(), "uploadId"=>"", "expiredAt"=>0, "uploaded"=>0);
         $this->finishedEtags = array("etags"=>array(), "uploadId"=>"", "expiredAt"=>0, "uploaded"=>0);
         $this->config = $config;
         $this->config = $config;
         $this->resumeRecordFile = $resumeRecordFile ? $resumeRecordFile : null;
         $this->resumeRecordFile = $resumeRecordFile ? $resumeRecordFile : null;
-        $this->version = $version ? $version : 'v1';
         $this->partSize = $partSize ? $partSize : config::BLOCK_SIZE;
         $this->partSize = $partSize ? $partSize : config::BLOCK_SIZE;
 
 
+        try {
+            $this->version = SplitUploadVersion::from($version ? $version : 'v1');
+        } catch (\Exception $e) {
+            throw new \Exception("only support v1/v2 now!", 0, $e);
+        }
+
         list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken);
         list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken);
         $this->bucket = $bucket;
         $this->bucket = $bucket;
         if ($err != null) {
         if ($err != null) {
@@ -92,7 +98,7 @@ final class ResumeUploader
     public function upload($fname)
     public function upload($fname)
     {
     {
         $uploaded = 0;
         $uploaded = 0;
-        if ($this->version == 'v2') {
+        if ($this->version == SplitUploadVersion::V2) {
             $partNumber = 1;
             $partNumber = 1;
             $encodedObjectName = $this->key? \Qiniu\base64_urlSafeEncode($this->key) : '~';
             $encodedObjectName = $this->key? \Qiniu\base64_urlSafeEncode($this->key) : '~';
         };
         };
@@ -125,13 +131,13 @@ final class ResumeUploader
             }
             }
 
 
             if ($blkputRets) {
             if ($blkputRets) {
-                if ($this->version == 'v1') {
+                if ($this->version == SplitUploadVersion::V1) {
                     if (isset($blkputRets['contexts']) && isset($blkputRets['uploaded']) &&
                     if (isset($blkputRets['contexts']) && isset($blkputRets['uploaded']) &&
                         is_array($blkputRets['contexts']) && is_int($blkputRets['uploaded'])) {
                         is_array($blkputRets['contexts']) && is_int($blkputRets['uploaded'])) {
                         $this->contexts = $blkputRets['contexts'];
                         $this->contexts = $blkputRets['contexts'];
                         $uploaded = $blkputRets['uploaded'];
                         $uploaded = $blkputRets['uploaded'];
                     }
                     }
-                } elseif ($this->version == 'v2') {
+                } elseif ($this->version == SplitUploadVersion::V2) {
                     if (isset($blkputRets["etags"]) && isset($blkputRets["uploadId"]) &&
                     if (isset($blkputRets["etags"]) && isset($blkputRets["uploadId"]) &&
                         isset($blkputRets["expiredAt"]) && $blkputRets["expiredAt"] > time()
                         isset($blkputRets["expiredAt"]) && $blkputRets["expiredAt"] > time()
                         && $blkputRets["uploaded"] > 0 && is_array($blkputRets["etags"]) &&
                         && $blkputRets["uploaded"] > 0 && is_array($blkputRets["etags"]) &&
@@ -149,13 +155,13 @@ final class ResumeUploader
                     throw new \Exception("only support v1/v2 now!");
                     throw new \Exception("only support v1/v2 now!");
                 }
                 }
             } else {
             } else {
-                if ($this->version == 'v2') {
+                if ($this->version == SplitUploadVersion::V2) {
                     $this->makeInitReq($encodedObjectName);
                     $this->makeInitReq($encodedObjectName);
                 }
                 }
             }
             }
         } else {
         } else {
             // init a Multipart Upload task if choose v2
             // init a Multipart Upload task if choose v2
-            if ($this->version == 'v2') {
+            if ($this->version == SplitUploadVersion::V2) {
                 $this->makeInitReq($encodedObjectName);
                 $this->makeInitReq($encodedObjectName);
             }
             }
         }
         }
@@ -166,10 +172,10 @@ final class ResumeUploader
             if ($data === false) {
             if ($data === false) {
                 throw new \Exception("file read failed", 1);
                 throw new \Exception("file read failed", 1);
             }
             }
-            if ($this->version == 'v1') {
+            if ($this->version == SplitUploadVersion::V1) {
                 $crc = \Qiniu\crc32_data($data);
                 $crc = \Qiniu\crc32_data($data);
                 $response = $this->makeBlock($data, $blockSize);
                 $response = $this->makeBlock($data, $blockSize);
-            } else {
+            } elseif ($this->version == SplitUploadVersion::V2) {
                 $md5 = md5($data);
                 $md5 = md5($data);
                 $response = $this->uploadPart(
                 $response = $this->uploadPart(
                     $data,
                     $data,
@@ -178,6 +184,8 @@ final class ResumeUploader
                     $encodedObjectName,
                     $encodedObjectName,
                     $md5
                     $md5
                 );
                 );
+            } else {
+                throw new \Exception("only support v1/v2 now!");
             }
             }
 
 
             $ret = null;
             $ret = null;
@@ -193,7 +201,7 @@ final class ResumeUploader
                 $this->host = $upHostBackup;
                 $this->host = $upHostBackup;
             }
             }
 
 
-            if ($this->version == 'v1') {
+            if ($this->version == SplitUploadVersion::V1) {
                 if ($response->needRetry() || !isset($ret['crc32']) || $crc != $ret['crc32']) {
                 if ($response->needRetry() || !isset($ret['crc32']) || $crc != $ret['crc32']) {
                     $response = $this->makeBlock($data, $blockSize);
                     $response = $this->makeBlock($data, $blockSize);
                     $ret = $response->json();
                     $ret = $response->json();
@@ -203,7 +211,7 @@ final class ResumeUploader
                     return array(null, new Error($this->currentUrl, $response));
                     return array(null, new Error($this->currentUrl, $response));
                 }
                 }
                 array_push($this->contexts, $ret['ctx']);
                 array_push($this->contexts, $ret['ctx']);
-            } else {
+            } elseif ($this->version == SplitUploadVersion::V2) {
                 if ($response->needRetry() || !isset($ret['md5']) || $md5 != $ret['md5']) {
                 if ($response->needRetry() || !isset($ret['md5']) || $md5 != $ret['md5']) {
                     $response = $this->uploadPart(
                     $response = $this->uploadPart(
                         $data,
                         $data,
@@ -221,22 +229,26 @@ final class ResumeUploader
                 $blockStatus = array('etag' => $ret['etag'], 'partNumber' => $partNumber);
                 $blockStatus = array('etag' => $ret['etag'], 'partNumber' => $partNumber);
                 array_push($this->finishedEtags['etags'], $blockStatus);
                 array_push($this->finishedEtags['etags'], $blockStatus);
                 $partNumber += 1;
                 $partNumber += 1;
+            } else {
+                throw new \Exception("only support v1/v2 now!");
             }
             }
 
 
             $uploaded += $blockSize;
             $uploaded += $blockSize;
-            if ($this->version == 'v2') {
+            if ($this->version == SplitUploadVersion::V2) {
                 $this->finishedEtags['uploaded'] = $uploaded;
                 $this->finishedEtags['uploaded'] = $uploaded;
             }
             }
 
 
             if ($this->resumeRecordFile !== null) {
             if ($this->resumeRecordFile !== null) {
-                if ($this->version == 'v1') {
+                if ($this->version == SplitUploadVersion::V1) {
                     $recordData = array(
                     $recordData = array(
                         'contexts' => $this->contexts,
                         'contexts' => $this->contexts,
                         'uploaded' => $uploaded
                         'uploaded' => $uploaded
                     );
                     );
                     $recordData = json_encode($recordData);
                     $recordData = json_encode($recordData);
-                } else {
+                } elseif ($this->version == SplitUploadVersion::V2) {
                     $recordData = json_encode($this->finishedEtags);
                     $recordData = json_encode($this->finishedEtags);
+                } else {
+                    throw new \Exception("only support v1/v2 now!");
                 }
                 }
                 if ($recordData) {
                 if ($recordData) {
                     $isWritten = file_put_contents($this->resumeRecordFile, $recordData);
                     $isWritten = file_put_contents($this->resumeRecordFile, $recordData);
@@ -248,10 +260,12 @@ final class ResumeUploader
                 }
                 }
             }
             }
         }
         }
-        if ($this->version == 'v1') {
+        if ($this->version == SplitUploadVersion::V1) {
             return $this->makeFile($fname);
             return $this->makeFile($fname);
-        } else {
+        } elseif ($this->version == SplitUploadVersion::V2) {
             return $this->completeParts($fname, $this->finishedEtags['uploadId'], $encodedObjectName);
             return $this->completeParts($fname, $this->finishedEtags['uploadId'], $encodedObjectName);
+        } else {
+            throw new \Exception("only support v1/v2 now!");
         }
         }
     }
     }
 
 

+ 13 - 11
vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php

@@ -65,21 +65,23 @@ final class UploadManager
     /**
     /**
      * 上传文件到七牛
      * 上传文件到七牛
      *
      *
-     * @param $upToken    上传凭证
-     * @param $key        上传文件名
-     * @param $filePath   上传文件的路径
-     * @param $params     自定义变量,规格参考
-     *                    http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
-     * @param $mime       上传数据的mimeType
-     * @param $checkCrc   是否校验crc32
-     * @param $version    分片上传版本 目前支持v1/v2版本 默认v1
-     * @param $partSize   分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB
-     * @param $resumeRecordFile 断点续传文件路径 默认为null
-     * @return array    包含已上传文件的信息,类似:
+     * @param string $upToken 上传凭证
+     * @param string $key 上传文件名
+     * @param string $filePath 上传文件的路径
+     * @param array<string, mixed> $params 定义变量,规格参考
+     *                                     http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
+     * @param boolean $mime 上传数据的mimeType
+     * @param string $checkCrc 是否校验crc32
+     * @param string $resumeRecordFile 断点续传文件路径 默认为null
+     * @param string $version 分片上传版本 目前支持v1/v2版本 默认v1
+     * @param int $partSize 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB
+     *
+     * @return array<string, mixed> 包含已上传文件的信息,类似:
      *                                              [
      *                                              [
      *                                                  "hash" => "<Hash string>",
      *                                                  "hash" => "<Hash string>",
      *                                                  "key" => "<Key string>"
      *                                                  "key" => "<Key string>"
      *                                              ]
      *                                              ]
+     * @throws \Exception
      */
      */
     public function putFile(
     public function putFile(
         $upToken,
         $upToken,

+ 174 - 0
vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php

@@ -12,6 +12,7 @@ namespace Qiniu {
 
 
 namespace Qiniu\Tests {
 namespace Qiniu\Tests {
     use Qiniu\Auth;
     use Qiniu\Auth;
+    use Qiniu\Http\Header;
 
 
     // @codingStandardsIgnoreEnd
     // @codingStandardsIgnoreEnd
 
 
@@ -67,5 +68,178 @@ namespace Qiniu\Tests {
         public function testVerifyCallback()
         public function testVerifyCallback()
         {
         {
         }
         }
+
+        public function testSignQiniuAuthorization()
+        {
+            $auth = new Auth("ak", "sk");
+
+            // ---
+            $url = "";
+            $method = "";
+            $headers = new Header(array(
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+            ));
+            $body = "{\"name\": \"test\"}";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:0i1vKClRDWFyNkcTFzwcE7PzX74=", $sign);
+
+            // ---
+            $url = "";
+            $method = "";
+            $headers = new Header(array(
+                "Content-Type" => array("application/json"),
+            ));
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:K1DI0goT05yhGizDFE5FiPJxAj4=", $sign);
+
+            // ---
+            $url = "";
+            $method = "GET";
+            $headers = new Header(array(
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+            ));
+            $body = "{\"name\": \"test\"}";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:0i1vKClRDWFyNkcTFzwcE7PzX74=", $sign);
+
+            // ---
+            $url = "";
+            $method = "POST";
+            $headers = new Header(array(
+                "Content-Type" => array("application/json"),
+                "X-Qiniu" => array("b"),
+            ));
+            $body = "{\"name\": \"test\"}";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:0ujEjW_vLRZxebsveBgqa3JyQ-w=", $sign);
+
+            // ---
+            $url = "http://upload.qiniup.com";
+            $method = "";
+            $headers = new Header(array(
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+            ));
+            $body = "{\"name\": \"test\"}";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:GShw5NitGmd5TLoo38nDkGUofRw=", $sign);
+
+            // ---
+            $url = "http://upload.qiniup.com";
+            $method = "";
+            $headers = new Header(array(
+                "Content-Type" => array("application/json"),
+                "X-Qiniu-Bbb" => array("BBB", "AAA"),
+                "X-Qiniu-Aaa" => array("DDD", "CCC"),
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+            ));
+            $body = "{\"name\": \"test\"}";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:DhNA1UCaBqSHCsQjMOLRfVn63GQ=", $sign);
+
+            // ---
+            $url = "http://upload.qiniup.com";
+            $method = "";
+            $headers = new Header(array(
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+                "X-Qiniu-Bbb" => array("BBB", "AAA"),
+                "X-Qiniu-Aaa" => array("DDD", "CCC"),
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+            ));
+            $body = "name=test&language=go";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:KUAhrYh32P9bv0COD8ugZjDCmII=", $sign);
+
+            // ---
+            $url = "http://upload.qiniup.com";
+            $method = "";
+            $headers = new Header(array(
+                "Content-Type" => array("application/x-www"),
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+                "X-Qiniu-Bbb" => array("BBB", "AAA"),
+                "X-Qiniu-Aaa" => array("DDD", "CCC"),
+            ));
+            $body = "name=test&language=go";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:KUAhrYh32P9bv0COD8ugZjDCmII=", $sign);
+
+            // ---
+            $url = "http://upload.qiniup.com/mkfile/sdf.jpg";
+            $method = "";
+            $headers = new Header(array(
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+                "X-Qiniu-Bbb" => array("BBB", "AAA"),
+                "X-Qiniu-Aaa" => array("DDD", "CCC"),
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+            ));
+            $body = "name=test&language=go";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:fkRck5_LeyfwdkyyLk-hyNwGKac=", $sign);
+
+            $url = "http://upload.qiniup.com/mkfile/sdf.jpg?s=er3&df";
+            $method = "";
+            $headers = new Header(array(
+                "Content-Type" => array("application/x-www-form-urlencoded"),
+                "X-Qiniu-Bbb" => array("BBB", "AAA"),
+                "X-Qiniu-Aaa" => array("DDD", "CCC"),
+                "X-Qiniu-" => array("a"),
+                "X-Qiniu" => array("b"),
+            ));
+            $body = "name=test&language=go";
+            list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers);
+            $this->assertNull($err);
+            $this->assertEquals("ak:PUFPWsEUIpk_dzUvvxTTmwhp3p4=", $sign);
+        }
+
+        public function testDisableQiniuTimestampSignatureDefault()
+        {
+            $auth = new Auth("ak", "sk");
+            $authedHeaders = $auth->authorizationV2("https://example.com", "GET");
+            $this->assertArrayHasKey("X-Qiniu-Date", $authedHeaders);
+        }
+
+        public function testDisableQiniuTimestampSignature()
+        {
+            $auth = new Auth("ak", "sk", array(
+                "disableQiniuTimestampSignature" => true
+            ));
+            $authedHeaders = $auth->authorizationV2("https://example.com", "GET");
+            $this->assertArrayNotHasKey("X-Qiniu-Date", $authedHeaders);
+        }
+        public function testDisableQiniuTimestampSignatureEnv()
+        {
+            putenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE=true");
+            $auth = new Auth("ak", "sk");
+            $authedHeaders = $auth->authorizationV2("https://example.com", "GET");
+            $this->assertArrayNotHasKey("X-Qiniu-Date", $authedHeaders);
+            putenv('DISABLE_QINIU_TIMESTAMP_SIGNATURE');
+        }
+        public function testDisableQiniuTimestampSignatureEnvBeIgnored()
+        {
+            putenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE=true");
+            $auth = new Auth("ak", "sk", array(
+                "disableQiniuTimestampSignature" => false
+            ));
+            $authedHeaders = $auth->authorizationV2("https://example.com", "GET");
+            $this->assertArrayHasKey("X-Qiniu-Date", $authedHeaders);
+            putenv('DISABLE_QINIU_TIMESTAMP_SIGNATURE');
+        }
     }
     }
 }
 }

+ 187 - 40
vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php

@@ -38,105 +38,144 @@ class BucketTest extends \PHPUnit_Framework_TestCase
     {
     {
 
 
         list($list, $error) = $this->bucketManager->buckets();
         list($list, $error) = $this->bucketManager->buckets();
-        $this->assertTrue(in_array($this->bucketName, $list));
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertTrue(in_array($this->bucketName, $list));
 
 
         list($list2, $error) = $this->dummyBucketManager->buckets();
         list($list2, $error) = $this->dummyBucketManager->buckets();
         $this->assertEquals(401, $error->code());
         $this->assertEquals(401, $error->code());
-        $this->assertNull($list2);
         $this->assertNotNull($error->message());
         $this->assertNotNull($error->message());
         $this->assertNotNull($error->getResponse());
         $this->assertNotNull($error->getResponse());
+        $this->assertNull($list2);
     }
     }
 
 
     public function testListbuckets()
     public function testListbuckets()
     {
     {
         list($ret, $error) = $this->bucketManager->listbuckets('z0');
         list($ret, $error) = $this->bucketManager->listbuckets('z0');
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testCreateBucket()
     public function testCreateBucket()
     {
     {
         list($ret, $error) = $this->bucketManager->createBucket('phpsdk-ci-test');
         list($ret, $error) = $this->bucketManager->createBucket('phpsdk-ci-test');
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testDeleteBucket()
     public function testDeleteBucket()
     {
     {
         list($ret, $error) = $this->bucketManager->deleteBucket('phpsdk-ci-test');
         list($ret, $error) = $this->bucketManager->deleteBucket('phpsdk-ci-test');
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testDomains()
     public function testDomains()
     {
     {
         list($ret, $error) = $this->bucketManager->domains($this->bucketName);
         list($ret, $error) = $this->bucketManager->domains($this->bucketName);
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testBucketInfo()
     public function testBucketInfo()
     {
     {
         list($ret, $error) = $this->bucketManager->bucketInfo($this->bucketName);
         list($ret, $error) = $this->bucketManager->bucketInfo($this->bucketName);
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testBucketInfos()
     public function testBucketInfos()
     {
     {
         list($ret, $error) = $this->bucketManager->bucketInfos('z0');
         list($ret, $error) = $this->bucketManager->bucketInfos('z0');
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testList()
     public function testList()
     {
     {
         list($ret, $error) = $this->bucketManager->listFiles($this->bucketName, null, null, 10);
         list($ret, $error) = $this->bucketManager->listFiles($this->bucketName, null, null, 10);
+        $this->assertNull($error);
         $this->assertNotNull($ret['items'][0]);
         $this->assertNotNull($ret['items'][0]);
         $this->assertNotNull($ret['marker']);
         $this->assertNotNull($ret['marker']);
-        $this->assertNull($error);
     }
     }
 
 
     public function testListFilesv2()
     public function testListFilesv2()
     {
     {
         list($ret, $error) = $this->bucketManager->listFilesv2($this->bucketName, null, null, 10);
         list($ret, $error) = $this->bucketManager->listFilesv2($this->bucketName, null, null, 10);
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testBucketLifecycleRule()
     public function testBucketLifecycleRule()
     {
     {
-        list($ret, $error) = $this->bucketManager->bucketLifecycleRule($this->bucketName, 'demo', 'test', 80, 70);
-        $this->assertNotNull($ret);
+        // delete
+        $this->bucketManager->deleteBucketLifecycleRule($this->bucketName, 'demo');
+
+        // add
+        list($ret, $error) = $this->bucketManager->bucketLifecycleRule(
+            $this->bucketName,
+            'demo',
+            'test',
+            80,
+            70,
+            72,
+            74
+        );
         $this->assertNull($error);
         $this->assertNull($error);
-    }
+        $this->assertNotNull($ret);
 
 
-    public function testGetbucketLifecycleRule()
-    {
+        // get
         list($ret, $error) = $this->bucketManager->getBucketLifecycleRules($this->bucketName);
         list($ret, $error) = $this->bucketManager->getBucketLifecycleRules($this->bucketName);
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
-    }
-
-    public function testUpdatebucketLifecycleRule()
-    {
+        $this->assertNotNull($ret);
+        $rule = null;
+        foreach ($ret as $r) {
+            if ($r["name"] === "demo") {
+                $rule = $r;
+                break;
+            }
+        }
+        $this->assertNotNull($rule);
+        $this->assertEquals("test", $rule["prefix"]);
+        $this->assertEquals(80, $rule["delete_after_days"]);
+        $this->assertEquals(70, $rule["to_line_after_days"]);
+        $this->assertEquals(72, $rule["to_archive_after_days"]);
+        $this->assertEquals(74, $rule["to_deep_archive_after_days"]);
+
+        // update
         list($ret, $error) = $this->bucketManager->updateBucketLifecycleRule(
         list($ret, $error) = $this->bucketManager->updateBucketLifecycleRule(
             $this->bucketName,
             $this->bucketName,
             'demo',
             'demo',
             'testupdate',
             'testupdate',
+            90,
+            75,
             80,
             80,
-            70
+            85
         );
         );
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
-    }
+        $this->assertNotNull($ret);
 
 
-    public function testDeleteBucketLifecycleRule()
-    {
-        list($ret, $error) = $this->bucketManager->deleteBucketLifecycleRule($this->bucketName, 'demo');
+        // get
+        list($ret, $error) = $this->bucketManager->getBucketLifecycleRules($this->bucketName);
+        $this->assertNull($error);
         $this->assertNotNull($ret);
         $this->assertNotNull($ret);
+        $rule = null;
+        foreach ($ret as $r) {
+            if ($r["name"] === "demo") {
+                $rule = $r;
+                break;
+            }
+        }
+        $this->assertNotNull($rule);
+        $this->assertEquals("testupdate", $rule["prefix"]);
+        $this->assertEquals(90, $rule["delete_after_days"]);
+        $this->assertEquals(75, $rule["to_line_after_days"]);
+        $this->assertEquals(80, $rule["to_archive_after_days"]);
+        $this->assertEquals(85, $rule["to_deep_archive_after_days"]);
+
+        // delete
+        list($ret, $error) = $this->bucketManager->deleteBucketLifecycleRule($this->bucketName, 'demo');
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testPutBucketEvent()
     public function testPutBucketEvent()
@@ -149,8 +188,8 @@ class BucketTest extends \PHPUnit_Framework_TestCase
             array('copy'),
             array('copy'),
             $this->customCallbackURL
             $this->customCallbackURL
         );
         );
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testUpdateBucketEvent()
     public function testUpdateBucketEvent()
@@ -163,47 +202,47 @@ class BucketTest extends \PHPUnit_Framework_TestCase
             array('copy'),
             array('copy'),
             $this->customCallbackURL
             $this->customCallbackURL
         );
         );
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testGetBucketEvent()
     public function testGetBucketEvent()
     {
     {
         list($ret, $error) = $this->bucketManager->getBucketEvents($this->bucketName);
         list($ret, $error) = $this->bucketManager->getBucketEvents($this->bucketName);
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testDeleteBucketEvent()
     public function testDeleteBucketEvent()
     {
     {
         list($ret, $error) = $this->bucketManager->deleteBucketEvent($this->bucketName, 'bucketevent');
         list($ret, $error) = $this->bucketManager->deleteBucketEvent($this->bucketName, 'bucketevent');
-        $this->assertNotNull($ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testStat()
     public function testStat()
     {
     {
         list($stat, $error) = $this->bucketManager->stat($this->bucketName, $this->key);
         list($stat, $error) = $this->bucketManager->stat($this->bucketName, $this->key);
-        $this->assertNotNull($stat);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertNotNull($stat);
         $this->assertNotNull($stat['hash']);
         $this->assertNotNull($stat['hash']);
 
 
         list($stat, $error) = $this->bucketManager->stat($this->bucketName, 'nofile');
         list($stat, $error) = $this->bucketManager->stat($this->bucketName, 'nofile');
-        $this->assertNull($stat);
         $this->assertEquals(612, $error->code());
         $this->assertEquals(612, $error->code());
         $this->assertNotNull($error->message());
         $this->assertNotNull($error->message());
+        $this->assertNull($stat);
 
 
         list($stat, $error) = $this->bucketManager->stat('nobucket', 'nofile');
         list($stat, $error) = $this->bucketManager->stat('nobucket', 'nofile');
-        $this->assertNull($stat);
         $this->assertEquals(631, $error->code());
         $this->assertEquals(631, $error->code());
         $this->assertNotNull($error->message());
         $this->assertNotNull($error->message());
+        $this->assertNull($stat);
     }
     }
 
 
     public function testDelete()
     public function testDelete()
     {
     {
         list($ret, $error) = $this->bucketManager->delete($this->bucketName, 'del');
         list($ret, $error) = $this->bucketManager->delete($this->bucketName, 'del');
-        $this->assertNull($ret);
         $this->assertNotNull($error);
         $this->assertNotNull($error);
+        $this->assertNull($ret);
     }
     }
 
 
 
 
@@ -271,6 +310,16 @@ class BucketTest extends \PHPUnit_Framework_TestCase
         $this->assertNull($error);
         $this->assertNull($error);
     }
     }
 
 
+    public function testPrefetchFailed()
+    {
+        list($ret, $error) = $this->bucketManager->prefetch(
+            'fakebucket',
+            'php-sdk.html'
+        );
+        $this->assertNotNull($error);
+        $this->assertNull($ret);
+    }
+
     public function testFetch()
     public function testFetch()
     {
     {
         list($ret, $error) = $this->bucketManager->fetch(
         list($ret, $error) = $this->bucketManager->fetch(
@@ -278,23 +327,33 @@ class BucketTest extends \PHPUnit_Framework_TestCase
             $this->bucketName,
             $this->bucketName,
             'fetch.html'
             'fetch.html'
         );
         );
-        $this->assertArrayHasKey('hash', $ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertArrayHasKey('hash', $ret);
 
 
         list($ret, $error) = $this->bucketManager->fetch(
         list($ret, $error) = $this->bucketManager->fetch(
             'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html',
             'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html',
             $this->bucketName,
             $this->bucketName,
             ''
             ''
         );
         );
-        $this->assertArrayHasKey('key', $ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertArrayHasKey('key', $ret);
 
 
         list($ret, $error) = $this->bucketManager->fetch(
         list($ret, $error) = $this->bucketManager->fetch(
             'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html',
             'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html',
             $this->bucketName
             $this->bucketName
         );
         );
-        $this->assertArrayHasKey('key', $ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertArrayHasKey('key', $ret);
+    }
+
+    public function testFetchFailed()
+    {
+        list($ret, $error) = $this->bucketManager->fetch(
+            'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html',
+            'fakebucket'
+        );
+        $this->assertNotNull($error);
+        $this->assertNull($ret);
     }
     }
 
 
     public function testAsynchFetch()
     public function testAsynchFetch()
@@ -305,8 +364,8 @@ class BucketTest extends \PHPUnit_Framework_TestCase
             null,
             null,
             'qiniu.png'
             'qiniu.png'
         );
         );
-        $this->assertArrayHasKey('id', $ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertArrayHasKey('id', $ret);
 
 
         list($ret, $error) = $this->bucketManager->asynchFetch(
         list($ret, $error) = $this->bucketManager->asynchFetch(
             'http://devtools.qiniu.com/qiniu.png',
             'http://devtools.qiniu.com/qiniu.png',
@@ -314,15 +373,25 @@ class BucketTest extends \PHPUnit_Framework_TestCase
             null,
             null,
             ''
             ''
         );
         );
-        $this->assertArrayHasKey('id', $ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertArrayHasKey('id', $ret);
 
 
         list($ret, $error) = $this->bucketManager->asynchFetch(
         list($ret, $error) = $this->bucketManager->asynchFetch(
             'http://devtools.qiniu.com/qiniu.png',
             'http://devtools.qiniu.com/qiniu.png',
             $this->bucketName
             $this->bucketName
         );
         );
-        $this->assertArrayHasKey('id', $ret);
         $this->assertNull($error);
         $this->assertNull($error);
+        $this->assertArrayHasKey('id', $ret);
+    }
+
+    public function testAsynchFetchFailed()
+    {
+        list($ret, $error) = $this->bucketManager->asynchFetch(
+            'http://devtools.qiniu.com/qiniu.png',
+            'fakebucket'
+        );
+        $this->assertNotNull($error);
+        $this->assertNull($ret);
     }
     }
 
 
 
 
@@ -378,6 +447,24 @@ class BucketTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(200, $ret[0]['code']);
         $this->assertEquals(200, $ret[0]['code']);
     }
     }
 
 
+    public function testBatchChangeTypeAndBatchRestoreAr()
+    {
+        $key = 'toChangeTypeThenRestore' . rand();
+        $this->bucketManager->copy($this->bucketName, $this->key, $this->bucketName, $key);
+
+        $ops = BucketManager::buildBatchChangeType($this->bucketName, array($key => 2)); // 2 Archive
+        list($ret, $error) = $this->bucketManager->batch($ops);
+        $this->assertNull($error);
+        $this->assertEquals(200, $ret[0]['code']);
+
+        $ops = BucketManager::buildBatchRestoreAr($this->bucketName, array($key => 1)); // 1 day
+        list($ret, $error) = $this->bucketManager->batch($ops);
+        $this->assertNull($error);
+        $this->assertEquals(200, $ret[0]['code']);
+
+        $this->bucketManager->delete($this->bucketName, $key);
+    }
+
     public function testDeleteAfterDays()
     public function testDeleteAfterDays()
     {
     {
         $key = rand();
         $key = rand();
@@ -440,6 +527,66 @@ class BucketTest extends \PHPUnit_Framework_TestCase
         $this->assertNull($err);
         $this->assertNull($err);
     }
     }
 
 
+    public function testArchiveRestoreAr()
+    {
+        $key = 'archiveToRestore' . rand();
+        $this->bucketManager->delete($this->bucketName, $key);
+
+        $this->bucketManager->copy(
+            $this->bucketName,
+            $this->key,
+            $this->bucketName,
+            $key
+        );
+        $this->bucketManager->changeType($this->bucketName, $key, 2);
+
+        list(, $err) = $this->bucketManager->restoreAr($this->bucketName, $key, 2);
+        $this->assertNull($err);
+        list($ret, $err) = $this->bucketManager->stat($this->bucketName, $key);
+        $this->assertNull($err);
+
+        $this->assertEquals(2, $ret["type"]);
+
+        // restoreStatus
+        // null means frozen;
+        // 1 means be unfreezing;
+        // 2 means be unfrozen;
+        $this->assertNotNull($ret["restoreStatus"]);
+        $this->assertContains($ret["restoreStatus"], array(1, 2));
+
+        $this->bucketManager->delete($this->bucketName, $key);
+    }
+
+    public function testDeepArchiveRestoreAr()
+    {
+        $key = 'deepArchiveToRestore' . rand();
+        $this->bucketManager->delete($this->bucketName, $key);
+
+        $this->bucketManager->copy(
+            $this->bucketName,
+            $this->key,
+            $this->bucketName,
+            $key
+        );
+        $this->bucketManager->changeType($this->bucketName, $key, 3);
+
+        list(, $err) = $this->bucketManager->restoreAr($this->bucketName, $key, 1);
+        $this->assertNull($err);
+        list($ret, $err) = $this->bucketManager->stat($this->bucketName, $key);
+        $this->assertNull($err);
+
+        $this->assertEquals(3, $ret["type"]);
+
+        // restoreStatus
+        // null means frozen;
+        // 1 means be unfreezing;
+        // 2 means be unfrozen;
+        $this->assertNotNull($ret["restoreStatus"]);
+        $this->assertContains($ret["restoreStatus"], array(1, 2));
+
+        $this->bucketManager->delete($this->bucketName, $key);
+    }
+
     public function testChangeStatus()
     public function testChangeStatus()
     {
     {
         list($ret, $err) = $this->bucketManager->changeStatus($this->bucketName, $this->key, 1);
         list($ret, $err) = $this->bucketManager->changeStatus($this->bucketName, $this->key, 1);

+ 4 - 3
vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php

@@ -121,9 +121,10 @@ class CdnManagerTest extends \PHPUnit_Framework_TestCase
 
 
     public function testGetCdnLogList()
     public function testGetCdnLogList()
     {
     {
-        list($ret, $err) = $this->cdnManager->getCdnLogList(array('fake.qiniu.com'), $this->testLogDate);
-        $this->assertNotNull($err);
-        $this->assertNull($ret);
+        $domain = getenv('QINIU_TEST_DOMAIN');
+        list($ret, $err) = $this->cdnManager->getCdnLogList(array($domain), $this->testLogDate);
+        $this->assertNull($err);
+        $this->assertNotNull($ret);
     }
     }
 
 
     public function testCreateTimestampAntiLeechUrl()
     public function testCreateTimestampAntiLeechUrl()

+ 17 - 0
vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php

@@ -38,6 +38,14 @@ class FormUpTest extends \PHPUnit_Framework_TestCase
         $this->assertNotNull($ret['hash']);
         $this->assertNotNull($ret['hash']);
     }
     }
 
 
+    public function testDataFailed()
+    {
+        $token = $this->auth->uploadToken('fakebucket');
+        list($ret, $error) = FormUploader::put($token, 'formput', 'hello world', $this->cfg, null, 'text/plain', null);
+        $this->assertNull($ret);
+        $this->assertNotNull($error);
+    }
+
     public function testFile()
     public function testFile()
     {
     {
         $key = 'formPutFile';
         $key = 'formPutFile';
@@ -56,4 +64,13 @@ class FormUpTest extends \PHPUnit_Framework_TestCase
         $this->assertNull($error);
         $this->assertNull($error);
         $this->assertNotNull($ret['hash']);
         $this->assertNotNull($ret['hash']);
     }
     }
+
+    public function testFileFailed()
+    {
+        $key = 'fakekey';
+        $token = $this->auth->uploadToken('fakebucket', $key);
+        list($ret, $error) = FormUploader::putFile($token, $key, __file__, $this->cfg, null, 'text/plain', null);
+        $this->assertNull($ret);
+        $this->assertNotNull($error);
+    }
 }
 }

+ 106 - 0
vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php

@@ -3,6 +3,7 @@ namespace Qiniu\Tests;
 
 
 use phpDocumentor\Reflection\DocBlock\Tags\Version;
 use phpDocumentor\Reflection\DocBlock\Tags\Version;
 use Qiniu\Region;
 use Qiniu\Region;
+use Qiniu\Storage\BucketManager;
 use Qiniu\Storage\ResumeUploader;
 use Qiniu\Storage\ResumeUploader;
 use Qiniu\Storage\UploadManager;
 use Qiniu\Storage\UploadManager;
 use Qiniu\Http\Client;
 use Qiniu\Http\Client;
@@ -11,6 +12,19 @@ use Qiniu\Zone;
 
 
 class ResumeUpTest extends \PHPUnit_Framework_TestCase
 class ResumeUpTest extends \PHPUnit_Framework_TestCase
 {
 {
+    private static $keyToDelete = array();
+
+    public static function tearDownAfterClass()
+    {
+        global $bucketName;
+        global $testAuth;
+
+        $config = new Config();
+        $bucketManager = new BucketManager($testAuth, $config);
+        foreach (self::$keyToDelete as $key) {
+            $bucketManager->delete($bucketName, $key);
+        }
+    }
     protected $bucketName;
     protected $bucketName;
     protected $auth;
     protected $auth;
 
 
@@ -93,6 +107,43 @@ class ResumeUpTest extends \PHPUnit_Framework_TestCase
     //     unlink($tempFile);
     //     unlink($tempFile);
     // }
     // }
 
 
+    public function testFileWithFileType()
+    {
+        $config = new Config();
+        $bucketManager = new BucketManager($this->auth, $config);
+
+        $testCases = array(
+            array(
+                "fileType" => 1,
+                "name" => "IA"
+            ),
+            array(
+                "fileType" => 2,
+                "name" => "Archive"
+            ),
+            array(
+                "fileType" => 3,
+                "name" => "DeepArchive"
+            )
+        );
+
+        foreach ($testCases as $testCase) {
+            $key = 'FileType'.$testCase["name"].rand();
+            $police = array(
+                "fileType" => $testCase["fileType"],
+            );
+            $token = $this->auth->uploadToken($this->bucketName, $key, 3600, $police);
+            $upManager = new UploadManager();
+            list($ret, $error) = $upManager->putFile($token, $key, __file__, null, 'text/plain');
+            $this->assertNull($error);
+            $this->assertNotNull($ret);
+            array_push(self::$keyToDelete, $key);
+            list($ret, $err) = $bucketManager->stat($this->bucketName, $key);
+            $this->assertNull($err);
+            $this->assertEquals($testCase["fileType"], $ret["type"]);
+        }
+    }
+
     public function testResumeUploadWithParams()
     public function testResumeUploadWithParams()
     {
     {
         $key = "resumePutFile4ML_".rand();
         $key = "resumePutFile4ML_".rand();
@@ -203,4 +254,59 @@ class ResumeUpTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals("val_2", $response->headers()["X-Qn-Meta-M2"]);
         $this->assertEquals("val_2", $response->headers()["X-Qn-Meta-M2"]);
         unlink($tempFile);
         unlink($tempFile);
     }
     }
+
+    // valid versions are tested above
+    // Use PHPUnit's Data Provider to test multiple Exception is better,
+    // but not match the test style of this project
+    public function testResumeUploadWithInvalidVersion()
+    {
+        $zone = new Zone(array('up.qiniup.com'));
+        $cfg = new Config($zone);
+        $upManager = new UploadManager($cfg);
+        $testFileSize = config::BLOCK_SIZE * 2;
+        $partSize = 5 * 1024 * 1024;
+        $testInvalidVersions = array(
+            // High probability invalid versions
+            'v',
+            '1',
+            '2'
+        );
+
+        $expectExceptionCount = 0;
+        foreach ($testInvalidVersions as $invalidVersion) {
+            $key = 'resumePutFile4ML_'.rand()."_";
+            $token = $this->auth->uploadToken($this->bucketName, $key);
+            $tempFile = qiniuTempFile($testFileSize);
+            $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file');
+            $this->assertNotFalse($resumeFile);
+            try {
+                $upManager->putFile(
+                    $token,
+                    $key,
+                    $tempFile,
+                    null,
+                    'application/octet-stream',
+                    false,
+                    $resumeFile,
+                    $invalidVersion,
+                    $partSize
+                );
+            } catch (\Exception $e) {
+                $isRightException = false;
+                $expectExceptionCount++;
+                while ($e) {
+                    $isRightException = $e instanceof \UnexpectedValueException;
+                    if ($isRightException) {
+                        break;
+                    }
+                    $e = $e->getPrevious();
+                }
+                $this->assertTrue($isRightException);
+            }
+
+            unlink($resumeFile);
+            unlink($tempFile);
+        }
+        $this->assertEquals(count($testInvalidVersions), $expectExceptionCount);
+    }
 }
 }

+ 1 - 1
vendor/qiniu/php-sdk/tests/bootstrap.php

@@ -15,7 +15,7 @@ $key2 = 'niu.jpg';
 $testStartDate = '2020-08-18';
 $testStartDate = '2020-08-18';
 $testEndDate = '2020-08-19';
 $testEndDate = '2020-08-19';
 $testGranularity = 'day';
 $testGranularity = 'day';
-$testLogDate = '2020-08-18';
+$testLogDate = date('Y-m-d',strtotime("-1 days"));
 
 
 $bucketNameBC = 'phpsdk-bc';
 $bucketNameBC = 'phpsdk-bc';
 $bucketNameNA = 'phpsdk-na';
 $bucketNameNA = 'phpsdk-na';

+ 6 - 0
vendor/symfony/options-resolver/CHANGELOG.md

@@ -1,6 +1,12 @@
 CHANGELOG
 CHANGELOG
 =========
 =========
 
 
+3.4.0
+-----
+
+ * added `OptionsResolverIntrospector` to inspect options definitions inside an `OptionsResolver` instance
+ * added array of types support in allowed types (e.g int[])
+
 2.6.0
 2.6.0
 -----
 -----
 
 

+ 1 - 1
vendor/symfony/options-resolver/LICENSE

@@ -1,4 +1,4 @@
-Copyright (c) 2004-2018 Fabien Potencier
+Copyright (c) 2004-2020 Fabien Potencier
 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 of this software and associated documentation files (the "Software"), to deal

+ 168 - 240
vendor/symfony/options-resolver/OptionsResolver.php

@@ -24,63 +24,56 @@ use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
  * @author Bernhard Schussek <bschussek@gmail.com>
  * @author Bernhard Schussek <bschussek@gmail.com>
  * @author Tobias Schultze <http://tobion.de>
  * @author Tobias Schultze <http://tobion.de>
  */
  */
-class OptionsResolver implements Options, OptionsResolverInterface
+class OptionsResolver implements Options
 {
 {
     /**
     /**
-     * The fully qualified name of the {@link Options} interface.
-     *
-     * @internal
-     */
-    const OPTIONS_INTERFACE = 'Symfony\\Component\\OptionsResolver\\Options';
-
-    /**
      * The names of all defined options.
      * The names of all defined options.
      */
      */
-    private $defined = array();
+    private $defined = [];
 
 
     /**
     /**
      * The default option values.
      * The default option values.
      */
      */
-    private $defaults = array();
+    private $defaults = [];
 
 
     /**
     /**
      * The names of required options.
      * The names of required options.
      */
      */
-    private $required = array();
+    private $required = [];
 
 
     /**
     /**
      * The resolved option values.
      * The resolved option values.
      */
      */
-    private $resolved = array();
+    private $resolved = [];
 
 
     /**
     /**
      * A list of normalizer closures.
      * A list of normalizer closures.
      *
      *
      * @var \Closure[]
      * @var \Closure[]
      */
      */
-    private $normalizers = array();
+    private $normalizers = [];
 
 
     /**
     /**
      * A list of accepted values for each option.
      * A list of accepted values for each option.
      */
      */
-    private $allowedValues = array();
+    private $allowedValues = [];
 
 
     /**
     /**
      * A list of accepted types for each option.
      * A list of accepted types for each option.
      */
      */
-    private $allowedTypes = array();
+    private $allowedTypes = [];
 
 
     /**
     /**
      * A list of closures for evaluating lazy options.
      * A list of closures for evaluating lazy options.
      */
      */
-    private $lazy = array();
+    private $lazy = [];
 
 
     /**
     /**
      * A list of lazy options whose closure is currently being called.
      * A list of lazy options whose closure is currently being called.
      *
      *
      * This list helps detecting circular dependencies between lazy options.
      * This list helps detecting circular dependencies between lazy options.
      */
      */
-    private $calling = array();
+    private $calling = [];
 
 
     /**
     /**
      * Whether the instance is locked for reading.
      * Whether the instance is locked for reading.
@@ -92,11 +85,11 @@ class OptionsResolver implements Options, OptionsResolverInterface
      */
      */
     private $locked = false;
     private $locked = false;
 
 
-    private static $typeAliases = array(
+    private static $typeAliases = [
         'boolean' => 'bool',
         'boolean' => 'bool',
         'integer' => 'int',
         'integer' => 'int',
         'double' => 'float',
         'double' => 'float',
-    );
+    ];
 
 
     /**
     /**
      * Sets the default value of a given option.
      * Sets the default value of a given option.
@@ -153,7 +146,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
             $reflClosure = new \ReflectionFunction($value);
             $reflClosure = new \ReflectionFunction($value);
             $params = $reflClosure->getParameters();
             $params = $reflClosure->getParameters();
 
 
-            if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && self::OPTIONS_INTERFACE === $class->name) {
+            if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) {
                 // Initialize the option if no previous value exists
                 // Initialize the option if no previous value exists
                 if (!isset($this->defaults[$option])) {
                 if (!isset($this->defaults[$option])) {
                     $this->defaults[$option] = null;
                     $this->defaults[$option] = null;
@@ -161,7 +154,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
 
 
                 // Ignore previous lazy options if the closure has no second parameter
                 // Ignore previous lazy options if the closure has no second parameter
                 if (!isset($this->lazy[$option]) || !isset($params[1])) {
                 if (!isset($this->lazy[$option]) || !isset($params[1])) {
-                    $this->lazy[$option] = array();
+                    $this->lazy[$option] = [];
                 }
                 }
 
 
                 // Store closure for later evaluation
                 // Store closure for later evaluation
@@ -182,7 +175,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
         // to resolve options with lazy closures, normalizers or validation
         // to resolve options with lazy closures, normalizers or validation
         // rules, none of which can exist for undefined options
         // rules, none of which can exist for undefined options
         // If the option was resolved before, update the resolved value
         // If the option was resolved before, update the resolved value
-        if (!isset($this->defined[$option]) || array_key_exists($option, $this->resolved)) {
+        if (!isset($this->defined[$option]) || \array_key_exists($option, $this->resolved)) {
             $this->resolved[$option] = $value;
             $this->resolved[$option] = $value;
         }
         }
 
 
@@ -222,7 +215,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
      */
      */
     public function hasDefault($option)
     public function hasDefault($option)
     {
     {
-        return array_key_exists($option, $this->defaults);
+        return \array_key_exists($option, $this->defaults);
     }
     }
 
 
     /**
     /**
@@ -287,7 +280,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
      */
      */
     public function isMissing($option)
     public function isMissing($option)
     {
     {
-        return isset($this->required[$option]) && !array_key_exists($option, $this->defaults);
+        return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults);
     }
     }
 
 
     /**
     /**
@@ -400,30 +393,6 @@ class OptionsResolver implements Options, OptionsResolverInterface
     }
     }
 
 
     /**
     /**
-     * Sets the normalizers for an array of options.
-     *
-     * @param array $normalizers An array of closures
-     *
-     * @return $this
-     *
-     * @throws UndefinedOptionsException If the option is undefined
-     * @throws AccessException           If called from a lazy option or normalizer
-     *
-     * @see setNormalizer()
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function setNormalizers(array $normalizers)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use setNormalizer() instead.', E_USER_DEPRECATED);
-
-        foreach ($normalizers as $option => $normalizer) {
-            $this->setNormalizer($option, $normalizer);
-        }
-
-        return $this;
-    }
-
-    /**
      * Sets allowed values for an option.
      * Sets allowed values for an option.
      *
      *
      * Instead of passing values, you may also pass a closures with the
      * Instead of passing values, you may also pass a closures with the
@@ -444,28 +413,17 @@ class OptionsResolver implements Options, OptionsResolverInterface
      * @throws UndefinedOptionsException If the option is undefined
      * @throws UndefinedOptionsException If the option is undefined
      * @throws AccessException           If called from a lazy option or normalizer
      * @throws AccessException           If called from a lazy option or normalizer
      */
      */
-    public function setAllowedValues($option, $allowedValues = null)
+    public function setAllowedValues($option, $allowedValues)
     {
     {
         if ($this->locked) {
         if ($this->locked) {
             throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
             throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
         }
         }
 
 
-        // BC
-        if (\is_array($option) && null === $allowedValues) {
-            @trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since Symfony 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
-
-            foreach ($option as $optionName => $optionValues) {
-                $this->setAllowedValues($optionName, $optionValues);
-            }
-
-            return $this;
-        }
-
         if (!isset($this->defined[$option])) {
         if (!isset($this->defined[$option])) {
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
         }
         }
 
 
-        $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : array($allowedValues);
+        $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues];
 
 
         // Make sure the option is processed
         // Make sure the option is processed
         unset($this->resolved[$option]);
         unset($this->resolved[$option]);
@@ -496,29 +454,18 @@ class OptionsResolver implements Options, OptionsResolverInterface
      * @throws UndefinedOptionsException If the option is undefined
      * @throws UndefinedOptionsException If the option is undefined
      * @throws AccessException           If called from a lazy option or normalizer
      * @throws AccessException           If called from a lazy option or normalizer
      */
      */
-    public function addAllowedValues($option, $allowedValues = null)
+    public function addAllowedValues($option, $allowedValues)
     {
     {
         if ($this->locked) {
         if ($this->locked) {
             throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.');
             throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.');
         }
         }
 
 
-        // BC
-        if (\is_array($option) && null === $allowedValues) {
-            @trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since Symfony 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
-
-            foreach ($option as $optionName => $optionValues) {
-                $this->addAllowedValues($optionName, $optionValues);
-            }
-
-            return $this;
-        }
-
         if (!isset($this->defined[$option])) {
         if (!isset($this->defined[$option])) {
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
         }
         }
 
 
         if (!\is_array($allowedValues)) {
         if (!\is_array($allowedValues)) {
-            $allowedValues = array($allowedValues);
+            $allowedValues = [$allowedValues];
         }
         }
 
 
         if (!isset($this->allowedValues[$option])) {
         if (!isset($this->allowedValues[$option])) {
@@ -548,23 +495,12 @@ class OptionsResolver implements Options, OptionsResolverInterface
      * @throws UndefinedOptionsException If the option is undefined
      * @throws UndefinedOptionsException If the option is undefined
      * @throws AccessException           If called from a lazy option or normalizer
      * @throws AccessException           If called from a lazy option or normalizer
      */
      */
-    public function setAllowedTypes($option, $allowedTypes = null)
+    public function setAllowedTypes($option, $allowedTypes)
     {
     {
         if ($this->locked) {
         if ($this->locked) {
             throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.');
             throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.');
         }
         }
 
 
-        // BC
-        if (\is_array($option) && null === $allowedTypes) {
-            @trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since Symfony 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
-
-            foreach ($option as $optionName => $optionTypes) {
-                $this->setAllowedTypes($optionName, $optionTypes);
-            }
-
-            return $this;
-        }
-
         if (!isset($this->defined[$option])) {
         if (!isset($this->defined[$option])) {
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
         }
         }
@@ -594,23 +530,12 @@ class OptionsResolver implements Options, OptionsResolverInterface
      * @throws UndefinedOptionsException If the option is undefined
      * @throws UndefinedOptionsException If the option is undefined
      * @throws AccessException           If called from a lazy option or normalizer
      * @throws AccessException           If called from a lazy option or normalizer
      */
      */
-    public function addAllowedTypes($option, $allowedTypes = null)
+    public function addAllowedTypes($option, $allowedTypes)
     {
     {
         if ($this->locked) {
         if ($this->locked) {
             throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.');
             throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.');
         }
         }
 
 
-        // BC
-        if (\is_array($option) && null === $allowedTypes) {
-            @trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since Symfony 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
-
-            foreach ($option as $optionName => $optionTypes) {
-                $this->addAllowedTypes($optionName, $optionTypes);
-            }
-
-            return $this;
-        }
-
         if (!isset($this->defined[$option])) {
         if (!isset($this->defined[$option])) {
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
             throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
         }
         }
@@ -665,14 +590,14 @@ class OptionsResolver implements Options, OptionsResolverInterface
             throw new AccessException('Options cannot be cleared from a lazy option or normalizer.');
             throw new AccessException('Options cannot be cleared from a lazy option or normalizer.');
         }
         }
 
 
-        $this->defined = array();
-        $this->defaults = array();
-        $this->required = array();
-        $this->resolved = array();
-        $this->lazy = array();
-        $this->normalizers = array();
-        $this->allowedTypes = array();
-        $this->allowedValues = array();
+        $this->defined = [];
+        $this->defaults = [];
+        $this->required = [];
+        $this->resolved = [];
+        $this->lazy = [];
+        $this->normalizers = [];
+        $this->allowedTypes = [];
+        $this->allowedValues = [];
 
 
         return $this;
         return $this;
     }
     }
@@ -701,7 +626,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
      * @throws NoSuchOptionException     If a lazy option reads an unavailable option
      * @throws NoSuchOptionException     If a lazy option reads an unavailable option
      * @throws AccessException           If called from a lazy option or normalizer
      * @throws AccessException           If called from a lazy option or normalizer
      */
      */
-    public function resolve(array $options = array())
+    public function resolve(array $options = [])
     {
     {
         if ($this->locked) {
         if ($this->locked) {
             throw new AccessException('Options cannot be resolved from a lazy option or normalizer.');
             throw new AccessException('Options cannot be resolved from a lazy option or normalizer.');
@@ -769,12 +694,12 @@ class OptionsResolver implements Options, OptionsResolverInterface
         }
         }
 
 
         // Shortcut for resolved options
         // Shortcut for resolved options
-        if (array_key_exists($option, $this->resolved)) {
+        if (\array_key_exists($option, $this->resolved)) {
             return $this->resolved[$option];
             return $this->resolved[$option];
         }
         }
 
 
         // Check whether the option is set at all
         // Check whether the option is set at all
-        if (!array_key_exists($option, $this->defaults)) {
+        if (!\array_key_exists($option, $this->defaults)) {
             if (!isset($this->defined[$option])) {
             if (!isset($this->defined[$option])) {
                 throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
                 throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
             }
             }
@@ -801,48 +726,49 @@ class OptionsResolver implements Options, OptionsResolverInterface
                 foreach ($this->lazy[$option] as $closure) {
                 foreach ($this->lazy[$option] as $closure) {
                     $value = $closure($this, $value);
                     $value = $closure($this, $value);
                 }
                 }
-            } catch (\Exception $e) {
-                unset($this->calling[$option]);
-                throw $e;
-            } catch (\Throwable $e) {
+            } finally {
                 unset($this->calling[$option]);
                 unset($this->calling[$option]);
-                throw $e;
             }
             }
-            unset($this->calling[$option]);
             // END
             // END
         }
         }
 
 
         // Validate the type of the resolved option
         // Validate the type of the resolved option
         if (isset($this->allowedTypes[$option])) {
         if (isset($this->allowedTypes[$option])) {
-            $valid = false;
+            $valid = true;
+            $invalidTypes = [];
 
 
             foreach ($this->allowedTypes[$option] as $type) {
             foreach ($this->allowedTypes[$option] as $type) {
                 $type = isset(self::$typeAliases[$type]) ? self::$typeAliases[$type] : $type;
                 $type = isset(self::$typeAliases[$type]) ? self::$typeAliases[$type] : $type;
 
 
-                if (\function_exists($isFunction = 'is_'.$type)) {
-                    if ($isFunction($value)) {
-                        $valid = true;
-                        break;
-                    }
-
-                    continue;
-                }
-
-                if ($value instanceof $type) {
-                    $valid = true;
+                if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) {
                     break;
                     break;
                 }
                 }
             }
             }
 
 
             if (!$valid) {
             if (!$valid) {
-                throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), $this->formatTypeOf($value)));
+                $fmtActualValue = $this->formatValue($value);
+                $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]);
+                $fmtProvidedTypes = implode('|', array_keys($invalidTypes));
+
+                $allowedContainsArrayType = \count(array_filter(
+                    $this->allowedTypes[$option],
+                    function ($item) {
+                        return '[]' === substr(isset(self::$typeAliases[$item]) ? self::$typeAliases[$item] : $item, -2);
+                    }
+                )) > 0;
+
+                if (\is_array($value) && $allowedContainsArrayType) {
+                    throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $option, $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes));
+                }
+
+                throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $option, $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes));
             }
             }
         }
         }
 
 
         // Validate the value of the resolved option
         // Validate the value of the resolved option
         if (isset($this->allowedValues[$option])) {
         if (isset($this->allowedValues[$option])) {
             $success = false;
             $success = false;
-            $printableAllowedValues = array();
+            $printableAllowedValues = [];
 
 
             foreach ($this->allowedValues[$option] as $allowedValue) {
             foreach ($this->allowedValues[$option] as $allowedValue) {
                 if ($allowedValue instanceof \Closure) {
                 if ($allowedValue instanceof \Closure) {
@@ -853,7 +779,9 @@ class OptionsResolver implements Options, OptionsResolverInterface
 
 
                     // Don't include closures in the exception message
                     // Don't include closures in the exception message
                     continue;
                     continue;
-                } elseif ($value === $allowedValue) {
+                }
+
+                if ($value === $allowedValue) {
                     $success = true;
                     $success = true;
                     break;
                     break;
                 }
                 }
@@ -896,14 +824,9 @@ class OptionsResolver implements Options, OptionsResolverInterface
             $this->calling[$option] = true;
             $this->calling[$option] = true;
             try {
             try {
                 $value = $normalizer($this, $value);
                 $value = $normalizer($this, $value);
-            } catch (\Exception $e) {
-                unset($this->calling[$option]);
-                throw $e;
-            } catch (\Throwable $e) {
+            } finally {
                 unset($this->calling[$option]);
                 unset($this->calling[$option]);
-                throw $e;
             }
             }
-            unset($this->calling[$option]);
             // END
             // END
         }
         }
 
 
@@ -914,6 +837,65 @@ class OptionsResolver implements Options, OptionsResolverInterface
     }
     }
 
 
     /**
     /**
+     * @param string $type
+     * @param mixed  $value
+     * @param array  &$invalidTypes
+     *
+     * @return bool
+     */
+    private function verifyTypes($type, $value, array &$invalidTypes)
+    {
+        if (\is_array($value) && '[]' === substr($type, -2)) {
+            return $this->verifyArrayType($type, $value, $invalidTypes);
+        }
+
+        if (self::isValueValidType($type, $value)) {
+            return true;
+        }
+
+        if (!$invalidTypes) {
+            $invalidTypes[$this->formatTypeOf($value, null)] = true;
+        }
+
+        return false;
+    }
+
+    /**
+     * @return bool
+     */
+    private function verifyArrayType($type, array $value, array &$invalidTypes, $level = 0)
+    {
+        $type = substr($type, 0, -2);
+
+        if ('[]' === substr($type, -2)) {
+            $success = true;
+            foreach ($value as $item) {
+                if (!\is_array($item)) {
+                    $invalidTypes[$this->formatTypeOf($item, null)] = true;
+
+                    $success = false;
+                } elseif (!$this->verifyArrayType($type, $item, $invalidTypes, $level + 1)) {
+                    $success = false;
+                }
+            }
+
+            return $success;
+        }
+
+        $valid = true;
+
+        foreach ($value as $item) {
+            if (!self::isValueValidType($type, $item)) {
+                $invalidTypes[$this->formatTypeOf($item, $type)] = $value;
+
+                $valid = false;
+            }
+        }
+
+        return $valid;
+    }
+
+    /**
      * Returns whether a resolved option with the given name exists.
      * Returns whether a resolved option with the given name exists.
      *
      *
      * @param string $option The option name
      * @param string $option The option name
@@ -930,7 +912,7 @@ class OptionsResolver implements Options, OptionsResolverInterface
             throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
             throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
         }
         }
 
 
-        return array_key_exists($option, $this->defaults);
+        return \array_key_exists($option, $this->defaults);
     }
     }
 
 
     /**
     /**
@@ -974,106 +956,6 @@ class OptionsResolver implements Options, OptionsResolverInterface
     }
     }
 
 
     /**
     /**
-     * Alias of {@link setDefault()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function set($option, $value)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the setDefaults() method instead.', E_USER_DEPRECATED);
-
-        return $this->setDefault($option, $value);
-    }
-
-    /**
-     * Shortcut for {@link clear()} and {@link setDefaults()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function replace(array $defaults)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the clear() and setDefaults() methods instead.', E_USER_DEPRECATED);
-
-        $this->clear();
-
-        return $this->setDefaults($defaults);
-    }
-
-    /**
-     * Alias of {@link setDefault()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function overload($option, $value)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the setDefault() method instead.', E_USER_DEPRECATED);
-
-        return $this->setDefault($option, $value);
-    }
-
-    /**
-     * Alias of {@link offsetGet()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function get($option)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the ArrayAccess syntax instead to get an option value.', E_USER_DEPRECATED);
-
-        return $this->offsetGet($option);
-    }
-
-    /**
-     * Alias of {@link offsetExists()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function has($option)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the ArrayAccess syntax instead to get an option value.', E_USER_DEPRECATED);
-
-        return $this->offsetExists($option);
-    }
-
-    /**
-     * Shortcut for {@link clear()} and {@link setDefaults()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function replaceDefaults(array $defaultValues)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the clear() and setDefaults() methods instead.', E_USER_DEPRECATED);
-
-        $this->clear();
-
-        return $this->setDefaults($defaultValues);
-    }
-
-    /**
-     * Alias of {@link setDefined()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function setOptional(array $optionNames)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the setDefined() method instead.', E_USER_DEPRECATED);
-
-        return $this->setDefined($optionNames);
-    }
-
-    /**
-     * Alias of {@link isDefined()}.
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function isKnown($option)
-    {
-        @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the isDefined() method instead.', E_USER_DEPRECATED);
-
-        return $this->isDefined($option);
-    }
-
-    /**
      * Returns a string representation of the type of the value.
      * Returns a string representation of the type of the value.
      *
      *
      * This method should be used if you pass the type of a value as
      * This method should be used if you pass the type of a value as
@@ -1081,13 +963,38 @@ class OptionsResolver implements Options, OptionsResolverInterface
      * parameters should usually not be included in messages aimed at
      * parameters should usually not be included in messages aimed at
      * non-technical people.
      * non-technical people.
      *
      *
-     * @param mixed $value The value to return the type of
+     * @param mixed  $value The value to return the type of
+     * @param string $type
      *
      *
      * @return string The type of the value
      * @return string The type of the value
      */
      */
-    private function formatTypeOf($value)
+    private function formatTypeOf($value, $type)
     {
     {
-        return \is_object($value) ? \get_class($value) : \gettype($value);
+        $suffix = '';
+
+        if ('[]' === substr($type, -2)) {
+            $suffix = '[]';
+            $type = substr($type, 0, -2);
+            while ('[]' === substr($type, -2)) {
+                $type = substr($type, 0, -2);
+                $value = array_shift($value);
+                if (!\is_array($value)) {
+                    break;
+                }
+                $suffix .= '[]';
+            }
+
+            if (\is_array($value)) {
+                $subTypes = [];
+                foreach ($value as $val) {
+                    $subTypes[$this->formatTypeOf($val, null)] = true;
+                }
+
+                return implode('|', array_keys($subTypes)).$suffix;
+            }
+        }
+
+        return (\is_object($value) ? \get_class($value) : \gettype($value)).$suffix;
     }
     }
 
 
     /**
     /**
@@ -1154,4 +1061,25 @@ class OptionsResolver implements Options, OptionsResolverInterface
 
 
         return implode(', ', $values);
         return implode(', ', $values);
     }
     }
+
+    private static function isValueValidType($type, $value)
+    {
+        return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
+    }
+
+    /**
+     * @return string|null
+     */
+    private function getParameterClassName(\ReflectionParameter $parameter)
+    {
+        if (!method_exists($parameter, 'getType')) {
+            return ($class = $parameter->getClass()) ? $class->name : null;
+        }
+
+        if (!($type = $parameter->getType()) || $type->isBuiltin()) {
+            return null;
+        }
+
+        return $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type;
+    }
 }
 }

+ 2 - 7
vendor/symfony/options-resolver/composer.json

@@ -16,7 +16,7 @@
         }
         }
     ],
     ],
     "require": {
     "require": {
-        "php": ">=5.3.9"
+        "php": "^5.5.9|>=7.0.8"
     },
     },
     "autoload": {
     "autoload": {
         "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },
         "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },
@@ -24,10 +24,5 @@
             "/Tests/"
             "/Tests/"
         ]
         ]
     },
     },
-    "minimum-stability": "dev",
-    "extra": {
-        "branch-alias": {
-            "dev-master": "2.8-dev"
-        }
-    }
+    "minimum-stability": "dev"
 }
 }