webignition / is-http-status-code
DSimple small library to check if a given number is an HTTP status code
Installs: 2 573
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-11-05 19:21:55 UTC
README
Simple small library to check if a given number is an HTTP status code.
Ever found yourself facing a number in your code and wondering whether it's a HTTP status code?
Problem solved!
The "Hello World" example
<?php $this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(100)); $this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(301)); $this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(404)); $this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(503)); $this->assertFalse(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(true)); $this->assertFalse(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(false)); $this->assertFalse(\webignition\IsHttpStatusCode\IsHttpStatusCode::check('Hello World!'));