Comments (6)
Ok, reproduced in php 8.0:
➜ rector-847-reproduction git:(main) php80 vendor/bin/rector process index.php --dry-run
PHP Fatal error: Uncaught Error: Undefined constant "MHASH_XXH32" in /Users/samsonasik/www/rector-847-reproduction/vendor/rector/rector/vendor/illuminate/container/Container.php:818
Stack trace:
from rector.
Wonderful, that works!
Thank you for such a quick turnaround. 😄
from rector.
Looking at the error, you don't have MHASH_XXH32
constant, I guess you have different php version between cli and web, could you create a reproducible repo? Thank you.
from rector.
Looking at the error, you don't have
MHASH_XXH32
constant,
Not sure what this is, searches don't turn up anything and given it's happening in the DI layer, I assumed it was a dynamically generated name.
The WebDevops PHP Image should contain pretty much all PHP modules by default, and I don't see any special requirements listed for Rector so I'm not sure what would cause it. This also happens on production servers (Debian via Sury) and a local machine (Arch via official packages), so seems to reproduce across several real-world cases.
could you create a reproducible repo?
Of course! Here you go.
The reproductions steps are similar to the above:
git clone https://github.com/Kenneth-Sills/rector-847-reproduction
cd rector-847-reproduction
docker run --rm -it -v `pwd`:/app webdevops/php:8.0 bash
cd app
composer exec rector -- --dry-run process index.php
Let me know if you need anything else from me. 😄
from rector.
Ok, it seems the following constant need to be added:
if (PHP_VERSION_ID < 80100) {
if (! defined('MHASH_XXH32')) {
define('MHASH_XXH32', 38);
}
if (! defined('MHASH_XXH64')) {
define('MHASH_XXH64', 39);
}
if (! defined('MHASH_XXH3')) {
define('MHASH_XXH3', 40);
}
if (! defined('MHASH_XXH128')) {
define('MHASH_XXH128', 41);
}
}
from rector.
@Kenneth-Sills could you try latest rector/rector:dev-main
:
composer config minimum-stability dev
composer config prefer-stable true
composer require --dev rector/rector:dev-main
and verify if it now resolved? thank you.
from rector.
Related Issues (20)
- [TypeDeclaration] Add typed property based on serialize attribute HOT 3
- [ERROR] when trying to process rector HOT 1
- removeUnusedImports may cause invalid removal on conflict use statements last name HOT 1
- Rector silently stop without error message HOT 1
- [DX] Make withSkip() report rules that are ignored, but never registered HOT 3
- Incorrect behavior of RemoveExtraParametersRector on variadic functions in abstract class calling extending class
- Incorrect behavior of FirstClassCallableRector with private methods HOT 1
- Better behavior of ReadOnlyClassRector
- 'join' alias is not processed by ConsistentImplodeRector.php HOT 2
- Incorrect behavior of BooleanInBooleanNotRuleFixerRector HOT 1
- Incorrect behavior of ReduceAlwaysFalseIfOrRector HOT 2
- "System error: "Call to undefined method PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode::getParamImmediatelyInvokedCallableTagValues()" HOT 2
- Php74 set renames non-deprecated apache_request_headers() function HOT 1
- New rule proposal: incorrect use of parenthesescan can cause unexpected behavior in code HOT 1
- Some public const enum values `types` are added on php 8.3 but on some it doesn't work. HOT 2
- Incorrect behavior of AssertRegExpRector HOT 1
- FirstClassCallableRector should also change simple function names
- Incorrect behavior of DowngradeThrowExprRector HOT 5
- Incorrect behavior of RemoveUnusedVariableAssignRector
- Incorrect behavior of NewInInitializerRector
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rector.