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

Conversation

@nickma42
Copy link
Contributor

Fix for #570 since the Graph API can return the birthday field as either mm/dd/yyyy, mm/dd or yyyy.

~~~~
$fb = new Facebook\Facebook(\* *\);
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get('/something');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's about a user, I'd get /me :)

{
$parts = explode('/', $date);

if (count($parts) === 3 || count($parts) === 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ifs are useless, you can just $this->hasYear = count($parts) === 3 || count($parts) === 1, same below with hasDate.

@yguedidi
Copy link
Contributor

@nickma42 Thanks for your contribution!

@nickma42
Copy link
Contributor Author

Thanks for your help in the ticket too! You guys are very helpful and responsive :)

'A collection that represents a User node.',
],
[
'[`Facebook\\GraphNodes\\Birthday`](/docs/php/Birthday#instance-methods)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should be listed here, ping @SammyK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I think I'd modify the docs on GraphNode and edit the lines that talk about the return type and link to the Birthday documentation from there. :)

@yguedidi
Copy link
Contributor

Looks good to me, 👍

/**
* @var bool
*/
protected $hasDate = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be private. :)

@nickma42
Copy link
Contributor Author

Thanks guys - much appreciated :)

@SammyK SammyK added this to the 5.2.0 milestone May 18, 2016
@SammyK SammyK merged commit 23eafab into facebookarchive:master May 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants