@php use App\Structural\Traits\RegraNegocioFuncoes; @endphp
@extends('layouts.secundario.create')
@section('fields')
@php
// Crie uma instância da classe ReflectionClass
$reflectionClass = new ReflectionClass(RegraNegocioFuncoes::class);
// Obtenha a lista de métodos da classe
$methods = $reflectionClass->getMethods();
@endphp
@foreach($methods as $method)
@php
$methodName = $method->getName();
$phpDoc = $method->getDocComment();
preg_match_all('/@([a-zA-Z]+)(?:\s+([^\n@]+))?/', $phpDoc, $matches, PREG_SET_ORDER);
$attributesArray = [];
$exceptionsArray = [];
foreach ($matches as $match) {
$retorno = '';
$attributeName = $match[1];
$attributeArgument = isset($match[2]) ? $match[2] : null;
if($attributeName == "param"){
$attributesArray[] = $attributeArgument;
}
if($attributeName == "return"){
$retorno = $attributeArgument;
}
if($attributeName == "throws"){
$exceptionsArray[] = $attributeArgument;
}
}
@endphp
-
{{$method->getName()}}(@foreach($attributesArray as $index => $attribute){{trim($attribute)}}@if($index+1 < count($attributesArray)),@endif @endforeach): {{$retorno == '' ? "void" : $retorno}}
@if(count($exceptionsArray) > 0)
@foreach($exceptionsArray as $index => $exception)
Exceptions: {{trim($exception)}}@if($index+1 < count($exceptionsArray)),@endif
@endforeach
@endif
@endforeach
@endsection