From d75f9a744acf467871c02eaf2d97e703374a74de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Scha=CC=88fli?= Date: Tue, 12 Sep 2017 10:08:34 +0200 Subject: [PATCH] Update qr code library to version 1.9.3 --- composer.json | 4 +- composer.lock | 26 +++--- vendor/composer/installed.json | 28 +++---- vendor/endroid/qrcode/src/QrCode.php | 17 +++- vendor/symfony/options-resolver/LICENSE | 2 +- .../options-resolver/OptionsResolver.php | 22 ++--- .../Tests/OptionsResolverTest.php | 81 ++++++++++--------- vendor/symfony/options-resolver/composer.json | 4 +- .../symfony/options-resolver/phpunit.xml.dist | 2 + 9 files changed, 104 insertions(+), 82 deletions(-) diff --git a/composer.json b/composer.json index 9d8f4967..cbac9ce2 100644 --- a/composer.json +++ b/composer.json @@ -35,10 +35,10 @@ "prefer-stable": true, "require": { "php" : "^5.5.9 || ^7.0", - "endroid/qrcode": "^1.7" + "endroid/qrcode": "^1.9" }, "require-dev": { - "endroid/qrcode": "^1.7" + "endroid/qrcode": "^1.9" }, "autoload": { "classmap": ["./classes/"] diff --git a/composer.lock b/composer.lock index 50589979..5a02c9c3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "7fc1b7e99fd13002916382bef781b48d", + "content-hash": "0c0574ef1a7d10a3bb1ddd7b0bb54177", "packages": [ { "name": "endroid/qrcode", - "version": "1.9.1", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/endroid/QrCode.git", - "reference": "ab09b42778ad67cfe850f9c23165f8d08b756680" + "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/endroid/QrCode/zipball/ab09b42778ad67cfe850f9c23165f8d08b756680", - "reference": "ab09b42778ad67cfe850f9c23165f8d08b756680", + "url": "https://api.github.com/repos/endroid/QrCode/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93", + "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93", "shasum": "" }, "require": { @@ -64,29 +64,29 @@ "qrcode", "symfony" ], - "time": "2017-01-03T11:02:14+00:00" + "time": "2017-04-08T09:13:59+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.2.1", + "version": "v3.3.9", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "45940bcad6388b3b6058107eca67ced738d205bb" + "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45940bcad6388b3b6058107eca67ced738d205bb", - "reference": "45940bcad6388b3b6058107eca67ced738d205bb", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ee4e22978fe885b54ee5da8c7964f0a5301abfb6", + "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -118,7 +118,7 @@ "configuration", "options" ], - "time": "2016-05-13T18:13:23+00:00" + "time": "2017-07-29T21:54:42+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 9c8f4117..066ad86a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,27 +1,27 @@ [ { "name": "symfony/options-resolver", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.3.9", + "version_normalized": "3.3.9.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "45940bcad6388b3b6058107eca67ced738d205bb" + "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45940bcad6388b3b6058107eca67ced738d205bb", - "reference": "45940bcad6388b3b6058107eca67ced738d205bb", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ee4e22978fe885b54ee5da8c7964f0a5301abfb6", + "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, - "time": "2016-05-13T18:13:23+00:00", + "time": "2017-07-29T21:54:42+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "installation-source": "dist", @@ -57,17 +57,17 @@ }, { "name": "endroid/qrcode", - "version": "1.9.1", - "version_normalized": "1.9.1.0", + "version": "1.9.3", + "version_normalized": "1.9.3.0", "source": { "type": "git", "url": "https://github.com/endroid/QrCode.git", - "reference": "ab09b42778ad67cfe850f9c23165f8d08b756680" + "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/endroid/QrCode/zipball/ab09b42778ad67cfe850f9c23165f8d08b756680", - "reference": "ab09b42778ad67cfe850f9c23165f8d08b756680", + "url": "https://api.github.com/repos/endroid/QrCode/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93", + "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93", "shasum": "" }, "require": { @@ -82,7 +82,7 @@ "symfony/framework-bundle": "^2.3|^3.0", "symfony/http-kernel": "^2.3|^3.0" }, - "time": "2017-01-03T11:02:14+00:00", + "time": "2017-04-08T09:13:59+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/endroid/qrcode/src/QrCode.php b/vendor/endroid/qrcode/src/QrCode.php index 1fe249ce..b128cfc4 100755 --- a/vendor/endroid/qrcode/src/QrCode.php +++ b/vendor/endroid/qrcode/src/QrCode.php @@ -1397,7 +1397,10 @@ public function create() ++$i; } - $mib = $max_modules_1side + 8; + $mib = $max_modules_1side; + if ($this->draw_quiet_zone) { + $mib += 8; + } if ($this->size == 0) { $this->size = $mib * $qrcode_module_size; @@ -1458,7 +1461,7 @@ public function create() 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 - 8, $mib - 8); + imagecopyresampled($output_image, $base_image, $this->padding, $this->padding, 4, 4, $this->size, $this->size, $mib, $mib); } if ($this->draw_border == true) { @@ -1559,7 +1562,15 @@ public function create() $output_image = imagecreatetruecolor($image_width, $image_height); imagecopy($output_image, $output_image_org, 0, 0, 0, 0, $image_width, $image_height); - $logo_image = call_user_func('imagecreatefrom'.$this->image_type, $this->logo); + $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'); } diff --git a/vendor/symfony/options-resolver/LICENSE b/vendor/symfony/options-resolver/LICENSE index 12a74531..17d16a13 100644 --- a/vendor/symfony/options-resolver/LICENSE +++ b/vendor/symfony/options-resolver/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2016 Fabien Potencier +Copyright (c) 2004-2017 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/options-resolver/OptionsResolver.php b/vendor/symfony/options-resolver/OptionsResolver.php index bcaea9e4..32ac5663 100644 --- a/vendor/symfony/options-resolver/OptionsResolver.php +++ b/vendor/symfony/options-resolver/OptionsResolver.php @@ -145,7 +145,7 @@ class OptionsResolver implements Options * @param string $option The name of the option * @param mixed $value The default value of the option * - * @return OptionsResolver This instance + * @return $this * * @throws AccessException If called from a lazy option or normalizer */ @@ -208,7 +208,7 @@ public function setDefault($option, $value) * * @param array $defaults The default values to set * - * @return OptionsResolver This instance + * @return $this * * @throws AccessException If called from a lazy option or normalizer */ @@ -241,7 +241,7 @@ public function hasDefault($option) * * @param string|string[] $optionNames One or more option names * - * @return OptionsResolver This instance + * @return $this * * @throws AccessException If called from a lazy option or normalizer */ @@ -322,7 +322,7 @@ public function getMissingOptions() * * @param string|string[] $optionNames One or more option names * - * @return OptionsResolver This instance + * @return $this * * @throws AccessException If called from a lazy option or normalizer */ @@ -389,7 +389,7 @@ public function getDefinedOptions() * @param string $option The option name * @param \Closure $normalizer The normalizer * - * @return OptionsResolver This instance + * @return $this * * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer @@ -432,7 +432,7 @@ public function setNormalizer($option, \Closure $normalizer) * @param string $option The option name * @param mixed $allowedValues One or more acceptable values/closures * - * @return OptionsResolver This instance + * @return $this * * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer @@ -477,7 +477,7 @@ public function setAllowedValues($option, $allowedValues) * @param string $option The option name * @param mixed $allowedValues One or more acceptable values/closures * - * @return OptionsResolver This instance + * @return $this * * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer @@ -522,7 +522,7 @@ public function addAllowedValues($option, $allowedValues) * @param string $option The option name * @param string|string[] $allowedTypes One or more accepted types * - * @return OptionsResolver This instance + * @return $this * * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer @@ -561,7 +561,7 @@ public function setAllowedTypes($option, $allowedTypes) * @param string $option The option name * @param string|string[] $allowedTypes One or more accepted types * - * @return OptionsResolver This instance + * @return $this * * @throws UndefinedOptionsException If the option is undefined * @throws AccessException If called from a lazy option or normalizer @@ -599,7 +599,7 @@ public function addAllowedTypes($option, $allowedTypes) * * @param string|string[] $optionNames One or more option names * - * @return OptionsResolver This instance + * @return $this * * @throws AccessException If called from a lazy option or normalizer */ @@ -620,7 +620,7 @@ public function remove($optionNames) /** * Removes all options. * - * @return OptionsResolver This instance + * @return $this * * @throws AccessException If called from a lazy option or normalizer */ diff --git a/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php b/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php index 216347a7..d09dece3 100644 --- a/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php +++ b/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php @@ -11,11 +11,13 @@ namespace Symfony\Component\OptionsResolver\Tests; +use PHPUnit\Framework\Assert; +use PHPUnit\Framework\TestCase; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; -class OptionsResolverTest extends \PHPUnit_Framework_TestCase +class OptionsResolverTest extends TestCase { /** * @var OptionsResolver @@ -134,7 +136,7 @@ public function testSetLazyClosure() public function testClosureWithoutTypeHintNotInvoked() { $closure = function ($options) { - \PHPUnit_Framework_Assert::fail('Should not be called'); + Assert::fail('Should not be called'); }; $this->resolver->setDefault('foo', $closure); @@ -145,7 +147,7 @@ public function testClosureWithoutTypeHintNotInvoked() public function testClosureWithoutParametersNotInvoked() { $closure = function () { - \PHPUnit_Framework_Assert::fail('Should not be called'); + Assert::fail('Should not be called'); }; $this->resolver->setDefault('foo', $closure); @@ -160,7 +162,7 @@ public function testAccessPreviousDefaultValue() // defined by subclass $this->resolver->setDefault('foo', function (Options $options, $previousValue) { - \PHPUnit_Framework_Assert::assertEquals('bar', $previousValue); + Assert::assertEquals('bar', $previousValue); return 'lazy'; }); @@ -177,7 +179,7 @@ public function testAccessPreviousLazyDefaultValue() // defined by subclass $this->resolver->setDefault('foo', function (Options $options, $previousValue) { - \PHPUnit_Framework_Assert::assertEquals('bar', $previousValue); + Assert::assertEquals('bar', $previousValue); return 'lazy'; }); @@ -189,7 +191,7 @@ public function testPreviousValueIsNotEvaluatedIfNoSecondArgument() { // defined by superclass $this->resolver->setDefault('foo', function () { - \PHPUnit_Framework_Assert::fail('Should not be called'); + Assert::fail('Should not be called'); }); // defined by subclass, no $previousValue argument defined! @@ -203,7 +205,7 @@ public function testPreviousValueIsNotEvaluatedIfNoSecondArgument() public function testOverwrittenLazyOptionNotEvaluated() { $this->resolver->setDefault('foo', function (Options $options) { - \PHPUnit_Framework_Assert::fail('Should not be called'); + Assert::fail('Should not be called'); }); $this->resolver->setDefault('foo', 'bar'); @@ -216,13 +218,13 @@ public function testInvokeEachLazyOptionOnlyOnce() $calls = 0; $this->resolver->setDefault('lazy1', function (Options $options) use (&$calls) { - \PHPUnit_Framework_Assert::assertSame(1, ++$calls); + Assert::assertSame(1, ++$calls); $options['lazy2']; }); $this->resolver->setDefault('lazy2', function (Options $options) use (&$calls) { - \PHPUnit_Framework_Assert::assertSame(2, ++$calls); + Assert::assertSame(2, ++$calls); }); $this->resolver->resolve(); @@ -505,7 +507,14 @@ public function testResolveFailsIfInvalidType($actualType, $allowedType, $except { $this->resolver->setDefined('option'); $this->resolver->setAllowedTypes('option', $allowedType); - $this->setExpectedException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException', $exceptionMessage); + + if (method_exists($this, 'expectException')) { + $this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException'); + $this->expectExceptionMessage($exceptionMessage); + } else { + $this->setExpectedException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException', $exceptionMessage); + } + $this->resolver->resolve(array('option' => $actualType)); } @@ -996,7 +1005,7 @@ public function testValidateTypeBeforeNormalization() $this->resolver->setAllowedTypes('foo', 'int'); $this->resolver->setNormalizer('foo', function () { - \PHPUnit_Framework_Assert::fail('Should not be called.'); + Assert::fail('Should not be called.'); }); $this->resolver->resolve(); @@ -1012,7 +1021,7 @@ public function testValidateValueBeforeNormalization() $this->resolver->setAllowedValues('foo', 'baz'); $this->resolver->setNormalizer('foo', function () { - \PHPUnit_Framework_Assert::fail('Should not be called.'); + Assert::fail('Should not be called.'); }); $this->resolver->resolve(); @@ -1024,8 +1033,8 @@ public function testNormalizerCanAccessOtherOptions() $this->resolver->setDefault('norm', 'baz'); $this->resolver->setNormalizer('norm', function (Options $options) { - /* @var \PHPUnit_Framework_TestCase $test */ - \PHPUnit_Framework_Assert::assertSame('bar', $options['default']); + /* @var TestCase $test */ + Assert::assertSame('bar', $options['default']); return 'normalized'; }); @@ -1044,8 +1053,8 @@ public function testNormalizerCanAccessLazyOptions() $this->resolver->setDefault('norm', 'baz'); $this->resolver->setNormalizer('norm', function (Options $options) { - /* @var \PHPUnit_Framework_TestCase $test */ - \PHPUnit_Framework_Assert::assertEquals('bar', $options['lazy']); + /* @var TestCase $test */ + Assert::assertEquals('bar', $options['lazy']); return 'normalized'; }); @@ -1093,7 +1102,7 @@ public function testFailIfCyclicDependencyBetweenNormalizerAndLazyOption() $this->resolver->resolve(); } - public function testCatchedExceptionFromNormalizerDoesNotCrashOptionResolver() + public function testCaughtExceptionFromNormalizerDoesNotCrashOptionResolver() { $throw = true; @@ -1107,7 +1116,7 @@ public function testCatchedExceptionFromNormalizerDoesNotCrashOptionResolver() } }); - $this->resolver->setNormalizer('thrower', function (Options $options) use (&$throw) { + $this->resolver->setNormalizer('thrower', function () use (&$throw) { if ($throw) { $throw = false; throw new \UnexpectedValueException('throwing'); @@ -1116,10 +1125,10 @@ public function testCatchedExceptionFromNormalizerDoesNotCrashOptionResolver() return true; }); - $this->resolver->resolve(); + $this->assertSame(array('catcher' => false, 'thrower' => true), $this->resolver->resolve()); } - public function testCatchedExceptionFromLazyDoesNotCrashOptionResolver() + public function testCaughtExceptionFromLazyDoesNotCrashOptionResolver() { $throw = true; @@ -1140,7 +1149,7 @@ public function testCatchedExceptionFromLazyDoesNotCrashOptionResolver() return true; }); - $this->resolver->resolve(); + $this->assertSame(array('catcher' => false, 'thrower' => true), $this->resolver->resolve()); } public function testInvokeEachNormalizerOnlyOnce() @@ -1151,12 +1160,12 @@ public function testInvokeEachNormalizerOnlyOnce() $this->resolver->setDefault('norm2', 'baz'); $this->resolver->setNormalizer('norm1', function ($options) use (&$calls) { - \PHPUnit_Framework_Assert::assertSame(1, ++$calls); + Assert::assertSame(1, ++$calls); $options['norm2']; }); $this->resolver->setNormalizer('norm2', function () use (&$calls) { - \PHPUnit_Framework_Assert::assertSame(2, ++$calls); + Assert::assertSame(2, ++$calls); }); $this->resolver->resolve(); @@ -1169,7 +1178,7 @@ public function testNormalizerNotCalledForUnsetOptions() $this->resolver->setDefined('norm'); $this->resolver->setNormalizer('norm', function () { - \PHPUnit_Framework_Assert::fail('Should not be called.'); + Assert::fail('Should not be called.'); }); $this->assertEmpty($this->resolver->resolve()); @@ -1410,17 +1419,17 @@ public function testArrayAccess() }); $this->resolver->setDefault('lazy2', function (Options $options) { - \PHPUnit_Framework_Assert::assertTrue(isset($options['default1'])); - \PHPUnit_Framework_Assert::assertTrue(isset($options['default2'])); - \PHPUnit_Framework_Assert::assertTrue(isset($options['required'])); - \PHPUnit_Framework_Assert::assertTrue(isset($options['lazy1'])); - \PHPUnit_Framework_Assert::assertTrue(isset($options['lazy2'])); - \PHPUnit_Framework_Assert::assertFalse(isset($options['defined'])); - - \PHPUnit_Framework_Assert::assertSame(0, $options['default1']); - \PHPUnit_Framework_Assert::assertSame(42, $options['default2']); - \PHPUnit_Framework_Assert::assertSame('value', $options['required']); - \PHPUnit_Framework_Assert::assertSame('lazy', $options['lazy1']); + Assert::assertTrue(isset($options['default1'])); + Assert::assertTrue(isset($options['default2'])); + Assert::assertTrue(isset($options['required'])); + Assert::assertTrue(isset($options['lazy1'])); + Assert::assertTrue(isset($options['lazy2'])); + Assert::assertFalse(isset($options['defined'])); + + Assert::assertSame(0, $options['default1']); + Assert::assertSame(42, $options['default2']); + Assert::assertSame('value', $options['required']); + Assert::assertSame('lazy', $options['lazy1']); // Obviously $options['lazy'] and $options['defined'] cannot be // accessed @@ -1525,7 +1534,7 @@ public function testCount() $this->resolver->setDefault('lazy1', function () {}); $this->resolver->setDefault('lazy2', function (Options $options) { - \PHPUnit_Framework_Assert::assertCount(4, $options); + Assert::assertCount(4, $options); }); $this->assertCount(4, $this->resolver->resolve(array('required' => 'value'))); diff --git a/vendor/symfony/options-resolver/composer.json b/vendor/symfony/options-resolver/composer.json index 28cb1d7b..4311b59c 100644 --- a/vendor/symfony/options-resolver/composer.json +++ b/vendor/symfony/options-resolver/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, @@ -27,7 +27,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } } } diff --git a/vendor/symfony/options-resolver/phpunit.xml.dist b/vendor/symfony/options-resolver/phpunit.xml.dist index abf84614..7e04e604 100644 --- a/vendor/symfony/options-resolver/phpunit.xml.dist +++ b/vendor/symfony/options-resolver/phpunit.xml.dist @@ -5,6 +5,8 @@ backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" + failOnRisky="true" + failOnWarning="true" >