Passed
Push — develop ( 501901...142042 )
by Septianata
14:25
created

Conversation::askRenderable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
rs 10
1
<?php
2
3
namespace App\Conversations;
4
5
use BotMan\BotMan\Messages\Conversations\Conversation as BaseConversation;
6
use Illuminate\Contracts\Support\Renderable;
7
8
abstract class Conversation extends BaseConversation
9
{
10
    /**
11
     * Run `$this->say()` method with a renderable parameter.
12
     *
13
     * @param  \Illuminate\Contracts\Support\Renderable  $view
14
     * @param  array  $additionalParameters
15
     * @return $this
16
     */
17
    protected function sayRenderable(Renderable $view, array $additionalParameters = [])
18
    {
19
        $this->say($view->render(), $additionalParameters);
20
21
        return $this;
22
    }
23
24
    /**
25
     * Run `$this->ask()` method with a renderable parameter.
26
     *
27
     * @param  \Illuminate\Contracts\Support\Renderable  $view
28
     * @param  array|\Closure  $next
29
     * @param  array  $additionalParameters
30
     * @return $this
31
     */
32
    protected function askRenderable($view, $next, $additionalParameters = [])
33
    {
34
        $this->ask($view->render(), $next, $additionalParameters);
35
36
        return $this;
37
    }
38
}
39