Fix PHPStan and PHPCS errors

This commit is contained in:
Oliver Davies 2020-06-01 19:03:25 +01:00
parent f5a0225c86
commit b49b487590
4 changed files with 12 additions and 15 deletions

View file

@ -11,8 +11,9 @@ use Drupal\custom\Entity\Node\Post;
* Implements hook_preprocess_HOOK().
*/
function opdavies_preprocess_page(array &$variables): void {
/** @var \Drupal\custom\Entity\Node\Post $node */
if (!$node = $variables['node'] ?? NULL) {
/** @var \Drupal\custom\Entity\Node\Post|null $node */
$node = $variables['node'] ?? NULL;
if (!$node) {
return;
}