GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 02cbc4...1dc391 )
by Krzysztof
01:55
created

examples.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
require_once 'vendor/autoload.php';
4
5
$login = 'login';
6
$password = 'password';
7
$number = '501234567';
8
$text = 'It works! Thanks :)';
9
10
// Simple
1 ignored issue
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
11
/*
12
try {
13
    $sms = new zembrowski\SMS\Orange();
14
    $sms->login($login, $password);
15
    $sms->send($number, $text);
16
} catch (Exception $e) {
17
    echo '[ERROR] ' . $e->getMessage();
18
}
19
*/
20
21
// Advanced
22
try {
23
    $sms = new zembrowski\SMS\Orange();
24
    $login = $sms->login($login, $password);
25
    if ($login['check']) {
26
        if ($login['free'] > 0) {
27
        $send = $sms->send($number, $text);
28
            if ($send['check']) {
29
                echo "SMS was successfully sent.";
30
                if (is_int($send['free'])) echo ' This month ' . $send['free'] . ' free SMS left.';
31
                else if (empty($send['free'])) echo ' This month ' . $sms->get_free() . ' free SMS left.';
32
                else 'Unknown how many free SMS left this month.';
33
            } else {
34
                echo "SMS was not sent.";
35
            }
36
        } else {
37
            echo 'You don\'t have any free SMS left.';
38
        }
39
    }
40
} catch (Exception $e) {
41
    echo '[ERROR] ' . $e->getMessage();
42
}
43