Skip to content

Commit

Permalink
Merge pull request #516 from nextcloud/add/php-ds
Browse files Browse the repository at this point in the history
Add php-ds polyfill
  • Loading branch information
rullzer committed Oct 28, 2020
2 parents 5b2c4bd + b4e3e83 commit a3fd9c2
Show file tree
Hide file tree
Showing 26 changed files with 3,397 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"symfony/routing": "4.4.15",
"symfony/translation": "4.4.15",
"php-http/guzzle6-adapter": "^2.0",
"web-auth/webauthn-lib": "^3.1"
"web-auth/webauthn-lib": "^3.1",
"php-ds/php-ds": "^1.3"
},
"scripts": {
"vendor": "composer install --no-dev && git clean -xdf && composer dump-autoload"
Expand Down
53 changes: 52 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,22 @@
'Doctrine\\DBAL\\Types\\VarDateTimeType' => $vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php',
'Doctrine\\DBAL\\Version' => $vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL/Version.php',
'Doctrine\\DBAL\\VersionAwarePlatformDriver' => $vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL/VersionAwarePlatformDriver.php',
'Ds\\Collection' => $vendorDir . '/php-ds/php-ds/src/Collection.php',
'Ds\\Deque' => $vendorDir . '/php-ds/php-ds/src/Deque.php',
'Ds\\Hashable' => $vendorDir . '/php-ds/php-ds/src/Hashable.php',
'Ds\\Map' => $vendorDir . '/php-ds/php-ds/src/Map.php',
'Ds\\Pair' => $vendorDir . '/php-ds/php-ds/src/Pair.php',
'Ds\\PriorityNode' => $vendorDir . '/php-ds/php-ds/src/PriorityQueue.php',
'Ds\\PriorityQueue' => $vendorDir . '/php-ds/php-ds/src/PriorityQueue.php',
'Ds\\Queue' => $vendorDir . '/php-ds/php-ds/src/Queue.php',
'Ds\\Sequence' => $vendorDir . '/php-ds/php-ds/src/Sequence.php',
'Ds\\Set' => $vendorDir . '/php-ds/php-ds/src/Set.php',
'Ds\\Stack' => $vendorDir . '/php-ds/php-ds/src/Stack.php',
'Ds\\Traits\\Capacity' => $vendorDir . '/php-ds/php-ds/src/Traits/Capacity.php',
'Ds\\Traits\\GenericCollection' => $vendorDir . '/php-ds/php-ds/src/Traits/GenericCollection.php',
'Ds\\Traits\\GenericSequence' => $vendorDir . '/php-ds/php-ds/src/Traits/GenericSequence.php',
'Ds\\Traits\\SquaredCapacity' => $vendorDir . '/php-ds/php-ds/src/Traits/SquaredCapacity.php',
'Ds\\Vector' => $vendorDir . '/php-ds/php-ds/src/Vector.php',
'Egulias\\EmailValidator\\EmailLexer' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailLexer.php',
'Egulias\\EmailValidator\\EmailParser' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailParser.php',
'Egulias\\EmailValidator\\EmailValidator' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailValidator.php',
Expand Down
1 change: 1 addition & 0 deletions composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'FG\\' => array($vendorDir . '/fgrosse/phpasn1/lib'),
'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/EmailValidator'),
'Ds\\' => array($vendorDir . '/php-ds/php-ds/src'),
'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL'),
'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'),
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'),
Expand Down
21 changes: 21 additions & 0 deletions composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
),
'D' =>
array (
'Ds\\' => 3,
'Doctrine\\DBAL\\' => 14,
'Doctrine\\Common\\Lexer\\' => 22,
'Doctrine\\Common\\Inflector\\' => 26,
Expand Down Expand Up @@ -447,6 +448,10 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
array (
0 => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator',
),
'Ds\\' =>
array (
0 => __DIR__ . '/..' . '/php-ds/php-ds/src',
),
'Doctrine\\DBAL\\' =>
array (
0 => __DIR__ . '/..' . '/doctrine/dbal/lib/Doctrine/DBAL',
Expand Down Expand Up @@ -1648,6 +1653,22 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Doctrine\\DBAL\\Types\\VarDateTimeType' => __DIR__ . '/..' . '/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php',
'Doctrine\\DBAL\\Version' => __DIR__ . '/..' . '/doctrine/dbal/lib/Doctrine/DBAL/Version.php',
'Doctrine\\DBAL\\VersionAwarePlatformDriver' => __DIR__ . '/..' . '/doctrine/dbal/lib/Doctrine/DBAL/VersionAwarePlatformDriver.php',
'Ds\\Collection' => __DIR__ . '/..' . '/php-ds/php-ds/src/Collection.php',
'Ds\\Deque' => __DIR__ . '/..' . '/php-ds/php-ds/src/Deque.php',
'Ds\\Hashable' => __DIR__ . '/..' . '/php-ds/php-ds/src/Hashable.php',
'Ds\\Map' => __DIR__ . '/..' . '/php-ds/php-ds/src/Map.php',
'Ds\\Pair' => __DIR__ . '/..' . '/php-ds/php-ds/src/Pair.php',
'Ds\\PriorityNode' => __DIR__ . '/..' . '/php-ds/php-ds/src/PriorityQueue.php',
'Ds\\PriorityQueue' => __DIR__ . '/..' . '/php-ds/php-ds/src/PriorityQueue.php',
'Ds\\Queue' => __DIR__ . '/..' . '/php-ds/php-ds/src/Queue.php',
'Ds\\Sequence' => __DIR__ . '/..' . '/php-ds/php-ds/src/Sequence.php',
'Ds\\Set' => __DIR__ . '/..' . '/php-ds/php-ds/src/Set.php',
'Ds\\Stack' => __DIR__ . '/..' . '/php-ds/php-ds/src/Stack.php',
'Ds\\Traits\\Capacity' => __DIR__ . '/..' . '/php-ds/php-ds/src/Traits/Capacity.php',
'Ds\\Traits\\GenericCollection' => __DIR__ . '/..' . '/php-ds/php-ds/src/Traits/GenericCollection.php',
'Ds\\Traits\\GenericSequence' => __DIR__ . '/..' . '/php-ds/php-ds/src/Traits/GenericSequence.php',
'Ds\\Traits\\SquaredCapacity' => __DIR__ . '/..' . '/php-ds/php-ds/src/Traits/SquaredCapacity.php',
'Ds\\Vector' => __DIR__ . '/..' . '/php-ds/php-ds/src/Vector.php',
'Egulias\\EmailValidator\\EmailLexer' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailLexer.php',
'Egulias\\EmailValidator\\EmailParser' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailParser.php',
'Egulias\\EmailValidator\\EmailValidator' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailValidator.php',
Expand Down
53 changes: 53 additions & 0 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,59 @@
"exception"
]
},
{
"name": "php-ds/php-ds",
"version": "v1.3.0",
"version_normalized": "1.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-ds/polyfill.git",
"reference": "b98396862fb8a13cbdbbaf4d18be28ee5c01ed3c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-ds/polyfill/zipball/b98396862fb8a13cbdbbaf4d18be28ee5c01ed3c",
"reference": "b98396862fb8a13cbdbbaf4d18be28ee5c01ed3c",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=7.0.0"
},
"provide": {
"ext-ds": "1.3.0"
},
"require-dev": {
"php-ds/tests": "^1.3"
},
"suggest": {
"ext-ds": "to improve performance and reduce memory usage"
},
"time": "2020-10-14T04:23:31+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Ds\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rudi Theunissen",
"email": "rudolf.theunissen@gmail.com"
}
],
"keywords": [
"data structures",
"ds",
"php",
"polyfill"
]
},
{
"name": "php-http/guzzle6-adapter",
"version": "v2.0.1",
Expand Down
33 changes: 33 additions & 0 deletions php-ds/php-ds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.3.0] - 2020-10-13
### Changed
- Implement ArrayAccess consistently
### Fixed
- Return types were incorrectly nullable in some cases
- Deque capacity was inconsistent with the extension

## [1.2.0] - 2017-08-03
### Changed
- Minor capacity updates

## [1.1.1] - 2016-08-09
### Fixed
- `Stack` and `Queue` array access should throw `OutOfBoundsException`, not `Error`.

### Improved
- Added a lot of docblock comments that were missing.

## [1.1.0] - 2016-08-04
### Added
- `Pair::copy`

## [1.0.3] - 2016-08-01
### Added
- `Set::merge`

## [1.0.2] - 2016-07-31
### Added
- `Map::putAll`
21 changes: 21 additions & 0 deletions php-ds/php-ds/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing

Contributions are accepted via [pull requests](https://github.com/php-ds/ext/pulls). If you would like to report a bug, please create an [issue](https://github.com/php-ds/ext/issues) instead.

## Issues

- **How to reproduce** - Provide an easy way to reproduce the bug. This makes it easier for others to debug.

- **Platform details** - Specify your platform and your PHP version, eg. "PHP 7.0.2 on Ubuntu 14.04 64x".

## Pull Requests

- **Add tests** - Your patch won't be accepted if it doesn't have tests where appropriate.

- **Document any change in behaviour** - Make sure the README and any other relevant documentation updated.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

- **Coding style** - Try to match the style of the rest of the source wherever possible. Your patch won't be accepted if the style is significantly different.
20 changes: 20 additions & 0 deletions php-ds/php-ds/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2016 Rudi Theunissen

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.
39 changes: 39 additions & 0 deletions php-ds/php-ds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Data Structures for PHP 7

[![Build Status](https://travis-ci.org/php-ds/polyfill.svg?branch=master)](https://travis-ci.org/php-ds/polyfill)
[![Code Coverage](https://scrutinizer-ci.com/g/php-ds/polyfill/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-ds/polyfill/?branch=master)
[![Packagist](https://img.shields.io/packagist/v/php-ds/php-ds.svg)](https://packagist.org/packages/php-ds/php-ds)

This is a compatibility polyfill for the [extension](https://github.com/php-ds/extension). You should include this package as a dependency of your project
to ensure that your codebase would still be functional in an environment where the extension is not installed. The polyfill will not be loaded if the extension is installed and enabled.

## Install

```bash
composer require php-ds/php-ds
```

You can also *require* that the extension be installed using `ext-ds`.

## Test

```
composer install
composer test
```

Make sure that the *ds* extension is not enabled, as the polyfill will not be loaded if it is.
The test output will indicate whether the extension is active.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for more information.

### Credits

- [Rudi Theunissen](https://github.com/rtheunissen)
- [Joe Watkins](https://github.com/krakjoe)

### License

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.
32 changes: 32 additions & 0 deletions php-ds/php-ds/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "php-ds/php-ds",
"license": "MIT",
"keywords": ["php", "ds", "data structures", "polyfill"],
"authors": [
{
"name": "Rudi Theunissen",
"email": "rudolf.theunissen@gmail.com"
}
],
"require": {
"php": ">=7.0.0",
"ext-json": "*"
},
"require-dev": {
"php-ds/tests": "^1.3"
},
"provide": {
"ext-ds": "1.3.0"
},
"suggest": {
"ext-ds": "to improve performance and reduce memory usage"
},
"scripts": {
"test": "phpunit"
},
"autoload": {
"psr-4" : {
"Ds\\": "src"
}
}
}
Loading

0 comments on commit a3fd9c2

Please sign in to comment.