Comments (8)
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.
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.
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.
This one seems to cover maximum use case, easy to use, so it's really fine!
from foundry.
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.
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.
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.
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)
- Feature request: Single Lazy Value HOT 9
- `FactoryCollection` should create `ArrayCollection` if needed
- Load extensions after DB reset HOT 6
- Deprecate `addState()` in favor of `withAttributes()` HOT 2
- Calling setters with more than one argument? HOT 2
- withAttributes in documentation HOT 1
- Can't change environment type in Bundles.php HOT 11
- createMany and createOne or new->create does not work well together on the CI HOT 3
- Don't return a `Proxy` if `->withoutPersist()` was used HOT 2
- Stub maker commands: missing command name in error HOT 1
- fix CI
- document "disable persist globally"
- doctrine:query:sql is deprecated
- ResetDatabase does not work with multiple schemas HOT 18
- Direct deprecation thrown with doctrine/dbal 3.6.6
- RuntimeException: Cannot get Foundry's configuration. Possible Bug? HOT 1
- Generated factories with PHPStan methods cause PhpStorm to mark file as error HOT 3
- Question: Access pool from it's own story::build() HOT 1
- Possibility of not flushing at all HOT 11
- Add Symfony 7 to test matrix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry.