Skip to content

Commit

Permalink
feat: support php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
sergix44 committed Jun 24, 2024
1 parent 27b8152 commit 85d5a84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ wiuphp is a PHP wrapper for the [Where's It Up API](https://api.wheresitup.com)

# Requirements

- PHP 5.4+
- PHP 7.4 or later
- [Guzzle](http://guzzlephp.org/)

# Installation
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
"tests": "./vendor/bin/phpunit tests/"
},
"require": {
"php": "^7.4",
"php": "^7.4|^8.0",
"ext-json": "*",
"ext-ctype": "*",
"guzzlehttp/guzzle": "^7"
},
"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function submit($uri, array $servers, array $tests, array $options = [])
}

$servers = array_values(array_filter($servers, function($server) {
return preg_match('/^[a-z]+$/', $server);
return is_string($server) ? preg_match('/^[a-z]+$/', $server) : false;
}));
if (!$servers) {
throw new Exception\ClientException('No valid servers requested');
Expand Down Expand Up @@ -104,7 +104,7 @@ public function submitRaw($request) {


public function retrieve($id) {
if (!ctype_xdigit($id)) {
if ($id === null || !ctype_xdigit($id)) {
throw new Exception\ClientException('Job ID is invalid');
}

Expand Down

0 comments on commit 85d5a84

Please sign in to comment.