Skip to content
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

Merged
merged 62 commits into from
Oct 9, 2024
Merged

refactor(be!): migrate Laravel to Symfony #70

merged 62 commits into from
Oct 9, 2024

Commits on Sep 27, 2024

  1. Configuration menu
    Copy the full SHA
    2253f5f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    295fb07 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    362cbf1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    31b568a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    02d6902 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    46c2288 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dae03d1 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2024

  1. $ composer require symfony/twig-bundle # already required by symfony/…

    …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
    n0099 committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    97d8491 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2024

  1. Configuration menu
    Copy the full SHA
    1587bf7 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2024

  1. + App\Doctrine\AlwaysQuoteStrategy to prevent explicitly quoting ev…

    …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
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    233752c View commit details
    Browse the repository at this point in the history
  2. + abstract class Post like tbm.Crawler.Db.Post.IPost in c#

    + 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
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    eedc563 View commit details
    Browse the repository at this point in the history
  3. + entity classes App\Entity\Post\Content\(Post|(Sub)?Reply)Content

    …and their repo `App\Repository\Post\Content\(Post|(Sub)?Reply)ContentRepository`
    
    + method `new(Sub)?ReplyContent()` @ `App\Repository\Post\PostRepositoryFactory`
    @ symfony
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    993a77a View commit details
    Browse the repository at this point in the history
  4. * remove the value of APP_SECRET to fix https://dashboard.gitguardi…

    …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
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    84fd4c5 View commit details
    Browse the repository at this point in the history
  5. * inline prop tid into derived classes to fix doctrine/orm#4131 @ `…

    …Post`
    
    * move common props `postedAt` & `(dis)?agreeCount` from derived classes of `Post` into it
    @ `Post`
    
    * mark abstract classes with attribute `MappedSuperclass`
    @ `App\Entity`
    @ symfony
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    787d700 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    400757b View commit details
    Browse the repository at this point in the history
  7. * mark concrete classes in App\Repository\Post except `PostReposito…

    …ryFactory` with `#[Symfony\Component\DependencyInjection\Attribute\Exclude]`: https://stackoverflow.com/questions/57854425/ignore-a-class-in-a-autowired-directory/79043103#79043103 @ symfony
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    b0a6b25 View commit details
    Browse the repository at this point in the history
  8. * sync composer packages between symfony & be

    $ 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
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    7513509 View commit details
    Browse the repository at this point in the history
  9. * update php version and requiring extensions for removing `symfony/p…

    …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
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    f4c1b07 View commit details
    Browse the repository at this point in the history
  10. + App\Entity\BlobResourceGetter like `App\Eloquent\ModelAttributeMa…

    …ker` in `be` @ symfony
    n0099 committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    9b9b4b9 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2024

  1. * add ?? 0 for some props like `App\Eloquent\NullableNumericAttribu…

    …teCast` in `be` @ symfony
    n0099 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    4a304f5 View commit details
    Browse the repository at this point in the history
  2. + entity classes BilibiliVote, Forum, LatestReplier & User an…

    …d their repositories @ symfony
    n0099 committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    fdd7145 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5c4ea01 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2024

  1. Configuration menu
    Copy the full SHA
    75ae379 View commit details
    Browse the repository at this point in the history
  2. + App\Controller\AssetController like `Route::get('/assets/{filenam…

    …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
    n0099 committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    5a0416d View commit details
    Browse the repository at this point in the history
  3. $ composer remove doctrine/dbal phpdocumentor/reflection-docblock php…

    …stan/phpdoc-parser symfony/{browser-kit,console,css-selector,property-{access,info},stopwatch}
    
    $ composer require --dev phpstan/phpstan-symfony psalm/plugin-symfony
    @ symfony
    n0099 committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    feccb70 View commit details
    Browse the repository at this point in the history
  4. * replace the default normalizer for serializer ObjectNormalizer th…

    …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
    n0099 committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    3be6b04 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2024

  1. $ composer require symfony/validator

    $ composer bump
    @ symfony
    n0099 committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    49cfae0 View commit details
    Browse the repository at this point in the history
  2. + App\Helper like its nameshake in be

    * 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
    n0099 committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    7b94b65 View commit details
    Browse the repository at this point in the history
  3. + App\Controller\SitemapController

    + `templates/sitemaps/{forum,thread}s.xml.twig` like `resources/views/sitemaps/{forum,thread}s.blade.php` in `be`
    + `App\Validator` to throw `ValidationFailedException`: https://stackoverflow.com/questions/47875979/constraintviolationlistinterface-to-exception-in-symfony/76004283#76004283
    
    + methods `getOrderedForumsId()` & `isForumExists()` for `App\Controller\SitemapController` @ `ForumRepository`
    + methods `getThreadsIdByChunks()` & `getThreadsIdAfter()` for `App\Controller\SitemapController` @ `ThreadRepository`
    @ `App\Repository`
    @ symfony
    n0099 committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    7c51c86 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e880e9c View commit details
    Browse the repository at this point in the history
  5. + App\EventListener\ExceptionToJsonResponse to serialize `HttpExcep…

    …tion` or `ValidationFailedException` into `JsonResponse` like `App\Exceptions\Handler->convertValidationExceptionToResponse()` in `be`
    
    * now will derived classes of `HttpException` with `Exception->code` @ `App\Helper->abortApi()`
    * passing the testing value to the `ValidationFailedException` to be thrown @ `App\Validator->__invoke()`
    @ symfony
    n0099 committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    e6148a9 View commit details
    Browse the repository at this point in the history
  6. $ rm Entity/BilibiliVote.php Repository/BilibiliVoteRepository.php

    $ composer remove google/recaptcha
    @ symfony
    n0099 committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    a612428 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. + class ParamsValidator and replace laravel validator rules in `val…

    …idateParamsValue()` with symfony validator constraints
    
    + classes `QueryParams?` copied from its namesake classes in `be`
    @ `App\PostsQuery`
    
    + classes `App\Validator\DateTimeRange(Validator)?` for `App\PostsQuery\ParamsValidator`
    * move class `App\Validator` into namespace `App\Validator` and rename `__invoke()` to `validate()`
    @ symfony
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    7c2de88 View commit details
    Browse the repository at this point in the history
  2. + App\PostsQuery\CursorCodec like its namesake class in be

    + `App\Repository\Post\PostRepositoryFactory->newForumPosts()` like `App\Eloquent\Model\Post\PostFactory->getPostModelsByFid()` in `be`
    @ symfony
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    3efff82 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95e4c72 View commit details
    Browse the repository at this point in the history
  4. $ cp {be/app/Http/Controllers,symfony/src/Controller}/PostsQuery.php

    $ cp {be/app/Http/Controllers,symfony/src/Controller}/UsersQuery.php
    $ cp {be/app/Http,symfony/src}/PostsQuery/IndexQuery.php
    $ cp {be/app/Http,symfony/src}/PostsQuery/SearchQuery.php
    $ cp {be/app/Http,symfony/src}/PostsQuery/BaseQuery.php
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    872e0e6 View commit details
    Browse the repository at this point in the history
  5. + selectCurrentAndParentPostID() & abstract getTableNameSuffix()

    …like their namesake methods from `App\Eloquent\Model\Post\Post` in `be`
    
    - param `$tableNameSuffix` in ctor in favor of `getTableNameSuffix()` that implemented by derived classes
    @ `PostRepository`
    
    + `new()` to replace usages of `newForumPosts()[...]`
    * fix referencing entity classes in the return type phpdoc @ `newForumPosts()`
    @ `PostRepositoryFactory`
    @ `App\Repository\Post`
    
    + prop `isMatchQuery` and its getter and fluent setter @ `App\Entity\Post\Post`
    @ symfony
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    a9c16f0 View commit details
    Browse the repository at this point in the history
  6. * migrate files that copied from be in 872e0e6 from laravel eloquen…

    …t to doctrine @ symfony
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    9a3b1fa View commit details
    Browse the repository at this point in the history
  7. + ForumsController like route /forums in be

    + `getOrderedForums()` @ App\Repository\ForumRepository
    * add `#[Route(...)]` for `(Post|User)sController->query()`
    @ `App\Controller`
    
    * mv Controller/Posts{Query,Controller}.php
    * mv Controller/Users{Query,Controller}.php
    @ symfony
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    39d0f00 View commit details
    Browse the repository at this point in the history
  8. + hasQueryResultMorePages() to reuse between setResult() & `Users…

    …Controller->query()` @ `BaseQuery`
    
    * fix validator not allowing optional params @ `ParamsValidator` & `(Post|User)sController`
    * replace injected `ParameterBag` with `Request->query` @ `PostsController->query()`
    
    * fix query params should come from all query string instead of json decoded query string `?query=` like `PostsController->query()`
    * fix only the value of the last query param will be used for all binding params in the prepared sql when giving multiple query params
    @ `UsersController->query()`
    @ `App\PostsQuery`
    @ symfony
    n0099 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    c79a749 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. * fix not accepting int typed value for numeric params: https://www.p…

    …hp.net/manual/en/function.ctype-digit.php#108712
    
    * rename `params` in method name and param to `param`
    @ `validateParamValue()`
    
    * replace public prop `$params` with getter and fluent setter contain the param `$params` in ctor
    @ `ParamsValidator`
    
    * now not being fluent method @ `BaseQuery->query()`
    @ `App\PostsQuery`
    
    * replace `new ParamsValidator()` & `new $queryClass()` with services locator
    * fix misusing `AbstractController->getParameter()` for getting the value of query string `?cursor=`
    @ `App\Controller\PostsController`
    
    * fix unquoted table name will become lowercase ing Postgres @ `PostRepository->__construct()`
    * fix typo in table name @ `SubReplyRepository->getTableNameSuffix()`
    @ `App\Repository\Post`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    8483414 View commit details
    Browse the repository at this point in the history
  2. * fix QueryBuilder->orderBy() will override previous orders @ `$ord…

    …eredQueries()`
    
    * inline `$addOrderByForBuilder()` into its only usage in `$queriesWithOrderBy` and rename it to `$orderedQueries`
    * fix missing entity name alias `t` for fields
    * fix `$this` cannot be used inside `static` closure @ `$resultsAndHasMorePages()`
    @ `setResult()`
    
    * cast `$threads`, `$replies` & `$subReplies` from `array` to `Collection`
    * set `Post->isMatchQuery = true` @ `$subReplies`
    @ `fillWithParentPost()`
    
    * fix not grouping `$replies` & `$subReplies` by their parent post id
    * fix not normalize entities of `SubReply` to array
    @ `nestPostsWithParent()`
    
    * mark prop `$queryResult` as `private` as not used by derived classes
    @ `BaseQuery`
    
    * fix an extra nesting array for a single row returned @ `$getFidByPostIDParam()`
    * fix `$this` cannot be used inside `static` closure @ `$getQueryBuilders()`
    @ `IndexQuery->query()`
    @ `App\PostsQuery`
    
    * fix `QueryBuilder->where()` will override previous predicates
    * fix using positional dql param instead of named
    * fix missing entity name alias `t` for fields
    @ `App\Controller\PostsController->query()`
    
    * fix `QueryBuilder->addSelect()` without any previous `->select()` will also selecting all entity fields @ `App\Repository\Post\PostRepository->selectCurrentAndParentPostID()`
    * rename method `isMatchQuery()` to `getIsMatchQuery()` for `Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer` @ `App\Entity\Post\Post`
    + overriding `boot()` to register laravel collection marcos like `Spatie\CollectionMacros\CollectionMacroServiceProvider->register()` @ `App\Kernel`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    32fbf13 View commit details
    Browse the repository at this point in the history
  3. + props $current(ForumModerator|AuthorExpGrade) and their g/setter …

    …@ `App\Entity\User`
    
    + `getLatestOfUsers()` @ ForumModeratorRepository
    + `getLatestOfUsers()` @ AuthorExpGradeRepository
    @ `App\Repository\Revision`
    
    + dto `ForumModerator` & AuthorExpGrade @ `App\DTO\User`
    * add auto mapping for `App\DTO` @ config/packges/doctrine.yaml
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    338d4a2 View commit details
    Browse the repository at this point in the history
  4. * manually query PostContent entities for reply and sub replies and…

    … store them with `PostWithContent->setContent()`, not using one-to-one association due to relying on `PostRepository->getTableNameSuffix()` to set table name prefix
    
    * replace `Collection->map()` with `->each()` when its closure returns `void`
    * remove unnecessary invokes to `Collection->toArray()`
    @ `App\PostsQuery\BaseQuery->fillWithParentPost()`
    
    + abstract class `PostWithContent` to let entity classes `(Sub)?Reply` inherits it
    * replace fluent setter `setIsMatchQuery()` with an normal setter @ `Post`
    @ `App\Entity\Post`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    8de7b4d View commit details
    Browse the repository at this point in the history
  5. * manually query partial projected DTO of entities AuthorExpGrade &…

    … `ForumModerator` of queried users and store them in the user entity like the one-to-one relationship based `App\Eloquent\Model\User->current(ForumModerator|AuthorExpGrade)()` in `be`
    
    * fix trying to directly access prop `Thread->latestReplierId`
    * fix selecting all fields for `uid IS NOT NULL`
    @ `App\Controller\PostsController->query()`
    
    + missing field `latestReplierId` and its getter @ `App\Entity\Post\Thread`
    * fix regression of double quoting the table name being interpolated into raw SQL since 8483414 @ `App\Repository\Post\ThreadRepository->getThreadsIdByChunks()`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    7521aa4 View commit details
    Browse the repository at this point in the history
  6. * partial revert 3be6b04 to remove fields with default value @ `BlobR…

    …esourceGetter`, also affects all its usages
    
    * replace the type of prop `$content` from `PostContentWrapper` to `array` @ `Post\PostWithContent->getContent()`
    @ `App\Entity`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    cc7ec13 View commit details
    Browse the repository at this point in the history
  7. * partial revert 32fbf13 @ reOrderNestedPosts()

    * partial revert 32fbf13 @ `fillWithParentPost()`
    @ `App\PostsQuery\BaseQuery`
    
    * fix passing the protobuf class inside `RepeatedField` @ `getIcon()`
    * fix the type of field `ipGeolocation` is not nullable
    @ `User`
    
    + `protoBufWrapper()` @ `BlobResourceGetter`
    + override `(g|s)etIsMatchQuery()` to make it always be `true` @ `Post\SubReply`
    @ `App\Entity`
    
    * fix nesting the only forum and selecting all its fields including surrogate PK `id` in the returned response @ `PostsController->query()`
    * add prefix `/api` for route `/{post,user,forum}s` like `be/routes/api.php` @ `App\Controller`
    * fix pretty JSON response for `ShowReactJsonView` @ `App\EventListener\PrettyJsonResponse`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    eb0f3e8 View commit details
    Browse the repository at this point in the history
  8. * fix appending AND predicate for each cursor without parenthesis

    * fix hardcoded `>` operator regardless of the querying order by direction
    * no longer returning the `QueryBuilder` by its fluent method as it's not immutable
    @ `$paginators()`
    
    * type `$postsKeyByTypePluralName` with `CursorCodec->PostsKeyByTypePluralName`
    @ `setResult()`
    
    * fix not querying reply content with `Reply->isMatchQuery === false` @ `fillWithParentPost()`
    @ `BaseQuery`
    
    * fix posts now will be an array that normalized from entity object
    * typing param `$postsKeyByTypePluralName`
    @ `encodeNextCursor()`
    
    * fix not removing cursors with all their field value is empty string or `0` @ `decodeCursor()`
    @ `CursorCodec`
    @ `App\PostsQuery`
    @ symfony
    n0099 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    52e4e48 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. * fix overwriting existing SQL param with the same name by distinguis…

    …hing them with `$paramIndex`
    
    * fix `QueryBuilder->where()` will override previous predicates like 32fbf13
    * fix false positive about `InvalidArgumentException` when sub param `range` doesn't exists
    @ `App\PostsQuery\SearchQuery->applyQueryParamsOnQuery()`
    @ symfony
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    6b40d87 View commit details
    Browse the repository at this point in the history
  2. * migrate config files of php-cs-fixer, pint, phpmd, phpstan, psalm, …

    …phan, phpunit & infection from `be` to `symfony`
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    0302713 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b726482 View commit details
    Browse the repository at this point in the history
  4. * move phpunit test files to match with current namespace hierarchy

    * 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
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    97bf3ed View commit details
    Browse the repository at this point in the history
  5. * replace dependency SerializerInterface $serializer with `Normaliz…

    …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
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    6404930 View commit details
    Browse the repository at this point in the history
  6. * migrate phpunit tests to use `Symfony\Bundle\FrameworkBundle\Test\K…

    …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
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    af67ff2 View commit details
    Browse the repository at this point in the history
  7. $ rm -r be && mv symfony be

    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    b531590 View commit details
    Browse the repository at this point in the history
  8. $ ./vendor/bin/pint @ be

    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    6aa5b87 View commit details
    Browse the repository at this point in the history
  9. * fix all violations of phpcs rule

    * 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
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    4156bf6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4b9914a View commit details
    Browse the repository at this point in the history
  11. + setter method of each prop for all entities

    - remove all phpdoc annotation `@noinspection PhpPropertyOnlyWrittenInspection`
    @ be
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    44a63fe View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ac19173 View commit details
    Browse the repository at this point in the history
  13. * fix passing empty entities by denormalize the array with props valu…

    …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
    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    950be34 View commit details
    Browse the repository at this point in the history
  14. $ git merge v2 -X ours

    n0099 committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    722c039 View commit details
    Browse the repository at this point in the history