context: Cleanup is_null() checks and irrelevant else code paths
authorDerick Alangi <alangiderick@gmail.com>
Wed, 20 Mar 2019 18:53:00 +0000 (19:53 +0100)
committerDerick Alangi <alangiderick@gmail.com>
Wed, 20 Mar 2019 19:51:58 +0000 (20:51 +0100)
commit5479c37368a60df7c0bdee35554b465effa1b491
tree5d570726585d685875f9a3c188bfb825b1d53bf3
parente552f302537d538a609ed8f95d476d99f4c6e248
context: Cleanup is_null() checks and irrelevant else code paths

This class specifically has these 2 things in many cases and converts
into the use of a tenary operations.

Quoting @Thiemo_WMDE from Gerrit comment: "The ?: operator will skip
empty arrays, empty strings, as well as the string "0". But this is
not a problem here because the properties under test are all objects.
Objects are always considered true in PHP."

Sample change can be seen below as, from;
```
if ( !is_null( $this->skin )) {
    return $this->skin;
} else {
    return $this->getContext()->getSkin();
}

```

to

```
return $this->skin ?: $this->getContext()->getSkin();
```

Change-Id: I377b118d86a24c7bcb15512f6714e6201a3e36ee
includes/context/DerivativeContext.php