Conditions | 9 |
Paths | 7 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function validateAttribute($object, $attribute) |
||
28 | { |
||
29 | if ($object->type != Apple::class) { |
||
30 | if ($object->enabled && !$object->clientId) { |
||
31 | $this->addError($object, $attribute, Craft::t('enupal-socializer','Client ID cannot be blank')); |
||
32 | } |
||
33 | |||
34 | if ($object->enabled && !$object->clientSecret) { |
||
35 | $this->addError($object, 'clientSecret', Craft::t('enupal-socializer','Client Secret cannot be blank')); |
||
36 | } |
||
37 | }else if ($object->type === Apple::class && $object->enabled) { |
||
38 | if (!Socializer::$app->settings->validateAppleSettings()) { |
||
39 | $this->addError($object, 'enabled', Craft::t('enupal-socializer','Unable to process the Apple settings from the config file')); |
||
40 | } |
||
45 |