Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 6b59698

Browse files
author
Nick Matthews
committed
Coding style violations, removing timezone
1 parent 3ee3ac0 commit 6b59698

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/Facebook/GraphNodes/Birthday.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
namespace Facebook\GraphNodes;
2525

2626
use DateTime;
27-
use DateTimeZone;
2827

2928
/**
3029
* Birthday object to handle various Graph return formats
@@ -52,22 +51,16 @@ class Birthday extends DateTime
5251
*
5352
* @link https://developers.facebook.com/docs/graph-api/reference/user
5453
*
55-
* @param string $date
56-
* @param DateTimeZone $timezone
54+
* @param string $date
5755
*/
58-
public function __construct($date, DateTimeZone $timezone = null)
56+
public function __construct($date)
5957
{
6058
$parts = explode('/', $date);
6159

62-
if (count($parts) === 3 || count($parts) === 1) {
63-
$this->hasYear = true;
64-
}
60+
$this->hasYear = count($parts) === 3 || count($parts) === 1;
61+
$this->hasDate = count($parts) === 3 || count($parts) === 2;
6562

66-
if (count($parts) === 3 || count($parts) === 2) {
67-
$this->hasDate = true;
68-
}
69-
70-
parent::__construct($date, $timezone);
63+
parent::__construct($date);
7164
}
7265

7366
/**

src/Facebook/GraphNodes/GraphNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function castItems(array $data)
6565
|| $this->isIso8601DateString($v))
6666
) {
6767
$items[$k] = $this->castToDateTime($v);
68-
} else if ($k === 'birthday') {
68+
} elseif ($k === 'birthday') {
6969
$items[$k] = $this->castToBirthday($v);
7070
} else {
7171
$items[$k] = $v;
@@ -178,7 +178,7 @@ public function castToDateTime($value)
178178
*
179179
* @param string $value
180180
*
181-
* @return \Facebook\GraphNodes\Birthday
181+
* @return Birthday
182182
*/
183183
public function castToBirthday($value)
184184
{

tests/GraphNodes/GraphUserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function setUp()
4242
public function testDatesGetCastToDateTime()
4343
{
4444
$dataFromGraph = [
45-
'updated_time' => '2016-04-26 13:22:05'
45+
'updated_time' => '2016-04-26 13:22:05',
4646
];
4747

4848
$this->responseMock

0 commit comments

Comments
 (0)