diff --git a/sample_push.php b/sample_push.php index 96475f7e..c3f96aeb 100644 --- a/sample_push.php +++ b/sample_push.php @@ -1,7 +1,10 @@ setSound(); // Set a custom property -$message->setCustomProperty('acme2', array('bang', 'whiz')); +$message->setCustomProperty('acme2', ['bang', 'whiz']); // Set another custom property -$message->setCustomProperty('acme3', array('bing', 'bong')); +$message->setCustomProperty('acme3', ['bing', 'bong']); // Set the expiry value to 30 seconds $message->setExpiry(30); @@ -75,5 +78,5 @@ public function log($level, $message, array $context = array()): void // Examine the error message container $aErrorQueue = $push->getErrors(); if (!empty($aErrorQueue)) { - var_dump($aErrorQueue); + var_dump($aErrorQueue); } diff --git a/sample_push_custom.php b/sample_push_custom.php index 422b9149..1e9b40e7 100644 --- a/sample_push_custom.php +++ b/sample_push_custom.php @@ -1,7 +1,10 @@ setSound(); // Set a custom property -$message->setCustomProperty('acme2', array('bang', 'whiz')); +$message->setCustomProperty('acme2', ['bang', 'whiz']); // Set the expiry value to 30 seconds $message->setExpiry(30); @@ -61,8 +64,9 @@ public function log($level, $message, array $context = array()): void $message->setActionLocKey('Show me!'); // Set the alert-message string and variable string values to appear in place of the format specifiers. -$message->setLocKey('Hello %1$@, you have %2$@ new messages!'); // This will overwrite the text specified with setText() method. -$message->setLocArgs(array('Steve', 5)); +// This will overwrite the text specified with setText() method. +$message->setLocKey('Hello %1$@, you have %2$@ new messages!'); +$message->setLocArgs(['Steve', 5]); // Set the filename of an image file in the application bundle. $message->setLaunchImage('DefaultAlert.png'); @@ -79,5 +83,5 @@ public function log($level, $message, array $context = array()): void // Examine the error message container $aErrorQueue = $push->getErrors(); if (!empty($aErrorQueue)) { - var_dump($aErrorQueue); + var_dump($aErrorQueue); } diff --git a/sample_push_http.php b/sample_push_http.php index a14fed84..0f866f4d 100644 --- a/sample_push_http.php +++ b/sample_push_http.php @@ -1,7 +1,10 @@ setTeamId('sgfdgfdfgd'); @@ -64,10 +67,10 @@ public function log($level, $message, array $context = array()): void $message->setSound(); // Set a custom property -$message->setCustomProperty('acme2', array('bang', 'whiz')); +$message->setCustomProperty('acme2', ['bang', 'whiz']); // Set another custom property -$message->setCustomProperty('acme3', array('bing', 'bong')); +$message->setCustomProperty('acme3', ['bing', 'bong']); // Set the expiry value to 30 seconds $message->setExpiry(30); @@ -84,5 +87,5 @@ public function log($level, $message, array $context = array()): void // Examine the error message container $aErrorQueue = $push->getErrors(); if (!empty($aErrorQueue)) { - var_dump($aErrorQueue); + var_dump($aErrorQueue); } diff --git a/sample_push_many.php b/sample_push_many.php index 48876e0e..653f515b 100644 --- a/sample_push_many.php +++ b/sample_push_many.php @@ -1,7 +1,10 @@ connect(); for ($i = 1; $i <= 10; $i++) { - // Instantiate a new Message with a single recipient - $message = new \ApnsPHP\Message($i == 5 ? INVALID_TOKEN : VALID_TOKEN); + // Instantiate a new Message with a single recipient + $message = new \ApnsPHP\Message($i == 5 ? INVALID_TOKEN : VALID_TOKEN); - // Set a custom identifier. To get back this identifier use the getCustomIdentifier() method - // over a ApnsPHP_Message object retrieved with the getErrors() message. - $message->setCustomIdentifier(sprintf("Message-Badge-%03d", $i)); + // Set a custom identifier. To get back this identifier use the getCustomIdentifier() method + // over a ApnsPHP_Message object retrieved with the getErrors() message. + $message->setCustomIdentifier(sprintf("Message-Badge-%03d", $i)); - // Set badge icon to "3" - $message->setBadge($i); + // Set badge icon to "3" + $message->setBadge($i); - // Add the message to the message queue - $push->add($message); + // Add the message to the message queue + $push->add($message); } // Send all messages in the message queue @@ -68,5 +71,5 @@ public function log($level, $message, array $context = array()): void // Examine the error message container $aErrorQueue = $push->getErrors(); if (!empty($aErrorQueue)) { - var_dump($aErrorQueue); + var_dump($aErrorQueue); } diff --git a/sample_push_safari.php b/sample_push_safari.php index 0e41bcbc..fad42a75 100644 --- a/sample_push_safari.php +++ b/sample_push_safari.php @@ -1,7 +1,10 @@ setAction('View'); -// Set an array of values that are paired with the placeholders inside the urlFormatString value of your website.json file -$message->setUrlArgs(array('boarding', 'A998')); +// Set an array of values that are paired with the placeholders inside the urlFormatString value +// of your website.json file +$message->setUrlArgs(['boarding', 'A998']); // Add the message to the message queue $push->add($message); @@ -66,5 +70,5 @@ public function log($level, $message, array $context = array()): void // Examine the error message container $aErrorQueue = $push->getErrors(); if (!empty($aErrorQueue)) { - var_dump($aErrorQueue); + var_dump($aErrorQueue); }