Skip to content

Commit

Permalink
Replaced old reference to Box_Exception (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
BelleNottelling authored Feb 12, 2024
1 parent baab923 commit b925ec9
Showing 1 changed file with 10 additions and 8 deletions.
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

0 comments on commit b925ec9

Please sign in to comment.