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

Simplify Validation::getErrors() #2341

Merged
merged 1 commit into from Oct 17, 2019
Merged

Simplify Validation::getErrors() #2341

merged 1 commit into from Oct 17, 2019

Conversation

dafriend
Copy link
Contributor

No need to use session helper if both $_SESSION and $_SESSION['_ci_validation_errors'] are proven set. Using isset($var1, $var2) is easier on eyes than a compound conditional - part of which is an assignment.

Change:

if (isset($_SESSION) && $errors  =  session('_ci_validation_errors'))

To:

if (isset($_SESSION, $_SESSION['_ci_validation_errors']))

No need to use session class instance to get $_SESSION['_ci_validation_errors'] if it and  $_SESSION are proven set.

Using isset($var1,  $var2) easier on eyes than a compound conditional part of which is an assignment.
@lonnieezell lonnieezell merged commit 345caa3 into codeigniter4:develop Oct 17, 2019
@dafriend dafriend deleted the Validation_getErrors branch October 17, 2019 15:47
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