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

Optimize import in generated files #32

Open
andreacivita opened this issue Oct 15, 2021 · 2 comments
Open

Optimize import in generated files #32

andreacivita opened this issue Oct 15, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@andreacivita
Copy link
Owner

andreacivita commented Oct 15, 2021

Some stub files has not optimized import. It would be nice to fix this.

E.g. (supposing Model name is Car in namespace App\Models

in Test stub, setUp method is:

public function setUp() : void
    {
        parent::setUp();

        $this->car = \App\Models\Car::factory()->make();
    }

and should be

use App\Models\Car;

public function setUp() : void
    {
        parent::setUp();

        $this->car = Car::factory()->make();
    }

This should be applied to all stubs, and it will produce optimized imports and better code.

@andreacivita andreacivita added enhancement New feature or request good first issue Good for newcomers labels Oct 15, 2021
@maxvrdev
Copy link
Contributor

I would like to work on this issue.

andreacivita pushed a commit that referenced this issue Oct 20, 2021
* - Optimized all the stubs and docblocks

* Add Import to Model Stub

* Remove the import from the Model Stub
Clean up the imports on the Controller Stub

Related to issue #32 

Co-authored-by: maxvrdev@gmail.com <max.vanray@exentago.com>
andreacivita pushed a commit that referenced this issue Oct 23, 2021
* - Optimized all the stubs and docblocks

* Add Import to Model Stub

* Remove the import from the Model Stub
Clean up the imports on the Controller Stub

Related to issue #32 

Co-authored-by: maxvrdev@gmail.com <max.vanray@exentago.com>
andreacivita added a commit that referenced this issue Oct 23, 2021
* Update .travis.yml

* Revert "Update .travis.yml"

This reverts commit 6c54da4.

* Update GeneratorTest.php

* feat: Hard Refactor (#29)

* Updated stub-test

* New Generators

* Added dependency Support

* Removed unused param & added setData

* commands depends on new generators

Old generator has been deprecated

* Updated PHPUnit test suite

* ControllerGenerator + tests

* FactoryGenerator + test

* ModelGenerator + test

* RequestGenerator + test

* ResourceGenerator + test

* RouteGenerator + tests

* fix: typo in ModelGenerator

* TestGenerator + test

* Stub + test

* updated .gitignore

* Php-cs-fixer

Co-authored-by: Andrea Civita <andrea.civita@immobiliare.it>

* Namespace Added to Factory Stub (#33) (#36)

Co-authored-by: Max VanRay <max.vanray@exentago.com>

* - Optimized all the stubs and docblocks (#35)

* - Optimized all the stubs and docblocks

* Add Import to Model Stub

* Remove the import from the Model Stub
Clean up the imports on the Controller Stub

Related to issue #32 

Co-authored-by: maxvrdev@gmail.com <max.vanray@exentago.com>

Co-authored-by: Andrea Civita <andrea.civita@immobiliare.it>
Co-authored-by: Max VanRay <max.vanray@exentago.com>
Co-authored-by: Max VanReynegom <89394207+maxvrdev@users.noreply.github.com>
@andreacivita andreacivita reopened this Oct 24, 2021
@andreacivita
Copy link
Owner Author

Some imports are still wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants