Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced old reference to Box_Exception #4

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

namespace Box\Mod\Example;

use FOSSBilling\InformationException;

class Service
{
protected $di;
Expand Down Expand Up @@ -72,15 +74,15 @@ public function getModulePermissions(): array
*
* @return bool
*
* @throws \Box_Exception
* @throws InformationException
*/
public function install(): bool
{
// Execute SQL script if needed
$db = $this->di['db'];
$db->exec('SELECT NOW()');

// throw new \Box_Exception("Throw exception to terminate module installation process with a message", array(), 123);
// throw new InformationException("Throw exception to terminate module installation process with a message", array(), 123);
return true;
}

Expand All @@ -93,11 +95,11 @@ public function install(): bool
*
* @return bool
*
* @throws \Box_Exception
* @throws InformationException
*/
public function uninstall(): bool
{
// throw new \Box_Exception("Throw exception to terminate module uninstallation process with a message", array(), 124);
// throw new InformationException("Throw exception to terminate module uninstallation process with a message", array(), 124);
return true;
}

Expand All @@ -110,11 +112,11 @@ public function uninstall(): bool
*
* @return bool
*
* @throws \Box_Exception
* @throws InformationException
*/
public function update(array $manifest): bool
{
// throw new \Box_Exception("Throw exception to terminate module update process with a message", array(), 125);
// throw new InformationException("Throw exception to terminate module update process with a message", array(), 125);
return true;
}

Expand Down Expand Up @@ -173,7 +175,7 @@ public function toApiArray(array $row, string $role = 'guest', bool $deep = true
*
* @return void
*
* @throws \Box_Exception
* @throws InformationException
*/
public static function onEventClientLoginFailed(\Box_Event $event): void
{
Expand Down Expand Up @@ -223,7 +225,7 @@ public static function onEventClientLoginFailed(\Box_Event $event): void

// if client gets funky, we block him
if ($meta->meta_value > 30) {
throw new \Box_Exception('You have failed to login too many times. Contact support.');
throw new InformationException('You have failed to login too many times. Contact support.');
}
}

Expand Down
Loading