Issues (390)

src/variables/ViteVariableInterface.php (34 issues)

1
<?php
2
/**
3
 * Vite plugin for Craft CMS
4
 *
5
 * Allows the use of the Vite.js next generation frontend tooling with Craft CMS
6
 *
7
 * @link      https://nystudio107.com
0 ignored issues
show
The tag in position 1 should be the @copyright tag
Loading history...
8
 * @copyright Copyright (c) 2021 nystudio107
0 ignored issues
show
@copyright tag must contain a year and the name of the copyright holder
Loading history...
9
 */
0 ignored issues
show
PHP version not specified
Loading history...
Missing @category tag in file comment
Loading history...
Missing @package tag in file comment
Loading history...
Missing @author tag in file comment
Loading history...
Missing @license tag in file comment
Loading history...
10
11
namespace nystudio107\pluginvite\variables;
12
13
use Twig\Markup;
14
use yii\base\InvalidConfigException;
15
16
/**
0 ignored issues
show
Missing short description in doc comment
Loading history...
17
 * @author    nystudio107
0 ignored issues
show
The tag in position 1 should be the @package tag
Loading history...
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
Tag value for @author tag indented incorrectly; expected 2 spaces but found 4
Loading history...
18
 * @package   Vite
0 ignored issues
show
Tag value for @package tag indented incorrectly; expected 1 spaces but found 3
Loading history...
19
 * @since     1.0.4
0 ignored issues
show
The tag in position 3 should be the @author tag
Loading history...
Tag value for @since tag indented incorrectly; expected 3 spaces but found 5
Loading history...
20
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
21
interface ViteVariableInterface
22
{
23
    // Public Methods
24
    // =========================================================================
25
26
    /**
27
     * Return the appropriate tags to load the Vite script, either via the dev server or
28
     * extracting it from the manifest.json file
29
     *
30
     * @param string $path
0 ignored issues
show
Missing parameter comment
Loading history...
31
     * @param bool $asyncCss
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 3 spaces after parameter type; 1 found
Loading history...
32
     * @param array $scriptTagAttrs
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 2 spaces after parameter type; 1 found
Loading history...
33
     * @param array $cssTagAttrs
0 ignored issues
show
Expected 2 spaces after parameter type; 1 found
Loading history...
Missing parameter comment
Loading history...
34
     *
35
     * @return Markup
36
     */
37
    public function script(string $path, bool $asyncCss = true, array $scriptTagAttrs = [], array $cssTagAttrs = []): Markup;
38
39
    /**
40
     * Register the appropriate tags to the Craft View to load the Vite script, either via the dev server or
41
     * extracting it from the manifest.json file
42
     *
43
     * @param string $path
0 ignored issues
show
Missing parameter comment
Loading history...
44
     * @param bool $asyncCss
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 3 spaces after parameter type; 1 found
Loading history...
45
     * @param array $scriptTagAttrs
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 2 spaces after parameter type; 1 found
Loading history...
46
     * @param array $cssTagAttrs
0 ignored issues
show
Expected 2 spaces after parameter type; 1 found
Loading history...
Missing parameter comment
Loading history...
47
     *
48
     * @return Markup
49
     * @throws InvalidConfigException
50
     */
51
    public function register(string $path, bool $asyncCss = true, array $scriptTagAttrs = [], array $cssTagAttrs = []): Markup;
52
53
    /**
54
     * Return the URL for the given entry
55
     *
56
     * @param string $path
0 ignored issues
show
Missing parameter comment
Loading history...
57
     *
58
     * @return Markup
59
     */
60
    public function entry(string $path): Markup;
61
62
    /**
63
     * Return the URL for the given asset
64
     *
65
     * @param string $path
0 ignored issues
show
Missing parameter comment
Loading history...
66
     *
67
     * @return Markup
68
     */
69
    public function asset(string $path): Markup;
70
71
    /**
72
     * Inline the contents of a local file (via path) or remote file (via URL) in your templates.
73
     * Yii2 aliases and/or environment variables may be used
74
     *
75
     * @param string $pathOrUrl
0 ignored issues
show
Missing parameter comment
Loading history...
76
     *
77
     * @return Markup
78
     */
79
    public function inline(string $pathOrUrl): Markup;
80
81
    /**
82
     * Determine whether the Vite dev server is running
83
     *
84
     * @return bool
85
     */
86
    public function devServerRunning(): bool;
87
}
88