Issues (686)

jaxon-examples/examples/synchronous/page.php (4 issues)

1
<?php $this->extends('templates::examples/layout.php') ?>
2
3
<?php $this->block('content') ?>
4
                <div class="row">
5
                    <div class="col-md-12" id="div2">
6
                        &nbsp;
7
                    </div>
8
                    <div class="col-md-12 buttons">
9
                        <button type="button" class="btn btn-primary" onclick="testSyncRequests()" >Test sync</button>
10
                        <button type="button" class="btn btn-primary" onclick="testNodupRequests()" >Test nodup</button>
11
                    </div>
12
                </div>
13
<?php $this->endblock() ?>
14
15
<?php $this->block('code') ?>
16
                <div class="card code">
17
                    <div class="card-body">
18
                        <?= highlight_file(__DIR__ . '/code.php', true) ?>
0 ignored issues
show
Are you sure highlight_file(__DIR__ . '/code.php', true) of type string|true can be used in echo? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

18
                        <?= /** @scrutinizer ignore-type */ highlight_file(__DIR__ . '/code.php', true) ?>
Loading history...
19
                    </div>
20
                </div>
21
<?php $this->endblock() ?>
22
23
<?php $this->block('javascript') ?>
24
<script type='text/javascript'>
25
    /* <![CDATA[ */
26
    function testSyncRequests() {
27
        <?= rq('HelloWorld')->ssleep(5) ?>;
0 ignored issues
show
The method ssleep() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        <?= rq('HelloWorld')->/** @scrutinizer ignore-call */ ssleep(5) ?>;
Loading history...
28
        <?= rq('HelloWorld')->sleep(6) ?>;
0 ignored issues
show
The method sleep() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        <?= rq('HelloWorld')->/** @scrutinizer ignore-call */ sleep(6) ?>;
Loading history...
29
        <?= rq('HelloWorld')->sleep(1) ?>;
30
        <?= rq('HelloWorld')->sleep(2) ?>;
31
32
        <?= rq('HelloWorld')->ssleep(5) ?>;
33
        <?= rq('HelloWorld')->sleep(6) ?>;
34
        <?= rq('HelloWorld')->sleep(1) ?>;
35
        <?= rq('HelloWorld')->sleep(2) ?>;
36
    }
37
38
    function testNodupRequests() {
39
        <?= rq('HelloWorld')->nodup(5) ?>;
0 ignored issues
show
The method nodup() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        <?= rq('HelloWorld')->/** @scrutinizer ignore-call */ nodup(5) ?>;
Loading history...
40
        <?= rq('HelloWorld')->nodup(1) ?>;
41
        setTimeout(function() {
42
            <?= rq('HelloWorld')->nodup(1) ?>;
43
        }, 3000);
44
        setTimeout(function() {
45
            <?= rq('HelloWorld')->nodup(1) ?>;
46
        }, 6000);
47
        <?= rq('HelloWorld')->nodup(1) ?>;
48
    }
49
50
    nodupCallbacks = {
51
        enableCall: true,
52
        onPrepare: function(oRequest) {
53
            if(nodupCallbacks.enableCall == false) {
54
                oRequest.ignore = true;
55
                console.log('Ignored request to HelloWorld.nodup');
56
                return;
57
            }
58
            nodupCallbacks.enableCall = false;
59
            console.log('Allowed request to HelloWorld.nodup');
60
            console.log('Disabled request to HelloWorld.nodup');
61
        },
62
        onComplete: function() {
63
            nodupCallbacks.enableCall = true;
64
            console.log('Enabled request to HelloWorld.nodup');
65
        }
66
    }
67
    /* ]]> */
68
</script>
69
<?php $this->endblock() ?>
70