in the example script, exit early if the user has no snaps
This commit is contained in:
parent
d775d0cc95
commit
1c33530a87
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,11 @@
|
||||||
$s = new Snaphax($opts);
|
$s = new Snaphax($opts);
|
||||||
$result = $s->login();
|
$result = $s->login();
|
||||||
var_dump($result);
|
var_dump($result);
|
||||||
|
if (empty($result) || empty($result['snaps'])) {
|
||||||
|
echo "no snaps";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($result['snaps'] as $snap) {
|
foreach ($result['snaps'] as $snap) {
|
||||||
var_dump($snap['st']);
|
var_dump($snap['st']);
|
||||||
if ($snap['st'] == SnapHax::STATUS_NEW) {
|
if ($snap['st'] == SnapHax::STATUS_NEW) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue