Replies: 6 comments 1 reply
-
I guess you're using Do you have "require": {
"php": "^8.1"
} that ensure to get php version to check. Otherwise, we need a reproducible repo for it. |
Beta Was this translation helpful? Give feedback.
-
Yes I am using composer.json with Rector.php default: withPaths([ __DIR__ . '/src', ]) // uncomment to reach your current PHP version // ->withPhpSets() ->withRules([ AddVoidReturnTypeWhereNoReturnRector::class, ]); |
Beta Was this translation helpful? Give feedback.
-
This is the file I'm trying to update to php 8.1 `<?php ------\ AzDG - S C R I P T S /-/-/-/-/-/-/############################################################ AzDGDatingPlatinum Version 2012Written by AzDG (support@azdg.com)Created 24/10/02 Last Modified 22/03/06Scripts Home: http://www.azdg.com############################################################ File name add.phpFile purpose Add user to DBFile created by AzDG support@azdg.com############################################################ $errors = ''; // By default - no errors
} Showing add user pageinclude_once C_PATH.'/header.php'; GenRegConst('USERNAME',!C_ID,$w[266],1,1); $tm = array(C_PASSS, C_PASSB); GenRegConst('FIRSTNAME',C_FIRSTNR,template($w[3], array(C_FIRSTNS, C_FIRSTNB)),C_REGISTER_FIELDS1,0); GenRegConst('DESCRIPTION',1,$w[38],C_REGISTER_FIELDS2,0); function is_hide($var) define('REGISTER_USER', $w[50]); define('USERNAME', $w[264].$w[0].is_hide(C_USERNAMESH)); $Require = (C_FIRSTNR) ? $w[0] :''; define('VERIFICATION', $w[498].$Require); $Require = (C_LASTNR) ? $w[0] :''; $Variable = (isset($pass)) ? $pass :''; $Variable = (isset($rpass)) ? $rpass :''; $Require = (C_BIRTHR) ? $w[0] :''; $Variable = ''; $Require = (C_GENDR) ? $w[0] :'';$Variable = ''; $Require = (C_BODYTYPER) ? $w[0] :'';$Variable = ''; $Require = (C_ORIENTATIONR) ? $w[0] :'';$Variable = ''; function GenField($const,$req,$show,$var,$arr,$windex,$sort=null) GenField('purpose',C_PURPR,C_PURPOSESH,'purpose',$wp,'58'); $Require = (C_CNTRR) ? $w[0] : ''; $Variable = '';$Check=array(); $Require = (C_STATER) ? $w[0] : ''; define('EMAIL', $w[60].$w[0].is_hide(C_EMAILSH)); define('URL', $w[61].is_hide(C_URLSH)); define('ICQ', $w[62].is_hide(C_ICQSH)); define('AIM', $w[63].is_hide(C_AIMSH)); $Require = (C_PHONER) ? $w[0] : $Require = (C_ZIPR) ? $w[0] : $Require = (C_CITYR) ? $w[0] : ''; $Require = (C_ADDRESSR) ? $w[0] : ''; $Require = (C_MARSR) ? $w[0] :''; $Require = (C_CHILDR) ? $w[0] :''; $Require = (C_HGHTR) ? $w[0] : $Require = (C_WGHTR) ? $w[0] : $Require = (C_HAIRR) ? $w[0] :''; $Require = (C_EYER) ? $w[0] :''; $Require = (C_ETNR) ? $w[0] : $Require = (C_RELR) ? $w[0] : $Require = (C_SMOKER) ? $w[0] :''; $Require = (C_DRINKR) ? $w[0] :''; $Require = (C_EDUCR) ? $w[0] :'';
// GenField('lang',C_LANGR,C_LANGSH,'lang',$wlng,'382');
?>` |
Beta Was this translation helpful? Give feedback.
-
Looking at your composer.json, that seems duplicated open close curly braces, I think you can generate composer.json first, eg:
Ensure you require-dev and require structure under root open |
Beta Was this translation helpful? Give feedback.
-
Thanks, I'll take a look. Should the composer.json file look like this? { |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks, I will see. |
Beta Was this translation helpful? Give feedback.
-
Hello! I ran into a problem when updating my code to php 8.1. This can be seen in the screenshot. This is error message:
PS C:\Users\alexa\www\someproject> vendor/bin/rector
1/1 [============================] 100%
sers\alexa\www\someproject\src\add.php" file, due to:
Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 45
PS C:\Users\alexa\www\someproject> vendor/bin/rector --debug
C:\Users\alexa\www\someproject\src\add.php
sers\alexa\www\someproject\src\add.php" file, due to:
#0
C:\Users\alexa\www\someproject\vendor\rector\rector\src\Php\PhpVersionResolver\ProjectComposerJsonPhpVersionRe
solver.php(25): RectorPrefix202402\Nette\Utils\Json::decode()
#1 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Php\PhpVersionProvider.php(47):
Rector\Php\PhpVersionResolver\ProjectComposerJsonPhpVersionResolver::resolve()
#2 C:\Users\alexa\www\someproject\vendor\rector\rector\src\VersionBonding\PhpVersionedFilter.php(34):
Rector\Php\PhpVersionProvider->provide()
#3
C:\Users\alexa\www\someproject\vendor\rector\rector\src\PhpParser\NodeTraverser\RectorNodeTraverser.php(65):
Rector\VersionBonding\PhpVersionedFilter->filter()
#4
C:\Users\alexa\www\someproject\vendor\rector\rector\src\PhpParser\NodeTraverser\RectorNodeTraverser.php(40):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->prepareNodeVisitors()
#5 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Application\FileProcessor.php(105):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverse()
#6 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Application\ApplicationFileProcessor.php(184):
Rector\Application\FileProcessor->processFile()
#7 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Application\ApplicationFileProcessor.php(161):
Rector\Application\ApplicationFileProcessor->processFile()
#8 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Console\Command\WorkerCommand.php(118):
Rector\Application\ApplicationFileProcessor->processFiles()
#9
C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\evenement\evenement\src\EventEmitterTrait.php(111):
Rector\Console\Command\WorkerCommand->Rector\Console\Command{closure}()
#10 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\clue\ndjson-react\src\Decoder.php(117):
RectorPrefix202402\Evenement\EventEmitter->emit()
#11
C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\evenement\evenement\src\EventEmitterTrait.php(111):
RectorPrefix202402\Clue\React\NDJson\Decoder->handleData()
#12 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\react\stream\src\Util.php(62):
RectorPrefix202402\Evenement\EventEmitter->emit()
#13
C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\evenement\evenement\src\EventEmitterTrait.php(111):
RectorPrefix202402\React\Stream\Util::RectorPrefix202402\React\Stream{closure}()
#14 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\react\stream\src\DuplexResourceStream.php(154):
RectorPrefix202402\Evenement\EventEmitter->emit()
#15 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\react\event-loop\src\StreamSelectLoop.php(201):
RectorPrefix202402\React\Stream\DuplexResourceStream->handleData()
#16 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\react\event-loop\src\StreamSelectLoop.php(173):
RectorPrefix202402\React\EventLoop\StreamSelectLoop->waitForStreamActivity()
#17 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Console\Command\WorkerCommand.php(89):
RectorPrefix202402\React\EventLoop\StreamSelectLoop->run()
#18 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\symfony\console\Command\Command.php(327):
Rector\Console\Command\WorkerCommand->execute()
#19 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\symfony\console\Application.php(960):
RectorPrefix202402\Symfony\Component\Console\Command\Command->run()
#20 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\symfony\console\Application.php(333):
RectorPrefix202402\Symfony\Component\Console\Application->doRunCommand()
#21 C:\Users\alexa\www\someproject\vendor\rector\rector\src\Console\ConsoleApplication.php(53):
RectorPrefix202402\Symfony\Component\Console\Application->doRun()
#22 C:\Users\alexa\www\someproject\vendor\rector\rector\vendor\symfony\console\Application.php(216):
Rector\Console\ConsoleApplication->doRun()
#23 C:\Users\alexa\www\someproject\vendor\rector\rector\bin\rector.php(130):
RectorPrefix202402\Symfony\Component\Console\Application->run()
#24 C:\Users\alexa\www\someproject\vendor\rector\rector\bin\rector(5): require_once('...')
#25 C:\Users\alexa\www\someproject\vendor\bin\rector(119): include('...')
#26 {main}". On line: 45
Beta Was this translation helpful? Give feedback.
All reactions