subject.php 507 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace phpnotify;
  3. require_once('notification.php');
  4. class subject {
  5. private string $url;
  6. private string $subject;
  7. public function __construct(string $url, string $subject) {
  8. $this->url = $url;
  9. $this->subject = $subject;
  10. }
  11. private function get_subject_url(): string {
  12. return $this->url.'/'.$this->subject;
  13. }
  14. public function publish(string $content): notification {
  15. return new notification($this->get_subject_url(), $content);
  16. }
  17. }