for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Pim\Bundle\CustomEntityBundle\Action;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author Antoine Guigan <[email protected]>
* @copyright 2013 Akeneo SAS (http://www.akeneo.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class QuickCreateAction extends CreateAction
{
* @param Request $request
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|Response
public function doExecute(Request $request)
if (!$request->isXmlHttpRequest()) {
return new RedirectResponse($this->getRedirectPath(null));
null
object
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
}
return parent::doExecute($request);
* {@inheritdoc}
protected function getRedirectResponse($object)
$response = array(
'status' => 1,
'url' => $this->getRedirectPath($object)
);
return new Response(json_encode($response));
protected function setDefaultOptions(OptionsResolver $resolver)
parent::setDefaultOptions($resolver);
$resolver->setDefaults(['template' => 'PimCustomEntityBundle:CustomEntity:quickcreate.html.twig']);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: