public function getEdicaoHtml(string $day) {
$issue = json_decode(file_get_contents($this->apiUrl . 'edicoes/?data=' . $day, false, stream_context_create($this->stream_opts)));
// var_dump($issue);
$date = date('d/m/Y', substr($day, 0, 10));
$areas = $issue->areas;
$html = '';
foreach($areas as $area){
if ($area->documentos){
$html .= '
<h2>'.$area->nome.'</h2>
/**
* @Route("dia/{day}", methods={"GET"})
*/
public function edicaoAction(string $day){
echo $this->htmlFactory->getEdicaoHtml($day);
exit();
}
}
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response, $event);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/indice/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
No log messages
ErrorException
|
---|
ErrorException: Warning: Attempt to read property "areas" on bool at src/Helper/HtmlFactory.php:86 at App\Helper\HtmlFactory->getEdicaoHtml() (src/Controller/EdicaoController.php:24) at App\Controller\EdicaoController->edicaoAction() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:184) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/var/www/arquivos_diario_eletronico/indice/vendor/autoload_runtime.php') (index.php/:5) |