Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
phpdevcommunity merged 4 commits into phpdevcommunity:main from jaumarar:process-quotes
Jul 4, 2021
Merged

Added process of quotes #3

phpdevcommunity merged 4 commits into phpdevcommunity:main from jaumarar:process-quotes
Jul 4, 2021

Conversation

Copy link
Contributor

@jaumarar jaumarar commented Feb 23, 2021

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:

  • Separate the process of variables and the configuration to other classes
  • Added test to this feature
  • Modified README

Copy link
Contributor Author

jaumarar commented Mar 7, 2021

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

Copy link
Owner

@jaumarar Thanks for your help, had you read my comments ? i submit review if you can fix it

Copy link
Contributor Author

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

Copy link
Owner

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 ?

Copy link
Contributor Author

jaumarar commented Mar 13, 2021
edited
Loading

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;
 }
}

Copy link
Owner

yes like this but Processor's Name willl be added in DotEnv (constructor)

jaumarar reacted with thumbs up emoji

Copy link
Contributor Author

I think it should be finished now

phpdevcommunity reacted with thumbs up emoji

Copy link
Owner

@phpdevcommunity phpdevcommunity left a 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

Copy link
Contributor Author

Hi @devcoder-xyz should I change anything more?

phpdevcommunity reacted with thumbs up emoji

Copy link
Owner

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

Copy link
Contributor Author

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

phpdevcommunity reacted with thumbs up emoji

@phpdevcommunity phpdevcommunity merged commit e61e0a0 into phpdevcommunity:main Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@phpdevcommunity phpdevcommunity phpdevcommunity left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /