Skip to content

Commit

Permalink
Merge pull request #2 from sergix44/main
Browse files Browse the repository at this point in the history
feat: support php 8
  • Loading branch information
mlebkowski authored Jun 24, 2024
2 parents 27b8152 + 85d5a84 commit fd6034e
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 fd6034e

Please sign in to comment.