This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cd5265
commit e269f62
Showing
7 changed files
with
23 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
The MIT License (MIT) | ||
===================== | ||
|
||
Copyright (c) `2017` `Josantonius, https://josantonius.com <[email protected]>` | ||
Copyright (c) `2017 - 2018` `Josantonius, https://josantonius.com <[email protected]>` | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* PHP library for handling requests. | ||
* | ||
* @author Josantonius <[email protected]> | ||
* @copyright 2017 (c) Josantonius - PHP-Request | ||
* @copyright 2017 - 2018 (c) Josantonius - PHP-Request | ||
* @license https://opensource.org/licenses/MIT - The MIT License (MIT) | ||
* @link https://github.com/Josantonius/PHP-Request | ||
* @since 1.0.0 | ||
|
@@ -12,16 +12,12 @@ | |
|
||
/** | ||
* Request handler. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
class Request | ||
{ | ||
/** | ||
* Secure access to GET parameters. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @param string $key → request key | ||
* | ||
* @return mixed|null → value or null | ||
|
@@ -38,8 +34,6 @@ public static function get($key = null) | |
/** | ||
* Secure access to POST parameters. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @param string $key → request key | ||
* | ||
* @return mixed|null → value or null | ||
|
@@ -56,8 +50,6 @@ public static function post($key = null) | |
/** | ||
* Secure access to FILES parameters. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @param string $key → request key | ||
* | ||
* @return mixed|null → value or null | ||
|
@@ -74,8 +66,6 @@ public static function files($key = null) | |
/** | ||
* Secure access to PUT parameters. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @param string $key → request key | ||
* | ||
* @return mixed|null → value or null | ||
|
@@ -94,8 +84,6 @@ public static function put($key = null) | |
/** | ||
* Secure access to DELETE parameters. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @param string $key → request key | ||
* | ||
* @return mixed|null → value or null | ||
|
@@ -110,8 +98,6 @@ public static function del($key) | |
/** | ||
* Check if it is a GET request. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return bool | ||
*/ | ||
public static function isGet() | ||
|
@@ -122,8 +108,6 @@ public static function isGet() | |
/** | ||
* Check if it is a POST request. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return bool | ||
*/ | ||
public static function isPost() | ||
|
@@ -134,8 +118,6 @@ public static function isPost() | |
/** | ||
* Check if it is a PUT request. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return bool | ||
*/ | ||
public static function isPut() | ||
|
@@ -146,8 +128,6 @@ public static function isPut() | |
/** | ||
* Check if it is a DELETE request. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return bool | ||
*/ | ||
public static function isDelete() | ||
|
@@ -158,8 +138,6 @@ public static function isDelete() | |
/** | ||
* Check if it is a AJAX request. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return bool | ||
*/ | ||
public static function isAjax() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* PHP library for handling requests. | ||
* | ||
* @author Josantonius <[email protected]> | ||
* @copyright 2017 (c) Josantonius - PHP-Request | ||
* @copyright 2017 - 2018 (c) Josantonius - PHP-Request | ||
* @license https://opensource.org/licenses/MIT - The MIT License (MIT) | ||
* @link https://github.com/Josantonius/PHP-Request | ||
* @since 1.1.3 | ||
|
@@ -15,8 +15,6 @@ | |
|
||
/** | ||
* Tests class for Request library. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
class RequestTest extends TestCase | ||
{ | ||
|
@@ -48,14 +46,11 @@ public function setUp() | |
*/ | ||
public function testIsInstanceOfRequest() | ||
{ | ||
$actual = $this->Request; | ||
$this->assertInstanceOf('Josantonius\Request\Request', $actual); | ||
$this->assertInstanceOf('Josantonius\Request\Request', $this->Request); | ||
} | ||
|
||
/** | ||
* Access to all GET parameters. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testGet() | ||
{ | ||
|
@@ -67,8 +62,6 @@ public function testGet() | |
|
||
/** | ||
* Access to GET specific key parameter. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testGetSpecificKey() | ||
{ | ||
|
@@ -79,8 +72,6 @@ public function testGetSpecificKey() | |
|
||
/** | ||
* Access to GET specific key parameter when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testGetSpecificKeyError() | ||
{ | ||
|
@@ -92,8 +83,6 @@ public function testGetSpecificKeyError() | |
|
||
/** | ||
* Access to all GET parameters when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testGetError() | ||
{ | ||
|
@@ -104,8 +93,6 @@ public function testGetError() | |
|
||
/** | ||
* Access to all POST parameters. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testPost() | ||
{ | ||
|
@@ -117,8 +104,6 @@ public function testPost() | |
|
||
/** | ||
* Access to POST specific key parameter. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testPostSpecificKey() | ||
{ | ||
|
@@ -129,8 +114,6 @@ public function testPostSpecificKey() | |
|
||
/** | ||
* Access to POST specific key parameter when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testPostSpecificKeyError() | ||
{ | ||
|
@@ -142,8 +125,6 @@ public function testPostSpecificKeyError() | |
|
||
/** | ||
* Access to all POST parameters when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testPostError() | ||
{ | ||
|
@@ -154,8 +135,6 @@ public function testPostError() | |
|
||
/** | ||
* Access to all FILES parameters. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testFiles() | ||
{ | ||
|
@@ -167,8 +146,6 @@ public function testFiles() | |
|
||
/** | ||
* Access to FILES specific key parameter. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testFilesSpecificKey() | ||
{ | ||
|
@@ -179,8 +156,6 @@ public function testFilesSpecificKey() | |
|
||
/** | ||
* Access to FILES specific key parameter when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testFilesSpecificKeyError() | ||
{ | ||
|
@@ -192,8 +167,6 @@ public function testFilesSpecificKeyError() | |
|
||
/** | ||
* Access to all FILES parameters when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testFilesError() | ||
{ | ||
|
@@ -204,8 +177,6 @@ public function testFilesError() | |
|
||
/** | ||
* Access to PUT specific key parameter when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testPutSpecificKeyError() | ||
{ | ||
|
@@ -216,8 +187,6 @@ public function testPutSpecificKeyError() | |
|
||
/** | ||
* Access to all PUT parameters when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testPutError() | ||
{ | ||
|
@@ -228,8 +197,6 @@ public function testPutError() | |
|
||
/** | ||
* Access to DEL specific key parameter when not exists. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testDelSpecificKeyError() | ||
{ | ||
|
@@ -240,8 +207,6 @@ public function testDelSpecificKeyError() | |
|
||
/** | ||
* Check if it is a GET request. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testIsGet() | ||
{ | ||
|
@@ -252,8 +217,6 @@ public function testIsGet() | |
|
||
/** | ||
* Check if it is a POST request. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testIsPost() | ||
{ | ||
|
@@ -264,8 +227,6 @@ public function testIsPost() | |
|
||
/** | ||
* Check if it is a PUT request. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testIsPut() | ||
{ | ||
|
@@ -276,8 +237,6 @@ public function testIsPut() | |
|
||
/** | ||
* Check if it is a DELETE request. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testIsDelete() | ||
{ | ||
|
@@ -288,8 +247,6 @@ public function testIsDelete() | |
|
||
/** | ||
* Check if it isn't a DELETE request. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testIsNotDelete() | ||
{ | ||
|
@@ -300,8 +257,6 @@ public function testIsNotDelete() | |
|
||
/** | ||
* Check if it is a Ajax request. | ||
* | ||
* @since 1.1.3 | ||
*/ | ||
public function testIsAjax() | ||
{ | ||
|