square / connect-api-examples

Code samples demonstrating the functionality of the Square Connect API
https://developer.squareup.com/docs/sample-apps
388 stars 791 forks source link

connect-api-examples/connect-examples/v2/php_payment requires php 8.0.0 (should be 7.1) #323

Open verticon opened 2 years ago

verticon commented 2 years ago

1) Clone connect-api-examples locally 2) Open terminal at connect-api-examples/connect-examples/v2/php_payment 3) run "composer install" 4) Examine vendor/composer/platform_check.php and find the following: if (!(PHP_VERSION_ID >= 80000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.'; }

Huh? README says 7.1 or greater

If I run php_payment on php 8.0.8 all is good. PHP 7.4.21 results in the php version check failing.

verticon commented 2 years ago

% for pkg in composer show --name-only; do echo $pkg; composer show $pkg | grep 'php '; printf "\n"; done

apimatic/jsonmapper

apimatic/unirest-php php >=5.6.0

brick/math php ^7.1 || ^8.0

phpoption/phpoption php ^7.0 || ^8.0

ramsey/collection php ^7.3 || ^8 hamcrest/hamcrest-php ^2

ramsey/uuid php ^8.0

square/square apimatic/unirest-php ^2.2.2 php >=7.2 <8.2

symfony/polyfill-ctype php >=7.1

symfony/polyfill-php81 php >=7.1

vlucas/phpdotenv php ^5.4 || ^7.0 || ^8.0


Looks like ramsey/uuid is the culprit


% composer show ramsey/uuid name : ramsey/uuid descrip. : A PHP library for generating and working with universally unique identifiers (UUIDs). keywords : guid, identifier, uuid versions : * 4.3.1 type : library license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText homepage : source : [git] https://github.com/ramsey/uuid.git 8505afd4fea63b81a85d3b7b53ac3cb8dc347c28 dist : [zip] https://api.github.com/repos/ramsey/uuid/zipball/8505afd4fea63b81a85d3b7b53ac3cb8dc347c28 8505afd4fea63b81a85d3b7b53ac3cb8dc347c28 path : /Users/robertvaessen/Library/Mobile Documents/com~apple~CloudDocs/Wordpress/Learn/Square/Payments/vendor/ramsey/uuid names : ramsey/uuid, rhumsaa/uuid

support issues : https://github.com/ramsey/uuid/issues source : https://github.com/ramsey/uuid/tree/4.3.1

autoload files psr-4 Ramsey\Uuid\ => src/

requires brick/math ^0.8 || ^0.9 ext-ctype ext-json php ^8.0 ramsey/collection ^1.0

requires (dev) captainhook/captainhook ^5.10 captainhook/plugin-composer ^5.3 dealerdirect/phpcodesniffer-composer-installer ^0.7.0 doctrine/annotations ^1.8 ergebnis/composer-normalize ^2.15 mockery/mockery ^1.3 moontoast/math ^1.1 paragonie/random-lib ^2 php-mock/php-mock ^2.2 php-mock/php-mock-mockery ^1.3 php-parallel-lint/php-parallel-lint ^1.1 phpbench/phpbench ^1.0 phpstan/extension-installer ^1.0 phpstan/phpstan ^0.12 phpstan/phpstan-mockery ^0.12 phpstan/phpstan-phpunit ^0.12 phpunit/phpunit ^8.5 || ^9 slevomat/coding-standard ^7.0 squizlabs/php_codesniffer ^3.5 vimeo/psalm ^4.9

suggests ext-bcmath Enables faster math with arbitrary-precision integers using BCMath. ext-ctype Enables faster processing of character classification using ctype functions. ext-gmp Enables faster math with arbitrary-precision integers using GMP. ext-uuid Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator. paragonie/random-lib Provides RandomLib for use with the RandomLibAdapter ramsey/uuid-doctrine Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.

replaces rhumsaa/uuid self.version