Skip to content

Расширенные сообщения в исключениях #6

@hello-omny

Description

@hello-omny

Добавить в конвенции по PHP пункт по оформлению сообщений в исключениях.

Например,

при поиске пользователя по $id выбрасывать такое исключение:

throw new UserNotFoundException(sprintf('User with id {%d} not found.', $id));

При восстановлении доступов к сервису Линды по телефону:

$service = $this->getService();
$user = $this->getUser();

if (!$this->accessRestore($this->phone)) {
  throw new UserAcessNotRestoredException(
    sprintf('On service id {%d}, domain {%s}, access for user with id {%d} not restored. Specified phone {%s}', 
    $service->id, $service->domain, $user->id, $this->phone)
  );
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions