Passed
Push — master ( 6eb156...b34d93 )
by Thierry
04:25
created

LibraryTrait::setResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * LibraryTrait.php - Trait for alert messages.
5
 *
6
 * @package jaxon-dialogs
0 ignored issues
show
Coding Style introduced by
Package name "jaxon-dialogs" is not valid; consider "Jaxondialogs" instead
Loading history...
7
 * @author Thierry Feuzeu <[email protected]>
8
 * @copyright 2016 Thierry Feuzeu <[email protected]>
9
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
10
 * @link https://github.com/jaxon-php/jaxon-core
11
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
12
13
namespace Jaxon\Ui\Dialogs;
14
15
use Jaxon\Response\Response;
16
17
trait LibraryTrait
0 ignored issues
show
Coding Style introduced by
Missing doc comment for trait LibraryTrait
Loading history...
18
{
19
    /**
20
     * @var Response
21
     */
22
    protected $xResponse = null;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before first member var; 0 found
Loading history...
23
24
    /**
25
     * @var bool
0 ignored issues
show
Bug introduced by
Expected "boolean" but found "bool" for @var tag in member variable comment
Loading history...
26
     */
27
    protected $bReturn = false;
28
29
    /**
30
     * Set the response to attach the messages to.
31
     *
32
     * @param Response $xResponse    Whether to return the code
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 4 found
Loading history...
33
     *
34
     * @return void
35
     */
36
    public function setResponse(Response $xResponse)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
37
    {
38
        $this->xResponse = $xResponse;
39
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
40
41
    /**
42
     * Get the <Jaxon\Response\Response> object
43
     *
44
     * @return Response
45
     */
46
    final public function response(): Response
47
    {
48
        return $this->xResponse;
49
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
50
51
    /**
52
     * Set the library to return the javascript code or run it in the browser.
53
     *
54
     * @param bool $bReturn    Whether to return the code
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 4 found
Loading history...
55
     *
56
     * @return void
57
     */
58
    public function setReturn(bool $bReturn)
59
    {
60
        $this->bReturn = $bReturn;
61
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
62
63
    /**
64
     * Check if the library should return the js code or run it in the browser.
65
     *
66
     * @return bool
67
     */
68
    public function getReturn(): bool
69
    {
70
        return $this->bReturn;
71
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
72
}
73