Updated Rector to commit 4179a87aac262d7f38daf79f8a2f530808d1cf8e

4179a87aac [Caching] Fix dependent files not yet exists on ChangedFilesDetector::cacheFileWithDependencies() (#3736)
This commit is contained in:
Tomas Votruba 2023-05-05 10:24:42 +00:00
parent e0ddc70719
commit 5eeea8840a
12 changed files with 106 additions and 58 deletions

View File

@ -52,6 +52,9 @@ final class ChangedFilesDetector
}
$hash = $this->hashFile($filePath);
$this->cache->save($filePathCacheKey, CacheKey::FILE_HASH_KEY, $hash);
if (!isset($this->dependentFiles[$filePathCacheKey])) {
return;
}
$this->cache->save($filePathCacheKey . '_files', CacheKey::DEPENDENT_FILES_KEY, $this->dependentFiles[$filePathCacheKey]);
}
public function addCachableFile(string $filePath) : void

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd9374ddfa6c8a1ae41c1ac271d102980c6eba8f5';
public const PACKAGE_VERSION = '4179a87aac262d7f38daf79f8a2f530808d1cf8e';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-05-05 16:30:49';
public const RELEASE_DATE = '2023-05-05 10:20:56';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitbef4244bb4d4752bdd0b9553b348ae46::getLoader();
return ComposerAutoloaderInit30d6c9723dff2773b134e8f7c058f8b0::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitbef4244bb4d4752bdd0b9553b348ae46
class ComposerAutoloaderInit30d6c9723dff2773b134e8f7c058f8b0
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitbef4244bb4d4752bdd0b9553b348ae46
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitbef4244bb4d4752bdd0b9553b348ae46', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit30d6c9723dff2773b134e8f7c058f8b0', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitbef4244bb4d4752bdd0b9553b348ae46', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit30d6c9723dff2773b134e8f7c058f8b0', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit30d6c9723dff2773b134e8f7c058f8b0::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit30d6c9723dff2773b134e8f7c058f8b0::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46
class ComposerStaticInit30d6c9723dff2773b134e8f7c058f8b0
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3125,9 +3125,9 @@ class ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitbef4244bb4d4752bdd0b9553b348ae46::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit30d6c9723dff2773b134e8f7c058f8b0::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit30d6c9723dff2773b134e8f7c058f8b0::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit30d6c9723dff2773b134e8f7c058f8b0::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1388,36 +1388,34 @@
},
{
"name": "react\/event-loop",
"version": "v1.3.0",
"version_normalized": "1.3.0.0",
"version": "v1.4.0",
"version_normalized": "1.4.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/reactphp\/event-loop.git",
"reference": "187fb56f46d424afb6ec4ad089269c72eec2e137"
"reference": "6e7e587714fff7a83dcc7025aee42ab3b265ae05"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/reactphp\/event-loop\/zipball\/187fb56f46d424afb6ec4ad089269c72eec2e137",
"reference": "187fb56f46d424afb6ec4ad089269c72eec2e137",
"url": "https:\/\/api.github.com\/repos\/reactphp\/event-loop\/zipball\/6e7e587714fff7a83dcc7025aee42ab3b265ae05",
"reference": "6e7e587714fff7a83dcc7025aee42ab3b265ae05",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit\/phpunit": "^9.3 || ^5.7 || ^4.8.35"
"phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36"
},
"suggest": {
"ext-event": "~1.0 for ExtEventLoop",
"ext-pcntl": "For signal handling support when using the StreamSelectLoop",
"ext-uv": "* for ExtUvLoop"
"ext-pcntl": "For signal handling support when using the StreamSelectLoop"
},
"time": "2022-03-17T11:10:22+00:00",
"time": "2023-05-05T10:11:24+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"RectorPrefix202305\\React\\EventLoop\\": "src"
"RectorPrefix202305\\React\\EventLoop\\": "src\/"
}
},
"notification-url": "https:\/\/packagist.org\/downloads\/",
@ -1453,16 +1451,12 @@
],
"support": {
"issues": "https:\/\/github.com\/reactphp\/event-loop\/issues",
"source": "https:\/\/github.com\/reactphp\/event-loop\/tree\/v1.3.0"
"source": "https:\/\/github.com\/reactphp\/event-loop\/tree\/v1.4.0"
},
"funding": [
{
"url": "https:\/\/github.com\/WyriHaximus",
"type": "github"
},
{
"url": "https:\/\/github.com\/clue",
"type": "github"
"url": "https:\/\/opencollective.com\/reactphp",
"type": "open_collective"
}
],
"install-path": "..\/react\/event-loop"

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,19 @@
# Changelog
## 1.4.0 (2023-05-05)
* Feature: Improve performance of `Loop` by avoiding unneeded method calls.
(#266 by @clue)
* Feature: Support checking `EINTR` constant from `ext-pcntl` without `ext-sockets`.
(#265 by @clue)
* Minor documentation improvements.
(#254 by @nhedger)
* Improve test suite, run tests on PHP 8.2 and report failed assertions.
(#258 by @WyriHaximus, #264 by @clue and #251, #261 and #262 by @SimonFrings)
## 1.3.0 (2022-03-17)
* Feature: Improve default `StreamSelectLoop` to report any warnings for invalid streams.

View File

@ -1,6 +1,6 @@
# EventLoop Component
# EventLoop
[![CI status](https://github.com/reactphp/event-loop/workflows/CI/badge.svg)](https://github.com/reactphp/event-loop/actions)
[![CI status](https://github.com/reactphp/event-loop/actions/workflows/ci.yml/badge.svg)](https://github.com/reactphp/event-loop/actions)
[![installs on Packagist](https://img.shields.io/packagist/dt/react/event-loop?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/event-loop)
[ReactPHP](https://reactphp.org/)'s core reactor event loop that libraries can use for evented I/O.
@ -10,7 +10,7 @@ same event loop. This component provides a common `LoopInterface` that any
library can target. This allows them to be used in the same loop, with one
single [`run()`](#run) call that is controlled by the user.
**Table of Contents**
**Table of contents**
* [Quickstart example](#quickstart-example)
* [Usage](#usage)
@ -889,7 +889,7 @@ This project follows [SemVer](https://semver.org/).
This will install the latest supported version:
```bash
$ composer require react/event-loop:^1.3
composer require react/event-loop:^1.4
```
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
@ -897,7 +897,7 @@ See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
This project aims to run on any platform and thus does not require any PHP
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
HHVM.
It's *highly recommended to use PHP 7+* for this project.
It's *highly recommended to use the latest supported PHP version* for this project.
Installing any of the event loop extensions is suggested, but entirely optional.
See also [event loop implementations](#loop-implementations) for more details.
@ -908,13 +908,13 @@ To run the test suite, you first need to clone this repo and then install all
dependencies [through Composer](https://getcomposer.org/):
```bash
$ composer install
composer install
```
To run the test suite, go to the project root and run:
```bash
$ vendor/bin/phpunit
vendor/bin/phpunit
```
## License

View File

@ -32,21 +32,19 @@
"php": ">=5.3.0"
},
"require-dev": {
"phpunit\/phpunit": "^9.3 || ^5.7 || ^4.8.35"
"phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36"
},
"suggest": {
"ext-event": "~1.0 for ExtEventLoop",
"ext-pcntl": "For signal handling support when using the StreamSelectLoop",
"ext-uv": "* for ExtUvLoop"
"ext-pcntl": "For signal handling support when using the StreamSelectLoop"
},
"autoload": {
"psr-4": {
"RectorPrefix202305\\React\\EventLoop\\": "src"
"RectorPrefix202305\\React\\EventLoop\\": "src\/"
}
},
"autoload-dev": {
"psr-4": {
"RectorPrefix202305\\React\\Tests\\EventLoop\\": "tests"
"RectorPrefix202305\\React\\Tests\\EventLoop\\": "tests\/"
}
}
}

View File

@ -8,7 +8,7 @@ namespace RectorPrefix202305\React\EventLoop;
final class Loop
{
/**
* @var LoopInterface
* @var ?LoopInterface
*/
private static $instance;
/** @var bool */
@ -74,7 +74,11 @@ final class Loop
*/
public static function addReadStream($stream, $listener)
{
self::get()->addReadStream($stream, $listener);
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
self::$instance->addReadStream($stream, $listener);
}
/**
* [Advanced] Register a listener to be notified when a stream is ready to write.
@ -87,7 +91,11 @@ final class Loop
*/
public static function addWriteStream($stream, $listener)
{
self::get()->addWriteStream($stream, $listener);
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
self::$instance->addWriteStream($stream, $listener);
}
/**
* Remove the read event listener for the given stream.
@ -98,7 +106,9 @@ final class Loop
*/
public static function removeReadStream($stream)
{
self::get()->removeReadStream($stream);
if (self::$instance !== null) {
self::$instance->removeReadStream($stream);
}
}
/**
* Remove the write event listener for the given stream.
@ -109,7 +119,9 @@ final class Loop
*/
public static function removeWriteStream($stream)
{
self::get()->removeWriteStream($stream);
if (self::$instance !== null) {
self::$instance->removeWriteStream($stream);
}
}
/**
* Enqueue a callback to be invoked once after the given interval.
@ -121,7 +133,11 @@ final class Loop
*/
public static function addTimer($interval, $callback)
{
return self::get()->addTimer($interval, $callback);
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
return self::$instance->addTimer($interval, $callback);
}
/**
* Enqueue a callback to be invoked repeatedly after the given interval.
@ -133,7 +149,11 @@ final class Loop
*/
public static function addPeriodicTimer($interval, $callback)
{
return self::get()->addPeriodicTimer($interval, $callback);
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
return self::$instance->addPeriodicTimer($interval, $callback);
}
/**
* Cancel a pending timer.
@ -144,7 +164,9 @@ final class Loop
*/
public static function cancelTimer(TimerInterface $timer)
{
return self::get()->cancelTimer($timer);
if (self::$instance !== null) {
self::$instance->cancelTimer($timer);
}
}
/**
* Schedule a callback to be invoked on a future tick of the event loop.
@ -155,7 +177,11 @@ final class Loop
*/
public static function futureTick($listener)
{
self::get()->futureTick($listener);
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
self::$instance->futureTick($listener);
}
/**
* Register a listener to be notified when a signal has been caught by this process.
@ -167,7 +193,11 @@ final class Loop
*/
public static function addSignal($signal, $listener)
{
self::get()->addSignal($signal, $listener);
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
self::$instance->addSignal($signal, $listener);
}
/**
* Removes a previously added signal listener.
@ -179,7 +209,9 @@ final class Loop
*/
public static function removeSignal($signal, $listener)
{
self::get()->removeSignal($signal, $listener);
if (self::$instance !== null) {
self::$instance->removeSignal($signal, $listener);
}
}
/**
* Run the event loop until there are no more tasks to perform.
@ -189,7 +221,11 @@ final class Loop
*/
public static function run()
{
self::get()->run();
// create loop instance on demand (legacy PHP < 7 doesn't like ternaries in method calls)
if (self::$instance === null) {
self::get();
}
self::$instance->run();
}
/**
* Instruct a running event loop to stop.
@ -200,6 +236,8 @@ final class Loop
public static function stop()
{
self::$stopped = \true;
self::get()->stop();
if (self::$instance !== null) {
self::$instance->stop();
}
}
}

View File

@ -241,7 +241,8 @@ final class StreamSelectLoop implements LoopInterface
/** @var ?callable $previous */
$previous = \set_error_handler(function ($errno, $errstr) use(&$previous) {
// suppress warnings that occur when `stream_select()` is interrupted by a signal
$eintr = \defined('SOCKET_EINTR') ? \SOCKET_EINTR : 4;
// PHP defines `EINTR` through `ext-sockets` or `ext-pcntl`, otherwise use common default (Linux & Mac)
$eintr = \defined('SOCKET_EINTR') ? \SOCKET_EINTR : (\defined('PCNTL_EINTR') ? \PCNTL_EINTR : 4);
if ($errno === \E_WARNING && \strpos($errstr, '[' . $eintr . ']: ') !== \false) {
return;
}