Git Product home page Git Product logo

Comments (8)

kbond avatar kbond commented on May 27, 2024 1

Yeah, good call, I think I'd prefer this and not add the options to the command. Maybe:

zenstruck_foundry:
    maker:
        factory:
            namespace:  DataFixtures\\Factory
            template: path/to/my/
        story:
            namespace:  DataFixtures\\Story
            template: path/to/my/

from foundry.

kbond avatar kbond commented on May 27, 2024

Hello, something like this?

make:factory --namespace=DataFixtures\\Factory --template=path/to/my/Factory.tpl.php
make:story --namespace=DataFixtures\\Story --template=path/to/my/Story.tpl.php

from foundry.

Hakihiro avatar Hakihiro commented on May 27, 2024

Something like this could work, it will be redundant to specify each time the folder instead of a global override, maybe this in addition with a configurable namespace and template like :

zenstruck_foundry:
    namespace:  DataFixtures\\Factory
    template: path/to/my/

Could be easier to use because in our case we will never (except for test but it's another case) be in another namespace/folder.

from foundry.

Hakihiro avatar Hakihiro commented on May 27, 2024

This one seems to cover maximum use case, easy to use, so it's really fine!

from foundry.

wouterj avatar wouterj commented on May 27, 2024

To take in consideration, the official MakerBundle makers explicitly do not support overriding the template file: symfony/maker-bundle#33 (comment) (it's of course OK to divert from that decision here, but at least it's good to know the downsides of this change)

from foundry.

kbond avatar kbond commented on May 27, 2024

I think I'm going to follow the official stance of the MakerBundle on this one. I have had a conversation with @weaverryan about possibly moving the makers from this library into the MakerBundle - adding this would complicate that process.

from foundry.

wouterj avatar wouterj commented on May 27, 2024

Btw, there is a difference between make:factory and make:fixture (of MakerBundle). In make:fixture, the class name is a required argument (and this defaults to a specific namespace, unless an FQCN was provided). The make:factory doesn't do this (as it has the great auto-discovery feature for entities).

I think it does make sense to add a --namespace=DataFixtures\Factory option to the makers to override the default FQCN (and the makers automatically adjust the file location based on the FQCN and composer autoloading config).

from foundry.

kbond avatar kbond commented on May 27, 2024

I think it does make sense to add a --namespace=DataFixtures\Factory

How do you think this should behave if the --test flag is used as well?

from foundry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.