Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-31810: Adapted code for 6.13 requirements #3063

Merged
merged 6 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
Expand All @@ -27,5 +25,5 @@ public function normalize($object, $format = null, array $context = [])
/**
* @return string[]
*/
abstract protected function getAllowedProperties(): array;
abstract protected function getAllowedProperties();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function normalize($object, $format = null, array $context = [])
return $data;
}

protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['subMatchers'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\HostElement;
Expand All @@ -20,7 +18,7 @@ public function supportsNormalization($data, $format = null)
/**
* @see \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\HostElement::__sleep
*/
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['elementNumber', 'hostElements'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\HostText;

final class HostTextNormalizer extends AbstractPropertyWhitelistNormalizer
{
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['siteAccessesConfiguration'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Regex\Host;

final class RegexHostNormalizer extends AbstractPropertyWhitelistNormalizer
{
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['siteAccessesConfiguration'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Regex;
Expand All @@ -20,7 +18,7 @@ public function supportsNormalization($data, $format = null)
/**
* @see \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Regex::__sleep
*/
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['regex', 'itemNumber', 'matchedSiteAccess'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Regex\URI;

final class RegexURINormalizer extends AbstractPropertyWhitelistNormalizer
{
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['siteAccessesConfiguration'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement;
Expand All @@ -20,7 +18,7 @@ public function supportsNormalization($data, $format = null)
/**
* @see \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement::__sleep
*/
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['elementNumber', 'uriElements'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;

use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIText;

final class URITextNormalizer extends AbstractPropertyWhitelistNormalizer
{
protected function getAllowedProperties(): array
protected function getAllowedProperties()
{
return ['siteAccessesConfiguration'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\Core\MVC\Symfony\Component\Serializer\CompoundMatcherNormalizer;
Expand All @@ -18,7 +16,7 @@

final class CompoundMatcherNormalizerTest extends TestCase
{
public function testNormalization(): void
public function testNormalization()
{
$matcher = new CompoundStub([]);
$matcher->setSubMatchers([
Expand All @@ -44,7 +42,7 @@ public function testNormalization(): void
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new CompoundMatcherNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\Core\MVC\Symfony\Component\Serializer\HostElementNormalizer;
Expand All @@ -17,7 +15,7 @@

final class HostElementNormalizerTest extends TestCase
{
public function testNormalization(): void
public function testNormalization()
{
$normalizer = new HostElementNormalizer();
$normalizer->setSerializer(new SerializerStub());
Expand All @@ -39,7 +37,7 @@ public function testNormalization(): void
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new HostElementNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\Core\MVC\Symfony\Component\Serializer\HostTextNormalizer;
Expand All @@ -16,7 +14,7 @@

final class HostTextNormalizerTest extends TestCase
{
public function testNormalize(): void
public function testNormalize()
{
$normalizer = new HostTextNormalizer();
$normalizer->setSerializer(new SerializerStub());
Expand All @@ -37,7 +35,7 @@ public function testNormalize(): void
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new HostTextNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\Core\MVC\Symfony\Component\Serializer\MapNormalizer;
Expand All @@ -15,7 +13,7 @@

final class MapNormalizerTest extends TestCase
{
public function testNormalization(): void
public function testNormalization()
{
$normalizer = new MapNormalizer();

Expand All @@ -32,7 +30,7 @@ public function testNormalization(): void
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new MapNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\Core\MVC\Symfony\Component\Serializer\RegexHostNormalizer;
Expand All @@ -16,7 +14,7 @@

final class RegexHostNormalizerTest extends TestCase
{
public function testNormalize(): void
public function testNormalize()
{
$normalizer = new RegexHostNormalizer();
$normalizer->setSerializer(new SerializerStub());
Expand All @@ -37,7 +35,7 @@ public function testNormalize(): void
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new RegexHostNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,20 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
use eZ\Publish\Core\MVC\Symfony\Component\Serializer\RegexNormalizer;
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher;
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Regex as RegexMatcher;
use eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer\Stubs\RegexMatcher as RegexMatcherStub;
use PHPUnit\Framework\TestCase;

final class RegexNormalizerTest extends TestCase
{
public function testNormalize(): void
public function testNormalize()
{
$normalizer = new RegexNormalizer();

$matcher = new class('/^Foo(.*)/(.*)/', 2) extends RegexMatcher {
public function getName()
{
throw new NotImplementedException(__METHOD__);
}
};
$matcher = new RegexMatcherStub('/^Foo(.*)/(.*)/', 2);

$this->assertEquals(
[
Expand All @@ -37,7 +29,7 @@ public function getName()
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new RegexNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;

use eZ\Publish\Core\MVC\Symfony\Component\Serializer\RegexURINormalizer;
Expand All @@ -16,7 +14,7 @@

final class RegexURINormalizerTest extends TestCase
{
public function testNormalize(): void
public function testNormalize()
{
$normalizer = new RegexURINormalizer();
$normalizer->setSerializer(new SerializerStub());
Expand All @@ -37,7 +35,7 @@ public function testNormalize(): void
);
}

public function testSupportsNormalization(): void
public function testSupportsNormalization()
{
$normalizer = new RegexURINormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer\Stubs;

use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer\Stubs;

use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer\Stubs;

use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Regex as BaseRegex;

final class RegexMatcher extends BaseRegex
{
public function getName()
{
throw new NotImplementedException(__METHOD__);
}
}
Loading