Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
fixes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
abdumu committed Sep 14, 2019
1 parent aacb890 commit da9d125
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Analyze.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ protected function detectWarnings()

if (version_compare($laravelVersion, '5.7', '>=')) {
if (
preg_match('/@?{{(\s*((?!}}).?)*\s*)or\s*.+?\s*}}(\r?\n)?/s', $this->code) ||
preg_match('/@?{{{(\s*((?!}}}).?)*\s*)or\s*.+?\s*}}}(\r?\n)?/s', $this->code) ||
preg_match('/@?{\!\!(\s*((?!\!\!}).?)*\s*)or\s*.+?\s*\!\!}(\r?\n)?/s', $this->code)
preg_match('/@?{{(((?!}})(?<!--).?)*\s+)or\s+.+?\s*}}(\r?\n)?/s', $this->code) ||
preg_match('/@?{{{(\s*((?!}}}).?)*\s+)or\s+.+?\s*}}}(\r?\n)?/s', $this->code) ||
preg_match('/@?{\!\!(\s*((?!\!\!}).?)*\s+)or\s+.+?\s*\!\!}(\r?\n)?/s', $this->code)
) {
$this->warnings->push(['or_operator', 'The "or" operator has been removed in favor of ?? as in {{ $var ?? "" }}']);
}
}
}
}

if (version_compare($laravelVersion, '5.8.13', '>=')) {
if (preg_match('/\@if\s*\(\s*\$errors->has\s*\(/s', $this->code)) {
Expand Down

0 comments on commit da9d125

Please sign in to comment.