diff --git a/.scrutinizer.yml b/.scrutinizer.yml index beeb2fc1..42617ac8 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,7 +21,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 2 + runs: 3 php_code_sniffer: enabled: true config: diff --git a/.travis.yml b/.travis.yml index 662dba75..e393a3c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ php: matrix: allow_failures: - - php: 7.4snapshot - php: nightly before_script: @@ -21,5 +20,5 @@ script: - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover after_script: - - if [ "$TRAVIS_PHP_VERSION" != "7.4snapshot" ] && [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [ "$TRAVIS_PHP_VERSION" != "7.4snapshot" ] && [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi + - if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi + - if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi diff --git a/resources/views/bootstrap-3/show.blade.php b/resources/views/bootstrap-3/show.blade.php index 8e667173..adb71b16 100644 --- a/resources/views/bootstrap-3/show.blade.php +++ b/resources/views/bootstrap-3/show.blade.php @@ -253,13 +253,18 @@ }); @unless (empty(log_styler()->toHighlight())) - $('.stack-content').each(function() { - var $this = $(this); - var html = $this.html().trim() - .replace(/({!! join(log_styler()->toHighlight(), '|') !!})/gm, '$1'); + @php + $htmlHighlight = version_compare(PHP_VERSION, '7.4.0') >= 0 + ? join('|', log_styler()->toHighlight()) + : join(log_styler()->toHighlight(), '|'); + @endphp + $('.stack-content').each(function() { + var $this = $(this); + var html = $this.html().trim() + .replace(/({!! $htmlHighlight !!})/gm, '$1'); - $this.html(html); - }); + $this.html(html); + }); @endunless }); diff --git a/resources/views/bootstrap-4/show.blade.php b/resources/views/bootstrap-4/show.blade.php index 8c6d068f..f4100e87 100644 --- a/resources/views/bootstrap-4/show.blade.php +++ b/resources/views/bootstrap-4/show.blade.php @@ -239,13 +239,19 @@ }); @unless (empty(log_styler()->toHighlight())) - $('.stack-content').each(function() { - var $this = $(this); - var html = $this.html().trim() - .replace(/({!! join(log_styler()->toHighlight(), '|') !!})/gm, '$1'); + @php + $htmlHighlight = version_compare(PHP_VERSION, '7.4.0') >= 0 + ? join('|', log_styler()->toHighlight()) + : join(log_styler()->toHighlight(), '|'); + @endphp - $this.html(html); - }); + $('.stack-content').each(function() { + var $this = $(this); + var html = $this.html().trim() + .replace(/({!! $htmlHighlight !!})/gm, '$1'); + + $this.html(html); + }); @endunless }); diff --git a/src/Utilities/LogStyler.php b/src/Utilities/LogStyler.php index 26351af2..902b1f06 100644 --- a/src/Utilities/LogStyler.php +++ b/src/Utilities/LogStyler.php @@ -99,6 +99,6 @@ public function color($level, $default = null) */ public function toHighlight(array $default = []) { - return $this->get("highlight", $default); + return $this->get('highlight', $default); } }