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

fix: misc fixes #5

Merged
merged 1 commit into from
Jan 11, 2024
Merged

fix: misc fixes #5

merged 1 commit into from
Jan 11, 2024

Conversation

nikophil
Copy link
Collaborator

@nikophil nikophil commented Jan 9, 2024

here are some easy fixes from the list here

expect some more in the coming days 😅

I really fixed the easiest stuff here:


This one fixes a major failure I have in my app:

  • we should catch both "persistence" and ORM/ODM MappingException used here and here is sometimes

This was one of my main problem: we need to disable autorefresh when using flush_after()

  • flush_after() throws the following error:

Cannot auto refresh "App\Domain\Program" as there are unsaved changes. Be sure to call ->_save() or disable auto refreshing


This is a BC break, we can mitigate easily here. Moreover I think is is legit tu allow to ask "from 0 to x items"

  • randomRange() does not accept 0 anymore

Following ones are easy picks:

  • we should not forget to add an empty Factory::__construct()
  • we should add @mixin T in Proxy other wise there will be sca problems in the rare places where Proxy is still type-hinted
  • object should be saved again after afterPersist callbacks
  • proxy_factory() missing

@nikophil nikophil force-pushed the few-fixes branch 2 times, most recently from f848f64 to c8df78e Compare January 10, 2024 08:18
@kbond
Copy link
Owner

kbond commented Jan 10, 2024

I don't know your feelings toward this: should we still support Symfony 5.4 (still supported till late 2024)? and thus support php 8.0?

I'd like foundry 2.0 to be 6.4+ so PHP 8.1+

@@ -173,23 +173,23 @@ public function random(array $criteria = []): object
*/
public function randomSet(int $count, array $criteria = []): array
{
if ($count < 1) {
if ($count < 1) { // @phpstan-ignore-line
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add treatPhpDocTypesAsCertain to the phpstan config to avoid requiring these exceptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean we should disable this option?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it is disabled. Not sure why this is required

@kbond kbond merged commit 596ae65 into kbond:2.x Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants