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

[8.x] Consistently negate conditions in @includeUnless() Blade directive #40077

Commits on Dec 16, 2021

  1. Consistently negate conditions in @includeUnless() Blade directive

    Before this, `@includeUnless($undefined ?? true, 'template')` would result
    in a PHP Warning and an unexpected condition result, because
    `$undefined ?? true` would be compiled as `! $undefined ?? true`, which due to
    `!` having precedence over `??` is different than `! ($undefined ?? true)`
    (which is how `@unless` would compile it).
    
    This necessitated the creation of `renderUnless()`, because `@includeUnless()`
    accepts multiple arguments, and parsing out the first argument to a Blade
    directive is fraught. So `renderUnless()` takes the parameters as-is,
    and negates the condition inside the method.
    markjaquith committed Dec 16, 2021
    Configuration menu
    Copy the full SHA
    8174e9d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    10dfd0b View commit details
    Browse the repository at this point in the history