Files
exchange-2.0/app/Classes/Modules/Wallets/Standards/Rules/CanCreateCompanyWallet.php
T
2020-12-28 00:03:14 +08:00

54 lines
1.2 KiB
PHP

<?php
namespace App\Classes\Modules\Wallets\Standards\Rules;
use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\SegmentCompanies\Standards\Validators\CompanyWalletValidation;
class CanCreateCompanyWallet extends AbstractRule
{
/** @var CompanyWalletValidation */
private $companyWalletValidation;
/**
* CanCreateCompanyWallet constructor.
* @param CompanyWalletValidation $companyWalletValidation
*/
public function __construct(CompanyWalletValidation $companyWalletValidation)
{
$this->companyWalletValidation = $companyWalletValidation;
}
/**
* @return bool
*/
protected function authorized(): bool
{
// TODO Set Authorization rules
return true;
}
/**
* @param CompanyWalletValidation $object
* @return bool
* @throws \App\Classes\Exceptions\RequestValidationException
*/
protected function validators($object): bool
{
return $this->companyWalletValidation->validate($object);
}
/**
* @param $object
* @return bool
*/
protected function criteria($object): bool
{
return true;
}
}