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

[make:*] Fluent setters bundle configuration option #436

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

prugala
Copy link
Contributor

@prugala prugala commented Jul 3, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #297
License MIT

Based on #297

At the moment we cannot decide that we want to generate fluent or not fluent setters.

I read the discussion in an issue and I added global configuration option:

maker:
  fluent_setters: false // default: true

@romaricdrigon romaricdrigon added the Status: Needs Work Additional work is needed label Oct 11, 2019
@maks-rafalko
Copy link

Are you going to finish it @prugala?

@prugala
Copy link
Contributor Author

prugala commented Dec 28, 2019

@maks-rafalko oh I forgot about it. Yes I will finish it. I will try to add tests and update docs this week.

@prugala
Copy link
Contributor Author

prugala commented Dec 28, 2019

OK I added tests and updated doc section.
@weaverryan could you look or call someone who can do it. Thanks :)

@AlboCode
Copy link

Any news about this PR?
What is it missing?

@prugala
Copy link
Contributor Author

prugala commented Sep 10, 2020

@AlboCode I see conflicts, I will fix it tomorrow and will ask about merge :)

@AlboCode
Copy link

@AlboCode I see conflicts, I will fix it tomorrow and will ask about merge :)

Thanks 👍

# Conflicts:
#	src/Maker/MakeUser.php
#	src/Resources/config/makers.xml
#	tests/Doctrine/EntityRegeneratorTest.php
#	tests/Maker/FunctionalTest.php
@prugala
Copy link
Contributor Author

prugala commented Sep 13, 2020

Sorry for ping but PR is old and I forgot to end it before. Now its ready with tests.

@nicolas-grekas @weaverryan and docs change so @javiereguiluz :)

Copy link
Contributor

@BatsaxIV BatsaxIV left a comment

Choose a reason for hiding this comment

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

Hi,

Besides what I reviewed in your code, I think that your forgot to update one maker, the MakeRegistrationForm.

https://github.com/symfony/maker-bundle/blob/master/src/Maker/MakeRegistrationForm.php#L309 : Here it can update a user class with a isVerified property and its setter that is fluent by default.

I think something like that should do the trick:

$userManipulator = new ClassSourceManipulator(
    file_get_contents($classDetails->getPath()),
    true,
    true,
    $generator->getFluentSetters()
);

Jérémy.

src/Resources/doc/index.rst Outdated Show resolved Hide resolved
@@ -0,0 +1,55 @@
<?php
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with the test for this bundle, but I can't figured out where this file is used (The others fixtures files are used in \Symfony\Bundle\MakerBundle\Tests\Maker*).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I forgot about test, added.

@acornforth
Copy link

This is just what I have been looking for. A must if we want to use maker in applications that have already defined non-fluent interfaces to implement on our entities (Sylius).
How long would this typically take to be merged now that tests are passing?

@prugala
Copy link
Contributor Author

prugala commented Oct 10, 2020

@BatsaxIV thank you again for review. I've added missing parameter there and in few other places. Now All "Manipulators"
use custom parameter.

@weaverryan weaverryan changed the base branch from master to main November 16, 2020 20:03
@jrushlow jrushlow added the Feature New Feature label May 10, 2022
@hockdudu
Copy link

hockdudu commented Nov 4, 2022

Is there something holding this PR back?

@prugala
Copy link
Contributor Author

prugala commented Nov 4, 2022

Is there something holding this PR back?

I resolve conflicts today later and I think all should be ready to merge :)

@jaroslavtyc
Copy link

jaroslavtyc commented Dec 7, 2023

Any chance to move this forward? Guys from my team refuse to use maker for entities because of forced fluent interface, which brings whole bunch of new troubles.

Yea, it is more about people than code, but this fluent_setters: false would help with people.-)

Thanks!

@bytes-commerce
Copy link

Since its been some time with this PR, I'd like to take the chance and un-necro it before it gets stale over a year again.

I'd love to see this configuration being pushed to prod so that we can go back to non-fluent setters. Thanks everyone involved pushing this forward.

@bytes-commerce
Copy link

Sorry to ping again. @prugala just in case you're still contributing to the project, I believe that many people would be happy to see your changes. If not, please let us know so that maybe someone else can take over from here on. 🙏

@prugala
Copy link
Contributor Author

prugala commented Jun 17, 2024

@NopeNopeNope sorry for lack of activity. I'll update PR to current code base today or tomorrow :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Needs Work Additional work is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants