phpstan fix check if method exists first
CI / testsuite (mysql, 8.2, ) (push) Successful in 3m26s
CI / testsuite (mysql, 8.4, ) (push) Successful in 4m20s
CI / testsuite (pgsql, 8.2, ) (push) Successful in 3m7s
CI / testsuite (pgsql, 8.4, ) (push) Successful in 4m17s
CI / testsuite (sqlite, 8.2, ) (push) Successful in 3m8s
CI / testsuite (sqlite, 8.2, prefer-lowest) (push) Successful in 3m7s
CI / testsuite (sqlite, 8.4, ) (push) Successful in 4m17s
CI / Coding Standard & Static Analysis (push) Failing after 2m4s

This commit is contained in:
bs
2026-11-14 23:57:01 -08:00
parent 0cc1894445
commit 71f571f16b
@@ -83,7 +83,10 @@ class ContactUsComponent extends Component {
$this->setConfig($config);
parent::initialize($config); // TODO: Change the autogenerated stub
$this->table = TableRegistry::getTableLocator()->get($this->getConfig('model'));
if (Configure::read('ContactUs.fields.turnstile') && $this->getController()->components()->has('FormProtection')) {
if (Configure::read('ContactUs.fields.turnstile') &&
$this->getController()->components()->has('FormProtection') &&
method_exists($this->getController()->components()->get('FormProtection'), 'unlockFields')
) {
$this->getController()->components()->get('FormProtection')
->unlockFields('cf-turnstile-response');
}