-
Notifications
You must be signed in to change notification settings - Fork 25
Added process of quotes #3
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
Conversation
Hi! @devcoder-xyz,
had you have time to look at this propossal? My intention is to use this package in several projects and it would be nice to add features like this and the process of numbers, for example.
I'm glad to help and hear your opinion about this so if there is something that you are not comfortable adding there will be no problems. Greetings
@jaumarar Thanks for your help, had you read my comments ? i submit review if you can fix it
Hi @devcoder-xyz i'm not seeing any reviews or comments in the mr nor other branches.
can you link me here those comments? maybe are marked as draft or the reviews has not been started
ok no problem 👍
Processor.php : Can you create a class unique for one resolve ?
in the Processor class, create a collection of Resolver and each resolver resolves a value
its possible ?
Sure, something like?
Processor.php
Processor
| BooleanProcessor.php
| QuotedProcessor.php
Where Processor.php
class Processor { execute($value) { foreach ([BooleanProcessor::class, QuotedProcessor::class] as $processorClass) { $processor = new $processorClass($value); if ($processor->canBeExecuted()) { return $processor->execute(); } } return $value; } }
yes like this but Processor's Name willl be added in DotEnv (constructor)
I think it should be finished now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/DotEnv.php
you forget "?" after array type,
Default value is NULL its ok but if $processors is null set Processors(null) , There will be a fatal error
src/Processor/QuotedProcessor.php
isWrappedByChar can be a private method
thank you very much @jaumarar it's perfect
Hi @devcoder-xyz should I change anything more?
Yes please , you not see my comment ?
src/DotEnv.php
you forget "?" after array type,
Default value is NULL its ok but if $processors is null set Processors(null) , There will be a fatal error
src/Processor/QuotedProcessor.php
isWrappedByChar can be a private method
thank you very much @jaumarar it's perfect
Hi @devcoder-xyz I was away for a long time..
I hace added a test to proof that that DotEnv::setProcessors()
should be safe to pass anything invalid since it filters invalid values, let me know if you need anything more
If the .env file has a value wrapped in single or double quotes it will be parsed into a simple string:
.env file:
VARIABLE="value with double quotes"
Before:
$_ENV['VARIABLE] = "value with double quotes";
Now:
$_ENV['VARIABLE] = value with double quotes;
Also: