Spatie\Newsletter\Exceptions\InvalidNewsletterList::noListWithName PHP Метод

noListWithName() публичный статический Метод

public static noListWithName ( string $name ) : static
$name string
Результат static
    public static function noListWithName($name)
    {
        return new static("There is no list named `{$name}`");
    }

Usage Example

 /**
  * @param string $name
  *
  * @return \Spatie\Newsletter\NewsletterList
  *
  * @throws \Spatie\Newsletter\Exceptions\InvalidNewsletterList
  */
 public function findByName($name)
 {
     if ((string) $name === '') {
         return $this->getDefault();
     }
     foreach ($this->items as $newsletterList) {
         if ($newsletterList->getName() === $name) {
             return $newsletterList;
         }
     }
     throw InvalidNewsletterList::noListWithName($name);
 }