From f6c6502c9d4c7a00ea0465f31f12e4d81a562847 Mon Sep 17 00:00:00 2001 From: Tobias Buschor Date: Sat, 12 Nov 2016 10:54:46 +0100 Subject: [PATCH] Use php ternary operator The ternary operator is available since php 5.3 --- finediff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finediff.php b/finediff.php index 920365a..618709d 100644 --- a/finediff.php +++ b/finediff.php @@ -214,7 +214,7 @@ class FineDiff { */ public function __construct($from_text = '', $to_text = '', $granularityStack = null) { // setup stack for generic text documents by default - $this->granularityStack = $granularityStack ? $granularityStack : FineDiff::$characterGranularity; + $this->granularityStack = $granularityStack ?: FineDiff::$characterGranularity; $this->edits = array(); $this->from_text = $from_text; $this->doDiff($from_text, $to_text);