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

some refactor in BaseCommand class #2

Closed
wants to merge 1 commit into from

Conversation

miladev95
Copy link

  1. The code currently modifies the $model variable in place several times. While this is not necessarily a problem, it can make the code harder to follow. Consider using separate variables for the modified versions of $model, rather than overwriting it each time.
  2. using the DIRECTORY_SEPARATOR constant. This can make the code more portable between different operating systems.
  3. it returns only a string instead of an array or a string, since the is_dir() check is only needed to determine the namespace to use.

…of $model

- use DIRECTORY_SEPARATOR constant instead of hard-coding the backslash
- it returns only a string instead of an array or a string, since the is_dir() check is only needed to determine the namespace to use.
@vildanbina
Copy link
Owner

The source code you have modified is taken from the Laravel Core (see here), and I believe they are experienced than us in this aspect.

This does not mean that your solution is less effective, it's just that I think it should stay as it is.

Thank you very much for your effort, if you see any other shortcomings, do not hesitate to contribute. Or if you want to discuss this topic!

@vildanbina vildanbina closed this Apr 24, 2023
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.

None yet

2 participants