Beispiel #1
0
 /**
  * @param array                                  $parameters
  * @param \Jgut\Tify\Adapter\Gcm\GcmBuilder|null $builder
  *
  * @throws \Jgut\Tify\Exception\AdapterException
  */
 public function __construct(array $parameters = [], GcmBuilder $builder = null)
 {
     parent::__construct($parameters, false);
     // @codeCoverageIgnoreStart
     if ($builder === null) {
         $builder = new GcmBuilder();
     }
     // @codeCoverageIgnoreEnd
     $this->builder = $builder;
 }
Beispiel #2
0
 /**
  * @param array                                    $parameters
  * @param bool                                     $sandbox
  * @param \Jgut\Tify\Adapter\Apns\ApnsBuilder|null $builder
  *
  * @throws \Jgut\Tify\Exception\AdapterException
  */
 public function __construct(array $parameters = [], $sandbox = false, ApnsBuilder $builder = null)
 {
     parent::__construct($parameters, $sandbox);
     $certificatePath = $this->getParameter('certificate');
     if (!file_exists($certificatePath) || !is_readable($certificatePath)) {
         throw new AdapterException(sprintf('Certificate file "%s" does not exist or is not readable', $certificatePath));
     }
     // @codeCoverageIgnoreStart
     if ($builder === null) {
         $builder = new ApnsBuilder();
     }
     // @codeCoverageIgnoreEnd
     $this->builder = $builder;
 }