Skip to content

Commit 08823ac

Browse files
committed
v2.0.0
1 parent 34560af commit 08823ac

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- `Fixed` for any bug fixes.
1313
- `Security` in case of vulnerabilities
1414

15+
## [2.0.0] - 2020.11.06
16+
17+
### Changed
18+
19+
- Renamed methods `getContent` and `hasContent` to `getBody` and `hasBody` respectively, as this more accurately depicts the HTTP request element.
20+
1521
## [1.3.0] - 2020.09.14
1622

1723
### Added

Diff for: README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ composer require bayfrontmedia/php-http-request
5454
- [hasCookie](#hascookie)
5555
- [getHeader](#getheader)
5656
- [hasHeader](#hasheader)
57-
- [getContent](#getcontent)
58-
- [hasContent](#hascontent)
57+
- [getBody](#getbody)
58+
- [hasBody](#hasbody)
5959

6060
**Specific values**
6161

@@ -620,7 +620,7 @@ if (Request::hasHeader('Content-Type')) {
620620

621621
<hr />
622622

623-
### getContent
623+
### getBody
624624

625625
**Description:**
626626

@@ -639,12 +639,12 @@ Returns content body of a request.
639639
```
640640
use Bayfront\HttpRequest\Request;
641641
642-
print_r(Request::getContent());
642+
print_r(Request::getBody());
643643
```
644644

645645
<hr />
646646

647-
### hasContent
647+
### hasBody
648648

649649
**Description:**
650650

@@ -663,7 +663,7 @@ Checks if content body of a request exists.
663663
```
664664
use Bayfront\HttpRequest\Request;
665665
666-
if (Request::hasContent()) {
666+
if (Request::hasBody()) {
667667
// Do something
668668
}
669669
```

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
],
3939
"require": {
4040
"php": ">=7.1.0",
41-
"bayfrontmedia/php-array-helpers": "^1.0.0",
41+
"bayfrontmedia/php-array-helpers": "^1.0.1",
4242
"bayfrontmedia/php-validator": "^1.0.0"
4343
},
4444
"autoload": {

Diff for: src/Request.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public static function hasHeader(string $key): bool
416416
* @return string
417417
*/
418418

419-
public static function getContent(): string
419+
public static function getBody(): string
420420
{
421421
return file_get_contents('php://input');
422422
}
@@ -427,9 +427,9 @@ public static function getContent(): string
427427
* @return bool
428428
*/
429429

430-
public static function hasContent(): bool
430+
public static function hasBody(): bool
431431
{
432-
return (self::getContent()) ? true : false;
432+
return (self::getBody()) ? true : false;
433433
}
434434

435435
/*

0 commit comments

Comments
 (0)