Chapters
19 Chapters
|
2:20:12
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^8.0.2",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "^3.6", // v3.6.1
"composer/package-versions-deprecated": "^1.11", // 1.11.99.5
"doctrine/annotations": "^1.13", // 1.13.2
"doctrine/dbal": "^3.3", // 3.3.5
"doctrine/doctrine-bundle": "^2.0", // 2.6.2
"doctrine/doctrine-migrations-bundle": "^3.2", // 3.2.2
"doctrine/orm": "^2.0", // 2.11.2
"knplabs/knp-markdown-bundle": "^1.8", // 1.10.0
"knplabs/knp-time-bundle": "^1.18", // v1.18.0
"pagerfanta/doctrine-orm-adapter": "^3.6", // v3.6.1
"pagerfanta/twig": "^3.6", // v3.6.1
"sensio/framework-extra-bundle": "^6.0", // v6.2.6
"sentry/sentry-symfony": "^4.0", // 4.2.8
"stof/doctrine-extensions-bundle": "^1.5", // v1.7.0
"symfony/asset": "6.0.*", // v6.0.7
"symfony/console": "6.0.*", // v6.0.7
"symfony/dotenv": "6.0.*", // v6.0.5
"symfony/flex": "^2.1", // v2.1.7
"symfony/form": "6.0.*", // v6.0.7
"symfony/framework-bundle": "6.0.*", // v6.0.7
"symfony/mailer": "6.0.*", // v6.0.5
"symfony/monolog-bundle": "^3.0", // v3.7.1
"symfony/property-access": "6.0.*", // v6.0.7
"symfony/property-info": "6.0.*", // v6.0.7
"symfony/proxy-manager-bridge": "6.0.*", // v6.0.6
"symfony/routing": "6.0.*", // v6.0.5
"symfony/runtime": "6.0.*", // v6.0.7
"symfony/security-bundle": "6.0.*", // v6.0.5
"symfony/serializer": "6.0.*", // v6.0.7
"symfony/stopwatch": "6.0.*", // v6.0.5
"symfony/twig-bundle": "6.0.*", // v6.0.3
"symfony/ux-chartjs": "^2.0", // v2.1.0
"symfony/validator": "6.0.*", // v6.0.7
"symfony/webpack-encore-bundle": "^1.7", // v1.14.0
"symfony/yaml": "6.0.*", // v6.0.3
"symfonycasts/verify-email-bundle": "^1.7", // v1.10.0
"twig/extra-bundle": "^2.12|^3.0", // v3.3.8
"twig/string-extra": "^3.3", // v3.3.5
"twig/twig": "^2.12|^3.0" // v3.3.10
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4", // 3.4.1
"phpunit/phpunit": "^9.5", // 9.5.20
"rector/rector": "^0.12.17", // 0.12.20
"symfony/debug-bundle": "6.0.*", // v6.0.3
"symfony/maker-bundle": "^1.15", // v1.38.0
"symfony/var-dumper": "6.0.*", // v6.0.6
"symfony/web-profiler-bundle": "6.0.*", // v6.0.6
"zenstruck/foundry": "^1.16" // v1.18.0
}
}
20 Comments
gives back
"Command init is not defined"
You should instead now use
which does the same.
Thanks @weekender
To avoid that, you can tell rector to import automatically dependencies with :
$rectorConfig->importNames();That's awesome - thanks for sharing that!
Do we just do ?
There's no levelset I could find
Hey Slawomir,
What levelset exactly are you looking for? It might be so that you're on a different version from the one that is used in the video. I see we're using v0.12.20 of rector/rector package in the video
Cheers!
I'm using v1.2.2. There's a levelset in the video with up_to_symfony54 but there aren't any
SymfonyLevelSetList::UP_TO_SYMFONY54. Does this mean using symfony54 will include everything before or do we have to import everything before that ?Hey Slawomir,
Yes, that seems to be deleted in https://github.com/rectorphp/rector-symfony/pull/609 because it was deprecated. Yeah, now I believe you need to use more specific set lists from the SymfonySetList, and if you need to jump over a few minor versions - you probably need to process them one by one now.
I hope that helps!
Cheers!
Hi. Love your screencasts on Symfony! I'm sure I'm doing something dumb using this code on SF 5.4.28 and Rector ^0.13.9:
Can you help me resolve:
Cheers,
JPS
Hey Jamuel,
Your Rector config looks fine. Try to upgrade Rector to the latest which is v0.18.3. I suppose those might be some internal issues that were fixed in a newer version. Also, try to clear the Symfony cache with
rm -rf var/cache/before running Rector just in case.Also, are you sure you're in the root dir of your Symfony project? Do you recognize that
/private/var/folders/d9/bv_yx_fx5hg9hj1t9v1lcym80000gn/T/PXtNQdfolder? It seems like you're in that temporary folder somehow and trying to run the Rector from it.Also, please, make sure you have valid PHP syntax in your project code, it might be so that you accidentally removed some chars and now code is broken, try to run the project first to see it works well in the browser and no errors.
P.S. I see you're using php@7.4 that is a legacy PHP version and dropped in Brew package manager, i.e. you can't update or install it anymore. Maybe try a different (newer) PHP version.
I hope this helps!
Cheers!
Hi, when I try to run
php vendor/bin/rector process src/I get this error:
Has anyone a clue how to fix this?
Hey @andremoens!
Sorry for the slow reply! That's not a fun error :/. I did find an issue on this - https://github.com/rectorphp/rector/issues/6698
If I'm reading it correctly, if you upgrade Rector AND use the new config format for Rector (if you upgrade rector and run
./vendor/bin/rector inityou should get this new format), then it might not be an issue anymore... but I can't guarantee that :). The new config format should look something like this - https://github.com/rectorphp/rector-symfony#use-setsLet me know if that helps!
Cheers!
Hi @weaverryan, you're my hero!
Thanks for your help! It's working now....
I now can continue my journey on upgrading to Symfony 6
Hey
When I execute this commande "./vendor/bin/rector init", the response : "." is not recognized as an internal control !!
I'm on window. Can someone help me? Than's.
Hey Gouchene,
That sounds like a Windows error. I believe it's due to the way you're trying to execute
rector, instead of using./path/to/fileexecute it through PHPphp vendor/bin/rector initCheers!
Hey MollKhan
Thanks for your help, it allows me to continue the course.
Cheers !
you should update reactor config to look like https://github.com/rectorphp/rector-symfony
Hey Thomas,
Unfortunately, we can't change the code that was already recorded on the video. However, we can add notes to the code script and video. We will consider adding a note about it, thanks for pointing into it!
Cheers!
Haha, yea, they updated the config format WHILE I was recording the video - so I actually mention this new format later. But yes, we should add a note in this chapter about it so people aren't surprised when things look different.
Cheers!
"Houston: no signs of life"
Start the conversation!