mirror of
https://github.com/doctrine/DoctrinePHPCRBundle.git
synced 2026-03-23 22:32:20 +01:00
Fix styleci
short_array_syntax is defined in Symfony preset https://docs.styleci.io/presets#symfony newline_after_open_tag is defined in Symfony preset as "linebreak_after_opening_tag" enabled risky mode
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
preset: symfony
|
||||
|
||||
risky: true
|
||||
|
||||
enabled:
|
||||
- combine_consecutive_unsets
|
||||
- short_array_syntax
|
||||
- newline_after_open_tag
|
||||
- no_php4_constructor
|
||||
- no_useless_else
|
||||
- ordered_use
|
||||
|
||||
@@ -50,8 +50,7 @@ abstract class AbstractPHPCRDataCollector extends DataCollector
|
||||
/**
|
||||
* Adds the stack logger for a connection.
|
||||
*
|
||||
* @param string $name
|
||||
* @param DebugStack $logger
|
||||
* @param string $name
|
||||
*/
|
||||
public function addLogger($name, DebugStack $logger)
|
||||
{
|
||||
@@ -129,7 +128,7 @@ abstract class AbstractPHPCRDataCollector extends DataCollector
|
||||
*/
|
||||
private function sanitizeParam($var): array
|
||||
{
|
||||
if (is_object($var)) {
|
||||
if (\is_object($var)) {
|
||||
if ($var instanceof QueryInterface) {
|
||||
$query = [
|
||||
'querystring' => $var->getStatement(),
|
||||
@@ -143,10 +142,10 @@ abstract class AbstractPHPCRDataCollector extends DataCollector
|
||||
return $query;
|
||||
}
|
||||
|
||||
return [sprintf('Object(%s)', get_class($var)), false];
|
||||
return [sprintf('Object(%s)', \get_class($var)), false];
|
||||
}
|
||||
|
||||
if (is_array($var)) {
|
||||
if (\is_array($var)) {
|
||||
$a = [];
|
||||
$original = true;
|
||||
foreach ($var as $k => $v) {
|
||||
@@ -158,7 +157,7 @@ abstract class AbstractPHPCRDataCollector extends DataCollector
|
||||
return [$a, $original];
|
||||
}
|
||||
|
||||
if (is_resource($var)) {
|
||||
if (\is_resource($var)) {
|
||||
return [sprintf('Resource(%s)', get_resource_type($var)), false];
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class PhpcrOdmQueryBuilderLoader implements EntityLoaderInterface
|
||||
return !empty($v);
|
||||
}));
|
||||
|
||||
if (0 === count($values)) {
|
||||
if (0 === \count($values)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -102,8 +102,6 @@ class PhpcrOdmQueryBuilderLoader implements EntityLoaderInterface
|
||||
/**
|
||||
* Run the query and return a consecutive array.
|
||||
*
|
||||
* @param QueryBuilder $qb
|
||||
*
|
||||
* @return array list of result documents
|
||||
*/
|
||||
private function getResult(QueryBuilder $qb): array
|
||||
|
||||
@@ -258,7 +258,7 @@ class PhpcrOdmTypeGuesser implements FormTypeGuesserInterface
|
||||
|
||||
private function getMetadata($class): ?array
|
||||
{
|
||||
if (array_key_exists($class, $this->cache)) {
|
||||
if (\array_key_exists($class, $this->cache)) {
|
||||
return $this->cache[$class];
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use Doctrine\ODM\PHPCR\Translation\LocaleChooser\LocaleChooser;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
|
||||
class LocaleListenerTest extends TestCase
|
||||
{
|
||||
@@ -21,11 +22,20 @@ class LocaleListenerTest extends TestCase
|
||||
private function setUpTestOnKernelRequest()
|
||||
{
|
||||
$this->chooser = $this->createMock(LocaleChooser::class);
|
||||
$this->responseEvent = $this->createMock(GetResponseEvent::class);
|
||||
$this->responseEvent = $this->createMock($this->getResponseEventClass());
|
||||
$this->request = $this->createMock(Request::class);
|
||||
$this->allowedLocales = ['fr', 'en', 'de'];
|
||||
}
|
||||
|
||||
private function getResponseEventClass(): string
|
||||
{
|
||||
if (class_exists(RequestEvent::class)) {
|
||||
return RequestEvent::class;
|
||||
}
|
||||
|
||||
return GetResponseEvent::class;
|
||||
}
|
||||
|
||||
public function testOnKernelRequestWithFallbackHardcoded()
|
||||
{
|
||||
$this->setUpTestOnKernelRequest();
|
||||
|
||||
@@ -37,7 +37,7 @@ class PHPCRReferenceTypeTest extends Testcase
|
||||
$this->builder->expects($this->once())
|
||||
->method('addModelTransformer')
|
||||
->will($this->returnCallback(function ($transformer) use (&$type) {
|
||||
$type = get_class($transformer);
|
||||
$type = \get_class($transformer);
|
||||
|
||||
return;
|
||||
}));
|
||||
|
||||
@@ -107,7 +107,7 @@ class InitializerManagerTest extends TestCase
|
||||
|
||||
$this->initializerManager->initialize();
|
||||
|
||||
$this->assertCount(count($initializers), $log);
|
||||
$this->assertCount(\count($initializers), $log);
|
||||
|
||||
// check expected order against the log
|
||||
foreach ($expectedOrder as $i => $initializerVar) {
|
||||
|
||||
Reference in New Issue
Block a user