Commit 1c642e1d925c347efadcb382211c21826238892a

Authored by Joalisson Barros
Committed by GitHub
2 parents 843eec4c c0ec2b5a
Exists in 2.8 and in 2 other branches 2.6, 2.7

Merge pull request #8532 from portabilis/fix-cadastro-aluno

Agrupa validações comuns no cadastro de aluno.
Showing 1 changed file with 13 additions and 13 deletions   Show diff stats
ieducar/modules/Api/Views/AlunoController.php
... ... @@ -224,24 +224,24 @@ class AlunoController extends ApiCoreController
224 224  
225 225 protected function canPost()
226 226 {
227   - return (
228   - parent::canPost() &&
  227 + return parent::canPost() &&
229 228 $this->validatesUniquenessOfAlunoByPessoaId() &&
230   - $this->canPut()
231   - );
  229 + $this->commonValidate();
232 230 }
233 231  
234 232 protected function canPut()
235 233 {
236   - return (
237   - parent::canPut() &&
238   - $this->validateDeficiencies()&&
239   - $this->validateBirthCertificate()&&
240   - $this->validateNis()&&
241   - $this->validateInepExam()&&
242   - $this->validateTechnologicalResources()&&
243   - $this->validateInepCode()
244   - );
  234 + return parent::canPut() && $this->commonValidate();
  235 + }
  236 +
  237 + protected function commonValidate(): bool
  238 + {
  239 + return $this->validateDeficiencies() &&
  240 + $this->validateNis() &&
  241 + $this->validateInepExam() &&
  242 + $this->validateTechnologicalResources() &&
  243 + $this->validateBirthCertificate() &&
  244 + $this->validateInepCode();
245 245 }
246 246  
247 247 /**
... ...