diff --git a/CHANGELOG.md b/CHANGELOG.md index 65f6d0e..c1e9c1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.2.2] - 2022-09-26 +### Fixed +- Randomize order of banners with the same score + ## [1.2.1] - 2022-08-04 ### Fixed - Types error @@ -78,7 +82,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1.0] - 2019-04-19 Last python version -[Unreleased]: https://github.com/adshares/adselect/compare/v1.2.1...develop +[Unreleased]: https://github.com/adshares/adselect/compare/v1.2.2...develop +[1.2.2]: https://github.com/adshares/adselect/compare/v1.2.1...v1.2.2 [1.2.1]: https://github.com/adshares/adselect/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/adshares/adselect/compare/v1.1.2...v1.2.0 [1.1.2]: https://github.com/adshares/adselect/compare/v1.1.1...v1.1.2 diff --git a/composer.lock b/composer.lock index 9323a8f..dfc6e47 100644 --- a/composer.lock +++ b/composer.lock @@ -8,26 +8,27 @@ "packages": [ { "name": "doctrine/collections", - "version": "1.6.8", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1958a744696c6bb3bb0d28db2611dc11610e78af" + "reference": "09dde3eb237756190f2de738d3c97cff10a8407b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1958a744696c6bb3bb0d28db2611dc11610e78af", - "reference": "1958a744696c6bb3bb0d28db2611dc11610e78af", + "url": "https://api.github.com/repos/doctrine/collections/zipball/09dde3eb237756190f2de738d3c97cff10a8407b", + "reference": "09dde3eb237756190f2de738d3c97cff10a8407b", "shasum": "" }, "require": { + "doctrine/deprecations": "^0.5.3 || ^1", "php": "^7.1.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^0.12", + "doctrine/coding-standard": "^9.0 || ^10.0", + "phpstan/phpstan": "^1.4.8", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", - "vimeo/psalm": "^4.2.1" + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -71,9 +72,52 @@ ], "support": { "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/1.6.8" + "source": "https://github.com/doctrine/collections/tree/1.7.3" + }, + "time": "2022-09-01T19:34:23+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" }, - "time": "2021-08-10T18:51:53+00:00" + "time": "2022-05-02T15:47:09+00:00" }, { "name": "elasticsearch/elasticsearch", @@ -886,16 +930,16 @@ }, { "name": "symfony/console", - "version": "v5.4.10", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000" + "reference": "c072aa8f724c3af64e2c7a96b796a4863d24dba1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000", - "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000", + "url": "https://api.github.com/repos/symfony/console/zipball/c072aa8f724c3af64e2c7a96b796a4863d24dba1", + "reference": "c072aa8f724c3af64e2c7a96b796a4863d24dba1", "shasum": "" }, "require": { @@ -965,7 +1009,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.10" + "source": "https://github.com/symfony/console/tree/v5.4.12" }, "funding": [ { @@ -981,7 +1025,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:00:04+00:00" + "time": "2022-08-17T13:18:05+00:00" }, { "name": "symfony/dependency-injection", @@ -1574,16 +1618,16 @@ }, { "name": "symfony/flex", - "version": "v1.19.2", + "version": "v1.19.3", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "d1a692369be53445af6e391170b509d7f5d026cf" + "reference": "ab0453b16029e131c112df1a76e59eb2a47e1f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/d1a692369be53445af6e391170b509d7f5d026cf", - "reference": "d1a692369be53445af6e391170b509d7f5d026cf", + "url": "https://api.github.com/repos/symfony/flex/zipball/ab0453b16029e131c112df1a76e59eb2a47e1f67", + "reference": "ab0453b16029e131c112df1a76e59eb2a47e1f67", "shasum": "" }, "require": { @@ -1619,7 +1663,7 @@ "description": "Composer plugin for Symfony", "support": { "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v1.19.2" + "source": "https://github.com/symfony/flex/tree/v1.19.3" }, "funding": [ { @@ -1635,20 +1679,20 @@ "type": "tidelift" } ], - "time": "2022-06-14T21:13:39+00:00" + "time": "2022-08-07T09:39:08+00:00" }, { "name": "symfony/framework-bundle", - "version": "v5.4.10", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "7cbc790e067a23a47b9f0dc59e2ff0ecddbd3e14" + "reference": "49f8fe5d39b7513a3f26898788885dbe66b0d910" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/7cbc790e067a23a47b9f0dc59e2ff0ecddbd3e14", - "reference": "7cbc790e067a23a47b9f0dc59e2ff0ecddbd3e14", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/49f8fe5d39b7513a3f26898788885dbe66b0d910", + "reference": "49f8fe5d39b7513a3f26898788885dbe66b0d910", "shasum": "" }, "require": { @@ -1770,7 +1814,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v5.4.10" + "source": "https://github.com/symfony/framework-bundle/tree/v5.4.12" }, "funding": [ { @@ -1786,7 +1830,7 @@ "type": "tidelift" } ], - "time": "2022-06-19T13:15:57+00:00" + "time": "2022-08-26T10:32:10+00:00" }, { "name": "symfony/http-foundation", @@ -2798,16 +2842,16 @@ }, { "name": "symfony/runtime", - "version": "v5.4.8", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/runtime.git", - "reference": "6dac02d816967fcdd456f96ee0190ea127177b20" + "reference": "c32ac27a8abebe4e6375cd12a4f78ba78e9c742f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/runtime/zipball/6dac02d816967fcdd456f96ee0190ea127177b20", - "reference": "6dac02d816967fcdd456f96ee0190ea127177b20", + "url": "https://api.github.com/repos/symfony/runtime/zipball/c32ac27a8abebe4e6375cd12a4f78ba78e9c742f", + "reference": "c32ac27a8abebe4e6375cd12a4f78ba78e9c742f", "shasum": "" }, "require": { @@ -2855,7 +2899,7 @@ "description": "Enables decoupling PHP applications from global state", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/runtime/tree/v5.4.8" + "source": "https://github.com/symfony/runtime/tree/v5.4.11" }, "funding": [ { @@ -2871,7 +2915,7 @@ "type": "tidelift" } ], - "time": "2022-04-12T16:02:29+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/service-contracts", @@ -3206,16 +3250,16 @@ }, { "name": "symfony/yaml", - "version": "v5.4.10", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "04e42926429d9e8b39c174387ab990bf7817f7a2" + "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/04e42926429d9e8b39c174387ab990bf7817f7a2", - "reference": "04e42926429d9e8b39c174387ab990bf7817f7a2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", + "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", "shasum": "" }, "require": { @@ -3261,7 +3305,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.10" + "source": "https://github.com/symfony/yaml/tree/v5.4.12" }, "funding": [ { @@ -3277,7 +3321,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T11:50:59+00:00" + "time": "2022-08-02T15:52:22+00:00" } ], "packages-dev": [ @@ -3700,49 +3744,6 @@ ], "time": "2022-06-13T21:43:03+00:00" }, - { - "name": "doctrine/deprecations", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" - }, - "time": "2022-05-02T15:47:09+00:00" - }, { "name": "doctrine/doctrine-bundle", "version": "2.7.0", @@ -3859,34 +3860,31 @@ }, { "name": "doctrine/event-manager", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" + "reference": "eb2ecf80e3093e8f3c2769ac838e27d8ede8e683" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/eb2ecf80e3093e8f3c2769ac838e27d8ede8e683", + "reference": "eb2ecf80e3093e8f3c2769ac838e27d8ede8e683", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "conflict": { - "doctrine/common": "<2.9@dev" + "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpunit/phpunit": "^7.0" + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "~1.4.10 || ^1.5.4", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\": "lib/Doctrine/Common" @@ -3933,7 +3931,7 @@ ], "support": { "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + "source": "https://github.com/doctrine/event-manager/tree/1.1.2" }, "funding": [ { @@ -3949,7 +3947,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T18:28:51+00:00" + "time": "2022-07-27T22:18:11+00:00" }, { "name": "doctrine/instantiator", @@ -4099,20 +4097,19 @@ }, { "name": "doctrine/persistence", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "25ec98a8cbd1f850e60fdb62c0ef77c162da8704" + "reference": "ac6fce61f037d7e54dbb2435f5b5648d86548e23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/25ec98a8cbd1f850e60fdb62c0ef77c162da8704", - "reference": "25ec98a8cbd1f850e60fdb62c0ef77c162da8704", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/ac6fce61f037d7e54dbb2435f5b5648d86548e23", + "reference": "ac6fce61f037d7e54dbb2435f5b5648d86548e23", "shasum": "" }, "require": { - "doctrine/collections": "^1.0", "doctrine/event-manager": "^1.0", "php": "^7.2 || ^8.0", "psr/cache": "^1.0 || ^2.0 || ^3.0" @@ -4180,7 +4177,7 @@ ], "support": { "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/3.0.2" + "source": "https://github.com/doctrine/persistence/tree/3.0.3" }, "funding": [ { @@ -4196,7 +4193,7 @@ "type": "tidelift" } ], - "time": "2022-05-06T06:10:05+00:00" + "time": "2022-08-04T21:14:21+00:00" }, { "name": "doctrine/sql-formatter", @@ -4595,233 +4592,6 @@ }, "time": "2019-12-27T09:44:58+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpstan/phpdoc-parser", "version": "1.6.4", @@ -4869,23 +4639,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -4934,7 +4704,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" }, "funding": [ { @@ -4942,7 +4712,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-08-30T12:24:04+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5187,16 +4957,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", "shasum": "" }, "require": { @@ -5211,7 +4981,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -5219,19 +4988,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -5273,7 +5039,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25" }, "funding": [ { @@ -5283,9 +5049,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2022-09-25T03:44:45+00:00" }, { "name": "qossmic/deptrac-shim", @@ -5509,16 +5279,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -5571,7 +5341,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -5579,7 +5349,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -5769,16 +5539,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -5834,7 +5604,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -5842,7 +5612,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -6197,16 +5967,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -6218,7 +5988,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -6241,7 +6011,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -6249,7 +6019,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -6423,16 +6193,16 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "18e73179c6a33d520de1b644941eba108dd811ad" + "reference": "081fe28a26b6bd671dea85ef3a4b5003f3c88027" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/18e73179c6a33d520de1b644941eba108dd811ad", - "reference": "18e73179c6a33d520de1b644941eba108dd811ad", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/081fe28a26b6bd671dea85ef3a4b5003f3c88027", + "reference": "081fe28a26b6bd671dea85ef3a4b5003f3c88027", "shasum": "" }, "require": { @@ -6475,7 +6245,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.3" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.11" }, "funding": [ { @@ -6491,20 +6261,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-07-27T15:50:05+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b0a190285cd95cb019237851205b8140ef6e368e" + "reference": "c1681789f059ab756001052164726ae88512ae3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0a190285cd95cb019237851205b8140ef6e368e", - "reference": "b0a190285cd95cb019237851205b8140ef6e368e", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c1681789f059ab756001052164726ae88512ae3d", + "reference": "c1681789f059ab756001052164726ae88512ae3d", "shasum": "" }, "require": { @@ -6541,7 +6311,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.3" + "source": "https://github.com/symfony/css-selector/tree/v5.4.11" }, "funding": [ { @@ -6557,7 +6327,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/doctrine-bridge", @@ -6753,16 +6523,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "899fdec151add3dc339cf394a15100a1acc177ad" + "reference": "75c2fa71d049c1f48e39d208c0cefba97e66335a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/899fdec151add3dc339cf394a15100a1acc177ad", - "reference": "899fdec151add3dc339cf394a15100a1acc177ad", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/75c2fa71d049c1f48e39d208c0cefba97e66335a", + "reference": "75c2fa71d049c1f48e39d208c0cefba97e66335a", "shasum": "" }, "require": { @@ -6816,7 +6586,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.1.2" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.1.3" }, "funding": [ { @@ -6832,7 +6602,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T12:01:07+00:00" + "time": "2022-07-28T13:40:41+00:00" }, { "name": "theseer/tokenizer", @@ -6883,64 +6653,6 @@ } ], "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -6957,5 +6669,5 @@ "ext-pcntl": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Application/Service/BannerFinder.php b/src/Application/Service/BannerFinder.php index 654794a..0b074be 100644 --- a/src/Application/Service/BannerFinder.php +++ b/src/Application/Service/BannerFinder.php @@ -9,5 +9,5 @@ interface BannerFinder { - public function find(QueryDto $queryDto, int $size): FoundBannersCollection; + public function find(QueryDto $queryDto, int $size = 1): FoundBannersCollection; } diff --git a/src/Infrastructure/ElasticSearch/QueryBuilder/ExpQueryBuilder.php b/src/Infrastructure/ElasticSearch/QueryBuilder/ExpQueryBuilder.php index 7a6adeb..b42196c 100644 --- a/src/Infrastructure/ElasticSearch/QueryBuilder/ExpQueryBuilder.php +++ b/src/Infrastructure/ElasticSearch/QueryBuilder/ExpQueryBuilder.php @@ -17,7 +17,7 @@ class ExpQueryBuilder double real_rpm = _score % 1000.0; double weight = doc['exp.weight'].value; weight = Math.pow(Math.random(), 1.0 / weight); -return Math.round(1000.0 * weight) * 100000 + Math.round(real_rpm * 100); +return Math.round(1000.0 * weight) * 100000 + Math.round(real_rpm * 100) + Math.random(); PAINLESS; public function __construct(QueryInterface $query) diff --git a/src/Infrastructure/ElasticSearch/QueryBuilder/QueryBuilder.php b/src/Infrastructure/ElasticSearch/QueryBuilder/QueryBuilder.php index 7cef3c4..de3fd9b 100644 --- a/src/Infrastructure/ElasticSearch/QueryBuilder/QueryBuilder.php +++ b/src/Infrastructure/ElasticSearch/QueryBuilder/QueryBuilder.php @@ -1,9 +1,5 @@ real_rpm) { - return 0; + return Math.random(); } return Math.round( 100.0 @@ -38,7 +34,8 @@ public function build(): array * (params.last_seen.containsKey(doc._id[0]) ? (params.last_seen[doc._id[0]]) : 1) ) * 100000 - + Math.round(real_rpm * 100); + + Math.round(real_rpm * 100) + + Math.random(); PAINLESS; return [ diff --git a/src/Infrastructure/ElasticSearch/Service/BannerFinder.php b/src/Infrastructure/ElasticSearch/Service/BannerFinder.php index 8cf8c70..e534b87 100644 --- a/src/Infrastructure/ElasticSearch/Service/BannerFinder.php +++ b/src/Infrastructure/ElasticSearch/Service/BannerFinder.php @@ -44,7 +44,7 @@ public function __construct( public function find( QueryDto $queryDto, - int $size + int $size = 1 ): FoundBannersCollection { $userHistory = $this->loadUserHistory($queryDto); $defined = $this->getDefinedRequireKeywords(); @@ -110,7 +110,7 @@ public function find( $hit['_id'], in_array($queryDto->getSize(), $hit['fields']['banner.size'], true) ? $queryDto->getSize() : $hit['fields']['banner.size'][0], - fmod($hit['_score'], 100_000) / 100 + fmod(floor($hit['_score']), 100_000) / 100 ) ); } diff --git a/src/UI/Controller/CampaignController.php b/src/UI/Controller/CampaignController.php index a0faeb8..44986f6 100644 --- a/src/UI/Controller/CampaignController.php +++ b/src/UI/Controller/CampaignController.php @@ -72,7 +72,6 @@ public function delete(Request $request): JsonResponse public function findBanners(Request $request): JsonResponse { $queries = json_decode($request->getContent(), true); - $size = 1; $results = []; foreach ($queries as $query) { @@ -80,7 +79,7 @@ public function findBanners(Request $request): JsonResponse try { $queryDto = QueryDto::fromArray($query); - $banners = $this->bannerFinder->find($queryDto, $size); + $banners = $this->bannerFinder->find($queryDto); $results[$requestId] = (new FoundBannerResponse($banners))->toArray(); } catch (ValidationDtoException $exception) { $results[$requestId] = []; @@ -89,7 +88,6 @@ public function findBanners(Request $request): JsonResponse sprintf('[Find] Invalid input data (%s).', $exception->getMessage()), $query ); - // think about adding a referer and more data related to a server which asks } } diff --git a/src/UI/Controller/Exception/IncorrectDataException.php b/src/UI/Controller/Exception/IncorrectDataException.php index 1d5e3e6..f0522bc 100644 --- a/src/UI/Controller/Exception/IncorrectDataException.php +++ b/src/UI/Controller/Exception/IncorrectDataException.php @@ -1,5 +1,7 @@ testSelectDifferentBannersWhenNoPayments(); + } + public function testSelectOnlyMatchingCampaignsWhenNoPayments(): void { - self::markTestSkipped('Not paying campaigns are not handled yet.'); $campaignsData = [ (new CampaignBuilder()) ->banners([(new BannerBuilder())->id('11111111111111111111111111111111')->build()]) @@ -383,6 +387,75 @@ public function testSelectDifferentCampaignsForSameUser2of3CampaignsPaid(): void self::assertResultsPresent($payingBannerIds, $results); } + /** + * @dataProvider eventAmountProvider + */ + public function testSelectDifferentBannersWithEqualPaymentsPerEvent3of3(int $eventAmount): void + { + $campaignId = '10000000000000000000000000000000'; + $bannerIds = [ + '11111111111111111111111111111111', + '22222222222222222222222222222222', + '33333333333333333333333333333333', + ]; + $campaignData = [ + (new CampaignBuilder()) + ->id($campaignId) + ->banners(array_map(fn($id) => (new BannerBuilder())->id($id)->build(), $bannerIds)) + ->build(), + ]; + $this->setupCampaigns($campaignData); + + $payingBannerIds = $bannerIds; + foreach ($payingBannerIds as $payingBannerId) { + $this->setupInitialPaymentsWithEqualEventAmount( + [$campaignId => $payingBannerId], + $payingBannerIds, + $eventAmount + ); + } + + $results = $this->findBanners(); + + self::assertResultsPresent($payingBannerIds, $results, 250); + } + + /** + * @dataProvider eventAmountProvider + */ + public function testSelectDifferentBannersWithEqualPaymentsPerEvent2of3(int $eventAmount): void + { + $campaignId = '10000000000000000000000000000000'; + $bannerIds = [ + '11111111111111111111111111111111', + '22222222222222222222222222222222', + '33333333333333333333333333333333', + ]; + $campaignData = [ + (new CampaignBuilder()) + ->id($campaignId) + ->banners(array_map(fn($id) => (new BannerBuilder())->id($id)->build(), $bannerIds)) + ->build(), + ]; + $this->setupCampaigns($campaignData); + + $payingBannerIds = [ + '22222222222222222222222222222222', + '33333333333333333333333333333333', + ]; + foreach ($payingBannerIds as $payingBannerId) { + $this->setupInitialPaymentsWithEqualEventAmount( + [$campaignId => $payingBannerId], + $payingBannerIds, + $eventAmount + ); + } + + $results = $this->findBanners(); + + self::assertResultsPresent($payingBannerIds, $results, 250); + } + /** * @dataProvider eventAmountProvider */ @@ -853,7 +926,7 @@ private function updateStatisticsOrFail(): void self::assertLessThan($maxTries, $try, 'Statistics were not updated'); sleep(1); $content = self::runCommand('ops:es:update-stats'); - $updated = str_starts_with($content, 'Finished'); + $updated = str_starts_with($content, 'Finished') || str_starts_with($content, 'No events to process'); $try++; } while (!$updated); @@ -1011,6 +1084,9 @@ private function findBanners(): array } else { $results[$bannerId]++; } + if ($i % 83 === 82) { + $this->updateStatisticsOrFail(); + } } return $results; }