Skip to content

Commit

Permalink
BT7
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Eggert committed Jan 13, 2019
1 parent e6157e2 commit c626995
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Response/Directives/Display/RenderTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
namespace Phlexa\Response\Directives\Display;

use Phlexa\Response\Directives\DirectivesInterface;
use function count;
use function in_array;

/**
* Class RenderTemplate
Expand All @@ -32,12 +34,14 @@ class RenderTemplate implements DirectivesInterface
public const TYPE_BODY_TEMPLATE_2 = 'BodyTemplate2';
public const TYPE_BODY_TEMPLATE_3 = 'BodyTemplate3';
public const TYPE_BODY_TEMPLATE_6 = 'BodyTemplate6';
public const TYPE_BODY_TEMPLATE_7 = 'BodyTemplate7';

/** Allowed template types */
public const ALLOWED_TYPES
= [
self::TYPE_LIST_TEMPLATE_1, self::TYPE_LIST_TEMPLATE_2, self::TYPE_BODY_TEMPLATE_1,
self::TYPE_BODY_TEMPLATE_2, self::TYPE_BODY_TEMPLATE_3, self::TYPE_BODY_TEMPLATE_6,
self::TYPE_BODY_TEMPLATE_7,
];

/** All back button types */
Expand Down Expand Up @@ -83,7 +87,7 @@ class RenderTemplate implements DirectivesInterface
*/
public function __construct(string $type, string $token, TextContent $textContent = null)
{
if (!in_array($type, self::ALLOWED_TYPES)) {
if (!in_array($type, self::ALLOWED_TYPES, true)) {
$type = self::TYPE_BODY_TEMPLATE_1;
}

Expand All @@ -97,7 +101,7 @@ public function __construct(string $type, string $token, TextContent $textConten
*/
public function setBackButton(string $backButton)
{
if (in_array($backButton, self::ALLOWED_BACK_BUTTONS)) {
if (in_array($backButton, self::ALLOWED_BACK_BUTTONS, true)) {
$this->backButton = $backButton;
}
}
Expand Down

0 comments on commit c626995

Please sign in to comment.