-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(be!): migrate Laravel to Symfony #70
Conversation
…web-profiler-bundle $ composer require illuminate/collections # also required by spatie/symfony-ignition-bundle $ composer require --dev spatie/symfony-ignition-bundle # to fix symfony/symfony#46457 as `highlight_file()` can be dangerous: https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/php-tricks-esp/php-useful-functions-disable_functions-open_basedir-bypass#filesystem-functions @ symfony
…ery case-sensitive column name with `#[Column(name: '"name"')]`: https://stackoverflow.com/questions/10471234/auto-quote-reserved-words-with-doctrine-2 https://stackoverflow.com/questions/29871735/why-doctrine2-doesnt-automatically-quote-all-sql-identifiers doctrine/orm#7815 + `App\Repository\Post\PostRepositoryFactory` like `App\Eloquent\Model\Post\PostFactory` in `be` + `App\Repository\Post\ThreadRepository` with interpolated table name: https://stackoverflow.com/questions/30871721/doctrine2-dynamic-table-name-for-entity/49796901#49796901 + `App\Entity\Post\Thread` like `tbm.Crawler.Db.PostThreadPost` in `c#` @ symfony
+ entity class `Reply` & `SubReply` * move some common props from `Thread` to `Post` @ `Post` + abstract class `TimestampedEntity` like `tbm.Crawler.Db.TimestampedEntity` in `c#` @ `App\Entity` + `PostRepository` to share common `__construct()` for derived classes + `ReplyRepository` & `SubReplyRepository` + method `new(Sub)?Reply()` @ `PostRepositoryFactory` @ `App\Repository\Post` @ symfony
…and their repo `App\Repository\Post\Content\(Post|(Sub)?Reply)ContentRepository` + method `new(Sub)?ReplyContent()` @ `App\Repository\Post\PostRepositoryFactory` @ symfony
…an.com/core-alerting/incident-resolution/b60bf985-1310-4e10-ace9-c32ecc1cc65f/ despite symfony/symfony#38021 @ .env - unused `template/base.html.twig` and empty `.gitignore` files that acts like `.gitkeep` @ symfony
…Post` * move common props `postedAt` & `(dis)?agreeCount` from derived classes of `Post` into it @ `Post` * mark abstract classes with attribute `MappedSuperclass` @ `App\Entity` @ symfony
…ryFactory` with `#[Symfony\Component\DependencyInjection\Attribute\Exclude]`: https://stackoverflow.com/questions/57854425/ignore-a-class-in-a-autowired-directory/79043103#79043103 @ symfony
$ composer require google/{protobuf,recaptcha} spatie/{laravel-collection-macros,regex} thecodingmachine/safe $ composer require --dev friendsofphp/php-cs-fixer infection/infection laravel/pint phan/phan phpmd/phpmd phpstan/{extension-installer,phpstan-{deprecation,strict}-rules} phpunit/phpunit roave/security-advisories squizlabs/php_codesniffer thecodingmachine/phpstan-safe-rule vimeo/psalm @ symfony
…loyfill-*` packages: https://stackoverflow.com/questions/18882201/how-does-the-replace-property-work-with-composer * add namespace autoload for `tbclient.protobuf/tbm_php` $ composer bump @ symfony
…ker` in `be` @ symfony
…teCast` in `be` @ symfony
…d their repositories @ symfony
…e}', ...)` in `be/routes/web.php` + `PrettyJsonResponse` & `ShowReactJsonView` like `App\Http\Middleware\DumpJsonResponse` in `be` + `SerializeToJson` for allowing controller methods to return an array instead of instance of class `Response` directly like laravel @ `App\EventListener` + var `ASSETS_BASE_URL` for config `framework.assets.base_urls` in `config/framework.yaml` @ .env @ symfony
…stan/phpdoc-parser symfony/{browser-kit,console,css-selector,property-{access,info},stopwatch} $ composer require --dev phpstan/phpstan-symfony psalm/plugin-symfony @ symfony
…at requires `symfony/property-access` which has been removed in feccb70 with `GetSetMethodNormalizer` @ config/services.yaml * now return the parsed protoBuf message directly without converting it to `stdClass` with `json_(de|en)code()` @ `BlobResourceGetter->protoBuf()` * replace `resource|null` with `?resource` in phpdoc typing @ `App\Entity` @ symfony
$ composer bump @ symfony
* fix referring `App\Entity\LatestReplier` @ `App\Repository\ForumRepository` * replace `ParameterBagInterface->get()` with `AbstractController->getParameter()` @ `App\Controller\AssetController` * lower priority to prevent dysfunction `#[Symfony\Bridge\Twig\Attribute\Template]` on controller routes that returning non `Response` @ `App\EventListener\SerializeToJson` * rename var `ASSETS_BASE_URL` to `APP_BASE_URL_ASSETS` + `APP_BASE_URL_FE` for `parameters.app.base_url.fe` in `config/services.yaml` @ .env @ symfony
* rename phpunit test classes to match with current systems under test * replace all references to `Tests\TestCase` in `be` with `Symfony\Bundle\FrameworkBundle\Test\KernelTestCase` @ `App\Tests` @ symfony
…erInterface $normalizer` for its only usages in `nestPostsWithParent()` @ `App\PostsQuery\BaseQuery->__construct()`, also affect all its derived classes * convert param values to `DateTimeImmutable` to allow constraint `LessThanOrEqual` be able to compare them @ `App\Validator\DateTimeRangeValidator->validate()` * wrap violations in root level key `errorInfo` and assign `errorCode=40000` to match with behavior in `be` @ `App\EventListener\ExceptionToJsonResponse->__invoke()` * fix not accepting stringify int for param `userGender` and missing string typed constraint for text params @ `App\PostsQuery\ParamsValidator->validateParamValue()` * mark param `$fid` as private prop and add getter for it @ `App\Repository\Post\PostRepository->__construct()` @ symfony
…ernelTestCase` for dependency injection + `EventListener\PrettyJsonResponse` for testing `App\EventListener\PrettyJsonResponse` that splited from `EventListener\ShowReactJsonViewTest\testHandle()` * rename methods to match with current methods of the system under test @ `Entity\BlobResourceGetterTest` & `EventListener\ExceptionToJsonResponseTest` * update expected data to match with behavior changed in 52e4e48 @ `PostsQuery\CursorCodecTest->provideDecodeCursor()` - `testXmlResponse()` and its data provider as `Helper::xmlResponse()` is not migrated in 7b94b65 @ `HelperTest` @ `App\Tests` @ symfony
053deac
to
7f2b5ad
Compare
* excluding rule `PSR12.ControlStructures.ControlStructureSpacing` @ .phpcs.xml $ rm phpcs.xml.dist # should be deleted in 0302713 * fix phpunit error `Class App\Entity\Post\Post does not have a property named unguarded` @ `App\Tests\PostsQuery\BaseQueryTest->provideNestPostsWithParent()` @ be
b4da414
to
435dd5c
Compare
…ons/be/action.yml
- remove all phpdoc annotation `@noinspection PhpPropertyOnlyWrittenInspection` @ be
…e into entity objects via their prop setter and filter out default values @ `(test|provide)NestPostsWithParent()` + dependency `DenormalizerInterface` for `testNestPostsWithParent()` @ `App\Tests\PostsQuery\BaseQueryTest` @ be
4504af1
to
950be34
Compare
2024 |
https://www.v2ex.com/t/1078290
https://twitter.com/yuxiyou/status/1842885186251640970
|
https://en.wikipedia.org/wiki/Enshittification
https://en.wikipedia.org/wiki/Accel_(company)
https://news.ycombinator.com/item?id=41455906
https://archive.is/lUWnK
https://news.ycombinator.com/item?id=41456312
https://i.imgur.com/W6tzgbd.jpeg
https://v2ex.com/t/1063401
tpetry/laravel-postgresql-enhanced#69
laravel/framework#10847
laravel/framework#10857
laravel/ideas#2169
e77ebd3
https://github.com/jBernavaPrah/eloquent-binary-cast
https://wiki.php.net/rfc/resource_to_object_conversion
https://wiki.php.net/rfc/resource_typehint
https://www.php.net/manual/en/resource.php
https://plugins.jetbrains.com/plugin/13441-laravel-idea
https://old.reddit.com/r/laravel/comments/slf4xh/why_laravel_9_isnt_typed/
https://old.reddit.com/r/PHPhelp/comments/17fzmc8/why_does_noone_use_declarestrict_types_1_in/
https://old.reddit.com/r/laravel/comments/14u5pc2/next_level_type_checking_in_laravel/
https://old.reddit.com/r/PHP/comments/1azghus/is_this_an_accurate_description_of_laravel/
laravel/ideas#1508
laravel-idea/plugin#984
https://forums.phpfreaks.com/topic/314703-how-to-disable-facades-in-laravel/
57363c5
https://old.reddit.com/r/PHP/comments/1dlt33b/symfony_or_laravel/
https://old.reddit.com/r/laravel/comments/17m2gxz/if_i_can_do_laravel_how_will_i_get_on_with_symfony/
https://old.reddit.com/r/PHP/comments/18vxryp/team_lead_telling_me_symfony_is_dying_and_i/
https://old.reddit.com/r/PHP/comments/mms6eg/use_iluminatecollections_outside_laravel/
https://dev.to/juyn/using-laravel-s-collection-into-symfony-4nf8
https://github.com/tighten/collect
https://github.com/atrauzzi/laravel-doctrine
https://github.com/laravel-doctrine/orm