<?php
/*
 * (c) webfactory GmbH <info@webfactory.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Webfactory\Bundle\LegacyIntegrationBundle\Integration;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class BootstrapFileKernelAdaptor implements HttpKernelInterface
{

    protected $file;

    public function __construct($filename)
    {
        $this->file = $filename;
    }

    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
    {
        $file = $this->file;
        return LegacyCaptureResponseFactory::create(function () use ($file, $request) {
            include($file);
        });
    }
}

<?php
/*
 * (c) webfactory GmbH <info@webfactory.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Webfactory\Bundle\LegacyIntegrationBundle\Integration;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class BootstrapFileKernelAdaptor implements HttpKernelInterface
{

    protected $file;

    public function __construct($filename)
    {
        $this->file = $filename;
    }

    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
    {
        $file = $this->file;
        return LegacyCaptureResponseFactory::create(function () use ($file, $request) {
            return include($file);
        });
    }
}

Fix that HTTP status code was not passed on
Fix that HTTP status code was not passed on

The bootstrap file is supposed to return the HTTP status code to send to the browser, because `http_response_code()` is only available as of PHP 5.4.

This return value was not passed on from the anonymous function to the ResponseFactory.