Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
<?php
declare(strict_types=1);
/*
* This file is part of the FOSJsRoutingBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\JsRoutingBundle\Serializer\Denormalizer;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
class RouteCollectionDenormalizer implements DenormalizerInterface
{
/**
* {@inheritDoc}
*/
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): RouteCollection
{
$collection = new RouteCollection();
foreach ($data as $name => $values) {
$collection->add($name, new Route(
$values['path'],
$values['defaults'],
$values['requirements'],
$values['options'],
$values['host'],
$values['schemes'],
$values['methods'],
$values['condition']
));
}
return $collection;
}
/**
* {@inheritDoc}
*/
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
if (!is_array($data)) {
return false;
}
if (count($data) < 1) {
return true;
}
$values = current($data);
foreach (['path', 'defaults', 'requirements', 'options', 'host', 'schemes', 'methods', 'condition'] as $key) {
if (!isset($values[$key])) {
return false;
}
}
return true;
}
public function getSupportedTypes(?string $format): array
{
return ['*' => false];
}
}

View File

@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
/*
* This file is part of the FOSJsRoutingBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\JsRoutingBundle\Serializer\Normalizer;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Class RouteCollectionNormalizer.
*/
class RouteCollectionNormalizer implements NormalizerInterface
{
/**
* {@inheritDoc}
*/
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
$collection = [];
foreach ($object->all() as $name => $route) {
$collection[$name] = [
'path' => $route->getPath(),
'host' => $route->getHost(),
'defaults' => $route->getDefaults(),
'requirements' => $route->getRequirements(),
'options' => $route->getOptions(),
'schemes' => $route->getSchemes(),
'methods' => $route->getMethods(),
'condition' => method_exists($route, 'getCondition') ? $route->getCondition() : '',
];
}
return $collection;
}
/**
* {@inheritDoc}
*/
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof RouteCollection;
}
public function getSupportedTypes(?string $format): array
{
return [RouteCollection::class => true];
}
}

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/*
* This file is part of the FOSJsRoutingBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\JsRoutingBundle\Serializer\Normalizer;
use FOS\JsRoutingBundle\Response\RoutesResponse;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Class RoutesResponseNormalizer.
*/
class RoutesResponseNormalizer implements NormalizerInterface
{
/**
* {@inheritDoc}
*/
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
return [
'base_url' => $object->getBaseUrl(),
'routes' => $object->getRoutes(),
'prefix' => $object->getPrefix(),
'host' => $object->getHost(),
'port' => $object->getPort(),
'scheme' => $object->getScheme(),
'locale' => $object->getLocale(),
];
}
/**
* {@inheritDoc}
*/
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof RoutesResponse;
}
public function getSupportedTypes(?string $format): array
{
return [RoutesResponse::class => true];
}
}