From 5af3c3577843a6f65c402c27607edca98233c08e Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 15 Mar 2024 17:14:31 +0100 Subject: another attmpt to install streams/php-jcs via composer --- .../php-json-canonicalization-scheme/CHANGELOG.md | 4 -- .../php-json-canonicalization-scheme/LICENSE.md | 21 ------ .../php-json-canonicalization-scheme/README.md | 43 ------------ .../php-json-canonicalization-scheme/composer.json | 50 -------------- .../src/JsonCanonicalizator.php | 79 ---------------------- .../src/JsonCanonicalizatorFactory.php | 13 ---- .../src/JsonCanonicalizatorInterface.php | 10 --- .../php-json-canonicalization-scheme/src/Utils.php | 52 -------------- 8 files changed, 272 deletions(-) delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/CHANGELOG.md delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/LICENSE.md delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/README.md delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/composer.json delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizator.php delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizatorFactory.php delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizatorInterface.php delete mode 100644 vendor/mmccook/php-json-canonicalization-scheme/src/Utils.php (limited to 'vendor/mmccook/php-json-canonicalization-scheme') diff --git a/vendor/mmccook/php-json-canonicalization-scheme/CHANGELOG.md b/vendor/mmccook/php-json-canonicalization-scheme/CHANGELOG.md deleted file mode 100644 index a9bd9a22b..000000000 --- a/vendor/mmccook/php-json-canonicalization-scheme/CHANGELOG.md +++ /dev/null @@ -1,4 +0,0 @@ -# Changelog - -All notable changes to `php-json-canonicalization-scheme` will be documented in this file. - diff --git a/vendor/mmccook/php-json-canonicalization-scheme/LICENSE.md b/vendor/mmccook/php-json-canonicalization-scheme/LICENSE.md deleted file mode 100644 index bbd0c5b62..000000000 --- a/vendor/mmccook/php-json-canonicalization-scheme/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) mmccook - -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, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/mmccook/php-json-canonicalization-scheme/README.md b/vendor/mmccook/php-json-canonicalization-scheme/README.md deleted file mode 100644 index 780c431b3..000000000 --- a/vendor/mmccook/php-json-canonicalization-scheme/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# JSON Canonicalization for PHP 8.1+ - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/mmccook/php-json-canonicalization-scheme.svg?style=flat-square)](https://packagist.org/packages/mmccook/php-json-canonicalization-scheme) -[![Tests](https://img.shields.io/github/actions/workflow/status/mmccook/php-json-canonicalization-scheme/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/mmccook/php-json-canonicalization-scheme/actions/workflows/run-tests.yml) -[![Total Downloads](https://img.shields.io/packagist/dt/mmccook/php-json-canonicalization-scheme.svg?style=flat-square)](https://packagist.org/packages/mmccook/php-json-canonicalization-scheme) - -Needed a way to canonicalize JSON to validate webhooks from [The Campaign Registry](https://csp-api.campaignregistry.com/v2/restAPI) -couldn't find an actively maintained package that all passed the JCS tests, so I used the one listed on the JCS Github and updated/refactored it. - -## Installation - -You can install the package via composer: - -```bash -composer require mmccook/php-json-canonicalization-scheme -``` - -## Usage - -```php -$canonicalization = JsonCanonicalizatorFactory::getInstance(); -$canonicalizedJsonString = $canonicalization->canonicalize($input); -``` - -## Testing - -```bash -composer test -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. - -## Credits -- [Mark M. McCook](https://github.com/mmccook) - -## License -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/vendor/mmccook/php-json-canonicalization-scheme/composer.json b/vendor/mmccook/php-json-canonicalization-scheme/composer.json deleted file mode 100644 index 62f712dcc..000000000 --- a/vendor/mmccook/php-json-canonicalization-scheme/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "mmccook/php-json-canonicalization-scheme", - "description": "This is my package php-json-canonicalization-scheme", - "keywords": [ - "mmccook", - "php-json-canonicalization-scheme" - ], - "homepage": "https://github.com/mmccook/php-json-canonicalization-scheme", - "license": "MIT", - "authors": [ - { - "name": "Mark M. McCook", - "email": "mark.mccook@gmail.com", - "role": "Developer" - } - ], - "require": { - "php": "^8.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.13", - "pestphp/pest": "^1.20", - "phpstan/phpstan": "^1.10", - "spatie/ray": "^1.28" - }, - "autoload": { - "psr-4": { - "Mmccook\\JsonCanonicalizator\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Mmccook\\JsonCanonicalizator\\Tests\\": "tests" - } - }, - "scripts": { - "test": "vendor/bin/pest", - "test-coverage": "vendor/bin/pest --coverage", - "format": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "pestphp/pest-plugin": true, - "phpstan/extension-installer": true - } - }, - "minimum-stability": "stable", - "prefer-stable": true -} diff --git a/vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizator.php b/vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizator.php deleted file mode 100644 index 6a3c82959..000000000 --- a/vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizator.php +++ /dev/null @@ -1,79 +0,0 @@ -serialize($data); - - $result = ob_get_clean(); - - return $asHex ? Utils::asHex($result) : $result; - } - - private function serialize($item) - { - if (is_float($item)) { - echo Utils::es6NumberFormat($item); - - return; - } - - if (null === $item || is_scalar($item)) { - echo json_encode($item, self::JSON_FLAGS); - - return; - } - - if (is_array($item) && ! Utils::isAssoc($item)) { - echo '['; - $next = false; - foreach ($item as $element) { - if ($next) { - echo ','; - } - $next = true; - $this->serialize($element); - } - echo ']'; - - return; - } - - if (is_object($item)) { - $item = (array)$item; - } - - uksort($item, function (string $a, string $b) { - $a = mb_convert_encoding($a, 'UTF-16BE'); - $b = mb_convert_encoding($b, 'UTF-16BE'); - - return strcmp($a, $b); - }); - - echo '{'; - $next = false; - foreach ($item as $key => $value) { - //var_dump($key, $value); - if ($next) { - echo ','; - } - $next = true; - $outKey = json_encode((string)$key, self::JSON_FLAGS); - echo $outKey, ':', $this->serialize($value); - } - echo '}'; - - } -} diff --git a/vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizatorFactory.php b/vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizatorFactory.php deleted file mode 100644 index 68b1c50c9..000000000 --- a/vendor/mmccook/php-json-canonicalization-scheme/src/JsonCanonicalizatorFactory.php +++ /dev/null @@ -1,13 +0,0 @@ -= 1e-6) { - $formatted = number_format($number, 7, '.', ''); - $formatted = rtrim($formatted, '.0'); - } else { - $formatted = sprintf('%e', $number); - $parts = explode('e', $formatted); - $parts[0] = rtrim($parts[0], '.0'); - $formatted = implode('e', $parts); - } - - return $sign . $formatted; - } -} -- cgit v1.2.3