Issues (7)

example/wallets.php (1 issue)

1
<?php
2
require __DIR__ . "/assets/config.php";
3
require __DIR__ . "/../vendor/autoload.php";
4
5
use RobsonVLeite\CafeApi\Wallets;
0 ignored issues
show
The type RobsonVLeite\CafeApi\Wallets was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
$wallets = new Wallets(
8
    "localhost/fsphp/api/cafe/",
9
    "[email protected]",
10
    "abc123456"
11
);
12
13
/**
14
 * index
15
 */
16
echo "<h1>INDEX</h1>";
17
$index = $wallets->index(null);
18
$index = $wallets->index([
19
    "free" => 1, //0 ou 1
20
    "page" => 1
21
]);
22
23
if ($index->error()) {
24
    var_dump($index->error());
25
} else {
26
    var_dump($index->response());
27
}
28
29
30
/**
31
 * create
32
 */
33
echo "<h1>CREATE</h1>";
34
35
//$create = $wallets->create(["wallet" => "Create By PHP Api"]);
36
$create = $wallets->create([]);
37
38
if ($create->error()) {
39
    echo "<p class='error'>{$create->error()->message}</p>";
40
} else {
41
    var_dump($create->response());
42
}
43
44
/**
45
 * READ
46
 */
47
echo "<h1>READ</h1>";
48
49
$read = $wallets->read(500);
50
$read = $wallets->read(24);
51
52
if ($read->error()) {
53
    echo "<p class='error'>{$read->error()->message}</p>";
54
} else {
55
    var_dump($read->response());
56
}
57
58
/**
59
 * UPDATE
60
 */
61
echo "<h1>UPDATE</h1>";
62
63
$update = $wallets->update(29, ["wallet" => "Updated By PHP API"]);
64
65
if ($update->error()) {
66
    echo "<p class='error'>{$update->error()->message}</p>";
67
} else {
68
    var_dump($update->response());
69
}
70
71
/**
72
 * DELETE
73
 */
74
echo "<h1>DELETE</h1>";
75
76
$delete = $wallets->delete(35);
77
78
if ($delete->error()) {
79
    echo "<p class='error'>{$delete->error()->message}</p>";
80
} else {
81
    var_dump($delete->response());
82
}