Skip to content

Commit

Permalink
Merge branch 'release/1.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Aug 4, 2024
2 parents 6f37dc7 + c9865d0 commit d9cf702
Show file tree
Hide file tree
Showing 12 changed files with 893 additions and 1,006 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.2', '8.3']
name: PHP ${{ matrix.php-versions }}

steps:
Expand Down Expand Up @@ -58,6 +58,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Install dependencies
run: composer install --no-progress

Expand Down
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PHP Sorted Collections
======================
# PHP Sorted Collections

[![PHP package](https://github.com/chdemko/php-sorted-collections/workflows/PHP%20Composer/badge.svg?branch=develop)](https://github.com/chdemko/php-sorted-collections/actions/workflows/php.yml)
[![Coveralls](https://img.shields.io/coveralls/chdemko/php-sorted-collections.svg?logo=Codecov&logoColor=white)](https://coveralls.io/r/chdemko/php-sorted-collections?branch=develop)
Expand All @@ -17,24 +16,31 @@ PHP Sorted Collections
[![Repo Size](https://img.shields.io/github/repo-size/chdemko/php-sorted-collections.svg?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+Cgo8c3ZnCiAgIGZpbGw9IiMwMDAwMDAiCiAgIHdpZHRoPSI4MDBweCIKICAgaGVpZ2h0PSI4MDBweCIKICAgdmlld0JveD0i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cGU6d2luZG93LXg9IjE5MjAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmcxNDc2IiAvPgogIDxwYXRoCiAgICAgZD0iTTE5LDRIMTcuNTVBMy4wOCwzLjA4LDAsMCwwLDE3LDNhMywzLDAsMCwwLTIuMjUtMUg5LjI3QTMsMywwLDAsMCw3LDNhMy4wOCwzLjA4LDAsMCwwLS41NywxSDVBMywzLDAsMCwwLDIsN1YxOWEzLDMsMCwwLDAsMywzSDE5YTMsMywwLDAsMCwzLTNWN0EzLDMsMCwwLDAsMTksNFpNOC41Miw0LjM0QTEsMSwwLDAsMSw5LjI3LDRoNS40NmExLDEsMCwwLDEsLjc1LjM0LDEsMSwwLDAsMSwuMjUuNzhsLS41LDRhMSwxLDAsMCwxLTEsLjg4SDEyLjU5bDEuMTQtMi40YTEsMSwwLDAsMC0xLjgtLjg2TDEwLjM3LDEwaC0uNmExLDEsMCwwLDEtMS0uODhsLS41LTRBMSwxLDAsMCwxLDguNTIsNC4zNFpNMjAsMTlhMSwxLDAsMCwxLTEsMUg1YTEsMSwwLDAsMS0xLTFWN0ExLDEsMCwwLDEsNSw2SDYuMzdsLjQyLDMuMzdhMywzLDAsMCwwLDMsMi42M2g0LjQ2YTMsMywwLDAsMCwzLTIuNjNMMTcuNjMsNkgxOWExLDEsMCwwLDEsMSwxWm0tNi0zSDEwYTEsMSwwLDAsMCwwLDJoNGExLDEsMCwwLDAsMC0yWiIKICAgICBpZD0icGF0aDE0NzQiCiAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZiIgLz4KPC9zdmc+Cg==)](http://php-sorted-collections.readthedocs.io/en/latest/)
[![Code Size](https://img.shields.io/github/languages/code-size/chdemko/php-sorted-collections.svg?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGL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oNGExLDEsMCwwLDAsMC0yWiIKICAgICBpZD0icGF0aDE0NzQiCiAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZiIgLz4KPC9zdmc+Cg==)](http://php-sorted-collections.readthedocs.io/en/latest/)

Sorted Collection for PHP. Insertion, search, and removal compute in `log(n)` time where `n` is the number of items present in the collection. It uses AVL threaded tree [see @Knuth97, 1:320, Sect. 2.3.1] as internal structure.
Sorted Collection for PHP. Insertion, search, and removal compute in
`log(n)` time where `n` is the number of items present in the collection.
It uses AVL threaded tree [see @Knuth97, 1:320, Sect. 2.3.1] as internal
structure.

@Knuth97: Donald E. Knuth, The Art of Computer Programming, Addison-Wesley, volumes 1 and 2, 2nd edition, 1997.
@Knuth97: Donald E. Knuth, The Art of Computer Programming, Addison-Wesley,
volumes 1 and 2, 2nd edition, 1997.

This project uses:

* [PHP Code Sniffer](https://github.com/squizlabs/php_codesniffer) for checking PHP code style
* [PHP Code Sniffer](https://github.com/squizlabs/php_codesniffer)
for checking PHP code style
* [PHPUnit](http://phpunit.de/) for unit test (100% covered)
* [Sphinx](https://www.sphinx-doc.org/) and [Doxygen](https://www.doxygen.nl/) for the
* [Sphinx](https://www.sphinx-doc.org/) and [Doxygen](https://www.doxygen.nl/)
for the
[documentation](http://php-sorted-collections.readthedocs.io/en/latest/?badge=latest)

Instructions
------------
## Instructions

Using composer: either

~~~shell
$ composer create-project chdemko/sorted-collections:1.0.*@dev; cd sorted-collections
Creating a "chdemko/sorted-collections:1.0.*@dev" project at "./sorted-collections"
...
~~~

or create a `composer.json` file containing
Expand All @@ -51,6 +57,8 @@ and run

~~~shell
$ composer install
Loading composer repositories with package information
...
~~~

Create a `test.php` file containg
Expand All @@ -72,18 +80,16 @@ And run

~~~shell
$ php test.php
~~~

This should print

~~~console
[0,1,2,3,4,5,6,7,8,9]
~~~

See the [examples](https://github.com/chdemko/php-sorted-collections/tree/develop/examples) and [benchmarks](https://github.com/chdemko/php-sorted-collections/tree/develop/benchmarks) folders for more information.
See the
[examples](https://github.com/chdemko/php-sorted-collections/tree/develop/examples)
and
[benchmarks](https://github.com/chdemko/php-sorted-collections/tree/develop/benchmarks)
folders for more information.

Documentation
-------------
## Documentation

Run

Expand All @@ -99,14 +105,17 @@ $

if you want to create local documentation with Sphinx.

## Citation

Citation
--------
If you are using this project including publication in research activities,
you have to cite it using
([BibTeX format](https://raw.github.com/chdemko/php-sorted-collections/develop/cite.bib)).
You are also pleased to send me an email to <chdemko@gmail.com>.

If you are using this project including publication in research activities, you have to cite it using ([BibTeX format](https://raw.github.com/chdemko/php-sorted-collections/develop/cite.bib)). You are also pleased to send me an email to chdemko@gmail.com.
* authors: Christophe Demko
* title: php-sorted-collections: a PHP library for handling sorted collections
* year: 2014
* how published: https://packagist.org/packages/chdemko/sorted-collections
* how published: <https://packagist.org/packages/chdemko/sorted-collections>

All releases can be found [here](https://github.com/chdemko/php-sorted-collections/releases)
All releases can be found
[here](https://github.com/chdemko/php-sorted-collections/releases)
16 changes: 8 additions & 8 deletions benchmarks/TreeMapBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class TreeMapBench
*/
public function provideCounts()
{
yield array('count' => 100);
yield array('count' => 1000);
yield array('count' => 10000);
yield array('count' => 100000);
yield ['count' => 100];
yield ['count' => 1000];
yield ['count' => 10000];
yield ['count' => 100000];
}

/**
Expand All @@ -63,10 +63,10 @@ public function provideCounts()
*/
public function provideTypes()
{
yield array('type' => 'tree');
yield array('type' => 'reversed');
yield array('type' => 'sub', 'from' => 0.30, 'to' => 0.70);
yield array('type' => 'sub', 'from' => 0.40, 'to' => 0.80);
yield ['type' => 'tree'];
yield ['type' => 'reversed'];
yield ['type' => 'sub', 'from' => 0.30, 'to' => 0.70];
yield ['type' => 'sub', 'from' => 0.40, 'to' => 0.80];
}

/**
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
}
],
"require": {
"php": ">=8.1"
"php": ">=8.2"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.6",
"squizlabs/php_codesniffer": "^3.7",
"phpunit/phpunit": "^10.2",
"phpbench/phpbench": "^1.2"
"php-coveralls/php-coveralls": "^2.7",
"squizlabs/php_codesniffer": "^3.10",
"phpunit/phpunit": "^11.3",
"phpbench/phpbench": "^1.3"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit d9cf702

Please sign in to comment.