Skip to content

RHS1b3 New push.admin.device_registrations.save#65

Merged
jdavid merged 2 commits intopushfrom
RHS1b3
Feb 7, 2019
Merged

RHS1b3 New push.admin.device_registrations.save#65
jdavid merged 2 commits intopushfrom
RHS1b3

Conversation

@jdavid
Copy link
Copy Markdown
Contributor

@jdavid jdavid commented Feb 6, 2019

RHS1b3 New push.admin.device_registrations.save

Copy link
Copy Markdown
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

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

Looking good but please see comments.


class DeviceDetails extends BaseOptions {

const DevicePushTransportType = ['fcm', 'gcm', 'apns', 'web'];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We've tended not to include this kind of validation check in the library, because then if we do add support for new types it's not possible to access that functionality without having a new library. I think it's best that the backend performs this validation.

/**
* @var string
*/
public $metadata;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the IDL this is declared to be of type JsonObject

/**
* @var string
*/
public $push;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the IDL this is declared to be of type DevicePushDetails


if ($this->platform && ! in_array($this->platform, self::DevicePlatform)) {
throw new \InvalidArgumentException(
sprintf('unexpected form factor %s', $this->platform)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/form factor/platform, but I guess this code is being removed anyway

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, could you check?

Copy link
Copy Markdown
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@jdavid jdavid merged commit cc34dac into push Feb 7, 2019
@jdavid jdavid deleted the RHS1b3 branch February 7, 2019 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants