MaterialDesignLite   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A wrapMessages() 0 4 1
1
<?php
2
3
namespace Egzaminer\Themes;
4
5
use Tamtamchik\SimpleFlash\BaseTemplate;
6
7
class MaterialDesignLite extends BaseTemplate
8
{
9
    protected $prefix = '
10
        var notification = document.querySelector(".mdl-js-snackbar");
11
        notification.MaterialSnackbar.showSnackbar({ message: "';
12
13
    protected $postfix = '"});';
14
15
    protected $wrapper = '
16
        <div class="mdl-js-snackbar mdl-snackbar">
17
          <div class="mdl-snackbar__text"></div>
18
          <button class="mdl-snackbar__action" type="button"></button>
19
        </div>
20
        <script>window.addEventListener("load", function(){%s});</script>';
21
22
    /**
23
     * @param string $messages message text
24
     * @param string $type     message type: success, info, warning, error
25
     *
26
     * @return string
27
     */
28
    public function wrapMessages($messages, $type): string
29
    {
30
        return sprintf($this->getWrapper(), $messages);
31
    }
32
}
33