From 540a2031bf5c221cb9be897e38aea6b204c3c415 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Fri, 13 Oct 2023 13:03:26 +0200 Subject: [PATCH 1/5] Remove the commonground bundle --- api/.gitignore | 6 - api/.php-cs-fixer.dist.php | 14 - api/Dockerfile | 2 +- api/config/bundles.php | 36 +- api/config/packages/doctrine.yaml | 2 +- api/config/packages/messenger.yaml | 2 - api/config/packages/prod/messenger.yaml | 2 - api/config/packages/ramsey_uuid_doctrine.yaml | 4 + api/config/packages/translation.yaml | 13 - api/src/Controller/LoginController.php | 11 +- api/src/Controller/UserController.php | 148 +- api/src/DataFixtures/AppFixtures.php | 2 +- api/src/Message/NotificationMessage.php | 27 - api/src/Message/PromiseMessage.php | 27 - api/src/Message/SyncPageMessage.php | 47 - .../NotificationMessageHandler.php | 32 - .../MessageHandler/PromiseMessageHandler.php | 89 - .../MessageHandler/SyncPageMessageHandler.php | 150 -- api/src/Security/ApiKeyAuthenticator.php | 72 +- .../Security/User/AuthenticationProvider.php | 9 - api/src/Service/AuthenticationService.php | 133 +- api/src/Service/AuthorizationService.php | 5 - api/src/Service/DocumentService.php | 8 +- api/src/Service/EavDocumentationService.php | 5 +- api/src/Service/EavService.php | 1141 +--------- api/src/Service/FunctionService.php | 160 +- api/src/Service/GatewayService.php | 81 +- api/src/Service/HandlerService.php | 438 ---- api/src/Service/ObjectEntityService.php | 1981 +---------------- api/src/Service/ResponseService.php | 849 ------- api/src/Service/SynchronizationService.php | 36 +- api/src/Service/UserService.php | 89 - api/symfony.lock | 129 +- api/translations/.gitignore | 0 34 files changed, 94 insertions(+), 5656 deletions(-) delete mode 100644 api/.php-cs-fixer.dist.php create mode 100644 api/config/packages/ramsey_uuid_doctrine.yaml delete mode 100644 api/config/packages/translation.yaml delete mode 100644 api/src/Message/NotificationMessage.php delete mode 100644 api/src/Message/PromiseMessage.php delete mode 100644 api/src/Message/SyncPageMessage.php delete mode 100644 api/src/MessageHandler/NotificationMessageHandler.php delete mode 100644 api/src/MessageHandler/PromiseMessageHandler.php delete mode 100644 api/src/MessageHandler/SyncPageMessageHandler.php delete mode 100644 api/src/Service/ResponseService.php delete mode 100644 api/src/Service/UserService.php delete mode 100644 api/translations/.gitignore diff --git a/api/.gitignore b/api/.gitignore index c78c3c1a7..cb0b62499 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -6,12 +6,6 @@ /.env.*.local /vendor/ ###< symfony/framework-bundle ### - -###> friendsofphp/php-cs-fixer ### -/.php_cs -/.php_cs.cache -###< friendsofphp/php-cs-fixer ### - ###> phpunit/phpunit ### /phpunit.xml .phpunit.result.cache diff --git a/api/.php-cs-fixer.dist.php b/api/.php-cs-fixer.dist.php deleted file mode 100644 index e63611e6a..000000000 --- a/api/.php-cs-fixer.dist.php +++ /dev/null @@ -1,14 +0,0 @@ -in(__DIR__) - ->exclude('var') -; - -return (new PhpCsFixer\Config()) - ->setRules([ - '@Symfony' => true, - ]) - ->setFinder($finder) - ->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line -; diff --git a/api/Dockerfile b/api/Dockerfile index ea5f04b18..a243fe718 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-fpm-alpine AS api_platform_php +FROM php:8.1-fpm-alpine AS api_platform_php # Create a user RUN addgroup -S -g 101 commonground-gateway && adduser -S -D -u 101 commonground-gateway diff --git a/api/config/bundles.php b/api/config/bundles.php index b03f4530d..e3ff55319 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -1,24 +1,22 @@ ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], - Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true], - Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['all' => true], + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], + Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], + Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], + Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], + Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['all' => true], Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['all' => true], - Hautelook\AliceBundle\HautelookAliceBundle::class => ['all' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['all' => true], - Setono\CronExpressionBundle\SetonoCronExpressionBundle::class => ['all' => true], - CommonGateway\CoreBundle\CoreBundle::class => ['all' => true], - Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true], - Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], - League\FlysystemBundle\FlysystemBundle::class => ['all' => true], + Hautelook\AliceBundle\HautelookAliceBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['all' => true], + Setono\CronExpressionBundle\SetonoCronExpressionBundle::class => ['all' => true], + CommonGateway\CoreBundle\CoreBundle::class => ['all' => true], + Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true], + Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], + League\FlysystemBundle\FlysystemBundle::class => ['all' => true], + Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], + Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], ]; diff --git a/api/config/packages/doctrine.yaml b/api/config/packages/doctrine.yaml index 4a17d0314..605bd6b64 100644 --- a/api/config/packages/doctrine.yaml +++ b/api/config/packages/doctrine.yaml @@ -6,7 +6,7 @@ doctrine: url: '%env(resolve:DATABASE_URL)%' types: uuid: Ramsey\Uuid\Doctrine\UuidType - datetime: Conduction\CommonGroundBundle\Types\UTCDateTimeType #We override the default doctrine datetime with a UTC based version +# datetime: Conduction\CommonGroundBundle\Types\UTCDateTimeType #We override the default doctrine datetime with a UTC based version orm: auto_generate_proxy_classes: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware diff --git a/api/config/packages/messenger.yaml b/api/config/packages/messenger.yaml index 275f9164d..944c8b384 100755 --- a/api/config/packages/messenger.yaml +++ b/api/config/packages/messenger.yaml @@ -27,5 +27,3 @@ framework: routing: # Route your messages to the transports 'App\Message\ActionMessage': async - 'App\Message\NotificationMessage': async - 'App\Message\SyncPageMessage': async diff --git a/api/config/packages/prod/messenger.yaml b/api/config/packages/prod/messenger.yaml index 24641e04e..09236c02c 100644 --- a/api/config/packages/prod/messenger.yaml +++ b/api/config/packages/prod/messenger.yaml @@ -27,7 +27,5 @@ framework: routing: # Route your messages to the transports 'App\Message\ActionMessage': async - 'App\Message\NotificationMessage': async - 'App\Message\SyncPageMessage': async 'CommonGateway\CoreBundle\Message\CacheMessage': async 'CommonGateway\CoreBundle\Message\ValueMessage': async diff --git a/api/config/packages/ramsey_uuid_doctrine.yaml b/api/config/packages/ramsey_uuid_doctrine.yaml new file mode 100644 index 000000000..cfc3036f9 --- /dev/null +++ b/api/config/packages/ramsey_uuid_doctrine.yaml @@ -0,0 +1,4 @@ +doctrine: + dbal: + types: + uuid: 'Ramsey\Uuid\Doctrine\UuidType' diff --git a/api/config/packages/translation.yaml b/api/config/packages/translation.yaml deleted file mode 100644 index abb76aae8..000000000 --- a/api/config/packages/translation.yaml +++ /dev/null @@ -1,13 +0,0 @@ -framework: - default_locale: en - translator: - default_path: '%kernel.project_dir%/translations' - fallbacks: - - en -# providers: -# crowdin: -# dsn: '%env(CROWDIN_DSN)%' -# loco: -# dsn: '%env(LOCO_DSN)%' -# lokalise: -# dsn: '%env(LOKALISE_DSN)%' diff --git a/api/src/Controller/LoginController.php b/api/src/Controller/LoginController.php index 6df1818aa..70e6aa1cb 100644 --- a/api/src/Controller/LoginController.php +++ b/api/src/Controller/LoginController.php @@ -4,9 +4,6 @@ namespace App\Controller; -use App\Service\ObjectEntityService; -use App\Service\UserService; -use Conduction\CommonGroundBundle\Service\CommonGroundService; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Cache\Adapter\AdapterInterface as CacheInterface; @@ -40,9 +37,8 @@ public function __construct(CacheInterface $cache, EntityManagerInterface $entit * @Route("/me") * @Route("api/users/me", methods={"get"}) */ - public function MeAction(Request $request, CommonGroundService $commonGroundService, ObjectEntityService $objectEntityService) + public function MeAction(Request $request) { - $userService = new UserService($commonGroundService, $objectEntityService); if ($this->getUser()) { $result = [ 'id' => $this->getUser()->getUserIdentifier(), @@ -52,9 +48,6 @@ public function MeAction(Request $request, CommonGroundService $commonGroundServ 'last_name' => $this->getUser()->getLastName(), 'name' => $this->getUser()->getName(), 'email' => $this->getUser()->getEmail(), - // TODO: if we have no person connected to this user create one? with $this->createPersonForUser() - 'person' => $userService->getPersonForUser($this->getUser()), - 'organization' => $userService->getOrganizationForUser($this->getUser()), ]; $result = json_encode($result); } else { @@ -74,7 +67,7 @@ public function MeAction(Request $request, CommonGroundService $commonGroundServ * * @return array */ - private function createPersonForUser(CommonGroundService $commonGroundService): array + private function createPersonForUser(): array { $person = [ 'givenName' => $this->getUser()->getFirstName(), diff --git a/api/src/Controller/UserController.php b/api/src/Controller/UserController.php index a4393d862..71cdc0eb4 100644 --- a/api/src/Controller/UserController.php +++ b/api/src/Controller/UserController.php @@ -267,142 +267,10 @@ private function cleanupLoginResponse(array $userArray): array return $userArray; } - private function getActiveOrganization(array $user, array $organizations): ?string - { - if ($user['organization']) { - return $user['organization']; - } - // If user has no organization, we default activeOrganization to an organization of a userGroup this user has - if (count($organizations) > 0) { - return $organizations[0]; - } - // If we still have no organization, get the organization from the application - if ($this->session->get('application')) { - $application = $this->entityManager->getRepository('App:Application')->findOneBy(['id' => $this->session->get('application')]); - if (!empty($application) && $application->getOrganization()) { - return $application->getOrganization(); - } - } - - return null; - } - - /** - * Get all the child organizations for an organization. - * - * @param array $organizations - * @param string $organization - * @param CommonGroundService $commonGroundService - * @param FunctionService $functionService - * - * @throws \Psr\Cache\CacheException - * @throws \Psr\Cache\InvalidArgumentException - * - * @return array - */ - private function getSubOrganizations(array $organizations, string $organization, CommonGroundService $commonGroundService, FunctionService $functionService): array - { - if ($organization = $functionService->getOrganizationFromCache($organization)) { - if (!empty($organization['subOrganizations']) && count($organization['subOrganizations']) > 0) { - foreach ($organization['subOrganizations'] as $subOrganization) { - if (!in_array($subOrganization['@id'], $organizations)) { - $organizations[] = $subOrganization['@id']; - $this->getSubOrganizations($organizations, $subOrganization['@id'], $commonGroundService, $functionService); - } - } - } - } - - return $organizations; - } - - /** - * Get al the parent organizations for an organization. - * - * @param array $organizations - * @param string $organization - * @param CommonGroundService $commonGroundService - * @param FunctionService $functionService - * - * @throws \Psr\Cache\CacheException - * @throws \Psr\Cache\InvalidArgumentException - * - * @return array - */ - private function getParentOrganizations(array $organizations, string $organization, CommonGroundService $commonGroundService, FunctionService $functionService): array - { - if ($organization = $functionService->getOrganizationFromCache($organization)) { - if (array_key_exists('parentOrganization', $organization) && $organization['parentOrganization'] != null - && !in_array($organization['parentOrganization']['@id'], $organizations)) { - $organizations[] = $organization['parentOrganization']['@id']; - $organizations = $this->getParentOrganizations($organizations, $organization['parentOrganization']['@id'], $commonGroundService, $functionService); - } - } - - return $organizations; - } - - /** - * @Route("users/request_password_reset", methods={"POST"}) - * @Route("api/users/request_password_reset", methods={"POST"}) - */ - public function requestResetAction(Request $request, CommonGroundService $commonGroundService) - { - $data = json_decode($request->getContent(), true); - $users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'], ['username' => urlencode($data['username'])])['hydra:member']; - if (count($users) > 0) { - $user = $users[0]; - } else { - return new Response(json_encode(['username' =>$data['username']]), 200, ['Content-type' => 'application/json']); - } - $this->authenticationService->sendTokenMail($user, 'Je wachtwoord herstellen', $request->headers->get('Referer', $request->headers->get('referer'))); - - return new Response(json_encode(['username' =>$data['username']]), 200, ['Content-type' => 'application/json']); - } - - /** - * @Route("users/reset_password", methods={"POST"}) - * @Route("api/users/reset_password", methods={"POST"}) - */ - public function resetAction(Request $request, CommonGroundService $commonGroundService) - { - $data = json_decode($request->getContent(), true); - if (!isset($data['username']) || !isset($data['password']) || !isset($data['token'])) { - $status = 400; - $user = [ - 'message' => 'Data missing', - 'type' => 'error', - 'path' => 'users/reset_password', - 'data' => [], - ]; - isset($data['username']) ?? $user['data']['username'] = null; - isset($data['password']) ?? $user['data']['password'] = null; - isset($data['token']) ?? $user['data']['token'] = null; - - return new Response(json_encode($user), $status, ['Content-type' => 'application/json']); - } - - try { - $user = $commonGroundService->createResource(['username' => $data['username'], 'password' => $data['password'], 'token' => $data['token']], ['component' => 'uc', 'type' => 'users/token']); - $status = 200; - $user['username'] = $data['username']; - } catch (ClientException $exception) { - $status = 400; - $user = [ - 'message' => 'Invalid token, username or password', - 'type' => 'error', - 'path' => 'users/reset_password', - 'data' => ['username' => $data['username'], 'password' => $data['password'], 'token'=>$data['token']], - ]; - } - - return new Response(json_encode($user), $status, ['Content-type' => 'application/json']); - } - /** * @Route("api/users/logout", methods={"POST", "GET"}) */ - public function ApiLogoutAction(Request $request, CommonGroundService $commonGroundService) + public function ApiLogoutAction(Request $request) { $request->getSession()->clear(); $request->getSession()->invalidate(); @@ -425,7 +293,7 @@ public function ApiLogoutAction(Request $request, CommonGroundService $commonGro return $response; } - public function ApiMeAction(Request $request, CommonGroundService $commonGroundService) + public function ApiMeAction(Request $request) { $token = substr($request->headers->get('Authorization'), strlen('Bearer ')); if (!$token) { @@ -465,18 +333,6 @@ public function ApiMeAction(Request $request, CommonGroundService $commonGroundS return new Response(json_encode($user), $status, ['Content-type' => 'application/json']); } - /** - * @Route("login/digispoof") - */ - public function DigispoofAction(Request $request, CommonGroundService $commonGroundService) - { - $redirect = $commonGroundService->cleanUrl(['component' => 'ds']); - - $responseUrl = $request->getSchemeAndHttpHost().$this->generateUrl('app_user_digispoof'); - - return $this->redirect($redirect.'?responseUrl='.$responseUrl.'&backUrl='.$request->headers->get('referer')); - } - /** * @Route("login/{method}/{identifier}") */ diff --git a/api/src/DataFixtures/AppFixtures.php b/api/src/DataFixtures/AppFixtures.php index 6c20526f4..987f6fe95 100644 --- a/api/src/DataFixtures/AppFixtures.php +++ b/api/src/DataFixtures/AppFixtures.php @@ -7,7 +7,7 @@ class AppFixtures extends Fixture { - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { // $product = new Product(); // $manager->persist($product); diff --git a/api/src/Message/NotificationMessage.php b/api/src/Message/NotificationMessage.php deleted file mode 100644 index b6cad4d0a..000000000 --- a/api/src/Message/NotificationMessage.php +++ /dev/null @@ -1,27 +0,0 @@ -objectEntityId = $objectEntityId; - $this->method = $method; - } - - public function getObjectEntityId(): UuidInterface - { - return $this->objectEntityId; - } - - public function getMethod(): string - { - return $this->method; - } -} diff --git a/api/src/Message/PromiseMessage.php b/api/src/Message/PromiseMessage.php deleted file mode 100644 index 0dd50f3ab..000000000 --- a/api/src/Message/PromiseMessage.php +++ /dev/null @@ -1,27 +0,0 @@ -objectEntityId = $objectEntityId; - $this->method = $method; - } - - public function getObjectEntityId(): UuidInterface - { - return $this->objectEntityId; - } - - public function getMethod(): string - { - return $this->method; - } -} diff --git a/api/src/Message/SyncPageMessage.php b/api/src/Message/SyncPageMessage.php deleted file mode 100644 index 9ae361688..000000000 --- a/api/src/Message/SyncPageMessage.php +++ /dev/null @@ -1,47 +0,0 @@ -callServiceData = $callServiceData; - $this->page = $page; - $this->entityId = $entityId; - $this->sessionData = $sessionData; - } - - public function getCallServiceData(): array - { - return $this->callServiceData; - } - - public function getPage(): int - { - return $this->page; - } - - public function getEntityId(): string - { - return $this->entityId; - } - - public function getSessionData(): array - { - return $this->sessionData; - } -} diff --git a/api/src/MessageHandler/NotificationMessageHandler.php b/api/src/MessageHandler/NotificationMessageHandler.php deleted file mode 100644 index 32966cdb3..000000000 --- a/api/src/MessageHandler/NotificationMessageHandler.php +++ /dev/null @@ -1,32 +0,0 @@ -objectEntityService = $objectEntityService; - $this->repository = $repository; - } - - public function __invoke(NotificationMessage $message): void - { - $object = $this->repository->find($message->getObjectEntityId()); - if ($object instanceof ObjectEntity) { -// var_dump('DispatchNotification: '.$object->getEntity()->getName().' - '.$message->getObjectEntityId()->toString().' - '.$object->getExternalId().' - '.$message->getMethod()); - $this->objectEntityService->notify($object, $message->getMethod()); - } else { -// var_dump('No ObjectEntity found with id: '.$message->getObjectEntityId()->toString()); - } - } -} diff --git a/api/src/MessageHandler/PromiseMessageHandler.php b/api/src/MessageHandler/PromiseMessageHandler.php deleted file mode 100644 index 30fc45173..000000000 --- a/api/src/MessageHandler/PromiseMessageHandler.php +++ /dev/null @@ -1,89 +0,0 @@ -objectEntityRepository = $objectEntityRepository; - $this->objectEntityService = $objectEntityService; - $this->entityManager = $entityManager; - $this->messageBus = $messageBus; - } - - public function __invoke(PromiseMessage $promiseMessage): void - { - $this->objectEntityService->notifications = []; // Make sure we reset notifications array. - $object = $this->objectEntityRepository->find($promiseMessage->getObjectEntityId()); - $this->objectEntityService->functionService->removeResultFromCache = []; - $promises = $this->getPromises($object, [], $promiseMessage->getMethod()); - if (!empty($promises)) { - Utils::settle($promises)->wait(); - - foreach ($promises as $promise) { - echo $promise->wait(); - } - } - $this->entityManager->persist($object); - $this->entityManager->flush(); - - foreach ($this->objectEntityService->notifications as $notification) { - $this->messageBus->dispatch(new NotificationMessage($notification['id'], $notification['method'])); - } - } - - public function getPromises(ObjectEntity $objectEntity, array $parentObjects, string $method, int $level = 0): array - { - $promises = []; - if (in_array($objectEntity, $parentObjects) || $level > 3) { - return $promises; - } - $parentObjects[] = $objectEntity; - foreach ($objectEntity->getSubresources() as $subresource) { - $promises = array_merge($promises, $this->getPromises($subresource, $parentObjects, $method, $level + 1)); - } - if ($objectEntity->getEntity()->getSource()) { - // createPromise will add a notification if promise is successful - $promise = $this->objectEntityService->createPromise($objectEntity, $method); - $promises[] = $promise; - $objectEntity->addPromise($promise); - } else { - // todo: very hacky code - // The code below makes sure that if we do not create a promise^, the method of the notification won't ... - // ... be POST when the ObjectEntity already exists for more than 5 minutes. In this case we want a ... - // ... notification with method = PUT not POST. - $now = new DateTime(); - $interval = $objectEntity->getDateCreated()->diff($now); - $compareDate = new DateTime(); - $compareDate->add($interval); - $now->add(new DateInterval('PT5M')); - if ($compareDate > $now) { - $method = 'PUT'; - } - - // Create Notification -// var_dump('NOTIFICATION: '.$objectEntity->getEntity()->getName().' - '.$objectEntity->getId()->toString().' - '.$objectEntity->getExternalId().' - '.$method); - $this->objectEntityService->notifications[] = ['id' => $objectEntity->getId(), 'method' => $method]; - } - - return $promises; - } -} diff --git a/api/src/MessageHandler/SyncPageMessageHandler.php b/api/src/MessageHandler/SyncPageMessageHandler.php deleted file mode 100644 index 1c519f57a..000000000 --- a/api/src/MessageHandler/SyncPageMessageHandler.php +++ /dev/null @@ -1,150 +0,0 @@ -commonGroundService = $commonGroundService; - $this->objectEntityRepository = $objectEntityRepository; - $this->entityRepository = $entityRepository; - } - - /** - * Handles a SyncPageMessage message. - * - * @param SyncPageMessage $message - * - * @throws Exception - * - * @return void - */ - public function __invoke(SyncPageMessage $message): void - { - $callServiceData = $message->getCallServiceData(); - $requiredKeys = ['component', 'url', 'query', 'headers']; - if (count(array_intersect_key($callServiceData, array_flip($requiredKeys))) !== count($requiredKeys)) { - throw new Exception('CallServiceData is missing one of the following keys: '.implode(', ', $requiredKeys)); - } - $entity = $this->entityRepository->find($message->getEntityId()); - - // Get objects from extern api - $externObjects = $this->getExternObjects($message, $entity); - - // Loop through all extern objects and update or create an ObjectEntity for it in the gateway. - $newGatewayObjects = $this->saveObjects($externObjects, ['message' => $message, 'entity' => $entity]); - - // Dump so we can see what's happening in the worker pod online. - var_dump('Entity: '.$entity->getName().' - Page: '.$message->getPage().' - New / changed gateway objects = '.count($newGatewayObjects)); - } - - /** - * Uses callService with info from the SyncPageMessage to get all objects from an extern api for one specific page. - * - * @param SyncPageMessage $message - * @param Entity $entity - * - * @return array - */ - private function getExternObjects(SyncPageMessage $message, Entity $entity): array - { - $callServiceData = $message->getCallServiceData(); - - $response = $this->commonGroundService->callService( - $callServiceData['component'], - $callServiceData['url'], - '', - array_merge($callServiceData['query'], $message->getPage() !== 1 ? ['page' => $message->getPage()] : []), - $callServiceData['headers'], - false, - 'GET' - ); - if (is_array($response)) { - var_dump('callService error: '.$response); //Throw error? //todo? - } - $response = json_decode($response->getBody()->getContents(), true); - - // Now get response from the correct place in the response - $collectionConfigResults = explode('.', $entity->getCollectionConfig()['results']); - foreach ($collectionConfigResults as $item) { - $response = $response[$item]; - } - - return $response; - } - - /** - * Loop through all extern objects and update or create an ObjectEntity for it in the gateway. - * - * @param array $externObjects - * @param array $messageData Must contain key 'message' (SyncPageMessage) and key 'entity' (Entity) - * - * @return ArrayCollection - */ - private function saveObjects(array $externObjects, array $messageData): ArrayCollection - { - $newGatewayObjects = new ArrayCollection(); - $collectionConfigEnvelope = []; - if (array_key_exists('envelope', $messageData['entity']->getCollectionConfig())) { - $collectionConfigEnvelope = explode('.', $messageData['entity']->getCollectionConfig()['envelope']); - } - $collectionConfigId = []; - if (array_key_exists('id', $messageData['entity']->getCollectionConfig())) { - $collectionConfigId = explode('.', $messageData['entity']->getCollectionConfig()['id']); - } - foreach ($externObjects as $externObject) { - $object = $this->saveObject( - $externObject, - [ - 'collectionConfigEnvelope' => $collectionConfigEnvelope, - 'collectionConfigId' => $collectionConfigId, - ], - $messageData - ); - - if ($object instanceof ObjectEntity) { - $newGatewayObjects->add($object); - } - } - - return $newGatewayObjects; - } - - private function saveObject(array $externObject, array $config, array $messageData): ?ObjectEntity - { - $id = $config['collectionConfigId'] !== [] ? $externObject : null; - // Make sure to get this item from the correct place in $externObject - foreach ($config['collectionConfigEnvelope'] as $item) { - $externObject = $externObject[$item]; - } - // Make sure to get id of this item from the correct place in $externObject - if ($id !== null) { - foreach ($config['collectionConfigId'] as $item) { - $id = $id[$item]; - } - } - - // We want to update all objects, unless specified not to, needs config option: -// if (!$this->objectEntityRepository->findOneBy(['entity' => $messageData['entity'], 'externalId' => $id])) { - // Convert this object to a gateway object - // todo: We could use the handleOwner function here to set the owner of this object, but should we set the owner to the person/user that uses the /sync api-call? -// } - - return $object ?? null; - } -} diff --git a/api/src/Security/ApiKeyAuthenticator.php b/api/src/Security/ApiKeyAuthenticator.php index d9c19f97e..9bb517b62 100644 --- a/api/src/Security/ApiKeyAuthenticator.php +++ b/api/src/Security/ApiKeyAuthenticator.php @@ -3,10 +3,7 @@ namespace App\Security; use App\Entity\User; -use App\Service\FunctionService; -use Conduction\CommonGroundBundle\Service\AuthenticationService; -use Conduction\CommonGroundBundle\Service\CommonGroundService; -use Conduction\SamlBundle\Security\User\AuthenticationUser; +use App\Security\User\AuthenticationUser; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\HttpFoundation\JsonResponse; @@ -23,26 +20,14 @@ class ApiKeyAuthenticator extends \Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator { - private CommonGroundService $commonGroundService; - private ParameterBagInterface $parameterBag; - private AuthenticationService $authenticationService; private SessionInterface $session; - private FunctionService $functionService; private EntityManagerInterface $entityManager; public function __construct( - CommonGroundService $commonGroundService, - AuthenticationService $authenticationService, - ParameterBagInterface $parameterBag, SessionInterface $session, - FunctionService $functionService, EntityManagerInterface $entityManager ) { - $this->commonGroundService = $commonGroundService; - $this->parameterBag = $parameterBag; - $this->authenticationService = $authenticationService; $this->session = $session; - $this->functionService = $functionService; $this->entityManager = $entityManager; } @@ -55,61 +40,6 @@ public function supports(Request $request): ?bool strpos($request->headers->get('Authorization'), 'Bearer') === false; } - /** - * Get all the child organizations for an organization. - * - * @param array $organizations - * @param string $organization - * @param CommonGroundService $commonGroundService - * @param FunctionService $functionService - * - * @throws \Psr\Cache\CacheException - * @throws \Psr\Cache\InvalidArgumentException - * - * @return array - */ - private function getSubOrganizations(array $organizations, string $organization, CommonGroundService $commonGroundService, FunctionService $functionService): array - { - if ($organization = $functionService->getOrganizationFromCache($organization)) { - if (!empty($organization['subOrganizations']) && count($organization['subOrganizations']) > 0) { - foreach ($organization['subOrganizations'] as $subOrganization) { - if (!in_array($subOrganization['@id'], $organizations)) { - $organizations[] = $subOrganization['@id']; - $this->getSubOrganizations($organizations, $subOrganization['@id'], $commonGroundService, $functionService); - } - } - } - } - - return $organizations; - } - - /** - * Get al the parent organizations for an organization. - * - * @param array $organizations - * @param string $organization - * @param CommonGroundService $commonGroundService - * @param FunctionService $functionService - * - * @throws \Psr\Cache\CacheException - * @throws \Psr\Cache\InvalidArgumentException - * - * @return array - */ - private function getParentOrganizations(array $organizations, string $organization, CommonGroundService $commonGroundService, FunctionService $functionService): array - { - if ($organization = $functionService->getOrganizationFromCache($organization)) { - if (array_key_exists('parentOrganization', $organization) && $organization['parentOrganization'] != null - && !in_array($organization['parentOrganization']['@id'], $organizations)) { - $organizations[] = $organization['parentOrganization']['@id']; - $organizations = $this->getParentOrganizations($organizations, $organization['parentOrganization']['@id'], $commonGroundService, $functionService); - } - } - - return $organizations; - } - private function prefixRoles(array $roles): array { foreach ($roles as $key => $value) { diff --git a/api/src/Security/User/AuthenticationProvider.php b/api/src/Security/User/AuthenticationProvider.php index bb8dea505..2af7d7e89 100644 --- a/api/src/Security/User/AuthenticationProvider.php +++ b/api/src/Security/User/AuthenticationProvider.php @@ -15,15 +15,6 @@ */ class AuthenticationProvider implements UserProviderInterface { - private $params; - private $commonGroundService; - - public function __construct(ParameterBagInterface $params, CommonGroundService $commonGroundService) - { - $this->params = $params; - $this->commonGroundService = $commonGroundService; - } - public function loadUserByUsername($username) { return $this->fetchUser($username); diff --git a/api/src/Service/AuthenticationService.php b/api/src/Service/AuthenticationService.php index 4d6da8a09..8868e5133 100644 --- a/api/src/Service/AuthenticationService.php +++ b/api/src/Service/AuthenticationService.php @@ -33,102 +33,19 @@ class AuthenticationService private EntityManagerInterface $entityManager; private Client $client; private Security $security; - private CommonGroundService $commonGroundService; private Environment $twig; private ParameterBagInterface $parameterBag; - public function __construct(SessionInterface $session, EntityManagerInterface $entityManager, Security $security, CommonGroundService $commonGroundService, Environment $twig, ParameterBagInterface $parameterBag) + public function __construct(SessionInterface $session, EntityManagerInterface $entityManager, Security $security, Environment $twig, ParameterBagInterface $parameterBag) { $this->session = $session; $this->entityManager = $entityManager; $this->client = new Client(); $this->security = $security; - $this->commonGroundService = $commonGroundService; $this->twig = $twig; $this->parameterBag = $parameterBag; } - public function generateJwt() - { - $user = $this->retrieveCurrentUser(); - - $array = [ - 'username' => $user->getUsername(), - 'password' => $user->getPassword(), - ]; - - $user = $this->commonGroundService->createResource($array, ['component' => 'uc', 'type' => 'login']); - - return $user['jwtToken']; - } - - /** - * Validates a JWT token with the public key stored in the component. - * - * @param string $jws The signed JWT token to validate - * @param string $publicKey - * - * @throws Exception Thrown when the JWT token could not be verified - * - * @return bool Whether the jwt is valid - */ - public function validateJWTAndGetPayload(string $jws, string $publicKey): bool - { - try { - $serializer = new CompactSerializer(); - $jwt = $serializer->unserialize($jws); - $algorithmManager = new AlgorithmManager([new RS512()]); - $pem = $this->writeFile($publicKey, 'pem'); - $public = JWKFactory::createFromKeyFile($pem); - $this->removeFiles([$pem]); - - $jwsVerifier = new JWSVerifier($algorithmManager); - - if ($jwsVerifier->verifyWithKey($jwt, $public, 0)) { - return true; - } - - return false; - } catch (\Throwable $e) { - return false; - } - } - - public function checkJWTExpiration($token): bool - { - $data = $this->retrieveJWTContents($token); - - if (!is_array($token) || !array_key_exists('exp', $token) || strtotime('now') >= $data['exp']) { - return false; - } - - return true; - } - - public function retrieveJWTUser($token): bool - { - $data = $this->retrieveJWTContents($token); - - try { - $user = $this->commonGroundService->getResource(['component' => 'uc', 'type' => 'users', 'id' => $data['userId']]); - } catch (\Throwable $e) { - return false; - } - - return true; - } - - public function retrieveJWTContents($token): array - { - try { - $json = base64_decode(explode('.', $token))[1]; - - return json_decode($json, true); - } catch (\Exception $exception) { - return []; - } - } - /** * Writes a temporary file in the component file system. * @@ -157,17 +74,6 @@ public function removeFiles(array $files): void } } - public function retrieveCurrentUser() - { - $user = $this->security->getUser(); - - if ($user) { - return $user; - } - - throw new AccessDeniedException('Unable to find logged in user'); - } - public function authenticate(string $method, string $identifier, string $code): array { if (!$method || !$identifier) { @@ -188,12 +94,12 @@ public function retrieveData(string $method, string $code, Authentication $authe case 'oidc': case 'adfs': return $this->retrieveAdfsData($code, $authentication, $redirectUrl); - break; case 'digid': break; default: throw new BadRequestException('Authentication method not supported'); } + return []; } public function refreshAccessToken(string $refreshToken, string $authenticator): array @@ -253,12 +159,13 @@ public function buildRedirectUrl(string $method, string $redirectUrl, Authentica return $this->handleOidcRedirectUrl($redirectUrl, $authentication); case 'adfs': return $this->handleAdfsRedirectUrl($redirectUrl, $authentication); - break; case 'digid': break; default: throw new BadRequestException('Authentication method not supported'); } + + return null; } public function handleOidcRedirectUrl(string $redirectUrl, Authentication $authentication): string @@ -288,36 +195,4 @@ public function retrieveAuthentication(string $identifier): Authentication return $authentications[0]; } - - public function sendTokenMail(array $user, string $subject, string $frontend): bool - { - $response = $this->commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users', 'id' => "{$user['id']}/token"], ['type' => 'SET_PASSWORD']); - $person = $this->commonGroundService->isResource($user['person']); - - $service = $this->commonGroundService->getResourceList(['component' => 'bs', 'type' => 'services'])['hydra:member'][0]; - $parameters = [ - 'fullname' => $person['name'] ?? $user['username'], - 'base64_encoded_email' => base64_encode($user['username']), - 'base64_encoded_token' => base64_encode($response['token']), - 'app_base_url' => rtrim($frontend, '/'), - 'subject' => $subject, - ]; - - $content = $this->twig->render('password-forgot-e-mail.html.twig', $parameters); - - $message = $this->commonGroundService->createResource( - [ - 'reciever' => $user['username'], - 'sender' => 'taalhuizen@biscutrecht.nl', - 'content' => $content, - 'type' => 'email', - 'status' => 'queued', - 'service' => '/services/'.$service['id'], - 'subject' => $subject, - ], - ['component' => 'bs', 'type' => 'messages'] - ); - - return true; - } } diff --git a/api/src/Service/AuthorizationService.php b/api/src/Service/AuthorizationService.php index 8f9bd00b0..9f4158cdd 100644 --- a/api/src/Service/AuthorizationService.php +++ b/api/src/Service/AuthorizationService.php @@ -4,8 +4,6 @@ use App\Entity\Attribute; use App\Entity\Entity; -use Conduction\CommonGroundBundle\Service\CommonGroundService; -use Conduction\CommonGroundBundle\Service\SerializerService; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityManagerInterface; use Psr\Cache\CacheException; @@ -29,7 +27,6 @@ class AuthorizationService { private ParameterBagInterface $parameterBag; - private CommonGroundService $commonGroundService; private Security $security; private SessionInterface $session; private CacheInterface $cache; @@ -37,14 +34,12 @@ class AuthorizationService public function __construct( ParameterBagInterface $parameterBag, - CommonGroundService $commonGroundService, Security $security, SessionInterface $session, CacheInterface $cache, EntityManagerInterface $entityManager ) { $this->parameterBag = $parameterBag; - $this->commonGroundService = $commonGroundService; $this->security = $security; $this->session = $session; $this->cache = $cache; diff --git a/api/src/Service/DocumentService.php b/api/src/Service/DocumentService.php index 4e8258b97..bf8f2cc3e 100644 --- a/api/src/Service/DocumentService.php +++ b/api/src/Service/DocumentService.php @@ -18,22 +18,16 @@ */ class DocumentService { - private CommonGroundService $commonGroundService; private EavService $eavService; - private ResponseService $responseService; private GatewayService $gatewayService; - private SerializerInterface $serializer; private ParameterBagInterface $parameterBag; private TranslationService $translationService; private TemplateService $templateService; - public function __construct(EavService $eavService, ResponseService $responseService, CommonGroundService $commonGroundService, GatewayService $gatewayService, SerializerInterface $serializer, ParameterBagInterface $parameterBag, TranslationService $translationService, TemplateService $templateService) + public function __construct(EavService $eavService, GatewayService $gatewayService, ParameterBagInterface $parameterBag, TranslationService $translationService, TemplateService $templateService) { $this->eavService = $eavService; - $this->responseService = $responseService; - $this->commonGroundService = $commonGroundService; $this->gatewayService = $gatewayService; - $this->serializer = $serializer; $this->parameterBag = $parameterBag; $this->translationService = $translationService; $this->templateService = $templateService; diff --git a/api/src/Service/EavDocumentationService.php b/api/src/Service/EavDocumentationService.php index e56829191..2edfd7565 100644 --- a/api/src/Service/EavDocumentationService.php +++ b/api/src/Service/EavDocumentationService.php @@ -4,7 +4,6 @@ use App\Entity\Attribute; use App\Entity\Entity; -use Conduction\CommonGroundBundle\Service\CommonGroundService; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Yaml\Yaml; @@ -19,13 +18,11 @@ class EavDocumentationService { private EntityManagerInterface $em; - private CommonGroundService $commonGroundService; private array $supportedValidators; - public function __construct(EntityManagerInterface $em, CommonGroundService $commonGroundService) + public function __construct(EntityManagerInterface $em) { $this->em = $em; - $this->commonGroundService = $commonGroundService; // Lets define the validator that we support for docummentation right now $this->supportedValidators = $this->supportedValidators(); diff --git a/api/src/Service/EavService.php b/api/src/Service/EavService.php index 29a8b63db..78c51f228 100644 --- a/api/src/Service/EavService.php +++ b/api/src/Service/EavService.php @@ -41,47 +41,21 @@ class EavService { private EntityManagerInterface $em; - private CommonGroundService $commonGroundService; - private SerializerService $serializerService; - private SerializerInterface $serializer; - private AuthorizationService $authorizationService; private SessionInterface $session; - private ObjectEntityService $objectEntityService; - private ResponseService $responseService; - private ParameterBagInterface $parameterBag; - private TranslationService $translationService; - private FunctionService $functionService; - private CacheInterface $cache; private Stopwatch $stopwatch; + private FunctionService $functionService; public function __construct( EntityManagerInterface $em, - CommonGroundService $commonGroundService, - SerializerService $serializerService, - SerializerInterface $serializer, AuthorizationService $authorizationService, SessionInterface $session, - ObjectEntityService $objectEntityService, - ResponseService $responseService, - ParameterBagInterface $parameterBag, - TranslationService $translationService, - FunctionService $functionService, - CacheInterface $cache, - Stopwatch $stopwatch + Stopwatch $stopwatch, + FunctionService $functionService ) { $this->em = $em; - $this->commonGroundService = $commonGroundService; - $this->serializerService = $serializerService; - $this->serializer = $serializer; - $this->authorizationService = $authorizationService; $this->session = $session; - $this->objectEntityService = $objectEntityService; - $this->responseService = $responseService; - $this->parameterBag = $parameterBag; - $this->translationService = $translationService; - $this->functionService = $functionService; - $this->cache = $cache; $this->stopwatch = $stopwatch; + $this->functionService = $functionService; } /** @@ -185,1043 +159,6 @@ public function getObject(?string $id, string $method, Entity $entity) return null; } - /** - * Handles an api request. - * - * @param Request $request - * - * @throws Exception - * - * @return Response - * @deprecated - */ - public function handleRequest(Request $request): Response - { - $this->cache->invalidateTags(['grantedScopes']); - - // Lets get our base stuff - $requestBase = $this->getRequestBase($request); - $contentType = $this->getRequestContentType($request, $requestBase['extension']); - $entity = $this->getEntity($requestBase['path']); - $body = []; // Lets default - - // What if we canot find an entity? - if (is_array($entity)) { - $resultConfig['responseType'] = Response::HTTP_BAD_REQUEST; - $resultConfig['result'] = $entity; - $entity = null; - } - - // Get a body - if ($request->getContent()) { - //@todo support xml messages - $body = json_decode($request->getContent(), true); - $body = filter_var_array($body, FILTER_SANITIZE_ENCODED); - } - // // If we have no body but are using form-data with a POST or PUT call instead: //TODO find a better way to deal with form-data? - // elseif ($request->getMethod() == 'POST' || $request->getMethod() == 'PUT') { - // // get other input values from form-data and put it in $body ($request->get('name')) - // $body = $this->handleFormDataBody($request, $entity); - // - // $formDataResult = $this->handleFormDataFiles($request, $entity, $object); - // if (array_key_exists('result', $formDataResult)) { - // $result = $formDataResult['result']; - // $responseType = Response::HTTP_BAD_REQUEST; - // } else { - // $object = $formDataResult; - // } - // } - - if (!isset($resultConfig['result'])) { - $resultConfig = $this->generateResult($request, $entity, $requestBase, $body); - } - - $options = []; - switch ($contentType) { - case 'text/csv': - $options = [ - CsvEncoder::ENCLOSURE_KEY => '"', - CsvEncoder::ESCAPE_CHAR_KEY => '+', - ]; - - // Lets allow _mapping tot take place - /* @todo remove the old fields support */ - /* @todo make this universal */ - if ($mapping = $request->query->get('_mapping')) { - foreach ($resultConfig['result'] as $key => $result) { - $resultConfig['result'][$key] = $this->translationService->dotHydrator([], $result, $mapping); - } - } - } - - // Lets seriliaze the shizle - $result = $this->serializerService->serialize(new ArrayCollection($resultConfig['result']), $requestBase['renderType'], $options); - - // Afther that we transale the shizle out of it - - /*@todo this is an ugly catch to make sure it only applies to bisc */ - /*@todo this should DEFINTLY be configuration */ - if ($contentType === 'text/csv') { - $translationVariables = [ - 'OTHER' => 'Anders', - 'YES_OTHER' => '"Ja, Anders"', - ]; - - $result = $this->translationService->parse($result, true, $translationVariables); - } else { - $translationVariables = []; - } - - /* - if ($contentType === 'text/csv') { - $replacements = [ - '/student\.person.givenName/' => 'Voornaam', - '/student\.person.additionalName/' => 'Tussenvoegsel', - '/student\.person.familyName/' => 'Achternaam', - '/student\.person.emails\..\.email/' => 'E-mail adres', - '/student.person.telephones\..\.telephone/' => 'Telefoonnummer', - '/student\.intake\.dutchNTLevel/' => 'NT1/NT2', - '/participations\.provider\.id/' => 'ID aanbieder', - '/participations\.provider\.name/' => 'Aanbieder', - '/participations/' => 'Deelnames', - '/learningResults\..\.id/' => 'ID leervraag', - '/learningResults\..\.verb/' => 'Werkwoord', - '/learningResults\..\.subjectOther/' => 'Onderwerp (anders)', - '/learningResults\..\.subject/' => 'Onderwerp', - '/learningResults\..\.applicationOther/' => 'Toepasing (anders)', - '/learningResults\..\.application/' => 'Toepassing', - '/learningResults\..\.levelOther/' => 'Niveau (anders)', - '/learningResults\..\.level/' => 'Niveau', - '/learningResults\..\.participation/' => 'Deelname', - '/learningResults\..\.testResult/' => 'Test Resultaat', - '/agreements/' => 'Overeenkomsten', - '/desiredOffer/' => 'Gewenst aanbod', - '/advisedOffer/' => 'Geadviseerd aanbod', - '/offerDifference/' => 'Aanbod verschil', - '/person\.givenName/' => 'Voornaam', - '/person\.additionalName/' => 'Tussenvoegsel', - '/person\.familyName/' => 'Achternaam', - '/person\.emails\..\.email/' => 'E-mail adres', - '/person.telephones\..\.telephone/' => 'Telefoonnummer', - '/intake\.date/' => 'Aanmaakdatum', - '/intake\.referringOrganizationEmail/' => 'Verwijzer Email', - '/intake\.referringOrganizationOther/' => 'Verwijzer Telefoon', - '/intake\.referringOrganization/' => 'Verwijzer', - '/intake\.foundViaOther/' => 'Via (anders)', - '/intake\.foundVia/' => 'Via', - '/roles/' => 'Rollen', - '/student\.id/' => 'ID deelnemer', - '/description/' => 'Beschrijving', - '/motivation/' => 'Leervraag', - '/languageHouse\.name/' => 'Naam taalhuis', - ]; - - foreach ($replacements as $key => $value) { - $result = preg_replace($key, $value, $result); - } - } - */ - - // Let return the shizle - $response = new Response( - $result, - $resultConfig['responseType'], - ['content-type' => $contentType] - ); - - // Let intervene if it is a known file extension - $supportedExtensions = ['json', 'jsonld', 'jsonhal', 'xml', 'csv', 'yaml']; - if ($entity && in_array($requestBase['extension'], $supportedExtensions)) { - $date = new \DateTime(); - $date = $date->format('Ymd_His'); - $disposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, "{$entity->getName()}_{$date}.{$requestBase['extension']}"); - $response->headers->set('Content-Disposition', $disposition); - } - - return $response; - } - - /** - * Handles an api request. - * - * @param Request $request - * - * @throws Exception - * - * @return Response - * @deprecated - */ - public function generateResult(Request $request, Entity $entity, array $requestBase, ?array $body = []): array - { - // Lets get our base stuff - $result = $requestBase['result']; - - // Set default responseType - $responseType = Response::HTTP_OK; - - // Get the application by searching for an application with a domain that matches the host of this request - $host = $request->headers->get('host'); - // TODO: use a sql query instead of array_filter for finding the correct application - // $application = $this->em->getRepository('App:Application')->findByDomain($host); - // if (!empty($application)) { - // $this->session->set('application', $application->getId()->toString()); - // } - $applications = $this->em->getRepository('App:Application')->findAll(); - $applications = array_values(array_filter($applications, function (Application $application) use ($host) { - return in_array($host, $application->getDomains()); - })); - if (count($applications) > 0) { - $this->session->set('application', $applications[0]->getId()->toString()); - } elseif ($this->session->get('apiKeyApplication')) { - // If an api-key is used for authentication we already know which application is used - $this->session->set('application', $this->session->get('apiKeyApplication')); - } else { - // var_dump('no application found'); - if ($host == 'localhost') { - $localhostApplication = new Application(); - $localhostApplication->setName('localhost'); - $localhostApplication->setDescription('localhost application'); - $localhostApplication->setDomains(['localhost']); - $localhostApplication->setPublic(''); - $localhostApplication->setSecret(''); - $localhostApplication->setOrganization('localhostOrganization'); - $this->em->persist($localhostApplication); - $this->em->flush(); - $this->session->set('application', $localhostApplication->getId()->toString()); - // var_dump('Created Localhost Application'); - } else { - $this->session->set('application', null); - $responseType = Response::HTTP_FORBIDDEN; - $result = [ - 'message' => 'No application found with domain '.$host, - 'type' => 'Forbidden', - 'path' => $host, - 'data' => ['host' => $host], - ]; - } - } - - if (!$this->session->get('activeOrganization') && $this->session->get('application')) { - $application = $this->em->getRepository('App:Application')->findOneBy(['id' => $this->session->get('application')]); - $this->session->set('activeOrganization', !empty($application) ? $application->getOrganization() : null); - } - if (!$this->session->get('organizations') && $this->session->get('activeOrganization')) { - $this->session->set('organizations', [$this->session->get('activeOrganization')]); - } - if (!$this->session->get('parentOrganizations')) { - $this->session->set('parentOrganizations', []); - } - - // Lets create an object - if (($requestBase['id'] || $request->getMethod() == 'POST') && $responseType == Response::HTTP_OK) { - $object = $this->getObject($requestBase['id'], $request->getMethod(), $entity); - if (array_key_exists('type', $object) && $object['type'] == 'Bad Request') { - $responseType = Response::HTTP_BAD_REQUEST; - $result = $object; - $object = null; - } // Lets check if the user is allowed to view/edit this resource. - elseif (!$this->objectEntityService->checkOwner($object)) { - // TODO: do we want to throw a different error if there are nog organizations in the session? (because of logging out for example) - if ($object->getOrganization() && !in_array($object->getOrganization(), $this->session->get('organizations') ?? [])) { - $object = null; // Needed so we return the error and not the object! - $responseType = Response::HTTP_FORBIDDEN; - $result = [ - 'message' => 'You are forbidden to view or edit this resource.', - 'type' => 'Forbidden', - 'path' => $entity->getName(), - 'data' => ['id' => $requestBase['id']], - ]; - } - } - } - - // Check for scopes, if forbidden to view/edit overwrite result so far to this forbidden error - if ((!isset($object) || !$object->getUri()) || !$this->objectEntityService->checkOwner($object)) { - try { - //TODO what to do if we do a get collection and want to show objects this user is the owner of, but not any other objects? - $this->authorizationService->checkAuthorization([ - 'method' => $request->getMethod(), - 'entity' => $entity, - 'object' => $object ?? null, - ]); - } catch (AccessDeniedException $e) { - $result = [ - 'message' => $e->getMessage(), - 'type' => 'Forbidden', - 'path' => $entity->getName(), - 'data' => [], - ]; - - return [ - 'result' => $result, - 'responseType' => Response::HTTP_FORBIDDEN, - 'object' => $object ?? null, - ]; - } - } - - // Lets allow for filtering specific fields - $fields = $this->getRequestFields($request); - - // Lets setup a switchy kinda thingy to handle the input (in handle functions) - // Its a enity endpoint - if ($requestBase['id'] && isset($object) && $object instanceof ObjectEntity) { - // Lets handle all different type of endpoints - $endpointResult = $this->handleEntityEndpoint($request, [ - 'object' => $object ?? null, 'body' => $body ?? null, 'fields' => $fields, 'path' => $requestBase['path'], - ]); - } - // its an collection endpoind - elseif ($responseType == Response::HTTP_OK) { - $endpointResult = $this->handleCollectionEndpoint($request, [ - 'object' => $object ?? null, 'body' => $body ?? null, 'fields' => $fields, 'path' => $requestBase['path'], - 'entity' => $entity, 'extension' => $requestBase['extension'], - ]); - } - if (isset($endpointResult)) { - $result = $endpointResult['result']; - $responseType = $endpointResult['responseType']; - } - - // If we have an error we want to set the responce type to error - if (isset($result) && array_key_exists('type', $result) && $result['type'] == 'error') { - $responseType = Response::HTTP_BAD_REQUEST; - } - - return [ - 'result' => $result, - 'responseType' => $responseType, - 'object' => $object ?? null, - ]; - } - - /** - * Gets the path, id, extension & renderType from the Request. - * - * @param Request $request - * - * @return array - * @deprecated - */ - private function getRequestBase(Request $request): array - { - // Lets get our base stuff - $path = $request->attributes->get('entity'); - $id = $request->attributes->get('id'); - - $extension = false; - - // Lets pull a render type form the extension if we have any - if (strpos($path, '.') && $renderType = explode('.', $path)) { - $path = $renderType[0]; - $renderType = end($renderType); - $extension = $renderType; - } elseif (strpos($id, '.') && $renderType = explode('.', $id)) { - $id = $renderType[0]; - $renderType = end($renderType); - $extension = $renderType; - } else { - $renderType = 'json'; - } - - return [ - 'path' => $path, - 'id' => $id, - 'extension' => $extension, - 'renderType' => $renderType, - 'result' => $this->checkAllowedRenderTypes($renderType, $path), - ]; - } - - /** - * Let do a backup to default to an allowed render type. - * - * @param string $renderType - * @param string $path - * - * @return array|null - * @deprecated - */ - private function checkAllowedRenderTypes(string $renderType, string $path): ?array - { - // Let do a backup to defeault to an allowed render type - $renderTypes = ['json', 'jsonld', 'jsonhal', 'xml', 'csv', 'yaml']; - if ($renderType && !in_array($renderType, $renderTypes)) { - return [ - 'message' => 'The rendering of this type is not suported, suported types are '.implode(',', $renderTypes), - 'type' => 'Bad Request', - 'path' => $path, - 'data' => ['rendertype' => $renderType], - ]; - } - - return null; - } - - /** - * @param Request $request - * @param string $extension - * - * @return string - * @deprecated - */ - private function getRequestContentType(Request $request, string $extension): string - { - // This should be moved to the commonground service and callded true $this->serializerService->getRenderType($contentType); - $acceptHeaderToSerialiazation = [ - 'application/json' => 'json', - 'application/ld+json' => 'jsonld', - 'application/json+ld' => 'jsonld', - 'application/hal+json' => 'jsonhal', - 'application/json+hal' => 'jsonhal', - 'application/xml' => 'xml', - 'text/csv' => 'csv', - 'text/yaml' => 'yaml', - ]; - - $contentType = $request->headers->get('accept'); - // If we overrule the content type then we must adjust the return header acordingly - if ($extension) { - $contentType = array_search($extension, $acceptHeaderToSerialiazation); - } elseif (!array_key_exists($contentType, $acceptHeaderToSerialiazation)) { - $contentType = 'application/json'; - } - - return $contentType; - } - - /** - * Creates a body array from the given key+values when using form-data for an POST or PUT (excl. attribute of type file). - * - * @param Request $request - * @param Entity $entity - * - * @return array - * @deprecated - */ - private function handleFormDataBody(Request $request, Entity $entity): array - { - // get other input values from form-data and put it in $body ($request->get('name')) - // TODO: Maybe use $request->request->all() and filter out attributes with type = file after that? ... - // todo... (so that we can check for input key+values that are not allowed and throw an error/warning instead of just ignoring them) - $body = []; - foreach ($entity->getAttributes() as $attribute) { - if ($attribute->getType() != 'file' && $request->get($attribute->getName())) { - $body[$attribute->getName()] = $request->get($attribute->getName()); - } - } - - return $body; - } - - /** - * Handles file validation and mutations for form-data. - * - * @param Request $request - * @param Entity $entity - * @param ObjectEntity $objectEntity - * - * @throws Exception - * @deprecated - */ - private function handleFormDataFiles(Request $request, Entity $entity, ObjectEntity $objectEntity) - { - if (count($request->files) > 0) { - // Check if this entity has an attribute with type file - $criteria = Criteria::create()->andWhere(Criteria::expr()->eq('type', 'file'))->setMaxResults(1); - $attributes = $entity->getAttributes()->matching($criteria); - - // If no attribute with type file found, throw an error - if ($attributes->isEmpty()) { - $result = [ - 'message' => 'No attribute with type file found for this entity', - 'type' => 'Bad Request', - 'path' => $entity->getName(), - 'data' => [], - ]; - - return ['result' => $result]; - } else { - // Else set attribute to the attribute with type = file - $attribute = $attributes->first(); - // Get the value (file(s)) for this attribute - $value = $request->files->get($attribute->getName()); - - if ($attribute->getMultiple()) { - // When using form-data with multiple=true for files the form-data key should have [] after the name (to make it an array, example key: files[], and support multiple file uploads with one key+multiple files in a single value) - if (!is_array($value)) { - $objectEntity->addError($attribute->getName(), 'Multiple is set for this attribute. Expecting an array of files. (Use array in form-data with the following key: '.$attribute->getName().'[])'); - } else { - // Loop through all files, validate them and store them in the files ArrayCollection - foreach ($value as $file) { - } - } - } else { - // Validate (and create/update) this file - } - - return $objectEntity; - } - } - } - - /** - * Gets fields from the request to use for filtering specific fields. - * - * @param Request $request - * - * @return array - * @deprecated - */ - public function getRequestFields(Request $request): ?array - { - $fields = $request->query->has('fields') ? $request->query->get('fields') : $request->query->get('_fields'); - - if ($fields) { - // Lets deal with a comma seperated list - if (!is_array($fields)) { - $fields = explode(',', $fields); - } - - $dot = new Dot(); - // Lets turn the from dor attat into an propper array - foreach ($fields as $key => $value) { - $dot->add($value, true); - } - - $fields = $dot->all(); - } - - return $fields; - } - - /** - * Gets extend from the request to use for extending. - * - * @param Request $request - * - * @return array - * @deprecated - */ - public function getRequestExtend(Request $request): ?array - { - $extend = $request->query->has('extend') ? $request->query->get('extend') : $request->query->get('_extend'); - - if ($extend) { - // Lets deal with a comma seperated list - if (!is_array($extend)) { - $extend = explode(',', $extend); - } - - $dot = new Dot(); - // Lets turn the from dor attat into an propper array - foreach ($extend as $key => $value) { - $dot->add($value, true); - } - - $extend = $dot->all(); - } - - return $extend; - } - - /** - * Handles entity endpoints. - * - * @param Request $request - * @param array $info Array with some required info, must contain the following keys: object, body, fields & path. - * - * @throws Exception - * - * @return array - * @deprecated - */ - public function handleEntityEndpoint(Request $request, array $info): array - { - // Lets setup a switchy kinda thingy to handle the input - // Its an enity endpoint - switch ($request->getMethod()) { - case 'GET': - $result = $this->handleGet($info['object'], $info['fields'], null); - $responseType = Response::HTTP_OK; - break; - case 'PUT': - // Transfer the variable to the service - $result = $this->handleMutation($info['object'], $info['body'], $info['fields'], $request); - $responseType = Response::HTTP_OK; - if (isset($result) && array_key_exists('type', $result) && $result['type'] == 'Forbidden') { - $responseType = Response::HTTP_FORBIDDEN; - } - break; - case 'DELETE': - $result = $this->handleDelete($info['object']); - $responseType = Response::HTTP_NO_CONTENT; - if (isset($result) && array_key_exists('type', $result) && $result['type'] == 'Forbidden') { - $responseType = Response::HTTP_FORBIDDEN; - } - break; - default: - $result = [ - 'message' => 'This method is not allowed on this endpoint, allowed methods are GET, PUT and DELETE', - 'type' => 'Bad Request', - 'path' => $info['path'], - 'data' => ['method' => $request->getMethod()], - ]; - $responseType = Response::HTTP_BAD_REQUEST; - break; - } - - return [ - 'result' => $result ?? null, - 'responseType' => $responseType, - ]; - } - - /** - * Handles collection endpoints. - * - * @param Request $request - * @param array $info Array with some required info, must contain the following keys: object, body, fields, path, entity & extension. - * - * @throws Exception - * - * @return array - * @deprecated - */ - public function handleCollectionEndpoint(Request $request, array $info): array - { - // its a collection endpoint - switch ($request->getMethod()) { - case 'GET': - $result = $this->handleSearch($info['entity'], $request, $info['fields'], null, $info['extension']); - $responseType = Response::HTTP_OK; - break; - case 'POST': - // Transfer the variable to the service - $result = $this->handleMutation($info['object'], $info['body'], $info['fields'], $request); - $responseType = Response::HTTP_CREATED; - if (isset($result) && array_key_exists('type', $result) && $result['type'] == 'Forbidden') { - $responseType = Response::HTTP_FORBIDDEN; - } - break; - default: - $result = [ - 'message' => 'This method is not allowed on this endpoint, allowed methods are GET and POST', - 'type' => 'Bad Request', - 'path' => $info['path'], - 'data' => ['method' => $request->getMethod()], - ]; - $responseType = Response::HTTP_BAD_REQUEST; - break; - } - - return [ - 'result' => $result ?? null, - 'responseType' => $responseType, - ]; - } - - /** - * This function handles data mutations on EAV Objects. - * - * @param ObjectEntity $object - * @param array $body - * @param $fields - * - * @throws Exception - * - * @return array - * @deprecated - */ - public function handleMutation(ObjectEntity $object, array $body, $fields, Request $request): array - { - // Check if session contains an activeOrganization, so we can't do calls without it. So we do not create objects with no organization! - if ($this->parameterBag->get('app_auth') && empty($this->session->get('activeOrganization'))) { - return [ - 'message' => 'An active organization is required in the session, please login to create a new session.', - 'type' => 'Forbidden', - 'path' => $object->getEntity()->getName(), - 'data' => ['activeOrganization' => null], - ]; - } - - // Check if @owner is present in the body and if so unset it. - // note: $owner is allowed to be null! - $owner = 'owner'; - if (array_key_exists('@owner', $body)) { - $owner = $body['@owner']; - unset($body['@owner']); - } - - // Check optional conditional logic - $object->checkConditionlLogic(); // Old way of checking condition logic - - // Saving the data - $this->em->persist($object); - if ($request->getMethod() == 'POST' && $object->getEntity()->getFunction() === 'organization' && !array_key_exists('@organization', $body)) { - $object = $this->functionService->createOrganization($object, $object->getUri(), $body['type']); - } - $this->objectEntityService->handleOwner($object, $owner); // note: $owner is allowed to be null! - $this->em->persist($object); - $this->em->flush(); - - return $this->responseService->renderResult($object, $fields, null); - } - - /** - * Handles a get item api call. - * - * @param ObjectEntity $object - * @param array|null $fields - * @param array|null $extend - * @param string $acceptType - * - * @throws CacheException|InvalidArgumentException - * - * @return array - * @deprecated - */ - public function handleGet(ObjectEntity $object, ?array $fields, ?array $extend, string $acceptType = 'json'): array - { - return $this->responseService->renderResult($object, $fields, $extend, $acceptType); - } - - /** - * A function to replace Request->query->all() because Request->query->all() will replace some characters with an underscore. - * This function will not. - * - * @param string $method The method of the Request - * - * @return array An array with all query parameters. - * @deprecated (see CoreBundle RequestService->realRequestQueryAll()!) - */ - public function realRequestQueryAll(string $method = 'get'): array - { - $vars = []; - if (strtolower($method) === 'get' && empty($_SERVER['QUERY_STRING'])) { - return $vars; - } - $pairs = explode('&', $_SERVER['QUERY_STRING']); - foreach ($pairs as $pair) { - $nv = explode('=', $pair); - $name = urldecode($nv[0]); - $value = ''; - if (count($nv) == 2) { - $value = urldecode($nv[1]); - } - - $this->recursiveRequestQueryKey($vars, $name, explode('[', $name)[0], $value); - } - - return $vars; - } - - /** - * This function adds a single query param to the given $vars array. ?$name=$value - * Will check if request query $name has [...] inside the parameter, like this: ?queryParam[$nameKey]=$value. - * Works recursive, so in case we have ?queryParam[$nameKey][$anotherNameKey][etc][etc]=$value. - * Also checks for queryParams ending on [] like: ?queryParam[$nameKey][] (or just ?queryParam[]), if this is the case - * this function will add given value to an array of [queryParam][$nameKey][] = $value or [queryParam][] = $value. - * If none of the above this function will just add [queryParam] = $value to $vars. - * - * @param array $vars The vars array we are going to store the query parameter in - * @param string $name The full $name of the query param, like this: ?$name=$value - * @param string $nameKey The full $name of the query param, unless it contains [] like: ?queryParam[$nameKey]=$value - * @param string $value The full $value of the query param, like this: ?$name=$value - * - * @return void - * @deprecated - */ - private function recursiveRequestQueryKey(array &$vars, string $name, string $nameKey, string $value) - { - $matchesCount = preg_match('/(\[[^[\]]*])/', $name, $matches); - if ($matchesCount > 0) { - $key = $matches[0]; - $name = str_replace($key, '', $name); - $key = trim($key, '[]'); - if (!empty($key)) { - $vars[$nameKey] = $vars[$nameKey] ?? []; - $this->recursiveRequestQueryKey($vars[$nameKey], $name, $key, $value); - } else { - $vars[$nameKey][] = $value; - } - } else { - $vars[$nameKey] = $value; - } - } - - /** - * Handles a search (collection) api call. - * - * @param Entity $entity - * @param Request $request - * @param array|null $fields - * @param array|null $extend - * @param $extension - * @param null $filters - * @param string $acceptType - * @param array|null $query - * - * @throws CacheException - * @throws InvalidArgumentException - * - * @return array|array[] - * @deprecated - */ - public function handleSearch(Entity $entity, Request $request, ?array $fields, ?array $extend, $extension, $filters = null, string $acceptType = 'json', ?array $query = null): array - { - $query = $query ?? $this->realRequestQueryAll($request->getMethod()); - unset($query['limit']); - unset($query['page']); - unset($query['start']); - $limit = (int) ($request->query->get('limit') ?? 25); // These type casts are not redundant! - $page = (int) ($request->query->get('page') ?? 1); - $start = (int) ($request->query->get('start') ?? 1); - - if ($start > 1) { - $offset = $start - 1; - } else { - $offset = ($page - 1) * $limit; - } - - // Allowed order by - $this->stopwatch->start('orderParametersCheck', 'handleSearch'); - $orderCheck = $this->em->getRepository('App:ObjectEntity')->getOrderParameters($entity); - // todo: ^^^ add something to ObjectEntities just like bool searchable, use that to check for fields allowed to be used for ordering. - // todo: sortable? - - $order = []; - if (array_key_exists('order', $query)) { - $order = $query['order']; - unset($query['order']); - if (!is_array($order)) { - $orderCheckStr = implode(', ', $orderCheck); - $message = 'Please give an attribute to order on. Like this: ?order[attributeName]=desc/asc. Supported order query parameters: '.$orderCheckStr; - } - if (is_array($order) && count($order) > 1) { - $message = 'Only one order query param at the time is allowed.'; - } - if (is_array($order) && !in_array(strtoupper(array_values($order)[0]), ['DESC', 'ASC'])) { - $message = 'Please use desc or asc as value for your order query param, not: '.array_values($order)[0]; - } - if (is_array($order) && !in_array(array_keys($order)[0], $orderCheck)) { - $orderCheckStr = implode(', ', $orderCheck); - $message = 'Unsupported order query parameters ('.array_keys($order)[0].'). Supported order query parameters: '.$orderCheckStr; - } - if (isset($message)) { - return [ - 'message' => $message, - 'type' => 'error', - 'path' => is_array($order) ? $entity->getName().'?order['.array_keys($order)[0].']='.array_values($order)[0] : $entity->getName().'?order='.$order, - 'data' => ['order' => $order], - ]; - } - } - $this->stopwatch->stop('orderParametersCheck'); - - // Allowed filters - $this->stopwatch->start('filterParametersCheck', 'handleSearch'); - $filterCheck = $this->em->getRepository('App:ObjectEntity')->getFilterParameters($entity); - - // Lets add generic filters - $filterCheck = array_merge($filterCheck, ['fields', '_fields', 'extend', '_extend']); - if (!empty($entity->getSearchPartial())) { - $filterCheck = array_merge($filterCheck, ['search', '_search']); - } - - foreach ($query as $param => $value) { - if (!in_array($param, $filterCheck)) { - $filterCheckStr = implode(', ', $filterCheck); - - if (is_array($value)) { - $value = end($value); - } - - return [ - 'message' => 'Unsupported queryParameter ('.$param.'). Supported queryParameters: '.$filterCheckStr, - 'type' => 'error', - 'path' => $entity->getName().'?'.$param.'='.$value, - 'data' => ['queryParameter' => $param], - ]; - } - } - - if ($filters) { - $query = array_merge($query, $filters); - } - $this->stopwatch->stop('filterParametersCheck'); - - $this->stopwatch->start('valueScopesToFilters', 'handleSearch'); - $query = array_merge($query, $this->authorizationService->valueScopesToFilters($entity)); - $this->stopwatch->stop('valueScopesToFilters'); - - $this->stopwatch->start('findAndCountByEntity', 'handleSearch'); - $repositoryResult = $this->em->getRepository('App:ObjectEntity')->findAndCountByEntity($entity, $query, $order, $offset, $limit); - $this->stopwatch->stop('findAndCountByEntity'); - - // Lets see if we need to flatten te responce (for example csv use) - // todo: $flat and $acceptType = 'json' should have the same result, so remove $flat? - $flat = false; - if (in_array($request->headers->get('accept'), ['text/csv']) || in_array($extension, ['csv'])) { - $flat = true; - } - - $results = []; - $this->stopwatch->start('renderResults', 'handleSearch'); - foreach ($repositoryResult['objects'] as $object) { - // If orderBy is used on an attribute we needed to add the value of that attribute to the select of the query... - // In this^ case $object will be an array containing the object and this specific value we are ordering on. - if (is_array($object)) { - $object = $object[0]; - // $object['stringValue'] contains the value we are ordering on. - } - // todo: remove the following function - // This is a quick fix for a problem where filtering would return to many result if we are filtering on a value... - // ...that is also present in a subobject of the main $object we are filtering on. - if (!$this->checkIfFilteredCorrectly($query, $object)) { - continue; - } - $result = $this->responseService->renderResult($object, $fields, $extend, $acceptType, false, $flat); - $results[] = $result; - $this->stopwatch->lap('renderResults'); - } - $this->stopwatch->stop('renderResults'); - - // If we need a flattend responce we are al done - // todo: $flat and $acceptType = 'json' should have the same result, so remove $flat? - if ($flat) { - return $results; - } - - // If not lets make it pretty - return $this->handlePagination($acceptType, $entity, $results, $repositoryResult['total'], $limit, $offset); - } - - /** - * This is a quick fix for a problem where filtering would return to many result if we are filtering on a value - * that is also present in a subobject of the main $object we are filtering on. - * todo: remove this function. - * - * @param array $query The query/filters we need to check. - * @param ObjectEntity $object The object to check. - * - * @return bool true by default, false if filtering wasn't done correctly and this object should not be shown in the results. - * @deprecated - */ - private function checkIfFilteredCorrectly(array $query, ObjectEntity $object): bool - { - unset( - $query['search'], $query['_search'], - $query['fields'], $query['_fields'], - $query['extend'], $query['_extend'] - ); - if (!empty($query)) { - $resultDot = new Dot($object->toArray()); - foreach ($query as $filter => $value) { - $filter = str_replace('|valueScopeFilter', '', $filter); - $resultFilter = $resultDot->get($filter); - $resultFilter = $resultFilter === true ? 'true' : ($resultFilter === false ? 'false' : $resultDot->get($filter)); - if (!is_array($value) && $resultDot->get($filter) !== null && $resultFilter != $value && - (is_string($value) && !str_contains($value, 'NULL')) && !str_contains($value, '%')) { - return false; - } - } - } - - return true; - } - - /** - * Returns a response array including pagination for handleSearch function. This response is different depending on the acceptType. - * - * @param string $acceptType - * @param Entity $entity - * @param array $results - * @param int $total - * @param int $limit - * @param int $offset - * - * @return array[] - * @deprecated - */ - private function handlePagination(string $acceptType, Entity $entity, array $results, int $total, int $limit, int $offset): array - { - $pages = ceil($total / $limit); - $pages = $pages == 0 ? 1 : $pages; - $page = floor($offset / $limit) + 1; - - switch ($acceptType) { - case 'jsonhal': - $paginationResult = $this->handleJsonHal($entity, [ - 'results' => $results, 'limit' => $limit, 'total' => $total, - 'offset' => $offset, 'page' => $page, 'pages' => $pages, - ]); - break; - case 'jsonld': - // todo: try and match api-platform ? https://api-platform.com/docs/core/pagination/ - case 'json': - default: - $paginationResult = ['results' => $results]; - $paginationResult = $this->handleDefaultPagination($paginationResult, [ - 'results' => $results, 'limit' => $limit, 'total' => $total, - 'offset' => $offset, 'page' => $page, 'pages' => $pages, - ]); - break; - } - - return $paginationResult; - } - - /** - * @param Entity $entity - * @param array $data - * - * @return array - * @deprecated - */ - private function handleJsonHal(Entity $entity, array $data): array - { - $path = $entity->getName(); - if ($this->session->get('endpoint')) { - $endpoint = $this->em->getRepository('App:Endpoint')->findOneBy(['id' => $this->session->get('endpoint')]); - $path = implode('/', $endpoint->getPath()); - } - $paginationResult['_links'] = [ - 'self' => ['href' => '/api/'.$path.($data['page'] == 1 ? '' : '?page='.$data['page'])], - 'first' => ['href' => '/api/'.$path], - ]; - if ($data['page'] > 1) { - $paginationResult['_links']['prev']['href'] = '/api/'.$path.($data['page'] == 2 ? '' : '?page='.($data['page'] - 1)); - } - if ($data['page'] < $data['pages']) { - $paginationResult['_links']['next']['href'] = '/api/'.$path.'?page='.($data['page'] + 1); - } - $paginationResult['_links']['last']['href'] = '/api/'.$path.($data['pages'] == 1 ? '' : '?page='.$data['pages']); - $paginationResult = $this->handleDefaultPagination($paginationResult, $data); - $paginationResult['_embedded'] = [$path => $data['results']]; //todo replace $path with $entity->getName() ? - - return $paginationResult; - } - - /** - * @param array $paginationResult - * @param array $data - * - * @return array - * @deprecated - */ - private function handleDefaultPagination(array $paginationResult, array $data): array - { - $paginationResult['count'] = count($data['results']); - $paginationResult['limit'] = $data['limit']; - $paginationResult['total'] = $data['total']; - $paginationResult['start'] = $data['offset'] + 1; - $paginationResult['page'] = $data['page']; - $paginationResult['pages'] = $data['pages']; - - return $paginationResult; - } - /** * Handles a delete api call. * @@ -1304,74 +241,4 @@ public function handleDelete(ObjectEntity $object, ArrayCollection $maxDepth = n return []; } - - /** - * @param ObjectEntity $createdObject - * @param ObjectEntity|null $motherObject - * - * @return void - * @deprecated - */ - private function handleDeleteObjectOnError(ObjectEntity $createdObject) - { - $this->em->clear(); - //TODO: test and make sure extern objects are not created after an error, and if they are, maybe add this; - // var_dump($createdObject->getUri()); - // if ($createdObject->getEntity()->getSource() && $createdObject->getEntity()->getSource()->getLocation() && $createdObject->getEntity()->getEndpoint() && $createdObject->getExternalId()) { - // try { - // $resource = $this->commonGroundService->getResource($createdObject->getUri(), [], false); - // var_dump('Delete extern object for: '.$createdObject->getEntity()->getName()); - // $this->commonGroundService->deleteResource(null, $createdObject->getUri()); // could use $resource instead? - // } catch (\Throwable $e) { - // $resource = null; - // } - // } - // var_dump('Delete: '.$createdObject->getEntity()->getName()); - // var_dump('Values on this^ object '.count($createdObject->getObjectValues())); - foreach ($createdObject->getObjectValues() as $value) { - if ($value->getAttribute()->getType() == 'object') { - foreach ($value->getObjects() as $object) { - $object->removeSubresourceOf($value); - } - } - - try { - $this->em->remove($value); - $this->em->flush(); - // var_dump($value->getAttribute()->getEntity()->getName().' -> '.$value->getAttribute()->getName()); - } catch (Exception $exception) { - // var_dump($exception->getMessage()); - // var_dump($value->getId()->toString()); - // var_dump($value->getValue()); - // var_dump($value->getAttribute()->getEntity()->getName().' -> '.$value->getAttribute()->getName().' GAAT MIS'); - continue; - } - } - - try { - $this->em->remove($createdObject); - $this->em->flush(); - // var_dump('Deleted: '.$createdObject->getEntity()->getName()); - } catch (Exception $exception) { - // var_dump($createdObject->getEntity()->getName().' GAAT MIS'); - } - } - - /** - * Builds the error response for an objectEntity that contains errors. - * - * @param ObjectEntity $objectEntity - * - * @return array - * @deprecated - */ - public function returnErrors(ObjectEntity $objectEntity): array - { - return [ - 'message' => 'The where errors', - 'type' => 'error', - 'path' => $objectEntity->getEntity()->getName(), - 'data' => $objectEntity->getAllErrors(), - ]; - } } diff --git a/api/src/Service/FunctionService.php b/api/src/Service/FunctionService.php index 4ac569b10..5bd2a0d2f 100644 --- a/api/src/Service/FunctionService.php +++ b/api/src/Service/FunctionService.php @@ -3,7 +3,6 @@ namespace App\Service; use App\Entity\ObjectEntity; -use Conduction\CommonGroundBundle\Service\CommonGroundService; use Doctrine\Common\Collections\ArrayCollection; use Psr\Cache\InvalidArgumentException; use Symfony\Component\Cache\Adapter\AdapterInterface as CacheInterface; @@ -20,171 +19,14 @@ class FunctionService { private CacheInterface $cache; - private CommonGroundService $commonGroundService; - private ObjectEntityService $objectEntityService; public array $removeResultFromCache; - public function __construct(CacheInterface $cache, CommonGroundService $commonGroundService, ObjectEntityService $objectEntityService) + public function __construct(CacheInterface $cache) { $this->cache = $cache; - $this->commonGroundService = $commonGroundService; - $this->objectEntityService = $objectEntityService; $this->removeResultFromCache = []; } - /** - * Handles the function of an Entity, this can be done in very different situations. That is why the data array should always contains a few specific keys! - * - * @param ObjectEntity $objectEntity - * @param string $function - * @param array $data Should at least contain the following key: method - * - * @return ObjectEntity - */ - public function handleFunction(ObjectEntity $objectEntity, string $function, array $data): ObjectEntity - { - switch ($function) { - case 'organization': - if ($data['method'] == 'POST') { - if (array_key_exists('organizationType', $data) && $data['organizationType']) { - $organizationType = $data['organizationType']; - } else { - $organizationType = $objectEntity->getValue('type'); - } - $objectEntity = $this->createOrganization($objectEntity, $data['uri'], $organizationType); - } - break; - case 'userGroup': - if ($data['method'] == 'PUT') { - if (array_key_exists('userGroupName', $data) && $data['userGroupName']) { - $userGroupName = $data['userGroupName']; - } else { - $userGroupName = $objectEntity->getValue('name'); - } - $objectEntity = $this->updateUserGroup($objectEntity, $userGroupName); - } - break; - default: - break; - } - - return $objectEntity; - } - - //todo: note: this createOrganization function is also used in different places than only the handleFunction function above^ - /** - * Performs the organization function. This is called when a new ObjectEntity is created for an Entity with function = 'organization'. - * - * @param ObjectEntity $objectEntity - * @param string $uri - * @param string|null $organizationType This is nullable so that it won't trigger 500's when no organization type is given, but a nice and correct error (if organization type is configured to be required, as it should) - * - * @return ObjectEntity - */ - public function createOrganization(ObjectEntity $objectEntity, string $uri, ?string $organizationType): ObjectEntity - { - if ($organizationType == 'taalhuis') { - $objectEntity->setOrganization($uri); - - $id = substr($uri, strrpos($uri, '/') + 1); - if (!$organization = $this->isResource($uri)) { - if (!$organization = $this->objectEntityService->getObjectByUri($uri)) { - $organization = $this->objectEntityService->getOrganizationObject($id); - } - } - // Invalidate all changed & related organizations from cache - if (!empty($organization)) { - $tags = ['organization_'.base64_encode($uri)]; - if (array_key_exists('subOrganizations', $organization) && count($organization['subOrganizations']) > 0) { - foreach ($organization['subOrganizations'] as $subOrganization) { - $tags[] = 'organization_'.base64_encode($subOrganization['@id']); - } - } - if (array_key_exists('parentOrganization', $organization) && $organization['parentOrganization'] != null) { - $tags[] = 'organization_'.base64_encode($organization['parentOrganization']['@id']); - } - $this->cache->invalidateTags($tags); - } - } - - return $objectEntity; - } - - /** - * Performs the userGroup function. - * - * @param ObjectEntity $objectEntity - * @param string|null $userGroupName This is nullable so that it won't trigger 500's when no group name is given - * - * @return ObjectEntity - */ - public function updateUserGroup(ObjectEntity $objectEntity, ?string $userGroupName): ObjectEntity - { - if ($userGroupName == 'ANONYMOUS') { - $this->cache->invalidateTags(['anonymousScopes']); - } - - return $objectEntity; - } - - /** - * Gets an organization for an url from cache or url, depending on cache. - * - * @TODO: move this elsewhere. - * - * @param $url - * - * @throws \Psr\Cache\CacheException - * @throws InvalidArgumentException - * - * @return array - */ - public function getOrganizationFromCache($url): array - { - return []; - // todo: stop using this code... deprecated - - $item = $this->cache->getItem('organizations_'.base64_encode("$url")); - if ($item->isHit()) { - return $item->get(); - } - - $id = substr($url, strrpos($url, '/') + 1); - if (!$organization = $this->isResource($url)) { - if (!$organization = $this->objectEntityService->getObjectByUri($url)) { - $organization = $this->objectEntityService->getOrganizationObject($id); - } - } - if (!empty($organization)) { - $item->set($organization); - $item->tag('organization_'.base64_encode("$url")); - - $this->cache->save($item); - - return $organization; - } - - return []; - } - - /** - * IsResource function from commongroundService without caching. - * - * @TODO: Make cache settable in CGB and remove. - * - * @param $url - * - * @return array|false|mixed|string|null - */ - public function isResource($url) - { - try { - return $this->commonGroundService->getResource($url, [], false); - } catch (\Throwable $e) { - return false; - } - } - /** * Removes all responses saved for the given ObjectEntity from the cache. Also does the same for all parent objects of the given object. * Always use $this->functionService->removeResultFromCache = []; before using this function to reset the list of objects that already got removed from cache. diff --git a/api/src/Service/GatewayService.php b/api/src/Service/GatewayService.php index 4e88f9b96..518b23e01 100644 --- a/api/src/Service/GatewayService.php +++ b/api/src/Service/GatewayService.php @@ -23,98 +23,19 @@ */ class GatewayService { - private CommonGroundService $commonGroundService; private EntityManagerInterface $entityManager; private Security $security; - private AuthenticationService $authenticationService; private RequestStack $requestStack; private TranslationService $translationService; - public function __construct(CommonGroundService $commonGroundService, EntityManagerInterface $entityManager, Security $security, AuthenticationService $authenticationService, RequestStack $requestStack, TranslationService $translationService) + public function __construct(EntityManagerInterface $entityManager, Security $security, AuthenticationService $authenticationService, RequestStack $requestStack, TranslationService $translationService) { - $this->commonGroundService = $commonGroundService; $this->entityManager = $entityManager; $this->security = $security; - $this->authenticationService = $authenticationService; $this->requestStack = $requestStack; $this->translationService = $translationService; } - /** - * Processes the call to the Source and returns the response. - * - * @param string $name Name of the Source. - * @param string $endpoint Endpoint of the Source to send the request to. - * @param string $method Method to use against the Source. - * @param string $content Content to send to the Source. - * @param array $query Query parameters to send to the Source. - * - * @return Response Created response received from Source or error received from Source. - */ - public function processSource(string $name, string $endpoint, string $method, string $content, array $query, array $headers): Response - { -// $this->checkAuthentication(); - $source = $this->retrieveSource($name); - if (!$source->getIsEnabled()) { - return new Response( - json_encode(['Message' => "This Source is not enabled: {$name}"]), - Response::HTTP_OK, - ['content-type' => 'application/json'] - ); - } - $this->checkSource($source); - $component = $this->sourceToArray($source); - $url = $source->getLocation().'/'.$endpoint; - - $newHeaders = $source->getHeaders(); - $newHeaders['accept'] = $headers['accept'][0]; - - //update query params - if (array_key_exists('query', $source->getTranslationConfig())) { - $query = array_merge($query, $source->getTranslationConfig()['query']); - } - - //translate query params - foreach ($query as $key => &$value) { - if (!is_array($value)) { - $value = $this->translationService->parse($value); - } - } - - $result = $this->commonGroundService->callService($component, $url, $content, $query, $newHeaders, false, $method); - - if (is_array($result)) { - $result['error'] = json_decode($result['error'], true); - - return new Response( - json_encode($result), - Response::HTTP_OK, - ['content-type' => 'application/json'] - ); - } - - return $this->createResponse($result); - } - - public function checkAuthentication(): void - { - $request = $this->requestStack->getCurrentRequest(); - $authorized = true; - $user = $this->security->getUser(); - - $token = str_replace('Bearer ', '', $request->headers->get('Authorization')); - - if (!$user) { - $authorized = $this->authenticationService->validateJWTAndGetPayload($token, $this->commonGroundService->getResourceList(['component' => 'uc', 'type' => 'public_key'])); - $authorized = $this->authenticationService->checkJWTExpiration($token); - $authorized = $this->authenticationService->retrieveJWTUser($token); - } - - if (!$authorized) { - throw new AccessDeniedHttpException('Access denied.'); - } - } - /** * Creates Response object based on the guzzle response. * diff --git a/api/src/Service/HandlerService.php b/api/src/Service/HandlerService.php index bc1219d9a..2e119d0db 100644 --- a/api/src/Service/HandlerService.php +++ b/api/src/Service/HandlerService.php @@ -41,7 +41,6 @@ class HandlerService private LogService $logService; private ProcessingLogService $processingLogService; private TemplateService $templateService; - private ObjectEntityService $objectEntityService; private CacheInterface $cache; private GatewayService $gatewayService; private Stopwatch $stopwatch; @@ -78,7 +77,6 @@ public function __construct( ProcessingLogService $processingLogService, Environment $twig, TemplateService $templateService, - ObjectEntityService $objectEntityService, CacheInterface $cache, GatewayService $gatewayService, Stopwatch $stopwatch, @@ -94,7 +92,6 @@ public function __construct( $this->processingLogService = $processingLogService; $this->templating = $twig; $this->templateService = $templateService; - $this->objectEntityService = $objectEntityService->addServices($eavService); // todo: temp fix untill we no longer need these services here $this->cache = $cache; $this->gatewayService = $gatewayService; $this->stopwatch = $stopwatch; @@ -102,227 +99,7 @@ public function __construct( $this->requestService = $requestService; } - /** - * This function sets the endpoint in the session and executes handleHandler with its found Handler. - */ - public function handleEndpoint(Endpoint $endpoint, array $parameters): Response - { - $this->stopwatch->start('invalidateTags-grantedScopes', 'handleEndpoint'); - $this->cache->invalidateTags(['grantedScopes']); - $this->stopwatch->stop('invalidateTags-grantedScopes'); - - $event = new ActionEvent('commongateway.handler.pre', ['request' => $this->getDataFromRequest(), 'response' => []]); - $this->stopwatch->start('newSession', 'handleEndpoint'); - $session = new Session(); - $this->stopwatch->stop('newSession'); - - $this->stopwatch->start('saveEndpointInSession', 'handleEndpoint'); - $session->set('endpoint', $endpoint->getId()->toString()); - $this->stopwatch->stop('saveEndpointInSession'); - - $this->stopwatch->start('saveParametersInSession', 'handleEndpoint'); - $session->set('parameters', $parameters); - $this->stopwatch->stop('saveParametersInSession'); - $this->eventDispatcher->dispatch($event, 'commongateway.handler.pre'); - - // @todo creat logicdata, generalvaribales uit de translationservice - - $this->stopwatch->start('handleHandlers', 'handleEndpoint'); - foreach ($endpoint->getHandlers() as $handler) { - // Check if handler should be used for this method - if ($handler->getMethods() !== null) { - $methods = array_map('strtoupper', $handler->getMethods()); - } - if (!in_array('*', $methods) && !in_array($this->request->getMethod(), $methods)) { - $this->stopwatch->lap('handleHandlers'); - continue; - } - if ($handler->getConditions() === '{}' || JsonLogic::apply(json_decode($handler->getConditions(), true), $this->getDataFromRequest())) { - $this->stopwatch->start('saveHandlerInSession', 'handleEndpoint'); - $session->set('handler', $handler->getId()); - $this->stopwatch->stop('saveHandlerInSession'); - - $this->stopwatch->start('handleHandler', 'handleEndpoint'); - $result = $this->handleHandler($handler, $endpoint, $event->getData()['request'] ?: []); - $this->stopwatch->stop('handleHandler'); - $this->stopwatch->stop('handleHandlers'); - - $event = new ActionEvent('commongateway.handler.post', array_merge($event->getData(), ['result' => $result])); - $this->eventDispatcher->dispatch($event, 'commongateway.handler.post'); - - return $result; - } - } - - // If no handlers are found check if endpoint throws events - // Throw event if set - if ($endpoint->getThrows() !== null || !empty($endpoint->getThrows())) { - if (count($endpoint->getThrows()) == 0) { - return $this->requestService->requestHandler($parameters, []); - } - - // Will use the first throw in array - foreach ($endpoint->getThrows() as $throw) { - if ($this->request->getMethod() == 'POST' || $this->request->getMethod() == 'PUT') { - $response = json_decode($this->requestService->requestHandler($parameters, [])->getContent(), true); - $event = new ActionEvent('commongateway.action.event', ['request' => $this->getDataFromRequest(), 'response' => $response, 'parameters' => $this->request], $throw); - $this->eventDispatcher->dispatch($event, 'commongateway.action.event'); - } else { - $event = new ActionEvent('commongateway.action.event', ['request' => $this->getDataFromRequest(), 'response' => [], 'parameters' => $this->request], $throw); - $this->eventDispatcher->dispatch($event, 'commongateway.action.event'); - - return $this->requestService->requestHandler($parameters, []); - } - } - - return $this->createResponse($event->getData()['response'], $endpoint); - } - - // Let default - return $this->requestService->requestHandler($parameters, []); - - // - //throw new GatewayException('No handler found for endpoint: '.$endpoint->getName().' and method: '.$this->request->getMethod(), null, null, ['data' => ['id' => $endpoint->getId()], 'path' => null, 'responseType' => Response::HTTP_NOT_FOUND]); - } - - public function cutPath(array $pathParams): string - { - $path = parse_url($this->request->getUri())['path']; - - return substr($path, strlen('/api/'.$pathParams[0])); - } - - public function proxy(Handler $handler, Endpoint $endpoint, string $method): Response - { - $path = $this->cutPath($endpoint->getPath()); - - return $this->gatewayService->processSource($handler->getProxyGateway(), $path, $method, $this->request->getContent(), $this->request->query->all(), $this->request->headers->all()); - } - - public function getMethodOverrides(string &$method, ?string &$operationType, Handler $handler) - { - $overrides = $handler->getMethodOverrides(); - if (!isset($overrides[$this->request->getMethod()])) { - return; - } - $content = new \Adbar\Dot($this->getDataFromRequest()); - - foreach ($overrides[$this->request->getMethod()] as $override) { - if (key_exists($method, $overrides) && (!array_key_exists('condition', $override) || $content->has($override['condition']))) { - $method = array_key_exists('method', $override) ? $override['method'] : $method; - $operationType = array_key_exists('operationType', $override) ? $override['operationType'] : $operationType; - $parameters = $this->request->getSession()->get('parameters'); - if (isset($override['pathValues'])) { - foreach ($override['pathValues'] as $key => $value) { - $parameters['path'][$key] = $content->get($value); - } - } - if (isset($override['queryParameters'])) { - foreach ($override['queryParameters'] as $key => $value) { - if ($key == 'fields' || $key == '_fields') { - $this->request->query->set('fields', $value); - } else { - $this->request->query->set($key, $content->get($value)); - } - } - } - $this->request->getSession()->set('parameters', $parameters); - } elseif (key_exists($method, $overrides) && (!array_key_exists('condition', $override) || $this->request->query->has($override['condition']))) { - $method = array_key_exists('method', $override) ? $override['method'] : $method; - $operationType = array_key_exists('operationType', $override) ? $override['operationType'] : $operationType; - $parameters = $this->request->getSession()->get('parameters'); - foreach ($override['pathValues'] as $key => $value) { - $parameters['path'][$key] = $this->request->query->get($value); - } - - $this->request->getSession()->set('parameters', $parameters); - } - } - } - - /** - * This function walks through the $handler with $data from the request to perform mapping, translating and fetching/saving from/to the eav. - * - * @todo remove old eav code if new way is finished and working - * @todo better check if $data is a document/template line 199 - */ - public function handleHandler(Handler $handler = null, Endpoint $endpoint, array $data = []): Response - { - $originalData = $data; - $method = $this->request->getMethod(); - $operationType = $endpoint->getOperationType(); - - if ($handler->getProxyGateway()) { - return $this->proxy($handler, $endpoint, $method); - } - - $this->getMethodOverrides($method, $operationType, $handler); - - // Form.io components array - // if ($method === 'GET' && $this->getRequestType('accept') === 'form.io' && $handler->getEntity() && $handler->getEntity()->getAttributes()) { - // return new Response( - // $this->serializer->serialize($this->formIOService->createFormIOArray($handler->getEntity()), 'json'), - // Response::HTTP_OK, - // ['content-type' => 'json'] - // ); - // } - - // To start it al off we need the data from the incomming request - if (in_array($method, ['POST', 'PUT', 'PATCH']) && ($data == null || empty($data))) { - throw new GatewayException('Faulty body or no body given', null, null, ['data' => null, 'path' => 'Request body', 'responseType' => Response::HTTP_NOT_FOUND]); - } - - // Update current Log - isset($data) ? $this->logService->saveLog($this->request, null, 0, json_encode($data)) : $this->logService->saveLog($this->request, null, 0, null); - - // Only do mapping and translation -in for calls with body - in_array($method, ['POST', 'PUT', 'PATCH']) && $handler && $data = $this->handleDataBeforeEAV($data, $handler); - - // eav new way - // dont get collection if accept type is formio - if (($this->getRequestType('accept') === 'form.io' && ($method === 'GET' && $operationType === 'item')) || $this->getRequestType('accept') !== 'form.io') { - $handler->getEntity() !== null && $data = $this->objectEntityService->handleObject($handler, $endpoint, $data ?? null, $method, $this->getRequestType('accept')); - } - - // Form.io components array - if ($method === 'GET' && $this->getRequestType('accept') === 'form.io' && $handler->getEntity() && $handler->getEntity()->getAttributes()) { - return new Response( - $this->serializer->serialize($this->formIOService->createFormIOArray($handler->getEntity(), $data ?? null), 'json'), - Response::HTTP_OK, - ['content-type' => 'json'] - ); - } - - // @todo remove this when eav part works and catch this->objectEntityService->handleObject instead - if (!isset($data)) { - throw new GatewayException('Could not fetch object(s) on endpoint: /'.implode('/'.$endpoint->getPath()), null, null, ['data' => null, 'path' => null, 'responseType' => Response::HTTP_NOT_FOUND]); - } - - // If data contains error dont execute following code and create response - if (!(isset($data['type']) && isset($data['message']))) { - // Update current Log - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, null, 2, json_encode($data)); - $event = new ActionEvent('commongateway.response.pre', ['entity' => $handler->getEntity()->getReference() ?? $handler->getEntity()->getReference(), 'httpRequest' => $this->request, 'request' => $originalData, 'response' => $data, 'queryParameters' => $this->request->query->all()]); - $this->eventDispatcher->dispatch($event, 'commongateway.response.pre'); - $data = $event->getData()['response']; - - $handler && $data = $this->handleDataAfterEAV($data, $handler); - } - - // Update current Log - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, null, 3, json_encode($data)); - - // An lastly we want to create a response - $response = $this->createResponse($data, $endpoint); - - // Final update Log - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, $response, 4, null, true); - - $this->processingLogService->saveProcessingLog(); - - return $response; - } /** * Checks content type and decodes that if needed. @@ -364,112 +141,6 @@ public function getDataFromRequest() } } - /** - * This function creates and prepares the response. - * - * @todo throw error if $data is not string when creating pdf - */ - public function createResponse(array $data, ?Endpoint $endpoint = null): Response - { - // We only end up here if there are no errors, so we only suply best case senario's - switch ($this->request->getMethod()) { - case 'GET': - $status = Response::HTTP_OK; - break; - case 'POST': - $status = Response::HTTP_CREATED; - break; - case 'PUT': - $status = Response::HTTP_OK; - break; - case 'UPDATE': - $status = Response::HTTP_OK; - break; - case 'DELETE': - $status = Response::HTTP_NO_CONTENT; - break; - default: - $status = Response::HTTP_OK; - } - - $this->stopwatch->start('getRequestType', 'createResponse'); - $acceptType = $this->getRequestType('accept', $endpoint); - $this->stopwatch->stop('getRequestType'); - - // Lets fill in some options - $options = []; - $this->stopwatch->start('switchAcceptType', 'createResponse'); - switch ($acceptType) { - case 'text/csv': - // @todo do something with options? - $options = [ - CsvEncoder::ENCLOSURE_KEY => '"', - CsvEncoder::ESCAPE_CHAR_KEY => '+', - ]; - $data = $this->serializer->encode($data, 'csv'); - - break; - case 'pdf': - $document = new Document(); - // @todo find better name for document - $document->setName('pdf'); - $document->setDocumentType($acceptType); - $document->setType('pdf'); - // If data is not a template json_encode it - if (isset($data) && !is_string($data)) { - $data = json_encode($data); - } - $document->setContent($data); - $result = $this->templateService->renderPdf($document); - break; - case 'xml': - $options['xml_root_node_name'] = array_keys($data)[0]; - $options['xml_encoding'] = 'utf-8'; - $data = $data[array_keys($data)[0]]; - break; - } - $this->stopwatch->stop('switchAcceptType'); - - // Lets seriliaze the shizle (if no document and we have a result) - $this->stopwatch->start('serialize', 'createResponse'); - - try { - !isset($document) && $result = $this->serializer->serialize($data, $acceptType, $options); - } catch (NotEncodableValueException $e) { - !isset($document) && $result = $this->serializer->serialize($data, 'json', $options); - // throw new GatewayException($e->getMessage(), null, null, ['data' => null, 'path' => null, 'responseType' => Response::HTTP_UNSUPPORTED_MEDIA_TYPE]); - } - $this->stopwatch->stop('serialize'); - - // Lets create the actual response - $this->stopwatch->start('newResponse', 'createResponse'); - $response = new Response( - $result, - $status, -// ['content-type' => $this->acceptHeaderToSerialiazation[array_search($acceptType, $this->acceptHeaderToSerialiazation)]] - //todo: should be ^ for taalhuizen we need accept = application/json to result in content-type = application/json - ['content-type' => array_search($acceptType, $this->acceptHeaderToSerialiazation)] - ); - $this->stopwatch->stop('newResponse'); - - // Lets handle file responses - $this->stopwatch->start('routeParameters', 'createResponse'); - $routeParameters = $this->request->attributes->get('_route_params'); - if (array_key_exists('extension', $routeParameters) && $extension = $routeParameters['extension']) { - $date = new \DateTime(); - $date = $date->format('Ymd_His'); - $disposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, "{$routeParameters['route']}_{$date}.{$acceptType}"); - $response->headers->set('Content-Disposition', $disposition); - } - $this->stopwatch->stop('routeParameters'); - - $this->stopwatch->start('prepareResponse', 'createResponse'); - $response->prepare($this->request); - $this->stopwatch->stop('prepareResponse'); - - return $response; - } - /** * Validates content or accept type from request. * @@ -510,115 +181,6 @@ public function getRequestType(string $type, ?Endpoint $endpoint = null): string throw new GatewayException('Unsupported content type', null, null, ['data' => $this->request->getAcceptableContentTypes(), 'path' => null, 'responseType' => Response::HTTP_UNSUPPORTED_MEDIA_TYPE]); } - /** - * Checks template type on handler and creates template. - * - * @todo Add global variables - */ - private function renderTemplate(Handler $handler, array $data): string - { - /* @todo add global variables */ - $variables = $data; - - // We only end up here if there are no errors, so we only suply best case senario's - switch (strtoupper($handler->getTemplateType())) { - case 'TWIG': - $document = $this->templating->createTemplate($handler->getTemplate()); - - return $document->render($variables); - break; - case 'MD': - return $handler->getTemplate(); - break; - case 'RST': - return $handler->getTemplate(); - break; - case 'HTML': - return $handler->getTemplate(); - break; - default: - throw new GatewayException('Unsupported template type', null, null, ['data' => $this->request->getAcceptableContentTypes(), 'path' => null, 'responseType' => Response::HTTP_UNSUPPORTED_MEDIA_TYPE]); - } - } - - private function handleDataBeforeEAV(array $data, Handler $handler): array - { - // Then we want to do the mapping in the incomming request - $skeleton = $handler->getSkeletonIn(); - if (!$skeleton || empty($skeleton)) { - $skeleton = $data; - } - - $data = $this->translationService->dotHydrator($skeleton, $data, $handler->getMappingIn()); - - // Update current Log - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, null, 5, json_encode($data)); - - if (!empty($handler->getTranslationsIn())) { - // Then we want to do translations on the incomming request - $transRepo = $this->entityManager->getRepository('App:Translation'); - - $translations = $transRepo->getTranslations($handler->getTranslationsIn()); - - if (!empty($translations)) { - $data = $this->translationService->parse($data, true, $translations); - } - } - // Update current Log - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, null, 6, json_encode($data)); - - return $data; - } - - private function handleDataAfterEAV(array $data, Handler $handler): array - { - $data = $this->translationService->addPrefix($data, $handler->getPrefix()); - - // Then we want to do to mapping on the outgoing response - $skeleton = $handler->getSkeletonOut(); - if (!$skeleton || empty($skeleton)) { - $skeleton = $data; - } - $this->stopwatch->start('dotHydrator2', 'handleDataAfterEAV'); - $data = $this->translationService->dotHydrator($skeleton, $data, $handler->getMappingOut()); - - $this->stopwatch->stop('dotHydrator2'); - - // Update current Log - $this->stopwatch->start('saveLog7', 'handleDataAfterEAV'); - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, null, 7, json_encode($data)); - $this->stopwatch->stop('saveLog7'); - - if (!empty($handler->getTranslationsOut())) { - // Then we want to do translations on the outgoing response - $transRepo = $this->entityManager->getRepository('App:Translation'); - - $this->stopwatch->start('getTranslations2', 'handleDataAfterEAV'); - $translations = $transRepo->getTranslations($handler->getTranslationsOut()); - $this->stopwatch->stop('getTranslations2'); - - if (!empty($translations)) { - $this->stopwatch->start('parse2', 'handleDataAfterEAV'); - $data = $this->translationService->parse($data, true, $translations); - $this->stopwatch->stop('parse2'); - } - } - - // Update current Log - $this->stopwatch->start('saveLog8', 'handleDataAfterEAV'); - $this->request->getMethod() !== 'DELETE' && $this->logService->saveLog($this->request, null, 8, json_encode($data)); - $this->stopwatch->stop('saveLog8'); - - // Lets see if we need te use a template - if ($handler->getTemplatetype() && $handler->getTemplate()) { - $this->stopwatch->start('renderTemplate', 'handleDataAfterEAV'); - $data = $this->renderTemplate($handler, $data); - $this->stopwatch->stop('renderTemplate'); - } - - return $data; - } - /** * Gets a handler for an endpoint method combination. * diff --git a/api/src/Service/ObjectEntityService.php b/api/src/Service/ObjectEntityService.php index 4b4be82b8..416afec53 100644 --- a/api/src/Service/ObjectEntityService.php +++ b/api/src/Service/ObjectEntityService.php @@ -52,60 +52,23 @@ class ObjectEntityService { private Security $security; - private Request $request; - private AuthorizationService $authorizationService; - private ApplicationService $applicationService; -// private ValidatorService $validatorService; private SessionInterface $session; - private ?EavService $eavService; private EntityManagerInterface $entityManager; - private CommonGroundService $commonGroundService; - private ResponseService $responseService; - public FunctionService $functionService; - private MessageBusInterface $messageBus; - private GatewayService $gatewayService; - private LogService $logService; private EventDispatcherInterface $eventDispatcher; public array $notifications; - private Environment $twig; private SymfonyStyle $io; - private TranslationService $translationService; public function __construct( Security $security, - RequestStack $requestStack, - AuthorizationService $authorizationService, - ApplicationService $applicationService, -// ValidatorService $validatorService, SessionInterface $session, EntityManagerInterface $entityManager, - CommonGroundService $commonGroundService, - ResponseService $responseService, - CacheInterface $cache, - MessageBusInterface $messageBus, - GatewayService $gatewayService, - TranslationService $translationService, - LogService $logService, - EventDispatcherInterface $eventDispatcher, - Environment $twig + EventDispatcherInterface $eventDispatcher ) { $this->security = $security; - $this->request = $requestStack->getCurrentRequest() ?: new Request(); - $this->authorizationService = $authorizationService; - $this->applicationService = $applicationService; -// $this->validatorService = $validatorService; $this->session = $session; $this->entityManager = $entityManager; - $this->commonGroundService = $commonGroundService; - $this->responseService = $responseService; - $this->functionService = new FunctionService($cache, $commonGroundService, $this); - $this->messageBus = $messageBus; - $this->gatewayService = $gatewayService; - $this->translationService = $translationService; - $this->logService = $logService; $this->notifications = []; $this->eventDispatcher = $eventDispatcher; - $this->twig = $twig; } /** @@ -216,64 +179,6 @@ private function dispatchTriggerParentEvents(ObjectEntity $object, ArrayCollecti } } - /** - * Add services for using the handleObject function todo: temp fix untill we no longer use these services here. - * - * @param EavService $eavService - * - * @return $this - * @deprecated - */ - public function addServices(EavService $eavService): ObjectEntityService - { - // EavService uses the ObjectEntityService for the handleOwner and checkOwner function. - // The only reason we need this service in this ObjectEntityService is for the handleObject function, - // because we use an 'old' way to create, update and get ObjectEntities there. - $this->eavService = $eavService; - - return $this; - } - - /** - * A function we want to call when doing a post or put, to set the owner of an ObjectEntity, if it hasn't one already. - * - * @param ObjectEntity $result The object entity - * @param string|null $owner The owner of the object - defaulted to owner - * - * @return ObjectEntity|array - * @deprecated - */ - public function handleOwner(ObjectEntity $result, ?string $owner = 'owner') - { - $user = $this->security->getUser(); - - if ($user && !$result->getOwner()) { - if ($owner == 'owner') { - $result->setOwner($user->getUserIdentifier()); - } else { - // $owner is allowed to be null or a valid uuid of a UC user - if ($owner !== null) { - if (!Uuid::isValid($owner)) { - $errorMessage = '@owner ('.$owner.') is not a valid uuid.'; - } elseif (!$this->commonGroundService->isResource($this->commonGroundService->cleanUrl(['component' => 'uc', 'type' => 'users', 'id' => $owner]))) { - $errorMessage = '@owner ('.$owner.') is not an existing user uuid.'; - } - if (isset($errorMessage)) { - return [ - 'message' => $errorMessage, - 'type' => 'Bad Request', - 'path' => $result->getEntity()->getName(), - 'data' => ['@owner' => $owner], - ]; - } - } - $result->setOwner($owner); - } - } - - return $result; - } - /** * This function checks the owner of the object. * @@ -293,1888 +198,4 @@ public function checkOwner(ObjectEntity $result): bool return false; } - - /** - * This function gets the object by its uri. - * - * @param string $uri The uri of the object - * @param array|null $fields The fields array that can be filtered on - * @param array|null $extend The extend array that can be extended - * - * @throws CacheException|InvalidArgumentException - * - * @return array - * @deprecated - */ - public function getObjectByUri(string $uri, ?array $fields = null, ?array $extend = null): array - { - $object = $this->entityManager->getRepository('App:ObjectEntity')->findOneBy(['uri' => $uri]); - if ($object instanceof ObjectEntity) { - return $this->responseService->renderResult($object, $fields, $extend, 'jsonld', true); - } - - return []; - } - - /** - * This function gets the object with its id and the related entity. - * - * @param Entity $entity The entity the object relates to - * @param string $id The id of the object entity - * @param array|null $fields The fields array that can be filtered on - * @param array|null $extend The extend array that can be extended - * - * @throws CacheException|InvalidArgumentException - * - * @return array - * @deprecated - */ - public function getObject(Entity $entity, string $id, ?array $fields = null, ?array $extend = null): array - { - $object = $this->entityManager->getRepository('App:ObjectEntity')->findOneBy(['entity' => $entity, 'id' => $id]); - if ($object instanceof ObjectEntity) { - return $this->responseService->renderResult($object, $fields, $extend, 'jsonld', true); - } - - return []; - } - - /** - * This function gets an object with the function set to person. - * - * @param string $id The id of the object entity - * @param array|null $fields The fields array that can be filtered on - * @param array|null $extend The extend array that can be extended - * - * @throws CacheException|InvalidArgumentException - * - * @return array - */ - public function getPersonObject(string $id, ?array $fields = null, ?array $extend = null): array - { - $entity = $this->entityManager->getRepository('App:Entity')->findOneBy(['function' => 'person']); - if ($entity instanceof Entity) { - return $this->getObject($entity, $id, $fields, $extend); - } - - return []; - } - - /** - * This function gets an object with the function set to organization. - * - * @param string $id The id of the object entity - * @param array|null $fields The fields array that can be filtered on - * @param array|null $extend The extend array that can be extended - * - * @throws CacheException|InvalidArgumentException - * - * @return array - */ - public function getOrganizationObject(string $id, ?array $fields = null, ?array $extend = null): array - { - $entity = $this->entityManager->getRepository('App:Entity')->findOneBy(['function' => 'organization']); //todo cache this!? - if ($entity instanceof Entity) { - return $this->getObject($entity, $id, $fields, $extend); - } - - return []; - } - - /** - * @TODO - * - * @param string $username The username of the person - * @param array|null $fields The fields array that can be filtered on - * @param array|null $extend The extend array that can be extended - * - * @throws CacheException|InvalidArgumentException - * - * @return array - */ - public function getUserObjectEntity(string $username, ?array $fields = null, ?array $extend = null): array - { - // Because inversedBy wil not set the UC->user->person when creating a person with a user in the gateway. - // We need to do this in order to find the person of this user: - $entity = $this->entityManager->getRepository('App:Entity')->findOneBy(['name' => 'users']); - - if ($entity == null) { - return []; - } - - $objects = $this->entityManager->getRepository('App:ObjectEntity')->findByEntity($entity, ['username' => $username]); - if (count($objects) == 1) { - $user = $this->responseService->renderResult($objects[0], $fields, $extend, 'jsonld', true); - // This: will be false if a user has no rights to do get on a person object - if (isset($user['person'])) { - return $user['person']; - } - } - - return []; - } - - /** - * This function get the filters array from the parameters. - * - * @return array - * @deprecated - */ - private function getFilterFromParameters(): array - { - if ($parameters = $this->session->get('parameters')) { - if (array_key_exists('path', $parameters)) { - foreach ($parameters['path'] as $key => $part) { - if ($key[0] === '{' && $key[strlen($key) - 1] === '}' && $part !== null) { - $key = substr($key, 1, -1); - $filters[$key] = $part; - - return $filters; - } else { - // @todo - } - } - } - } - - return []; - } - - /** - * This function handles the check for an object. - * - * @param string|null $id The id of the object - * @param string|null $method Method from request if there is a request - * @param Entity $entity The entity of the object - * - * @throws GatewayException - * - * @return ObjectEntity|array|mixed|null - * @deprecated - */ - public function checkGetObject(?string $id, string $method, Entity $entity) - { - // todo: re-used old code for getting an objectEntity - $object = $this->eavService->getObject($method === 'POST' ? null : $id, $method, $entity); - - if (is_array($object) && array_key_exists('type', $object) && $object['type'] == 'Bad Request') { - throw new GatewayException($object['message'], null, null, ['data' => $object['data'], 'path' => $object['path'], 'responseType' => Response::HTTP_BAD_REQUEST]); - } // Let's check if the user is allowed to view/edit this resource. - - if (!$method == 'POST' && !$this->checkOwner($object)) { - // TODO: do we want to throw a different error if there are no organizations in the session? (because of logging out for example) - if ($object->getOrganization() && !in_array($object->getOrganization(), $this->session->get('organizations') ?? [])) { - throw new GatewayException('You are forbidden to view or edit this resource.', null, null, ['data' => ['id' => $id ?? null], 'path' => $entity->getName(), 'responseType' => Response::HTTP_FORBIDDEN]); - } - } - - if ($object instanceof ObjectEntity && $object->getId() !== null) { - $this->session->set('object', $object->getId()->toString()); - } - - // Check for scopes, if forbidden to view/edit this, throw forbidden error - if (!isset($object) || is_array($object) || !$object->getUri() || !$this->checkOwner($object)) { - try { - //TODO what to do if we do a get collection and want to show objects this user is the owner of, but not any other objects? - $this->authorizationService->checkAuthorization([ - 'method' => $method, - 'entity' => $entity, - 'object' => $object ?? null, - ]); - } catch (AccessDeniedException $e) { - throw new GatewayException($e->getMessage(), null, null, ['data' => null, 'path' => $entity->getName(), 'responseType' => Response::HTTP_FORBIDDEN]); - } - } - - return $object; - } - - /** - * This function handles the check on operation types exceptions. - * - * @param Endpoint $endpoint The endpoint of the object - * @param Entity $entity The entity of the object - * @param array $data Data to be set into the eav - * - * @throws GatewayException - * - * @return ObjectEntity|string[]|void - * @deprecated - */ - public function checkGetOperationTypeExceptions(Endpoint $endpoint, Entity $entity, array &$data) - { - $operationType = $endpoint->getOperationType(); - if (((isset($operationType) && $operationType === 'item') || $endpoint->getOperationType() === 'item') && array_key_exists('results', $data) && count($data['results']) == 1) { // todo: $data['total'] == 1 - $data = $data['results'][0]; - isset($data['id']) && Uuid::isValid($data['id']) ?? $this->session->set('object', $data['id']); - } elseif ((isset($operationType) && $operationType === 'item') || $endpoint->getOperationType() === 'item') { - throw new GatewayException('No object found with these filters', null, null, ['data' => $filters ?? null, 'path' => $entity->getName(), 'responseType' => Response::HTTP_BAD_REQUEST]); - } - - return $data; - } - - /** - * This function handles the object entity exceptions. - * - * - * @param array|null $data Data to be set into the eav - * @param ObjectEntity|null $object The objects that is being checked on exceptions - * @param array|null $fields The fields array that can be filtered on - * @param array|null $extend The extend array that can be extended - * @param string $acceptType The acceptType of the call - defaulted to jsonld - * - * @throws CacheException - * @throws InvalidArgumentException - * - * @return string[] - * @deprecated - */ - public function checkGetObjectExceptions(?array &$data, ?ObjectEntity $object, ?array $fields, ?array $extend, string $acceptType): array - { - if ($object instanceof ObjectEntity) { - !$object->getSelf() ?? $object->setSelf($this->createSelf($object)); - if (isset($extend['x-commongateway-metadata']['dateRead']) - || isset($extend['x-commongateway-metadata']['all'])) { - $extend['x-commongateway-metadata']['dateRead'] = 'getItem'; - } - $data = $this->eavService->handleGet($object, $fields, $extend, $acceptType); - } else { - $data['error'] = $object; - } - - return $data; - } - - /** - * Gets fields and extend from the query params used in the request. - * - * @return array An array containing 2 keys: 'fields' & 'extend'. - * @deprecated - */ - private function getRequestQueryParams(): array - { - $fields = $this->eavService->getRequestFields($this->request); - - // Let's allow for extending - $extend = $this->eavService->getRequestExtend($this->request); - if (isset($extend['x-commongateway-metadata']) && $extend['x-commongateway-metadata'] === true) { - $extend['x-commongateway-metadata'] = []; - $extend['x-commongateway-metadata']['all'] = true; - } - - return [ - 'fields' => $fields, - 'extend' => $extend, - ]; - } - - /** - * This function handles the get case of an object entity. - * - * @param string|null $id The id of the object - * @param array|null $data Data to be set into the eav - * @param string $method The method of the call - * @param Entity $entity The entity of the object - * @param Endpoint|null $endpoint The endpoint of the object - * @param string $acceptType The acceptType of the call - defaulted to jsonld - * - * @throws CacheException - * @throws GatewayException - * @throws InvalidArgumentException - * - * @return array - * @deprecated - */ - public function getCase(?string $id, ?array &$data, string $method, Entity $entity, ?Endpoint $endpoint, string $acceptType): array - { - $queryParamData = $this->getRequestQueryParams(); - - if (isset($id)) { - $object = $this->checkGetObject($id, $method, $entity); - $data = $this->checkGetObjectExceptions($data, $object, $queryParamData['fields'], $queryParamData['extend'], $acceptType); - } else { - $data = $this->eavService->handleSearch( - $entity, - $this->request, - $queryParamData['fields'], - $queryParamData['extend'], - false, - $filters ?? [], - $acceptType - ); - - if (isset($endpoint)) { - $this->session->get('endpoint') ?? $data = $this->checkGetOperationTypeExceptions($endpoint, $entity, $data); - } - } - - return $data; - } - - /** - * This function checks and unsets the owner of the body of the call. - * - * @param array $data Data to be set into the eav - * - * @return string|null - * @deprecated - */ - public function checkAndUnsetOwner(array &$data): ?string - { - // todo: what about @organization? (See saveObject function, test it first, look at and compare with old code!) - // Check if @owner is present in the body and if so unset it. - // note: $owner is allowed to be null! - $owner = 'owner'; - if (array_key_exists('@owner', $data)) { - $owner = $data['@owner']; - unset($data['@owner']); - } - - return $owner; - } - - /** - * This function handles creating, updating and patching the object. - * - * @param array $data Data to be set into the eav - * @param ObjectEntity $object The objects that needs to be created/updated - * @param string $owner The owner of the object - * @param string $method The method of the call - * @param string $acceptType The acceptType of the call - defaulted to jsonld - * - * @throws CacheException - * @throws InvalidArgumentException - * - * @return string[] - * @deprecated - */ - public function createOrUpdateCase(array &$data, ObjectEntity $object, string $owner, string $method, string $acceptType): array - { - $queryParamData = $this->getRequestQueryParams(); - - // Save the object (this will remove this object result from the cache) - $this->functionService->removeResultFromCache = []; - $object = $this->saveObject($object, $data); - - // Handle Entity Function (note that this might be overwritten when handling the promise later!) - $object = $this->functionService->handleFunction($object, $object->getEntity()->getFunction(), [ - 'method' => $method, - 'uri' => $object->getUri(), - 'organizationType' => array_key_exists('type', $data) ? $data['type'] : null, - 'userGroupName' => array_key_exists('name', $data) ? $data['name'] : null, - ]); - - $this->handleOwner($object, $owner); // note: $owner is allowed to be null! - $object->setDateModified(new DateTime()); - - $this->entityManager->persist($object); - $this->entityManager->flush(); - - $data = $this->responseService->renderResult($object, $queryParamData['fields'], $queryParamData['extend'], $acceptType); - - return $data; - } - - /** - * This function handles deleting the object. - * - * @param string $id the id of the object - * @param array|null $data Data to be set into the eav - * @param string $method The method of the call - * @param Entity $entity The entity of the object - * - * @throws GatewayException - * @throws InvalidArgumentException - * - * @return string[] - * @deprecated - */ - public function deleteCase(string $id, ?array &$data, string $method, Entity $entity): array - { - $object = $this->checkGetObject($id, $method, $entity); - //todo: use PromiseMessage for delete promise and notification (re-use / replace code from eavService->handleDelete - - //todo: -start- old code... - //TODO: old code for deleting an ObjectEntity - - // delete object (this will remove this object result from the cache) - $this->functionService->removeResultFromCache = []; - $data = $this->eavService->handleDelete($object); - if (array_key_exists('type', $data) && $data['type'] == 'Forbidden') { - throw new GatewayException($data['message'], null, null, ['data' => $data['data'], 'path' => $data['path'], 'responseType' => Response::HTTP_FORBIDDEN]); - } - //todo: -end- old code... - - return $data; - } - - /** - * Saves an ObjectEntity in the DB using the $post array. NOTE: validation is and should only be done by the validatorService->validateData() function this saveObject() function only saves the object in the DB. - * - * @param array|null $data Data to be set into the eav - * @param Endpoint|null $endpoint The endpoint of the object - * @param Entity $entity The entity of the object - * @param string|null $id The id of the object - * @param string $method The method of the call - * @param string $acceptType The acceptType of the call - defaulted to jsonld - * - * @throws CacheException - * @throws ComponentException - * @throws GatewayException - * @throws InvalidArgumentException - * - * @return string[]|void - * @deprecated - */ - public function switchMethod(?array &$data, ?Endpoint $endpoint, Entity $entity, string $id = null, string $method = 'GET', string $acceptType = 'json') - { - // Get filters from query parameters - $filters = $this->getFilterFromParameters(); - - array_key_exists('id', $filters) && $id = $filters['id']; - !isset($id) && array_key_exists('uuid', $filters) && $id = $filters['uuid']; - - $validationErrors = null; - switch ($method) { - case 'GET': - $data = $this->getCase($id, $data, $method, $entity, $endpoint, $acceptType); - // todo: this dispatch should probably be moved to the getCase function!? - $this->dispatchEvent('commongateway.object.read', ['response' => $data, 'entity' => $entity->getId()->toString()]); - break; - case 'POST': - case 'PUT': - case 'PATCH': - $object = $this->checkGetObject($id, $method, $entity); - $owner = $this->checkAndUnsetOwner($data); - - // validate -// if ($validationErrors = $this->validatorService->validateData($data, $entity, $method)) { -// return $validationErrors; -// } - - $data = $this->createOrUpdateCase($data, $object, $owner, $method, $acceptType); - // todo: this dispatch should probably be moved to the createOrUpdateCase function!? - $this->dispatchEvent($method == 'POST' ? 'commongateway.object.create' : 'commongateway.object.update', ['response' => $data, 'entity' => $entity->getId()->toString()]); - break; - case 'DELETE': - $data = $this->deleteCase($id, $data, $method, $entity); - // todo: this dispatch should probably be moved to the deleteCase function!? - $this->dispatchEvent('commongateway.object.delete', ['response' => $data, 'entity' => $entity->getId()->toString()]); - break; - default: - throw new GatewayException('This method is not allowed', null, null, ['data' => ['method' => $method], 'path' => $entity->getName(), 'responseType' => Response::HTTP_FORBIDDEN]); - } - - return $validationErrors; - } - - /** - * A function to handle calls to eav. - * - * @param Handler $handler The handler the object relates to - * @param Endpoint $endpoint The endpoint of the object - * @param array|null $data Data to be set into the eav - * @param string|null $method Method from request if there is a request - * @param string $acceptType The acceptType of the call - defaulted to jsonld - * - * @throws GatewayException|CacheException|InvalidArgumentException|ComponentException|Exception - * - * @return array $data - * @deprecated - */ - public function handleObject(Handler $handler, Endpoint $endpoint, ?array $data = null, string $method = null, string $acceptType = 'json'): array - { - // Set application in the session or create new application for localhost if we need it. - $this->applicationService->getApplication(); - - // set session with sessionInfo - $sessionInfo = [ - 'entity' => $handler->getEntity()->getId()->toString(), - 'source' => $handler->getEntity()->getSource() ? $handler->getEntity()->getSource()->getId()->toString() : null, - ]; - $this->session->set('entitySource', $sessionInfo); - - $validationErrors = $this->switchMethod($data, $endpoint, $handler->getEntity(), null, $method, $acceptType); - if (isset($validationErrors)) { - throw new GatewayException('Validation errors', null, null, ['data' => $validationErrors, 'path' => $handler->getEntity()->getName(), 'responseType' => Response::HTTP_BAD_REQUEST]); - } - - // use events - return $data; - } - - /** - * Saves an ObjectEntity in the DB using the $post array. NOTE: validation is and should only be done by the validatorService->validateData() function this saveObject() function only saves the object in the DB. - * - * @param ObjectEntity $objectEntity - * @param array $post - * - * @throws Exception|InvalidArgumentException - * - * @return ObjectEntity - * @deprecated - */ - public function saveObject(ObjectEntity $objectEntity, array $post): ObjectEntity - { - $entity = $objectEntity->getEntity(); - - foreach ($entity->getAttributes() as $attribute) { - // Check attribute function - if ($attribute->getFunction() !== 'noFunction') { - $objectEntity = $this->handleAttributeFunction($objectEntity, $attribute); - continue; // Do not save this attribute(/value) in any other way! - } - - // Check if we have a value ( a value is given in the post body for this attribute, can be null) - // If no value is present in the post body for this attribute check for defaultValue and nullable. - if (key_exists($attribute->getName(), $post)) { - $objectEntity = $this->saveAttribute($objectEntity, $attribute, $post[$attribute->getName()]); - } elseif ($this->request->getMethod() == 'POST') { - if ($attribute->getDefaultValue()) { - // todo: defaultValue should maybe be a Value object, so that defaultValue can be something else than a string - // DefaultValue can be a uuid string to connect an object... - $objectEntity = $this->saveAttribute($objectEntity, $attribute, $this->twig->createTemplate($attribute->getDefaultValue())->render()); - } else { - // If no value is given when creating a new object, make sure we set a value to null for this attribute. - $objectEntity->setValue($attribute, null); - } - } - } - - if (!$objectEntity->getUri()) { - // Lets make sure we always set the uri - $objectEntity->setUri($this->createUri($objectEntity)); - } - if (!$objectEntity->getSelf()) { - // Lets make sure we always set the self (@id) - $objectEntity->setSelf($this->createSelf($objectEntity)); - } - - if (array_key_exists('@organization', $post) && $objectEntity->getOrganization() != $post['@organization']) { - $objectEntity->setOrganization($post['@organization']); - } - - // Only do this if we are changing an object, not when creating one. - if ($this->request->getMethod() != 'POST') { - // Handle setting an object as unread. - if (array_key_exists('@dateRead', $post) && $post['@dateRead'] == false) { - $this->setUnread($objectEntity); - } - - // If we change an ObjectEntity we should remove it from the result cache - $this->functionService->removeResultFromCache($objectEntity); - } - - return $objectEntity; - } - - /** - * Checks if there exists an unread object for the given ObjectEntity + current UserId. If not, creation one. - * - * @param ObjectEntity $objectEntity - * - * @return void - * @deprecated moved this function to CoreBundle->ReadUnreadService->setUnread() - */ - public function setUnread(ObjectEntity $objectEntity) - { - // First, check if there is an Unread object for this Object+User. If so, do nothing. - $user = $this->security->getUser(); - if ($user !== null) { - $unreads = $this->entityManager->getRepository('App:Unread')->findBy(['object' => $objectEntity, 'userId' => $user->getUserIdentifier()]); - if (empty($unreads)) { - $unread = new Unread(); - $unread->setObject($objectEntity); - $unread->setUserId($user->getUserIdentifier()); - $this->entityManager->persist($unread); - // Do not flush, will always be done after the api-call that triggers this function, if that api-call doesn't throw an exception. - } - } - } - - /** - * @return string - * @deprecated - */ - private function getUserName(): string - { - $user = $this->security->getUser(); - - if ($user instanceof AuthenticationUser) { - return $user->getName(); - } - - return ''; - } - - /** - * Handles saving the value for an Attribute when the Attribute has a function set. A function makes it 'function' (/behave) differently. - * - * @param ObjectEntity $objectEntity - * @param Attribute $attribute - * - * @throws Exception - * - * @return ObjectEntity - * @deprecated - */ - private function handleAttributeFunction(ObjectEntity $objectEntity, Attribute $attribute): ObjectEntity - { - switch ($attribute->getFunction()) { - case 'id': - $objectEntity->setValue($attribute, $objectEntity->getId()->toString()); - // Note: attributes with function = id should also be readOnly and type=string - break; - case 'self': - $self = $objectEntity->getSelf() ?? $objectEntity->setSelf($this->createSelf($objectEntity))->getSelf(); - $objectEntity->setValue($attribute, $self); - // Note: attributes with function = self should also be readOnly and type=string - break; - case 'uri': - $uri = $objectEntity->getUri() ?? $objectEntity->setUri($this->createUri($objectEntity))->getUri(); - $objectEntity->setValue($attribute, $uri); - // Note: attributes with function = uri should also be readOnly and type=string - break; - case 'externalId': - $objectEntity->setValue($attribute, $objectEntity->getExternalId()); - // Note: attributes with function = externalId should also be readOnly and type=string - break; - case 'dateCreated': - $objectEntity->setValue($attribute, $objectEntity->getDateCreated()->format("Y-m-d\TH:i:sP")); - // Note: attributes with function = dateCreated should also be readOnly and type=string||date||datetime - break; - case 'dateModified': - $objectEntity->setValue($attribute, $objectEntity->getDateModified()->format("Y-m-d\TH:i:sP")); - // Note: attributes with function = dateModified should also be readOnly and type=string||date||datetime - break; - case 'userName': - $objectEntity->getValueObject($attribute)->getValue() ?? $objectEntity->setValue($attribute, $this->getUserName()); - break; - } - - return $objectEntity; - } - - /** - * Saves a Value for an Attribute (of the Entity) of an ObjectEntity. - * - * @param ObjectEntity $objectEntity - * @param Attribute $attribute - * @param $value - * - * @throws Exception|InvalidArgumentException - * - * @return ObjectEntity - * @deprecated - */ - private function saveAttribute(ObjectEntity $objectEntity, Attribute $attribute, $value): ObjectEntity - { - //todo: check owner? -// try { -// if (!$this->checkOwner($objectEntity)) { -// $this->authorizationService->checkAuthorization([ -// 'method' => $this->request->getMethod(), -// 'attribute' => $attribute, -// 'value' => $value, -// ]); -// } -// } catch (AccessDeniedException $e) { -// throw new GatewayException('message', null, null, ['data' => ['info' => 'info'], 'path' => 'somePath', 'responseType' => Response::HTTP_FORBIDDEN]); -// } - - $valueObject = $objectEntity->getValueObject($attribute); - - // If the value given by the user is empty... - if (empty($value) && !(in_array($attribute->getType(), ['bool', 'boolean']) && $value === false)) { - if ($attribute->getMultiple() && $value === []) { - if ($attribute->getType() == 'object' && ($this->request->getMethod() == 'PUT' || $this->request->getMethod() == 'PATCH')) { - foreach ($valueObject->getObjects() as $object) { - // If we are not re-adding this object... - $object->removeSubresourceOf($valueObject); - if (count($object->getSubresourceOf()) == 0) { - $this->eavService->handleDelete($object); - } - } - $valueObject->getObjects()->clear(); - } else { - $valueObject->setValue([]); - } - } else { - $valueObject->setValue(null); - } - - return $objectEntity; - } - - // Save the actual value, unless type is object or file, we save those differently. - if (!in_array($attribute->getType(), ['object', 'file'])) { - $valueObject->setValue($value); - } elseif ($attribute->getMultiple()) { - // If multiple, this is an array, loop through $value and save as array of $attribute->getType() - $objectEntity = $this->saveAttributeMultiple($objectEntity, $attribute, $valueObject, $value); - } else { - $objectEntity = $this->saveAttributeType($objectEntity, $attribute, $valueObject, $value); - } - - return $objectEntity; - } - - /** - * Saves a subObject using saveObject. Will also set the owner, uri, organization and application. And check for a Entity function. - * - * @param ObjectEntity $subObject - * @param $object - * - * @throws InvalidArgumentException - * - * @return ObjectEntity - * @deprecated - */ - private function saveSubObject(ObjectEntity $subObject, $object): ObjectEntity - { - $subObject = $this->saveObject($subObject, $object); - $this->handleOwner($subObject); // Do this after all CheckAuthorization function calls - - // We need to set uri here in case we need it in $this->functionService->handleFunction later! - $subObject->setUri($this->createUri($subObject)); - - // todo remove if no longer needed, see value.php setValue() where we set owner, organization and application for subobjects - // Set organization for this object - if (count($subObject->getSubresourceOf()) > 0 && !empty($subObject->getSubresourceOf()->first()->getObjectEntity()->getOrganization())) { - $subObject->setOrganization($subObject->getSubresourceOf()->first()->getObjectEntity()->getOrganization()); - $subObject->setApplication($subObject->getSubresourceOf()->first()->getObjectEntity()->getApplication()); - } else { - $subObject->setOrganization($this->session->get('activeOrganization')); - $application = $this->entityManager->getRepository('App:Application')->findOneBy(['id' => $this->session->get('application')]); - $subObject->setApplication(!empty($application) ? $application : null); - } - - return $this->functionService->handleFunction($subObject, $subObject->getEntity()->getFunction(), [ - 'method' => $this->request->getMethod(), - 'uri' => $subObject->getUri(), - 'organizationType' => is_array($object) && array_key_exists('type', $object) ? $object['type'] : null, - 'userGroupName' => is_array($object) && array_key_exists('name', $object) ? $object['name'] : null, - ]); - } - - /** - * @TODO - * - * @param ObjectEntity $objectEntity - * @param Attribute $attribute - * @param Value $valueObject - * @param $value - * - * @throws InvalidArgumentException - * - * @return ObjectEntity - * @deprecated - */ - private function saveAttributeMultiple(ObjectEntity $objectEntity, Attribute $attribute, Value $valueObject, $value): ObjectEntity - { - switch ($attribute->getType()) { - case 'object': - $subObjectIds = []; - $saveSubObjects = new ArrayCollection(); // collection to store all new subobjects in before we actually connect them to the value - foreach ($value as $key => $object) { - // If we are not cascading and value is a string, then value should be an id. - if (is_string($object)) { - if (Uuid::isValid($object) == false) { - // We should also allow commonground Uri's like: https://taalhuizen-bisc.commonground.nu/api/v1/wrc/organizations/008750e5-0424-440e-aea0-443f7875fbfe - // TODO: support /$attribute->getObject()->getEndpoint()/uuid? - if ($object == $attribute->getObject()->getSource()->getLocation().'/'.$attribute->getObject()->getEndpoint().'/'.$this->commonGroundService->getUuidFromUrl($object)) { - $object = $this->commonGroundService->getUuidFromUrl($object); - } else { -// var_dump('The given value ('.$object.') is not a valid object, a valid uuid or a valid uri ('.$attribute->getObject()->getSource()->getLocation().'/'.$attribute->getObject()->getEndpoint().'/uuid).'); - continue; - } - } - - // Look for object in the gateway with this id (for ObjectEntity id and for ObjectEntity externalId) - // todo make one sql query for finding an ObjectEntity by id or externalId - if (!$subObject = $this->entityManager->getRepository('App:ObjectEntity')->findOneBy(['entity' => $attribute->getObject(), 'id' => $object])) { - if (!$subObject = $this->entityManager->getRepository('App:ObjectEntity')->findOneBy(['entity' => $attribute->getObject(), 'externalId' => $object])) { - // If gateway->location and endpoint are set on the attribute(->getObject) Entity look outside the gateway for an existing object. - if (!$subObject) { - // todo: throw error? -// var_dump('Could not find an object with id '.$object.' of type '.$attribute->getObject()->getName()); - continue; - } - } - } - // object toevoegen - $saveSubObjects->add($subObject); - continue; - } - - // If we are doing a PUT with a subObject that contains an id, find the object with this id and update it. - if (($this->request->getMethod() == 'PUT' || $this->request->getMethod() == 'PATCH') && array_key_exists('id', $object)) { - if (!is_string($object['id']) || Uuid::isValid($object['id']) == false) { -// var_dump('The given value ('.$object['id'].') is not a valid uuid.'); - continue; - } - $subObject = $valueObject->getObjects()->filter(function (ObjectEntity $item) use ($object) { - return $item->getId() == $object['id'] || $item->getExternalId() == $object['id']; - }); - if (count($subObject) == 0) { - // look outside the gateway - - if (!$subObject) { - // todo: throw error? -// var_dump('Could not find an object with id '.$object['id'].' of type '.$attribute->getObject()->getName()); - continue; - } - - // object toevoegen - $saveSubObjects->add($subObject); - continue; - } elseif (count($subObject) > 1) { -// var_dump('Found more than 1 object with id '.$object['id'].' of type '.$attribute->getObject()->getName()); - continue; - } else { - $subObject = $subObject->first(); - } - } elseif (($this->request->getMethod() == 'PUT' || $this->request->getMethod() == 'PATCH') - && count($value) == 1 - && count($valueObject->getObjects()) == 1) { - // If we are doing a PUT with a single subObject (and it contains no id) and the existing mainObject only has a single subObject, use the existing subObject and update that. - $subObject = $valueObject->getObjects()->first(); - $object['id'] = $subObject->getExternalId(); - } else { - //Lets do a cascade check here. - if (!$attribute->getCascade() && !is_string($object)) { - continue; - } - - // Create a new subObject (ObjectEntity) - $subObject = new ObjectEntity(); - $subObject->setEntity($attribute->getObject()); - $subObject->addSubresourceOf($valueObject); - } - - $subObject->setSubresourceIndex($key); - - $subObject = $this->saveSubObject($subObject, $object); - - // object toevoegen - $saveSubObjects->add($subObject); - $subObjectIds[] = $subObject->getId()->toString(); - } - $valueObject->setArrayValue($subObjectIds); - - // If we are doing a put, we want to actually clear (or remove) objects connected to this valueObject we no longer need - if ($this->request->getMethod() == 'PUT' || $this->request->getMethod() == 'PATCH') { - foreach ($valueObject->getObjects() as $object) { - // If we are not re-adding this object... allow delete on PUT - if (!$saveSubObjects->contains($object)) { - $object->removeSubresourceOf($valueObject); - if (count($object->getSubresourceOf()) == 0) { - $this->eavService->handleDelete($object); - } - } - } - $valueObject->getObjects()->clear(); - } - // Actually add the objects to the valueObject - foreach ($saveSubObjects as $saveSubObject) { - // Make sure we never connect the value of a multiple=false attribute to more than one object! Checks inversedBy - $this->disconnectNotMultipleObjects($objectEntity, $attribute, $saveSubObject); - - $valueObject->addObject($saveSubObject); - } - break; - case 'file': - foreach ($value as $file) { - $objectEntity = $this->saveFile($objectEntity, $valueObject, $this->base64ToFileArray($file)); - } - break; - default: - // do nothing - break; - } - - return $objectEntity; - } - - /** - * @TODO - * - * @param ObjectEntity $objectEntity - * @param Attribute $attribute - * @param Value $valueObject - * @param $value - * - * @throws Exception - * - * @return ObjectEntity - * @deprecated - */ - private function saveAttributeType(ObjectEntity $objectEntity, Attribute $attribute, Value $valueObject, $value): ObjectEntity - { - switch ($attribute->getType()) { - case 'object': - // Check for cascading (should already be done by validatorService... - if (!$attribute->getCascade() && !is_string($value)) { - break; - } - - // If we are not cascading and value is a string, then value should be an id. - if (is_string($value)) { - if (Uuid::isValid($value) == false) { - // We should also allow commonground Uri's like: https://taalhuizen-bisc.commonground.nu/api/v1/wrc/organizations/008750e5-0424-440e-aea0-443f7875fbfe - // TODO: support /$attribute->getObject()->getEndpoint()/uuid? -// if ($value == $attribute->getObject()->getSource()->getLocation().'/'.$attribute->getObject()->getEndpoint().'/'.$this->commonGroundService->getUuidFromUrl($value)) { -// $value = $this->commonGroundService->getUuidFromUrl($value); -// } else { - //// var_dump('The given value ('.$value.') is not a valid object, a valid uuid or a valid uri ('.$attribute->getObject()->getSource()->getLocation().'/'.$attribute->getObject()->getEndpoint().'/uuid).'); -// break; -// } - } - - // Look for object in the gateway with this id (for ObjectEntity id and for ObjectEntity externalId) - // todo make one sql query for finding an ObjectEntity by id or externalId - if (!$subObject = $this->entityManager->getRepository('App:ObjectEntity')->findOneBy(['entity' => $attribute->getObject(), 'id' => $value])) { - if (!$subObject = $this->entityManager->getRepository('App:ObjectEntity')->findOneBy(['entity' => $attribute->getObject(), 'externalId' => $value])) { - // If gateway->location and endpoint are set on the attribute(->getObject) Entity look outside the gateway for an existing object. - if (!$subObject) { - // todo: throw error? -// var_dump('Could not find an object with id '.$value.' of type '.$attribute->getObject()->getName()); - break; - } - } - } - - // Make sure we never connect the value of a multiple=false attribute to more than one object! Checks inversedBy. - $this->disconnectNotMultipleObjects($objectEntity, $attribute, $subObject); - - // Object toevoegen - $valueObject->getObjects()->clear(); // We start with a default object - $valueObject->addObject($subObject); - break; - } - - if (!$valueObject->getValue()) { - // Cascading... - $subObject = new ObjectEntity(); - $subObject->setEntity($attribute->getObject()); - $subObject->addSubresourceOf($valueObject); - } else { - // Put... - $subObject = $valueObject->getValue(); - } - - $subObject = $this->saveSubObject($subObject, $value); - - $this->entityManager->persist($subObject); - - $valueObject->setValue($subObject); - - break; - case 'file': - $objectEntity = $this->saveFile($objectEntity, $valueObject, $this->base64ToFileArray($value)); - break; - default: - // do nothing - break; - } - - return $objectEntity; - } - - /** - * This function will check if an attribute has inversedBy, if so, get the inversedBy value and check if this value does not already have given $objectEntity as a relation. - * If inversedBy value does not have the $objectEntity as relation and the attribute of this inversedBy value is multiple=false this inversedBy value should only contain one object. - * So, if the inversedBy value has already one or more other objects connected to it, disconnect all these objects, so we can add $objectEntity as the only relation after using this function. - * - * @param ObjectEntity $objectEntity The 'parent' objectEntity of $attribute we might want to add as a inversedBy relation to $subObject. - * @param Attribute $attribute The attribute we are going to check inversedBy on and get its value if it has a inversedBy attribute/value. - * @param ObjectEntity $subObject The 'child' objectEntity we want to add to the Value of the $attribute of $objectEntity. - * - * @return void - */ - private function disconnectNotMultipleObjects(ObjectEntity $objectEntity, Attribute $attribute, ObjectEntity $subObject) - { - // Make sure we never connect the value of a multiple=false attribute to more than one object! - if ($attribute->getInversedBy()) { - // If we have inversedBy on this attribute - $inversedByValue = $subObject->getValueObject($attribute->getInversedBy()); - if (!$inversedByValue->getObjects()->contains($objectEntity)) { // $valueObject->getObjectEntity() = $objectEntity - // If inversedBy attribute is not multiple it should only have one object connected to it - if (!$attribute->getInversedBy()->getMultiple() and count($inversedByValue->getObjects()) > 0) { - // Disconnect old objects - foreach ($inversedByValue->getObjects() as $object) { - // Clear any objects and there parent relations (subresourceOf) to make sure we only can have one object connected. - $object->removeSubresourceOf($inversedByValue); - } - } - } - } - } - - /** - * @TODO - * - * @param ObjectEntity $objectEntity - * @param Value $valueObject - * @param array $fileArray - * - * @return ObjectEntity - */ - private function saveFile(ObjectEntity $objectEntity, Value $valueObject, array $fileArray): ObjectEntity - { - if ($fileArray['name']) { - // Find file by filename (this can be the uuid of the file object) - $fileObject = $valueObject->getFiles()->filter(function (File $item) use ($fileArray) { - return $item->getName() == $fileArray['name']; - }); - if (count($fileObject) > 1) { -// var_dump($attribute->getName().'.name More than 1 file found with this name: '.$fileArray['name']); - // todo: throw error? - } - } - - if (isset($fileObject) && count($fileObject) == 1) { - // Update existing file if we found one using the given file name - $fileObject = $fileObject->first(); - } else { - // Create a new file - $fileObject = new File(); - } - $this->entityManager->persist($fileObject); // For getting the id if no name is given - $fileObject->setName($fileArray['name'] ?? $fileObject->getId()); - $fileObject->setExtension($fileArray['extension']); - $fileObject->setMimeType($fileArray['mimeType']); - $fileObject->setSize($fileArray['size']); - $fileObject->setBase64($fileArray['base64']); - - $valueObject->addFile($fileObject); - - return $objectEntity; - } - - /** - * Converts a mime type to an extension (or find all mime_types with an extension). - * - * @param $mime - * @param null $ext - * - * @return array|false|string - */ - private function mimeToExt($mime, $ext = null) - { - // todo: move this to a dedicated file and get it from there? - $mime_map = [ - 'video/3gpp2' => '3g2', - 'video/3gp' => '3gp', - 'video/3gpp' => '3gp', - 'application/x-compressed' => '7zip', - 'audio/x-acc' => 'aac', - 'audio/ac3' => 'ac3', - 'application/postscript' => 'ai', - 'audio/x-aiff' => 'aif', - 'audio/aiff' => 'aif', - 'audio/x-au' => 'au', - 'video/x-msvideo' => 'avi', - 'video/msvideo' => 'avi', - 'video/avi' => 'avi', - 'application/x-troff-msvideo' => 'avi', - 'application/macbinary' => 'bin', - 'application/mac-binary' => 'bin', - 'application/x-binary' => 'bin', - 'application/x-macbinary' => 'bin', - 'image/bmp' => 'bmp', - 'image/x-bmp' => 'bmp', - 'image/x-bitmap' => 'bmp', - 'image/x-xbitmap' => 'bmp', - 'image/x-win-bitmap' => 'bmp', - 'image/x-windows-bmp' => 'bmp', - 'image/ms-bmp' => 'bmp', - 'image/x-ms-bmp' => 'bmp', - 'application/bmp' => 'bmp', - 'application/x-bmp' => 'bmp', - 'application/x-win-bitmap' => 'bmp', - 'application/cdr' => 'cdr', - 'application/coreldraw' => 'cdr', - 'application/x-cdr' => 'cdr', - 'application/x-coreldraw' => 'cdr', - 'image/cdr' => 'cdr', - 'image/x-cdr' => 'cdr', - 'zz-application/zz-winassoc-cdr' => 'cdr', - 'application/mac-compactpro' => 'cpt', - 'application/pkix-crl' => 'crl', - 'application/pkcs-crl' => 'crl', - 'application/x-x509-ca-cert' => 'crt', - 'application/pkix-cert' => 'crt', - 'text/css' => 'css', - 'text/x-comma-separated-values' => 'csv', - 'text/comma-separated-values' => 'csv', - 'application/vnd.msexcel' => 'csv', - 'application/x-director' => 'dcr', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', - 'application/x-dvi' => 'dvi', - 'message/rfc822' => 'eml', - 'application/x-msdownload' => 'exe', - 'video/x-f4v' => 'f4v', - 'audio/x-flac' => 'flac', - 'video/x-flv' => 'flv', - 'image/gif' => 'gif', - 'application/gpg-keys' => 'gpg', - 'application/x-gtar' => 'gtar', - 'application/x-gzip' => 'gzip', - 'application/mac-binhex40' => 'hqx', - 'application/mac-binhex' => 'hqx', - 'application/x-binhex40' => 'hqx', - 'application/x-mac-binhex40' => 'hqx', - 'text/html' => 'html', - 'image/x-icon' => 'ico', - 'image/x-ico' => 'ico', - 'image/vnd.microsoft.icon' => 'ico', - 'text/calendar' => 'ics', - 'application/java-archive' => 'jar', - 'application/x-java-application' => 'jar', - 'application/x-jar' => 'jar', - 'image/jp2' => 'jp2', - 'video/mj2' => 'jp2', - 'image/jpx' => 'jp2', - 'image/jpm' => 'jp2', - 'image/jpeg' => 'jpeg', - 'image/pjpeg' => 'jpeg', - 'application/x-javascript' => 'js', - 'application/json' => 'json', - 'text/json' => 'json', - 'application/vnd.google-earth.kml+xml' => 'kml', - 'application/vnd.google-earth.kmz' => 'kmz', - 'text/x-log' => 'log', - 'audio/x-m4a' => 'm4a', - 'audio/mp4' => 'm4a', - 'application/vnd.mpegurl' => 'm4u', - 'audio/midi' => 'mid', - 'application/vnd.mif' => 'mif', - 'video/quicktime' => 'mov', - 'video/x-sgi-movie' => 'movie', - 'audio/mpeg' => 'mp3', - 'audio/mpg' => 'mp3', - 'audio/mpeg3' => 'mp3', - 'audio/mp3' => 'mp3', - 'video/mp4' => 'mp4', - 'video/mpeg' => 'mpeg', - 'application/oda' => 'oda', - 'audio/ogg' => 'ogg', - 'video/ogg' => 'ogg', - 'application/ogg' => 'ogg', - 'font/otf' => 'otf', - 'application/x-pkcs10' => 'p10', - 'application/pkcs10' => 'p10', - 'application/x-pkcs12' => 'p12', - 'application/x-pkcs7-signature' => 'p7a', - 'application/pkcs7-mime' => 'p7c', - 'application/x-pkcs7-mime' => 'p7c', - 'application/x-pkcs7-certreqresp' => 'p7r', - 'application/pkcs7-signature' => 'p7s', - 'application/pdf' => 'pdf', - 'application/octet-stream' => 'pdf', - 'application/x-x509-user-cert' => 'pem', - 'application/x-pem-file' => 'pem', - 'application/pgp' => 'pgp', - 'application/x-httpd-php' => 'php', - 'application/php' => 'php', - 'application/x-php' => 'php', - 'text/php' => 'php', - 'text/x-php' => 'php', - 'application/x-httpd-php-source' => 'php', - 'image/png' => 'png', - 'image/x-png' => 'png', - 'application/powerpoint' => 'ppt', - 'application/vnd.ms-powerpoint' => 'ppt', - 'application/vnd.ms-office' => 'ppt', - 'application/msword' => 'doc', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', - 'application/x-photoshop' => 'psd', - 'image/vnd.adobe.photoshop' => 'psd', - 'audio/x-realaudio' => 'ra', - 'audio/x-pn-realaudio' => 'ram', - 'application/x-rar' => 'rar', - 'application/rar' => 'rar', - 'application/x-rar-compressed' => 'rar', - 'audio/x-pn-realaudio-plugin' => 'rpm', - 'application/x-pkcs7' => 'rsa', - 'text/rtf' => 'rtf', - 'text/richtext' => 'rtx', - 'video/vnd.rn-realvideo' => 'rv', - 'application/x-stuffit' => 'sit', - 'application/smil' => 'smil', - 'text/srt' => 'srt', - 'image/svg+xml' => 'svg', - 'application/x-shockwave-flash' => 'swf', - 'application/x-tar' => 'tar', - 'application/x-gzip-compressed' => 'tgz', - 'image/tiff' => 'tiff', - 'font/ttf' => 'ttf', - 'text/plain' => 'txt', - 'text/x-vcard' => 'vcf', - 'application/videolan' => 'vlc', - 'text/vtt' => 'vtt', - 'audio/x-wav' => 'wav', - 'audio/wave' => 'wav', - 'audio/wav' => 'wav', - 'application/wbxml' => 'wbxml', - 'video/webm' => 'webm', - 'image/webp' => 'webp', - 'audio/x-ms-wma' => 'wma', - 'application/wmlc' => 'wmlc', - 'video/x-ms-wmv' => 'wmv', - 'video/x-ms-asf' => 'wmv', - 'font/woff' => 'woff', - 'font/woff2' => 'woff2', - 'application/xhtml+xml' => 'xhtml', - 'application/excel' => 'xl', - 'application/msexcel' => 'xls', - 'application/x-msexcel' => 'xls', - 'application/x-ms-excel' => 'xls', - 'application/x-excel' => 'xls', - 'application/x-dos_ms_excel' => 'xls', - 'application/xls' => 'xls', - 'application/x-xls' => 'xls', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', - 'application/vnd.ms-excel' => 'xlsx', - 'application/xml' => 'xml', - 'text/xml' => 'xml', - 'text/xsl' => 'xsl', - 'application/xspf+xml' => 'xspf', - 'application/x-compress' => 'z', - 'application/x-zip' => 'zip', - 'application/zip' => 'zip', - 'application/x-zip-compressed' => 'zip', - 'application/s-compressed' => 'zip', - 'multipart/x-zip' => 'zip', - 'text/x-scriptzsh' => 'zsh', - ]; - - if ($ext) { - $mime_types = []; - foreach ($mime_map as $mime_type => $extension) { - if ($extension == $ext) { - $mime_types[] = $mime_type; - } - } - - return $mime_types; - } - - return $mime_map[$mime] ?? false; - } - - /** - * Create a file array (matching the Entity File) from an array containing at least a base64 string and maybe a filename (not required). - * - * @param array $file - * - * @return array - */ - private function base64ToFileArray(array $file): array - { - // Get mime_type from base64 - $explode_base64 = explode(',', $file['base64']); - $imgdata = base64_decode(end($explode_base64)); - $f = finfo_open(); - $mime_type = finfo_buffer($f, $imgdata, FILEINFO_MIME_TYPE); - finfo_close($f); - - // Create file data - return [ - 'name' => array_key_exists('filename', $file) ? $file['filename'] : null, - // Get extension from filename, and else from the mime_type - 'extension' => array_key_exists('filename', $file) ? pathinfo($file['filename'], PATHINFO_EXTENSION) : $this->mimeToExt($mime_type), - 'mimeType' => $mime_type, - 'size' => $this->getBase64Size($file['base64']), - 'base64' => $file['base64'], - ]; - } - - /** - * Gets the memory size of a base64 file. - * - * @param $base64 - * - * @return Exception|float|int - */ - private function getBase64Size($base64) - { //return memory size in B, KB, MB - try { - $size_in_bytes = (int) (strlen(rtrim($base64, '=')) * 3 / 4); - $size_in_kb = $size_in_bytes / 1024; - $size_in_mb = $size_in_kb / 1024; - - return $size_in_bytes; - } catch (Exception $e) { - return $e; - } - } - - /** - * Create a file array (matching the Entity File) from an UploadedFile object. - * - * @param UploadedFile $file - * @param string|null $key - * - * @return array - */ - public function uploadedFileToFileArray(UploadedFile $file, string $key = null): array - { - return [ - 'name' => $file->getClientOriginalName() ?? null, - 'extension' => $file->getClientOriginalExtension() ?? $file->getClientMimeType() ? $this->mimeToExt($file->getClientMimeType()) : null, - 'mimeType' => $file->getClientMimeType() ?? null, - 'size' => $file->getSize() ?? null, - 'base64' => $this->uploadToBase64($file), - 'key' => $key, // Pass this through for showing correct error messages with multiple files - ]; - } - - /** - * Create a base64 string from an UploadedFile object. - * - * @param UploadedFile $file - * - * @return string - */ - private function uploadToBase64(UploadedFile $file): string - { - $content = base64_encode($file->openFile()->fread($file->getSize())); - $mimeType = $file->getClientMimeType(); - - return 'data:'.$mimeType.';base64,'.$content; - } - - /** - * @TODO - * - * @param ObjectEntity $objectEntity - * - * @return string - * @deprecated - */ - public function createUri(ObjectEntity $objectEntity): string - { - // We need to persist if this is a new ObjectEntity in order to set and getId to generate the uri... - $this->entityManager->persist($objectEntity); - if ($objectEntity->getEntity()->getSource() && $objectEntity->getEntity()->getSource()->getLocation() && $objectEntity->getExternalId()) { - return $objectEntity->getEntity()->getSource()->getLocation().'/'.$objectEntity->getEntity()->getEndpoint().'/'.$objectEntity->getExternalId(); - } - - $uri = isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] !== 'localhost' ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://localhost'; - - if ($objectEntity->getEntity()->getRoute()) { - return $uri.'/api'.$objectEntity->getEntity()->getRoute().'/'.$objectEntity->getId(); - } - - return $uri.'/admin/object_entities/'.$objectEntity->getId(); - } - - /** - * Returns the string used for {at sign}id or self->href for the given objectEntity. This function will use the ObjectEntity->Entity - * to first look for the get item endpoint and else use the Entity route or name to generate the correct string. - * - * @param ObjectEntity $objectEntity - * - * @return string - * @deprecated - */ - public function createSelf(ObjectEntity $objectEntity): string - { - // We need to persist if this is a new ObjectEntity in order to set and getId to generate the self... - $this->entityManager->persist($objectEntity); - $endpoints = $this->entityManager->getRepository('App:Endpoint')->findGetItemByEntity($objectEntity->getEntity()); - if (count($endpoints) > 0 && $endpoints[0] instanceof Endpoint) { - $pathArray = $endpoints[0]->getPath(); - $foundId = in_array('{id}', $pathArray) ? $pathArray[array_search('{id}', $pathArray)] = $objectEntity->getId() : - (in_array('{uuid}', $pathArray) ? $pathArray[array_search('{uuid}', $pathArray)] = $objectEntity->getId() : false); - if ($foundId !== false) { - $path = implode('/', $pathArray); - - return '/api/'.$path; - } - } - - return '/api'.($objectEntity->getEntity()->getRoute() ?? $objectEntity->getEntity()->getName()).'/'.$objectEntity->getId(); - } - - /** - * Create a NRC notification for the given ObjectEntity. - * - * @param ObjectEntity $objectEntity - * @param string $method - * @deprecated - */ - public function notify(ObjectEntity $objectEntity, string $method) - { - if (!$this->commonGroundService->getComponent('nrc')) { - return; - } - // TODO: move this function to a notificationService? - $topic = $objectEntity->getEntity()->getName(); - switch ($method) { - case 'POST': - $action = 'Create'; - break; - case 'PUT': - case 'PATCH': - $action = 'Update'; - break; - case 'DELETE': - $action = 'Delete'; - break; - } - if (isset($action)) { - $notification = [ - 'topic' => $topic, - 'action' => $action, - 'resource' => $objectEntity->getUri(), - 'id' => $objectEntity->getExternalId(), - ]; - if (!$objectEntity->getUri()) { - // var_dump('Couldn\'t notifiy for object, because it has no uri!'); - // var_dump('Id: '.$objectEntity->getId()); - // var_dump('ExternalId: '.$objectEntity->getExternalId() ?? null); - // var_dump($notification); - return; - } - $this->commonGroundService->createResource($notification, ['component' => 'nrc', 'type' => 'notifications'], false, true, false); - } - } - - /** - * When rendering a single attribute value for the post body of the api-call/promise to update an object in a source outside the gateway, - * and when the type of this attribute is object and cascading on this attribute is not allowed, - * try and render/use the entire object for all subresources of this attribute. - * - * @param Collection $objects - * @param Attribute $attribute - * - * @return array|mixed|null - * @deprecated - */ - public function renderSubObjects(Collection $objects, Attribute $attribute) - { - $results = []; - foreach ($objects as $object) { - // We allow cascading on promises, but only if the gateway of the parent entity and subresource match. - $results[] = - $object->getEntity()->getSource() == $attribute->getEntity()->getSource() ? - $this->renderPostBody($object) : - $object->getUri(); - } - if (!$attribute->getMultiple()) { - if (count($results) == 1) { - return $results[0]; - } else { - return null; - } - } else { - return $results; - } - } - - /** - * When rendering a single attribute value for the post body of the api-call/promise to update an object in a source outside the gateway, - * and when the type of this attribute is object and cascading on this attribute is not allowed, - * only render/use the uri for all subresources of this attribute. - * - * @param Collection $objects - * @param Attribute $attribute - * - * @return array|mixed|string|null - * @deprecated - */ - public function getSubObjectIris(Collection $objects, Attribute $attribute) - { - $results = []; - foreach ($objects as $object) { - $results[] = - $object->getEntity()->getSource() == $attribute->getEntity()->getSource() ? - "/{$object->getEntity()->getEndpoint()}/{$object->getExternalId()}" : - $object->getUri(); - } - if (!$attribute->getMultiple()) { - if (count($results) == 1) { - return $results[0]; - } else { - return null; - } - } else { - return $results; - } - } - - /** - * Render a single attribute value for the post body of the api-call/promise to update an object in a source outside the gateway (before doing the api-call). - * - * @param Value $value - * @param Attribute $attribute - * - * @return File[]|Value[]|array|bool|Collection|float|int|mixed|string|void|null - * @deprecated - */ - public function renderValue(Value $value, Attribute $attribute) - { - $rendered = ''; - switch ($attribute->getType()) { - case 'object': - // We allow cascading on promises, but only if the gateway of the parent entity and subresource match. - if ($attribute->getCascade()) { - $rendered = $this->renderSubObjects($value->getObjects(), $attribute); - } else { - $rendered = $this->getSubObjectIris($value->getObjects(), $attribute); - } - break; - default: - $rendered = $value->getValue(); - } - - return $rendered; - } - - /** - * Render the post body, with all attributes to update/send with the api-call/promise to update an object in a source outside the gateway (before doing the api-call). - * - * @param ObjectEntity $objectEntity - * - * @return array - * @deprecated - */ - public function renderPostBody(ObjectEntity $objectEntity): array - { - $body = []; - foreach ($objectEntity->getEntity()->getAttributes() as $attribute) { - // todo: With this ===null check we can never set a value to null with a promise. - // todo: Maybe we should add a new bool to attribute that determines it shouldn't be added if value===null? - if (!$attribute->getPersistToGateway() || (!$attribute->getRequired() && $objectEntity->getValue($attribute) === null)) { - continue; - } - $body[$attribute->getName()] = $this->renderValue($objectEntity->getValueObject($attribute), $attribute); - } - - return $body; - } - - /** - * Encode body for the api-call/promise to update an object in a source outside the gateway, before doing the api-call. - * - * @param ObjectEntity $objectEntity - * @param array $body - * @param array $headers - * - * @throws Exception - * - * @return string - * @deprecated - */ - public function encodeBody(ObjectEntity $objectEntity, array $body, array &$headers): string - { - switch ($objectEntity->getEntity()->getSource()->getType()) { - case 'json': - $body = json_encode($body); - break; - case 'soap': - $xmlEncoder = new XmlEncoder(['xml_root_node_name' => 'S:Envelope']); - $body = $this->translationService->parse($xmlEncoder->encode($this->translationService->dotHydrator( - $objectEntity->getEntity()->getToSoap()->getRequest() ? $xmlEncoder->decode($objectEntity->getEntity()->getToSoap()->getRequest(), 'xml') : [], - $objectEntity->toArray(), - $objectEntity->getEntity()->getToSoap()->getRequestHydration() - ), 'xml', ['xml_encoding' => 'utf-8', 'remove_empty_tags' => true]), false); - $headers['Content-Type'] = 'application/xml;charset=UTF-8'; - break; - default: - throw new Exception('Encoding type not supported'); - } - - return $body; - } - - /** - * If there is special translation config for the api-calls/promises to update an object in a source outside the gateway, before doing the api-call. - * - * @param ObjectEntity $objectEntity - * @param string $method - * @param array $headers - * @param array $query - * @param string $url - * - * @return void - */ - public function getTranslationConfig(ObjectEntity $objectEntity, string &$method, array &$headers, array &$query, string &$url): void - { - $oldMethod = $method; - $config = $objectEntity->getEntity()->getTranslationConfig(); - if ($config && array_key_exists($method, $config)) { - !array_key_exists('method', $config[$oldMethod]) ?: $method = $config[$oldMethod]['method']; - !array_key_exists('headers', $config[$oldMethod]) ?: $headers = array_merge($headers, $config[$oldMethod]['headers']); - !array_key_exists('query', $config[$oldMethod]) ?: $headers = array_merge($query, $config[$oldMethod]['headers']); - !array_key_exists('endpoint', $config[$oldMethod]) ?: $url = $objectEntity->getEntity()->getSource()->getLocation().'/'.str_replace('{id}', $objectEntity->getExternalId(), $config[$oldMethod]['endpoint']); - } - } - - /** - * Decide what method and url to use for a promise to update an object in a source outside the gateway. - * - * @param ObjectEntity $objectEntity - * @param string $url - * @param string $method - * - * @return void - */ - public function decideMethodAndUrl(ObjectEntity $objectEntity, string &$url, string &$method): void - { - if ($method == 'POST' && $objectEntity->getUri() != $objectEntity->getEntity()->getSource()->getLocation().'/'.$objectEntity->getEntity()->getEndpoint().'/'.$objectEntity->getExternalId()) { - $url = $objectEntity->getEntity()->getSource()->getLocation().'/'.$objectEntity->getEntity()->getEndpoint(); - } elseif ($objectEntity->getUri()) { - $method = 'PUT'; - $url = $objectEntity->getUri(); - } elseif ($objectEntity->getExternalId()) { - $method = 'PUT'; - $url = $objectEntity->getEntity()->getSource()->getLocation().'/'.$objectEntity->getEntity()->getEndpoint().'/'.$objectEntity->getExternalId(); - } - } - - /** - * Makes sure if an ObjectEntity has any subresources these wil also result in promises to update those objects in a source outside the gateway. - * - * @param ObjectEntity $objectEntity - * - * @return void - */ - private function settleSubPromises(ObjectEntity $objectEntity): void - { - foreach ($objectEntity->getSubresources() as $sub) { - $promises = $sub->getPromises(); - } - - if (!empty($promises)) { - Utils::settle($promises)->wait(); - } - } - - /** - * Decodes the response of a successful promise to update an object in a source outside the gateway. - * - * @param $response - * @param ObjectEntity $objectEntity - * - * @throws Exception - * - * @return array - */ - private function decodeResponse($response, ObjectEntity $objectEntity): array - { - switch ($objectEntity->getEntity()->getSource()->getType()) { - case 'json': - $result = json_decode($response->getBody()->getContents(), true); - break; - case 'xml': - $xmlEncoder = new XmlEncoder(); - $result = $xmlEncoder->decode($response->getBody()->getContents(), 'xml'); - break; - case 'soap': - $xmlEncoder = new XmlEncoder(['xml_root_node_name' => 'soap:Envelope']); - $result = $response->getBody()->getContents(); - // $result = $this->translationService->parse($result); - $result = $xmlEncoder->decode($result, 'xml'); - $result = $this->translationService->dotHydrator([], $result, $objectEntity->getEntity()->getToSoap()->getResponseHydration()); - break; - default: - throw new Exception('Unsupported type'); - } - - return $result; - } - - /** - * Set externalId of an ObjectEntity after a successful promise to update an object in a source outside the gateway. - * - * @param ObjectEntity $objectEntity - * @param array $result - * @param string $url - * @param string $method - * - * @return ObjectEntity - */ - private function setExternalId(ObjectEntity $objectEntity, array $result, string $url, string $method): ObjectEntity - { - if (array_key_exists('id', $result) && !strpos($url, $result['id'])) { - $objectEntity->setUri($url.'/'.$result['id']); - $objectEntity->setExternalId($result['id']); - } else { - $objectEntity->setUri($url); - $objectEntity->setExternalId($this->commonGroundService->getUuidFromUrl($url)); - } - -// var_dump('GetUri: '.$objectEntity->getUri()); - - // Handle Function todo: what if @organization is used in the post body? than we shouldn't handle function organization here: - return $this->functionService->handleFunction($objectEntity, $objectEntity->getEntity()->getFunction(), [ - 'method' => $method, - 'uri' => $objectEntity->getUri(), - ]); - } - - /** - * Set externalResult of an ObjectEntity after a successful promise to update an object in a source outside the gateway. - * - * @param ObjectEntity $objectEntity - * @param array $result - * - * @return ObjectEntity - */ - private function setExternalResult(ObjectEntity $objectEntity, array $result): ObjectEntity - { - if (!is_null($objectEntity->getEntity()->getAvailableProperties())) { - $availableProperties = $objectEntity->getEntity()->getAvailableProperties(); - $result = array_filter($result, function ($key) use ($availableProperties) { - return in_array($key, $availableProperties); - }, ARRAY_FILTER_USE_KEY); - } - - return $objectEntity->setExternalResult($result); - } - - /** - * Handle successful/ok response of a promise to update an object in a source outside the gateway. - * Includes updating the Gateway ObjectEntity, Gateway Cache and sending an async notification. - * - * @param $response - * @param ObjectEntity $objectEntity - * @param string $url - * @param string $method - * - * @throws InvalidArgumentException - * - * @return ObjectEntity - */ - private function onFulfilled($response, ObjectEntity $objectEntity, string $url, string $method) - { - $result = $this->decodeResponse($response, $objectEntity); - $objectEntity = $this->setExternalId($objectEntity, $result, $url, $method); - - // Lets reset cache - $this->functionService->removeResultFromCache($objectEntity); -// $this->responseService->renderResult($objectEntity, null); // pre-load/re-load cache - - // Create Notification -// var_dump('NOTIFICATION: '.$objectEntity->getEntity()->getName().' - '.$objectEntity->getId()->toString().' - '.$objectEntity->getExternalId().' - '.$method); - $this->notifications[] = ['id' => $objectEntity->getId(), 'method' => $method]; - - // log -// $responseLog = new Response(json_encode($result), 201, []); -// $this->logService->saveLog($this->logService->makeRequest(), $responseLog, 13, json_encode($result), null, 'out'); - - return $this->setExternalResult($objectEntity, $result); - } - - /** - * Handle error response of a promise to update an object in a source outside the gateway. - * - * @param $error - * @param ObjectEntity $objectEntity - * - * @return void - */ - private function onError($error, ObjectEntity $objectEntity) - { - /* @todo lelijke code */ - if ($error->getResponse()) { - $errorBody = json_decode((string) $error->getResponse()->getBody(), true); - if ($errorBody && array_key_exists('message', $errorBody)) { - $error_message = $errorBody['message']; - } elseif ($errorBody && array_key_exists('hydra:description', $errorBody)) { - $error_message = $errorBody['hydra:description']; - } else { - $error_message = (string) $error->getResponse()->getBody(); - } - } else { - $error_message = $error->getMessage(); - } -// var_dump($error_message); - -// // log -// if ($error->getResponse() instanceof Response) { -// $responseLog = $error->getResponse(); -// } else { -// $responseLog = new Response($error_message, $error->getResponse()->getStatusCode(), []); -// } -// $log = $this->logService->saveLog($this->logService->makeRequest(), $responseLog, 14, $error_message, null, 'out'); - /* @todo eigenlijk willen we links naar error reports al losse property mee geven op de json error message */ - $objectEntity->addError('gateway endpoint on '.$objectEntity->getEntity()->getName().' said', $error_message.'. (see /admin/logs/'./*$log->getId().*/ ') for a full error report'); - } - - /** - * Creates a promise to update an object in a source outside the gateway. - * - * @param ObjectEntity $objectEntity - * @param string $method - * - * @throws Exception - * - * @return PromiseInterface - */ - public function createPromise(ObjectEntity $objectEntity, string &$method): PromiseInterface - { - $component = $this->gatewayService->sourceToArray($objectEntity->getEntity()->getSource()); - $query = []; - $headers = []; - $url = ''; - $this->decideMethodAndUrl($objectEntity, $url, $method); - - $this->settleSubPromises($objectEntity); - - $body = $this->renderPostBody($objectEntity); - $body = $this->encodeBody($objectEntity, $body, $headers); - $this->getTranslationConfig($objectEntity, $method, $headers, $query, $url); - -// // log -// $this->logService->saveLog($this->logService->makeRequest(), null, 12, $body, null, 'out'); - -// var_dump('CallServiceUrl: '.$url); -// var_dump($body); - - return $this->commonGroundService->callService($component, $url, $body, $query, $headers, true, $method)->then( - function ($response) use ($objectEntity, $url, $method) { -// var_dump('succes'); - $this->onFulfilled($response, $objectEntity, $url, $method); - }, - function ($error) use ($objectEntity) { -// var_dump('error'); - $this->onError($error, $objectEntity); - } - ); - } - - /** - * Implodes a multidimensional array to a string. - * - * @param array $array - * @param string $separator - * @param string $keyValueSeparator - * - * @return string - * @deprecated - */ - public function implodeMultiArray(array $array, string $separator = ', ', string $keyValueSeparator = '='): string - { - $str = ''; - - foreach ($array as $key => $value) { - $currentSeparator = $separator; - if ($key === array_key_first($array)) { - $currentSeparator = ''; - } - if (is_array($value)) { - $str .= "$currentSeparator\"$key\"{$keyValueSeparator}[{$this->implodeMultiArray($value, $separator, $keyValueSeparator)}]"; - } else { - $str .= "$currentSeparator\"$key\"$keyValueSeparator\"$value\""; - } - } - - return $str; - } } diff --git a/api/src/Service/ResponseService.php b/api/src/Service/ResponseService.php deleted file mode 100644 index c088b6d51..000000000 --- a/api/src/Service/ResponseService.php +++ /dev/null @@ -1,849 +0,0 @@ - - * - * @license EUPL - * - * @category Service - * @deprecated - */ -class ResponseService -{ - private EntityManagerInterface $em; - private CommonGroundService $commonGroundService; - private AuthorizationService $authorizationService; - private SessionInterface $session; - private Security $security; - private CacheInterface $cache; - // todo: maybe start using one or more array properties to save data in, so we don't have to pass down all this... - // todo: ...data in RenderResult (and other function after that, untill we come back to RenderResult again, because of 'recursion') - // todo: other examples we could use this for when we cleanup this service: $fields, $extend, $acceptType, $skipAuthCheck - // todo: use this as example (checking for $level when setting this data only once is very important): - public array $xCommongatewayMetadata; - - public function __construct(EntityManagerInterface $em, CommonGroundService $commonGroundService, AuthorizationService $authorizationService, SessionInterface $session, Security $security, CacheInterface $cache) - { - $this->em = $em; - $this->commonGroundService = $commonGroundService; - $this->authorizationService = $authorizationService; - $this->session = $session; - $this->security = $security; - $this->cache = $cache; - } - - // todo remove responseService from the ObjectEntityService, so we can use the ObjectEntityService->createSelf() function here - /** - * Returns the string used for {at sign}id or self->href for the given objectEntity. This function will use the ObjectEntity->Entity - * to first look for the get item endpoint and else use the Entity route or name to generate the correct string. - * - * @param ObjectEntity $objectEntity - * - * @return string - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - public function createSelf(ObjectEntity $objectEntity): string - { - // We need to persist if this is a new ObjectEntity in order to set and getId to generate the self... - $this->em->persist($objectEntity); - $endpoints = $this->em->getRepository('App:Endpoint')->findGetItemByEntity($objectEntity->getEntity()); - if (count($endpoints) > 0 && $endpoints[0] instanceof Endpoint) { - $pathArray = $endpoints[0]->getPath(); - $foundId = in_array('{id}', $pathArray) ? $pathArray[array_search('{id}', $pathArray)] = $objectEntity->getId() : - (in_array('{uuid}', $pathArray) ? $pathArray[array_search('{uuid}', $pathArray)] = $objectEntity->getId() : false); - if ($foundId !== false) { - $path = implode('/', $pathArray); - - return '/api/'.$path; - } - } - - return '/api'.($objectEntity->getEntity()->getRoute() ?? $objectEntity->getEntity()->getName()).'/'.$objectEntity->getId(); - } - - /** - * Get the last date read for the given ObjectEntity, for the current user. (uses sql to search in logs). - * - * @param ObjectEntity $objectEntity - * - * @return DateTimeInterface|null - * @deprecated moved this function to CoreBundle->ReadUnreadService->getDateRead() - */ - private function getDateRead(ObjectEntity $objectEntity): ?DateTimeInterface - { - $user = $this->security->getUser(); - if ($user === null) { - return null; - } - - // First, check if there is an Unread object for this Object+User. If so, return null. - $unreads = $this->em->getRepository('App:Unread')->findBy(['object' => $objectEntity, 'userId' => $user->getUserIdentifier()]); - if (!empty($unreads)) { - return null; - } - - // Use sql to find last get item log of the current user for the given object. - $logs = $this->em->getRepository('App:Log')->findDateRead($objectEntity->getId()->toString(), $user->getUserIdentifier()); - - if (!empty($logs) and $logs[0] instanceof Log) { - return $logs[0]->getDateCreated(); - } - - return null; - } - - /** - * Filters fields that should not be displayed. - * - * @param array $response The full response - * @param ObjectEntity $result The objectEntity that contains the results - * @param bool $skipAuthCheck Whether the authorization should be checked - * - * @return array The resulting response - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - public function filterResult(array $response, ObjectEntity $result, bool $skipAuthCheck): array - { - return array_filter($response, function ($value, $key) use ($result) { - if (str_starts_with($key, '@') || $key == 'id') { - return true; - } - $attribute = $this->em->getRepository('App:Attribute')->findOneBy(['name' => $key, 'entity' => $result->getEntity()]); - // todo: this breaks SynchronizationService -// if (!$skipAuthCheck && !empty($attribute)) { -// try { -// if (!$this->checkOwner($result)) { -// $this->authorizationService->checkAuthorization(['attribute' => $attribute, 'value' => $value]); -// } -// } catch (AccessDeniedException $exception) { -// return false; -// } -// } - - return true; - }, ARRAY_FILTER_USE_BOTH); - } - - /** - * Renders the result for a ObjectEntity that will be used for the response after a successful api call. - * - * @param ObjectEntity $result - * @param array|null $fields - * @param array|null $extend - * @param string $acceptType - * @param bool $skipAuthCheck - * @param bool $flat todo: $flat and $acceptType = 'json' should have the same result, so remove $flat? - * @param int $level - * - * @throws CacheException|InvalidArgumentException - * - * @return array|string[]|string Only returns a string if $level is higher than 3 and acceptType is not jsonld. - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - public function renderResult(ObjectEntity $result, ?array $fields, ?array $extend, string $acceptType = 'json', bool $skipAuthCheck = false, bool $flat = false, int $level = 0) - { - $response = []; - if ($level === 0) { - $this->xCommongatewayMetadata = []; - if (is_array($extend) && array_key_exists('x-commongateway-metadata', $extend)) { - $this->xCommongatewayMetadata = $extend['x-commongateway-metadata']; - unset($extend['x-commongateway-metadata']); - if (empty($extend)) { - $extend = null; - } - } - } - - if ( - $result->getEntity()->getSource() !== null && - ($result->getEntity()->getSource()->getType() == 'soap' || - $result->getEntity()->getSource()->getType() == 'xml' || - $result->getEntity()->getSource()->getAuth() == 'vrijbrp-jwt') - ) { - return $response; - } - - $user = $this->security->getUser(); - $userId = $user !== null ? $user->getUserIdentifier() : 'anonymous'; - $item = $this->cache->getItem( - 'object_' - .base64_encode( - $result->getId() - .'userId_'.$userId - .'acceptType_'.$acceptType - .'level_'.$level - .'fields_'.http_build_query($fields ?? [], '', ',') - .'extend_'.http_build_query($extend ?? [], '', ',') - .'xCommongatewayMetadata_'.http_build_query($this->xCommongatewayMetadata ?? [], '', ',') - ) - ); - // Todo: what to do with dateRead and caching... this works for now: - if ($item->isHit() && !isset($this->xCommongatewayMetadata['dateRead']) && !isset($this->xCommongatewayMetadata['all'])) { -// var_dump('FromCache: '.$result->getId().'userId_'.$userId.'acceptType_'.$acceptType.'level_'.$level.'fields_'.http_build_query($fields ?? [], '', ',').'extend_'.http_build_query($extend ?? [], '', ',').'xCommongatewayMetadata_'.http_build_query($this->xCommongatewayMetadata ?? [], '', ',')); - return $this->filterResult($item->get(), $result, $skipAuthCheck); - } - $item->tag('object_'.base64_encode($result->getId()->toString())); - $item->tag('object_userId_'.base64_encode($userId)); - - // Make sure to break infinite render loops! ('New' MaxDepth) - if ($level > 3) { - if ($acceptType === 'jsonld') { - return [ - '@id' => $result->getSelf() ?? '/api'.($result->getEntity()->getRoute() ?? $result->getEntity()->getName()).'/'.$result->getId(), - ]; - } - - return $result->getSelf() ?? '/api'.($result->getEntity()->getRoute() ?? $result->getEntity()->getName()).'/'.$result->getId(); - } - - // todo: do we still want to do this if we have BL for syncing objects? - // Lets start with the external result - if ($result->getEntity()->getSource() && $result->getEntity()->getEndpoint()) { - if (!empty($result->getExternalResult())) { - $response = array_merge($response, $result->getExternalResult()); - } elseif (!$result->getExternalResult() === [] && $this->commonGroundService->isResource($result->getExternalResult())) { - $response = array_merge($response, $this->commonGroundService->getResource($result->getExternalResult())); - } elseif ($this->commonGroundService->isResource($result->getUri())) { - $response = array_merge($response, $this->commonGroundService->getResource($result->getUri())); - } - - // Only render the attributes that are available for this Entity (filters out unwanted properties from external results) - if (!is_null($result->getEntity()->getAvailableProperties() || !empty($fields))) { - $response = array_filter($response, function ($propertyName) use ($result, $fields) { - $attTypeObject = false; - if ($attribute = $result->getAttributeObject($propertyName)) { - $attTypeObject = $attribute->getType() === 'object'; - } - - return - (empty($fields) || array_key_exists($propertyName, $fields)) && - (!$attTypeObject || $attribute->getExtend() || (!empty($extend) && (array_key_exists('all', $extend) || array_key_exists($propertyName, $extend)))) && - (empty($result->getEntity()->getAvailableProperties()) || in_array($propertyName, $result->getEntity()->getAvailableProperties())); - }, ARRAY_FILTER_USE_KEY); - } - } - - // Let overwrite the id with the gateway id - $response['id'] = $result->getId()->toString(); // todo: remove this line of code if $flat is removed - - // Let get the internal results - $renderValues = $this->renderValues($result, $fields, $extend, $acceptType, $skipAuthCheck, $flat, $level); - $response = array_merge($response, $renderValues['renderValuesResponse']); - - // Lets sort the result alphabeticly - ksort($response); - - // Lets skip the pritty styff when dealing with a flat object - // todo: $flat and $acceptType = 'json' should have the same result, so remove $flat? - if ($flat) { - $item->set($response); - $this->cache->save($item); - - return $response; - } - - $response = $this->handleAcceptType($result, $fields, $extend, $acceptType, $level, $response, $renderValues['renderValuesEmbedded']); - - // Todo: what to do with dateRead and caching... this works for now: - if (!isset($this->xCommongatewayMetadata['dateRead']) && !isset($this->xCommongatewayMetadata['all'])) { - $item->set($response); - $this->cache->save($item); - } - - return $response; - } - - /** - * Returns a response array for renderResult function. This response is different depending on the acceptType. - * - * @param ObjectEntity $result - * @param array|null $fields - * @param array|null $extend - * @param string $acceptType - * @param int $level - * @param array $response - * @param array $embedded - * - * @return array - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function handleAcceptType(ObjectEntity $result, ?array $fields, ?array $extend, string $acceptType, int $level, array $response, array $embedded): array - { - $gatewayContext = []; - switch ($acceptType) { - case 'jsonld': - $jsonLd = $this->handleJsonLd($result, $fields, $extend, $level, $response, $embedded); - $gatewayContext = $jsonLd['gatewayContext']; - $embedded = $jsonLd['embedded']; - break; - case 'jsonhal': - $jsonHal = $this->handleJsonHal($result, $fields, $extend, $level, $response, $embedded); - $gatewayContext = $jsonHal['gatewayContext']; - $embedded = $jsonHal['embedded']; - break; - case 'json': - default: - if ($this->xCommongatewayMetadata !== []) { - $gatewayContext['x-commongateway-metadata'] = $this->handleXCommongatewayMetadata($result, $fields, $extend, $level, $response); - } - if (!empty($embedded)) { - $embedded['embedded'] = $embedded; - } - break; - } - - $gatewayContext['id'] = $result->getId(); - - return $gatewayContext + $response + $embedded; - } - - /** - * Returns a response array for renderResult function. This response conforms to the acceptType jsonLd. - * - * @param ObjectEntity $result - * @param array|null $fields - * @param array|null $extend - * @param int $level - * @param array $response - * @param array $embedded - * - * @return array - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function handleJsonLd(ObjectEntity $result, ?array $fields, ?array $extend, int $level, array $response, array $embedded): array - { - $gatewayContext['@id'] = $result->getSelf() ?? '/api'.($result->getEntity()->getRoute() ?? $result->getEntity()->getName()).'/'.$result->getId(); - $gatewayContext['@type'] = ucfirst($result->getEntity()->getName()); - $gatewayContext['@context'] = '/contexts/'.ucfirst($result->getEntity()->getName()); - $gatewayContext['@dateCreated'] = $result->getDateCreated(); - $gatewayContext['@dateModified'] = $result->getDateModified(); - if ($level === 0) { - $this->addToMetadata($gatewayContext, 'dateRead', $result, '@dateRead'); - } - $gatewayContext['@owner'] = $result->getOwner(); - $gatewayContext['@organization'] = $result->getOrganization(); - $gatewayContext['@application'] = $result->getApplication() !== null ? $result->getApplication()->getId() : null; - $gatewayContext['@uri'] = $result->getUri(); - $gatewayContext['@gateway/id'] = $result->getExternalId() ?? (array_key_exists('id', $response) ? $response['id'] : null); - if (array_key_exists('@type', $response)) { - $gatewayContext['@gateway/type'] = $response['@type']; - } - if (array_key_exists('@context', $response)) { - $gatewayContext['@gateway/context'] = $response['@context']; - } - $gatewayContext['@synchronizations'] = $result->getReadableSyncDataArray(); - if (is_array($extend)) { - $gatewayContext['@extend'] = $extend; - } - if (is_array($fields)) { - $gatewayContext['@fields'] = $fields; - } - $gatewayContext['@level'] = $level; - if (!empty($embedded)) { - $embedded['@embedded'] = $embedded; - } - - return [ - 'gatewayContext' => $gatewayContext, - 'embedded' => $embedded, - ]; - } - - /** - * Returns a response array for renderResult function. This response conforms to the acceptType jsonHal. - * - * @param ObjectEntity $result - * @param array|null $fields - * @param array|null $extend - * @param int $level - * @param array $response - * @param array $embedded - * - * @return array - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function handleJsonHal(ObjectEntity $result, ?array $fields, ?array $extend, int $level, array $response, array $embedded): array - { - $gatewayContext['_links']['self']['href'] = $result->getSelf() ?? '/api'.($result->getEntity()->getRoute() ?? $result->getEntity()->getName()).'/'.$result->getId(); - $gatewayContext['_metadata'] = [ - '_type' => ucfirst($result->getEntity()->getName()), - '_context' => '/contexts/'.ucfirst($result->getEntity()->getName()), - '_dateCreated' => $result->getDateCreated(), - '_dateModified' => $result->getDateModified(), - ]; - if ($level === 0) { - $this->addToMetadata($gatewayContext['_metadata'], 'dateRead', $result, '_dateRead'); - } - $gatewayContext['_metadata'] = array_merge($gatewayContext['_metadata'], [ - '_owner' => $result->getOwner(), - '_organization' => $result->getOrganization(), - '_application' => $result->getApplication() !== null ? $result->getApplication()->getId() : null, - '_uri' => $result->getUri(), - '_gateway/id' => $result->getExternalId() ?? (array_key_exists('id', $response) ? $response['id'] : null), - ]); - if (array_key_exists('@type', $response)) { - $gatewayContext['_metadata']['_gateway/type'] = $response['@type']; - } - if (array_key_exists('@context', $response)) { - $gatewayContext['_metadata']['_gateway/context'] = $response['@context']; - } - $gatewayContext['_metadata']['_synchronizations'] = $result->getReadableSyncDataArray(); - if (is_array($extend)) { - $gatewayContext['_metadata']['_extend'] = $extend; - } - if (is_array($fields)) { - $gatewayContext['_metadata']['_fields'] = $fields; - } - $gatewayContext['_metadata']['_level'] = $level; - if (!empty($embedded)) { - $embedded['_embedded'] = $embedded; - } - - return [ - 'gatewayContext' => $gatewayContext, - 'embedded' => $embedded, - ]; - } - - /** - * Returns a response array for renderResult function. - * This function is called and used to show metadata for AcceptTypes json or 'default' when the extend query param contains x-commongateway-metadata. - * - * @param ObjectEntity $result - * @param array|null $fields - * @param array|null $extend - * @param int $level - * @param array $response - * - * @return array - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function handleXCommongatewayMetadata(ObjectEntity $result, ?array $fields, ?array $extend, int $level, array $response): array - { - $metadata = []; - $this->addToMetadata( - $metadata, - 'self', - $result->getSelf() ?? $result->setSelf($this->createSelf($result))->getSelf() - ); - $this->addToMetadata($metadata, 'type', ucfirst($result->getEntity()->getName())); - $this->addToMetadata($metadata, 'context', '/contexts/'.ucfirst($result->getEntity()->getName())); - $this->addToMetadata($metadata, 'dateCreated', $result->getDateCreated()); - $this->addToMetadata($metadata, 'dateModified', $result->getDateModified()); - if ($level === 0) { - $this->addToMetadata($metadata, 'dateRead', $result); - } - $this->addToMetadata($metadata, 'owner', $result->getOwner()); - $this->addToMetadata($metadata, 'organization', $result->getOrganization()); - $this->addToMetadata( - $metadata, - 'application', - $result->getApplication() !== null ? $result->getApplication()->getId() : null - ); - $this->addToMetadata($metadata, 'uri', $result->getUri()); - $this->addToMetadata( - $metadata, - 'gateway/id', - $result->getExternalId() ?? (array_key_exists('id', $response) ? $response['id'] : null) - ); - if (array_key_exists('@type', $response)) { - $this->addToMetadata($metadata, 'gateway/type', $response['@type']); - } - if (array_key_exists('@context', $response)) { - $this->addToMetadata($metadata, 'gateway/context', $response['@context']); - } - $this->addToMetadata($metadata, 'synchronizations', $result->getReadableSyncDataArray()); - if (is_array($extend)) { - $this->addToMetadata($metadata, 'extend', $extend); - } - if (is_array($fields)) { - $this->addToMetadata($metadata, 'fields', $fields); - } - $this->addToMetadata($metadata, 'level', $level); - - return $metadata; - } - - /** - * Adds a key and value to the given $metadata array. But only if all or the $key is present in $this->xCommongatewayMetadata. - * If $key contains dateRead this will also trigger some specific BL we only want to do if specifically asked for. - * - * @param array $metadata - * @param string $key - * @param $value - * @param string|null $overwriteKey Default = null, if a string is given this will be used instead of $key, for the key to add to the $metadata array. - * - * @return void - * @deprecated moved this function for dateRead only to CoreBundle->ReadUnreadService->addDateRead() - */ - public function addToMetadata(array &$metadata, string $key, $value, ?string $overwriteKey = null) - { - if (array_key_exists('all', $this->xCommongatewayMetadata) || array_key_exists($key, $this->xCommongatewayMetadata)) { - // Make sure we only do getDateRead function when it is present in $this->xCommongatewayMetadata - if ($key === 'dateRead') { - // If the api-call is an getItem call show NOW instead! - $value = isset($this->xCommongatewayMetadata['dateRead']) && $this->xCommongatewayMetadata['dateRead'] === 'getItem' - ? new DateTime() : $this->getDateRead($value); - $value = $value == null ? $value : $value->format('c'); - } - $metadata[$overwriteKey ?? $key] = $value; - } - } - - /** - * Renders the values of an ObjectEntity for the renderResult function. - * - * @param ObjectEntity $result - * @param array|null $fields - * @param array|null $extend - * @param string $acceptType - * @param bool $skipAuthCheck - * @param bool $flat - * @param int $level - * - * @throws CacheException|InvalidArgumentException - * - * @return array - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderValues(ObjectEntity $result, ?array $fields, ?array $extend, string $acceptType, bool $skipAuthCheck = false, bool $flat = false, int $level = 0): array - { - $response = []; - $embedded = []; - - // Lets keep track of how deep in the tree we are - $level++; - - $entity = $result->getEntity(); - foreach ($entity->getAttributes() as $attribute) { - // Only render the attributes that are used && don't render attributes that are writeOnly - if ((!is_null($entity->getUsedProperties()) && !in_array($attribute->getName(), $entity->getUsedProperties())) - || $attribute->getWriteOnly() - ) { - continue; - } - - // Lets deal with fields filtering - if (is_array($fields) and !array_key_exists($attribute->getName(), $fields)) { - continue; - } - - // Check if user is allowed to see this - // todo: this breaks SynchronizationService -// try { -// if (!$skipAuthCheck && !$this->checkOwner($result)) { -// $this->authorizationService->checkAuthorization(['attribute' => $attribute, 'object' => $result]); -// } -// } catch (AccessDeniedException $exception) { -// continue; -// } - - $valueObject = $result->getValueObject($attribute); - if ($attribute->getType() == 'object') { - // Lets deal with extending - if (!$this->checkExtendAttribute($response, $attribute, $valueObject, $extend, $acceptType)) { - continue; - } - - // Let's deal with subFields filtering - $subFields = null; - if (is_array($fields) && array_key_exists($attribute->getName(), $fields)) { - if (is_array($fields[$attribute->getName()])) { - $subFields = $fields[$attribute->getName()]; - } elseif ($fields[$attribute->getName()] == false) { - continue; - } - } - - // Let's deal with subExtend extending - $subExtend = is_array($extend) ? $this->attributeSubExtend($extend, $attribute) : null; - - $renderObjects = $this->renderObjects($result, $embedded, $valueObject, $subFields, $subExtend, $acceptType, $skipAuthCheck, $flat, $level); - $response[$attribute->getName()] = is_array($renderObjects) && array_key_exists('renderObjectsObjectsArray', $renderObjects) ? $renderObjects['renderObjectsObjectsArray'] : $renderObjects; - if (is_array($renderObjects) && array_key_exists('renderObjectsEmbedded', $renderObjects)) { - $embedded = $renderObjects['renderObjectsEmbedded']; - } - - continue; - } elseif ($attribute->getType() == 'file') { - $response[$attribute->getName()] = $this->renderFiles($valueObject); - continue; - } - $response[$attribute->getName()] = $valueObject->getValue(); - } - - return [ - 'renderValuesResponse' => $response, - 'renderValuesEmbedded' => isset($renderObjects) && is_array($renderObjects) && array_key_exists('renderObjectsEmbedded', $renderObjects) ? $renderObjects['renderObjectsEmbedded'] : [], - ]; - } - - /** - * Checks if a given attribute should be extended. Will return true if it should be extended and false if not. - * Will also add a reference to an object to the response if the attribute should not be extended. Or null if there is no value. - * - * @param array $response The response array we will be adding object references to, if needed. - * @param Attribute $attribute The attribute we are checking if it needs extending. - * @param Value $valueObject The value(Object) of the objectEntity for the attribute we are rendering. - * @param array|null $extend The extend array used in the api-call. - * @param string $acceptType The acceptType used in the api-call. - * - * @return bool Will return true if the attribute should be extended and false if not. - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function checkExtendAttribute(array &$response, Attribute $attribute, Value $valueObject, ?array $extend, string $acceptType): bool - { - if ($attribute->getExtend() !== true && - (!is_array($extend) || (!array_key_exists('all', $extend) && !array_key_exists($attribute->getName(), $extend))) - ) { - $attribute->getMultiple() ? - $this->renderObjectReferences($response, $attribute, $valueObject, $acceptType) : - $this->renderObjectReference($response, $attribute, $valueObject, $acceptType); - - return false; - } - - return true; - } - - /** - * For a multiple=false attribute, add a reference to a single object to the response if that attribute should not be extended. - * Or adds null instead if there is no value at all. - * - * @param array $response The response array we will be adding an object references (or null) to. - * @param Attribute $attribute The attribute that does not need to be extended for the current result we are rendering. - * @param Value $valueObject The value(Object) of the objectEntity for the attribute we are rendering. - * @param string $acceptType The acceptType used in the api-call. - * - * @return void - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderObjectReference(array &$response, Attribute $attribute, Value $valueObject, string $acceptType) - { - $object = $valueObject->getValue(); - if (!$object instanceof ObjectEntity) { - $response[$attribute->getName()] = null; - - return; - } - $response[$attribute->getName()] = $this->renderObjectSelf($object, $acceptType); - } - - /** - * For a multiple=true attribute, add one or more references to one or more objects to the response if that attribute should not be extended. - * Or adds null instead if there is no value at all. - * - * @param array $response The response array we will be adding one or more object references (or null) to. - * @param Attribute $attribute The attribute that does not need to be extended for the current result we are rendering. - * @param Value $valueObject The value(Object) of the objectEntity for the attribute we are rendering. - * @param string $acceptType The acceptType used in the api-call. - * - * @return void - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderObjectReferences(array &$response, Attribute $attribute, Value $valueObject, string $acceptType) - { - $objects = $valueObject->getValue(); - if (!is_countable($objects)) { - $response[$attribute->getName()] = []; - - return; - } - foreach ($objects as $object) { - $response[$attribute->getName()][] = $this->renderObjectSelf($object, $acceptType); - } - } - - /** - * Renders the 'self' of a given object, result will differ depending on the acceptType. - * - * @param ObjectEntity $object The object to render 'self' for. - * @param string $acceptType The acceptType that will influence the way this 'self' is rendered. - * - * @return string|string[] The 'self' string or array with this string in it, depending on acceptType. - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderObjectSelf(ObjectEntity $object, string $acceptType) - { - $objectSelf = $object->getSelf() ?? '/api'.($object->getEntity()->getRoute() ?? $object->getEntity()->getName()).'/'.$object->getId(); - // todo: if we add more different acceptTypes to this list, use a switch: - if ($acceptType === 'jsonld') { - return ['@id' => $objectSelf]; - } - - return $objectSelf; - } - - /** - * Checks if a given attribute is present in the extend array and the value/object for this attribute should be extended. - * This function will decide how the subExtend array for this attribute should look like. - * - * @param array $extend The extend array used in the api-call. - * @param Attribute $attribute The attribute we are checking if it needs extending. - * - * @return array|null Will return the subExtend array for rendering the subresources if they should be extended. Will return empty array if attribute should not be extended. - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function attributeSubExtend(array $extend, Attribute $attribute): ?array - { - if (array_key_exists('all', $extend)) { - return $extend; - } elseif (array_key_exists($attribute->getName(), $extend) && is_array($extend[$attribute->getName()])) { - return $extend[$attribute->getName()]; - } - - return null; - } - - /** - * Renders the objects of a value with attribute type 'object' for the renderValues function. If attribute is extended. - * - * @param ObjectEntity $result - * @param array $embedded - * @param Value $value - * @param array|null $fields - * @param array|null $extend - * @param string $acceptType - * @param bool $skipAuthCheck - * @param bool $flat - * @param int $level - * - * @throws CacheException - * @throws InvalidArgumentException - * - * @return string|array|null - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderObjects(ObjectEntity $result, array $embedded, Value $value, ?array $fields, ?array $extend, string $acceptType, bool $skipAuthCheck = false, bool $flat = false, int $level = 0) - { - $attribute = $value->getAttribute(); - - if ($value->getValue() == null) { - return [ - 'renderObjectsObjectsArray' => $attribute->getMultiple() ? [] : null, - 'renderObjectsEmbedded' => $embedded, - ]; - } - - // If we have only one Object (because multiple = false) - if (!$attribute->getMultiple()) { - try { - // todo: this breaks SynchronizationService -// // if you have permission to see the entire parent object, you are allowed to see it's attributes, but you might not have permission to see that property if it is an object -// if (!$skipAuthCheck && !$this->checkOwner($result)) { -// $this->authorizationService->checkAuthorization(['entity' => $attribute->getObject(), 'object' => $value->getValue()]); -// } - - if ($attribute->getInclude()) { - return $this->renderResult($value->getValue(), $fields, $extend, $acceptType, $skipAuthCheck, $flat, $level); - } else { - $embedded[$attribute->getName()] = $this->renderResult($value->getValue(), $fields, $extend, $acceptType, $skipAuthCheck, $flat, $level); - } - - $object = $value->getValue(); - - return [ - 'renderObjectsObjectsArray' => $this->renderObjectSelf($object, $acceptType), - 'renderObjectsEmbedded' => $embedded, - ]; - } catch (AccessDeniedException $exception) { - return null; - } - } - - // If we can have multiple Objects (because multiple = true) - $objects = $value->getValue(); - $objectsArray = []; - foreach ($objects as $object) { - try { - // todo: this breaks SynchronizationService -// // if you have permission to see the entire parent object, you are allowed to see it's attributes, but you might not have permission to see that property if it is an object -// if (!$skipAuthCheck && !$this->checkOwner($result)) { -// $this->authorizationService->checkAuthorization(['entity' => $attribute->getObject(), 'object' => $object]); -// } - if ($attribute->getInclude()) { - $objectsArray[] = $this->renderResult($object, $fields, $extend, $acceptType, $skipAuthCheck, $flat, $level); - continue; - } else { - $embedded[$attribute->getName()][] = $this->renderResult($object, $fields, $extend, $acceptType, $skipAuthCheck, $flat, $level); - } - - $objectsArray[] = $this->renderObjectSelf($object, $acceptType); - } catch (AccessDeniedException $exception) { - continue; - } - } - - return [ - 'renderObjectsObjectsArray' => $objectsArray, - 'renderObjectsEmbedded' => $embedded, - ]; - } - - /** - * Renders the files of a value with attribute type 'file' for the renderValues function. - * - * @param Value $value - * - * @return array|null - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderFiles(Value $value): ?array - { - $attribute = $value->getAttribute(); - - if ($value->getValue() == null) { - return null; - } - if (!$attribute->getMultiple()) { - return $this->renderFileResult($value->getValue()); - } - $files = $value->getValue(); - $filesArray = []; - foreach ($files as $file) { - $filesArray[] = $this->renderFileResult($file); - } - - return $filesArray; - } - - /** - * Renders the result for a File that will be used (in renderFiles) for the response after a successful api call. - * - * @param File $file - * - * @return array - * @deprecated Make sure we do not lose any BL used here, we are just currently not using this function for rendering the result! - */ - private function renderFileResult(File $file): array - { - return [ - 'id' => $file->getId()->toString(), - 'name' => $file->getName(), - 'extension' => $file->getExtension(), - 'mimeType' => $file->getMimeType(), - 'size' => $file->getSize(), - 'base64' => $file->getBase64(), - ]; - } -} diff --git a/api/src/Service/SynchronizationService.php b/api/src/Service/SynchronizationService.php index cd48120b9..32d973444 100644 --- a/api/src/Service/SynchronizationService.php +++ b/api/src/Service/SynchronizationService.php @@ -76,7 +76,6 @@ class SynchronizationService * @param LogService $logService * @param MessageBusInterface $messageBus * @param TranslationService $translationService - * @param ObjectEntityService $objectEntityService * @param EavService $eavService * @param Environment $twig * @param EventDispatcherInterface $eventDispatcher @@ -92,7 +91,6 @@ public function __construct( LogService $logService, MessageBusInterface $messageBus, TranslationService $translationService, - ObjectEntityService $objectEntityService, EavService $eavService, Environment $twig, EventDispatcherInterface $eventDispatcher, @@ -107,8 +105,6 @@ public function __construct( $this->logService = $logService; $this->messageBus = $messageBus; $this->translationService = $translationService; - $this->objectEntityService = $objectEntityService; - $this->objectEntityService->addServices($eavService); $this->eavService = $eavService; $this->configuration = []; $this->data = []; @@ -156,6 +152,34 @@ public function synchronizationItemHandler(array $data, array $configuration): a return $data; } + /** + * Implodes a multidimensional array to a string. + * + * @param array $array + * @param string $separator + * @param string $keyValueSeparator + * + * @return string + */ + public function implodeMultiArray(array $array, string $separator = ', ', string $keyValueSeparator = '='): string + { + $str = ''; + + foreach ($array as $key => $value) { + $currentSeparator = $separator; + if ($key === array_key_first($array)) { + $currentSeparator = ''; + } + if (is_array($value)) { + $str .= "$currentSeparator\"$key\"{$keyValueSeparator}[{$this->implodeMultiArray($value, $separator, $keyValueSeparator)}]"; + } else { + $str .= "$currentSeparator\"$key\"$keyValueSeparator\"$value\""; + } + } + + return $str; + } + /** * Synchronises objects in the gateway to a source. * @@ -543,8 +567,8 @@ private function getObjectsFromSource(Source $source): array new TableSeparator(), ['Source' => "Source \"{$source->getName()}\" ({$source->getId()->toString()})"], ['Endpoint' => $callServiceConfig['endpoint']], - ['Query' => is_array($callServiceConfig['query']) ? "[{$this->objectEntityService->implodeMultiArray($callServiceConfig['query'])}]" : $callServiceConfig['query']], - ['Headers' => is_array($callServiceConfig['headers']) ? "[{$this->objectEntityService->implodeMultiArray($callServiceConfig['headers'])}]" : $callServiceConfig['headers']], + ['Query' => is_array($callServiceConfig['query']) ? "[{$this->implodeMultiArray($callServiceConfig['query'])}]" : $callServiceConfig['query']], + ['Headers' => is_array($callServiceConfig['headers']) ? "[{$this->implodeMultiArray($callServiceConfig['headers'])}]" : $callServiceConfig['headers']], ['Method' => $callServiceConfig['method'] ?? 'GET'], ); } diff --git a/api/src/Service/UserService.php b/api/src/Service/UserService.php deleted file mode 100644 index 0925445d0..000000000 --- a/api/src/Service/UserService.php +++ /dev/null @@ -1,89 +0,0 @@ -, Wilco Louwerse - * - * @license EUPL - * - * @category Service - */ -class UserService -{ - private CommonGroundService $commonGroundService; - private ObjectEntityService $objectEntityService; - - public function __construct(CommonGroundService $commonGroundService, ObjectEntityService $objectEntityService) - { - $this->commonGroundService = $commonGroundService; - $this->objectEntityService = $objectEntityService; - } - - public function getPersonForUser(UserInterface $user): array - { - if (!($user instanceof AuthenticationUser)) { - return []; - } - if ($user->getPerson() && $person = $this->objectEntityService->getObjectByUri($user->getPerson())) { - return $person; - } elseif ($user->getPerson()) { - try { - $id = substr($user->getPerson(), strrpos($user->getPerson(), '/') + 1); - - if (!$this->commonGroundService->getComponent('cc') || - !$person = $this->commonGroundService->getResource($user->getPerson())) { - $person = $this->objectEntityService->getPersonObject($id); - } - if (empty($person)) { - throw new Exception(); - } - } catch (Exception $exception) { - $person = $this->objectEntityService->getUserObjectEntity($user->getUsername()); - } - } else { - $person = $this->objectEntityService->getUserObjectEntity($user->getUsername()); - } - - return $person; - } - - public function getOrganizationForUser(UserInterface $user): array - { - if (!($user instanceof AuthenticationUser)) { - return []; - } - if (!$user->getOrganization()) { - return []; - } else { - $organizationFields = [ - 'name' => true, 'type' => true, 'addresses' => true, 'emails' => true, 'telephones' => true, - 'parentOrganization' => [ - 'name' => true, 'type' => true, 'addresses' => true, 'emails' => true, 'telephones' => true, - ], - ]; - if (!($organization = $this->objectEntityService->getObjectByUri($user->getOrganization(), $organizationFields, $organizationFields))) { - try { - $id = substr($user->getOrganization(), strrpos($user->getOrganization(), '/') + 1); - - if (!$this->commonGroundService->getComponent('cc') || - !$organization = $this->commonGroundService->getResource($user->getOrganization())) { - $organization = $this->objectEntityService->getOrganizationObject($id); - } - if (empty($organization)) { - throw new Exception(); - } - } catch (Exception $exception) { - return []; - } - } - } - - return $organization; - } -} diff --git a/api/symfony.lock b/api/symfony.lock index 0664d2039..c09d89550 100644 --- a/api/symfony.lock +++ b/api/symfony.lock @@ -5,9 +5,6 @@ "alcaeus/mongo-php-adapter": { "version": "1.2.2" }, - "api-platform/api-pack": { - "version": "v1.3.0" - }, "api-platform/core": { "version": "2.5", "recipe": { @@ -22,9 +19,6 @@ "./src/Entity/.gitignore" ] }, - "api-platform/schema-generator": { - "version": "v3.0.0" - }, "bacon/bacon-qr-code": { "version": "2.0.7" }, @@ -32,7 +26,7 @@ "version": "v1.3.0" }, "behat/transliterator": { - "version": "v1.3.0" + "version": "v1.5.0" }, "brick/math": { "version": "0.9.3" @@ -44,7 +38,7 @@ "version": "dev-master" }, "composer/ca-bundle": { - "version": "1.2.10" + "version": "1.3.7" }, "composer/package-versions-deprecated": { "version": "1.11.99.3" @@ -53,19 +47,10 @@ "version": "1.0.1" }, "composer/semver": { - "version": "3.2.5" + "version": "3.4.0" }, "composer/xdebug-handler": { - "version": "2.0.2" - }, - "conduction/commongroundbundle": { - "version": "dev-feature-gateway" - }, - "conduction/digidbundle": { - "version": "dev-master" - }, - "conduction/samlbundle": { - "version": "dev-master" + "version": "3.0.3" }, "dasprid/enum": { "version": "1.0.3" @@ -117,12 +102,12 @@ ] }, "doctrine/doctrine-fixtures-bundle": { - "version": "3.0", + "version": "3.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "3.0", - "ref": "e5b542d4ef47d8a003c91beb35650c76907f7e53" + "ref": "1f5514cfa15b947298df4d771e694e578d4c204d" }, "files": [ "src/DataFixtures/AppFixtures.php" @@ -171,9 +156,6 @@ "dragonmantank/cron-expression": { "version": "v3.3.1" }, - "easyrdf/easyrdf": { - "version": "1.1.1" - }, "egulias/email-validator": { "version": "3.2.1" }, @@ -190,28 +172,16 @@ "version": "v1.15.0" }, "fgrosse/phpasn1": { - "version": "v2.3.0" + "version": "v2.5.0" }, "fig/link-util": { "version": "1.1.2" }, - "friendsofphp/php-cs-fixer": { - "version": "2.19", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "2.19", - "ref": "34d1a22f840953909c581b8f993093b14cc9491b" - }, - "files": [ - ".php-cs-fixer.dist.php" - ] - }, "friendsofphp/proxy-manager-lts": { "version": "v1.0.5" }, "gedmo/doctrine-extensions": { - "version": "v3.1.0" + "version": "v3.2.0" }, "guzzlehttp/guzzle": { "version": "6.5.5" @@ -246,7 +216,7 @@ "version": "1.0.6" }, "knplabs/knp-markdown-bundle": { - "version": "1.9.0" + "version": "1.10.0" }, "laminas/laminas-code": { "version": "4.4.2" @@ -274,7 +244,7 @@ "version": "2.4.2" }, "league/html-to-markdown": { - "version": "4.10.0" + "version": "5.1.1" }, "league/mime-type-detection": { "version": "1.11.0" @@ -283,10 +253,7 @@ "version": "2.7.5" }, "michelf/php-markdown": { - "version": "1.9.0" - }, - "mollie/mollie-api-php": { - "version": "v2.37.1" + "version": "1.9.1" }, "mongodb/mongodb": { "version": "1.15.0" @@ -328,12 +295,6 @@ "nikic/php-parser": { "version": "v4.12.0" }, - "onelogin/php-saml": { - "version": "4.0.0" - }, - "paragonie/random_compat": { - "version": "v9.99.100" - }, "phar-io/manifest": { "version": "2.0.3" }, @@ -346,9 +307,6 @@ "phenx/php-svg-lib": { "version": "0.3.4" }, - "php-cs-fixer/diff": { - "version": "v1.3.1" - }, "phpdocumentor/reflection-common": { "version": "2.2.0" }, @@ -420,17 +378,23 @@ "ralouphie/getallheaders": { "version": "3.0.3" }, + "ramsey/collection": { + "version": "1.3.0" + }, "ramsey/uuid": { - "version": "3.9.4" + "version": "4.2.3" }, "ramsey/uuid-doctrine": { - "version": "1.3", + "version": "2.0", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.3", "ref": "471aed0fbf5620b8d7f92b7a5ebbbf6c0945c27a" - } + }, + "files": [ + "config/packages/ramsey_uuid_doctrine.yaml" + ] }, "respect/stringifier": { "version": "0.2.0" @@ -438,9 +402,6 @@ "respect/validation": { "version": "2.2.3" }, - "robrichards/xmlseclibs": { - "version": "3.1.1" - }, "sabberworm/php-css-parser": { "version": "8.4.0" }, @@ -501,18 +462,6 @@ "spomky-labs/base64url": { "version": "v2.0.4" }, - "stof/doctrine-extensions-bundle": { - "version": "1.2", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "master", - "version": "1.2", - "ref": "6c1ceb662f8997085f739cd089bfbef67f245983" - } - }, - "sumup/sumup-ecom-php-sdk": { - "version": "1.0.2" - }, "symfony/amqp-messenger": { "version": "v5.3.14" }, @@ -640,15 +589,6 @@ "ref": "addcb559b32d9dbb4843826b063565e1b15a2a57" } }, - "symfony/maker-bundle": { - "version": "1.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.0", - "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" - } - }, "symfony/messenger": { "version": "5.3", "recipe": { @@ -682,9 +622,6 @@ "symfony/options-resolver": { "version": "v5.3.4" }, - "symfony/orm-pack": { - "version": "v2.1.0" - }, "symfony/password-hasher": { "version": "v5.3.4" }, @@ -718,9 +655,6 @@ "symfony/polyfill-mbstring": { "version": "v1.23.1" }, - "symfony/polyfill-php70": { - "version": "v1.20.0" - }, "symfony/polyfill-php73": { "version": "v1.23.0" }, @@ -730,9 +664,6 @@ "symfony/polyfill-php81": { "version": "v1.23.0" }, - "symfony/process": { - "version": "v5.3.4" - }, "symfony/property-access": { "version": "v5.3.4" }, @@ -788,28 +719,12 @@ "symfony/serializer": { "version": "v5.3.4" }, - "symfony/serializer-pack": { - "version": "v1.0.4" - }, "symfony/stopwatch": { "version": "v5.3.4" }, "symfony/string": { "version": "v5.3.3" }, - "symfony/translation": { - "version": "5.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.3", - "ref": "da64f5a2b6d96f5dc24914517c0350a5f91dee43" - }, - "files": [ - "config/packages/translation.yaml", - "translations/.gitignore" - ] - }, "symfony/twig-bridge": { "version": "v5.3.4" }, diff --git a/api/translations/.gitignore b/api/translations/.gitignore deleted file mode 100644 index e69de29bb..000000000 From d1f2e01ae8991c1f3581599988d644b4340cae9b Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Fri, 13 Oct 2023 15:58:40 +0200 Subject: [PATCH 2/5] Dependency updates --- api/Dockerfile | 4 +- api/composer.json | 24 +- api/composer.lock | 2174 ++++------------- api/config/bundles.php | 1 - .../conduction/conduction_white_on_blue.svg | 1 - .../condution_blue_on_transparant.svg | 1 - .../conduction/condution_blue_on_white.svg | 1 - .../condution_white_on_transparant.svg | 1 - .../images/municipalities/s-hertogenbosch.svg | 41 - .../images/municipalities/utrecht.svg | 335 --- api/symfony.lock | 9 +- 11 files changed, 505 insertions(+), 2087 deletions(-) delete mode 100644 api/public/bundles/commonground/images/conduction/conduction_white_on_blue.svg delete mode 100644 api/public/bundles/commonground/images/conduction/condution_blue_on_transparant.svg delete mode 100644 api/public/bundles/commonground/images/conduction/condution_blue_on_white.svg delete mode 100644 api/public/bundles/commonground/images/conduction/condution_white_on_transparant.svg delete mode 100644 api/public/bundles/commonground/images/municipalities/s-hertogenbosch.svg delete mode 100644 api/public/bundles/commonground/images/municipalities/utrecht.svg diff --git a/api/Dockerfile b/api/Dockerfile index a243fe718..a075b9ea6 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm-alpine AS api_platform_php +FROM php:8.2-fpm-alpine AS api_platform_php # Create a user RUN addgroup -S -g 101 commonground-gateway && adduser -S -D -u 101 commonground-gateway @@ -18,7 +18,7 @@ RUN apk add --no-cache \ bash \ ; -ARG APCU_VERSION=5.1.17 +ARG APCU_VERSION=5.1.21 ARG SQLSRV_VERSION=5.10.1 RUN set -eux; \ diff --git a/api/composer.json b/api/composer.json index 29e506841..16b81286e 100644 --- a/api/composer.json +++ b/api/composer.json @@ -1,10 +1,10 @@ { "type": "project", "license": "proprietary", - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": "^7.4.0", + "php": "^7.4.0 || ^8.1.0 || ^8.2.0", "ext-ctype": "*", "ext-fileinfo": "*", "ext-iconv": "*", @@ -13,29 +13,36 @@ "alcaeus/mongo-php-adapter": "^1.2", "api-platform/core": "^2.6", "beberlei/doctrineextensions": "^1.3", - "commongateway/corebundle": "^1.1.74", + "commongateway/corebundle": "dev-feature/MF-62/PHP-8.2", + "composer/ca-bundle": "*", "composer/package-versions-deprecated": "1.11.99.3", - "conduction/commongroundbundle": "dev-feature-gateway", - "conduction/digidbundle": "dev-master", - "conduction/samlbundle": "dev-master", + "composer/semver": "*", + "composer/xdebug-handler": "*", "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^2.4", + "doctrine/doctrine-fixtures-bundle": "*", "doctrine/doctrine-migrations-bundle": "^3.1", "doctrine/orm": "^2.9", "dompdf/dompdf": "^2", "endroid/qr-code-bundle": "3.4", + "friendsofphp/proxy-manager-lts": "*", + "gedmo/doctrine-extensions": "*", "guzzlehttp/guzzle": "6.5.8", "guzzlehttp/psr7": "1.9", "hautelook/alice-bundle": "^2.9.0", "jwadhams/json-logic-php": "^1.4", + "laminas/laminas-code": "*", + "laminas/laminas-escaper": "*", "league/flysystem-bundle": "^2.4", "league/flysystem-ftp": "^2.4", + "league/html-to-markdown": "*", "mongodb/mongodb": "^1.15", "monolog/monolog": "^2.8.0", "nelmio/cors-bundle": "^2.1", "phpdocumentor/reflection-docblock": "^5.2", "phpoffice/phpspreadsheet": "^1.29", "phpoffice/phpword": "^0.18.2", + "ramsey/uuid-doctrine": "*", "respect/validation": "^2.2", "setono/cron-expression-bundle": "^1.5", "symfony/asset": "5.3.*", @@ -49,6 +56,7 @@ "symfony/mailer": "5.3.*", "symfony/mailgun-mailer": "5.3.*", "symfony/messenger": "5.3.*", + "symfony/process": "5.3.*", "symfony/property-access": "5.3.*", "symfony/property-info": "5.3.*", "symfony/proxy-manager-bridge": "5.3.*", @@ -58,7 +66,9 @@ "symfony/twig-bundle": "5.3.*", "symfony/validator": "5.3.*", "symfony/web-profiler-bundle": "5.3.*", - "symfony/yaml": "5.3.*" + "symfony/yaml": "5.3.*", + "thecodingmachine/safe": "*", + "web-token/jwt-framework": "*" }, "config": { "optimize-autoloader": true, diff --git a/api/composer.lock b/api/composer.lock index ed73b85fd..3491c9121 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "26900a024cf0ecaf8966b2e29a938737", + "content-hash": "b06ff88d1873f12139f276bf48c7d1d1", "packages": [ { "name": "adbario/php-dot-notation", @@ -128,43 +128,6 @@ }, "time": "2022-01-11T15:05:50+00:00" }, - { - "name": "api-platform/api-pack", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/api-platform/api-pack.git", - "reference": "0fb12343362f565b65eb374d3c49bec580ffcf8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/api-platform/api-pack/zipball/0fb12343362f565b65eb374d3c49bec580ffcf8d", - "reference": "0fb12343362f565b65eb374d3c49bec580ffcf8d", - "shasum": "" - }, - "require": { - "api-platform/core": "*", - "nelmio/cors-bundle": "*", - "symfony/asset": "*", - "symfony/expression-language": "*", - "symfony/orm-pack": "*", - "symfony/security-bundle": "*", - "symfony/serializer-pack": "*", - "symfony/twig-bundle": "*", - "symfony/validator": "*" - }, - "type": "symfony-pack", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A pack for API Platform", - "support": { - "issues": "https://github.com/api-platform/api-pack/issues", - "source": "https://github.com/api-platform/api-pack/tree/v1.3.0" - }, - "time": "2020-08-28T20:27:34+00:00" - }, { "name": "api-platform/core", "version": "v2.6.5", @@ -320,81 +283,6 @@ ], "time": "2021-06-15T16:53:33+00:00" }, - { - "name": "api-platform/schema-generator", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/api-platform/schema-generator.git", - "reference": "cf7aacaf5078e8110142131c5c66382a1fd83328" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/api-platform/schema-generator/zipball/cf7aacaf5078e8110142131c5c66382a1fd83328", - "reference": "cf7aacaf5078e8110142131c5c66382a1fd83328", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^1.4.3 || ^2.0", - "easyrdf/easyrdf": "^1.1", - "ext-json": "*", - "friendsofphp/php-cs-fixer": "^2.15", - "league/html-to-markdown": "^4.9", - "php": ">=7.4", - "psr/log": "^1.0", - "symfony/config": "^5.2", - "symfony/console": "^5.2", - "symfony/filesystem": "^5.2", - "symfony/yaml": "^5.2", - "twig/twig": "^3.0" - }, - "require-dev": { - "api-platform/core": "^2.5", - "doctrine/orm": "^2.7", - "myclabs/php-enum": "^1.7", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/phpstan": "^0.12", - "symfony/doctrine-bridge": "^5.2", - "symfony/phpunit-bridge": "^5.2", - "symfony/serializer": "^5.2", - "symfony/validator": "^5.2" - }, - "bin": [ - "bin/schema" - ], - "type": "library", - "autoload": { - "psr-4": { - "ApiPlatform\\SchemaGenerator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kévin Dunglas", - "email": "dunglas@gmail.com" - } - ], - "description": "Various tools to generate a data model based on Schema.org vocables", - "homepage": "https://api-platform.com/docs/schema-generator/", - "keywords": [ - "doctrine", - "entity", - "enum", - "model", - "schema.org", - "semantic", - "symfony" - ], - "support": { - "issues": "https://github.com/api-platform/schema-generator/issues", - "source": "https://github.com/api-platform/schema-generator/tree/v3.0.0" - }, - "time": "2021-01-20T21:39:48+00:00" - }, { "name": "bacon/bacon-qr-code", "version": "2.0.7", @@ -508,30 +396,30 @@ }, { "name": "behat/transliterator", - "version": "v1.3.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/Behat/Transliterator.git", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc" + "reference": "baac5873bac3749887d28ab68e2f74db3a4408af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/baac5873bac3749887d28ab68e2f74db3a4408af", + "reference": "baac5873bac3749887d28ab68e2f74db3a4408af", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "require-dev": { "chuyskywalker/rolling-curl": "^3.1", "php-yaoi/php-yaoi": "^1.0", - "phpunit/phpunit": "^4.8.36|^6.3" + "phpunit/phpunit": "^8.5.25 || ^9.5.19" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -551,9 +439,9 @@ ], "support": { "issues": "https://github.com/Behat/Transliterator/issues", - "source": "https://github.com/Behat/Transliterator/tree/v1.3.0" + "source": "https://github.com/Behat/Transliterator/tree/v1.5.0" }, - "time": "2020-01-14T16:39:13+00:00" + "time": "2022-03-30T09:27:43+00:00" }, { "name": "brick/math", @@ -660,16 +548,16 @@ }, { "name": "commongateway/corebundle", - "version": "1.1.74", + "version": "dev-feature/MF-62/PHP-8.2", "source": { "type": "git", "url": "https://github.com/CommonGateway/CoreBundle.git", - "reference": "7a4bd00b95f84e1a5ca5f787b64635941ad22a83" + "reference": "8349de2b20097e5fc4d7a29f283f949c01d870eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CommonGateway/CoreBundle/zipball/7a4bd00b95f84e1a5ca5f787b64635941ad22a83", - "reference": "7a4bd00b95f84e1a5ca5f787b64635941ad22a83", + "url": "https://api.github.com/repos/CommonGateway/CoreBundle/zipball/8349de2b20097e5fc4d7a29f283f949c01d870eb", + "reference": "8349de2b20097e5fc4d7a29f283f949c01d870eb", "shasum": "" }, "require": { @@ -678,9 +566,6 @@ "api-platform/core": "^2.6", "beberlei/doctrineextensions": "^1.3", "composer/package-versions-deprecated": "1.11.99.3", - "conduction/commongroundbundle": "dev-feature-gateway", - "conduction/digidbundle": "dev-master", - "conduction/samlbundle": "dev-master", "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^2.4", "doctrine/doctrine-migrations-bundle": "^3.1", @@ -701,7 +586,7 @@ "mongodb/mongodb": "^1.15", "monolog/monolog": "^2.8.0", "nelmio/cors-bundle": "^2.1", - "php": "^7.4.0", + "php": "^7.4.0 || ^8.1.0 || ^8.2.0", "phpdocumentor/reflection-docblock": "^5.2", "phpoffice/phpspreadsheet": "^1.29", "phpoffice/phpword": "^0.18.2", @@ -783,20 +668,20 @@ "issues": "https://github.com/CommonGateway/CoreBundle/issues", "source": "https://github.com/CommonGateway/CoreBundle" }, - "time": "2023-08-16T09:52:03+00:00" + "time": "2023-10-13T10:59:01+00:00" }, { "name": "composer/ca-bundle", - "version": "1.2.10", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", "shasum": "" }, "require": { @@ -808,7 +693,7 @@ "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, "type": "library", "extra": { @@ -843,7 +728,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + "source": "https://github.com/composer/ca-bundle/tree/1.3.7" }, "funding": [ { @@ -859,7 +744,7 @@ "type": "tidelift" } ], - "time": "2021-06-07T13:58:28+00:00" + "time": "2023-08-30T09:31:38+00:00" }, { "name": "composer/package-versions-deprecated", @@ -931,25 +816,26 @@ "time": "2021-08-17T13:49:14+00:00" }, { - "name": "composer/semver", - "version": "3.2.5", + "name": "composer/pcre", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "url": "https://github.com/composer/pcre.git", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { @@ -959,7 +845,7 @@ }, "autoload": { "psr-4": { - "Composer\\Semver\\": "src" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -967,33 +853,22 @@ "MIT" ], "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "semantic", - "semver", - "validation", - "versioning" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.1" }, "funding": [ { @@ -1009,34 +884,38 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2023-10-11T07:11:09+00:00" }, { - "name": "composer/xdebug-handler", - "version": "2.0.2", + "name": "composer/semver", + "version": "3.4.0", "source": { "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "Composer\\XdebugHandler\\": "src" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1045,19 +924,32 @@ ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Restarts a process without Xdebug.", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "Xdebug", - "performance" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -1073,138 +965,37 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { - "name": "conduction/commongroundbundle", - "version": "dev-feature-gateway", + "name": "composer/xdebug-handler", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/ConductionNL/CommonGroundBundle.git", - "reference": "02d76a8ddda5cc2329f0e4ff326f427ac1eba3c0" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ConductionNL/CommonGroundBundle/zipball/02d76a8ddda5cc2329f0e4ff326f427ac1eba3c0", - "reference": "02d76a8ddda5cc2329f0e4ff326f427ac1eba3c0", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "api-platform/api-pack": "^1.2@stable", - "api-platform/core": "^2.4@stable", - "api-platform/schema-generator": "^3.0", - "doctrine/doctrine-bundle": "^1.6 || ^2.0 || ^2.4", - "doctrine/doctrine-fixtures-bundle": "^3.2", - "guzzlehttp/guzzle": "^6.3", - "knplabs/knp-markdown-bundle": "^1.8", - "mollie/mollie-api-php": "^2.0", - "php": "^7.4.0", - "ramsey/uuid": "^3.8", - "ramsey/uuid-doctrine": "^1.5", - "stof/doctrine-extensions-bundle": "^1.3", - "sumup/sumup-ecom-php-sdk": "^1.0", - "symfony/cache": "^5.0@stable", - "symfony/cache-contracts": "^2.4", - "symfony/console": "^5.0@stable", - "symfony/contracts": "^2.4", - "symfony/event-dispatcher": "^5.1", - "symfony/maker-bundle": "^1.11@stable", - "symfony/translation": "^5.0", - "symfony/var-exporter": "^5.0", - "twig/twig": "^3.3", - "web-token/jwt-framework": "^2.2" - }, - "conflict": { - "doctrine/dbal": "<2.5", - "symfony/dependency-injection": "<3.4", - "symfony/var-dumper": "<3.4" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/cache": "~1.6", - "doctrine/dbal": "~2.5", - "predis/predis": "~1.1", - "symfony/config": "^5.1", - "symfony/dependency-injection": "~3.4|~4.1|~5.0", - "symfony/var-dumper": "^4.1.1|^5.1" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { "psr-4": { - "Conduction\\CommonGroundBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ruben van der Linde", - "email": "ruben@conduction.nl" - }, - { - "name": "Conduction", - "homepage": "https://conduction.nl" + "Composer\\XdebugHandler\\": "src" } - ], - "description": "Symfony Bundle for dutch common ground functionality", - "homepage": "https://conduction.nl", - "keywords": [ - "Sofi", - "adres", - "brp", - "bsn", - "kadaster", - "kamer van koophandel", - "kvk", - "postcode", - "rsin" - ], - "support": { - "email": "ruben@conduction.nl", - "issues": "https://github.com/ConductionNL/ConductionCommonGroundBundle/issues", - "source": "https://github.com/ConductionNL/ConductionCommonGroundBundle" - }, - "time": "2022-09-13T14:22:16+00:00" - }, - { - "name": "conduction/digidbundle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/ConductionNL/digid-bundle.git", - "reference": "19c921d51e10bf70b32190cccf7c375aa619ddf9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ConductionNL/digid-bundle/zipball/19c921d51e10bf70b32190cccf7c375aa619ddf9", - "reference": "19c921d51e10bf70b32190cccf7c375aa619ddf9", - "shasum": "" - }, - "require": { - "conduction/commongroundbundle": "v2.*-dev | dev-feature-gateway", - "conduction/samlbundle": "dev-master", - "guzzlehttp/guzzle": "^6.3", - "onelogin/php-saml": "^4.0", - "php": "^7.4.0", - "ramsey/uuid": "^3.8", - "symfony/cache": "^5.0@stable", - "symfony/console": "^5.0@stable", - "symfony/event-dispatcher": "^5.0" - }, - "default-branch": true, - "type": "symfony-bundle", - "autoload": { - "psr-4": { - "Conduction\\DigidBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1212,84 +1003,35 @@ ], "authors": [ { - "name": "Robert Zondervan", - "email": "robert@conduction.nl" - }, - { - "name": "Conduction", - "homepage": "https://conduction.nl" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Symfony Bundle for DigiD configuration", - "homepage": "https://conduction.nl", + "description": "Restarts a process without Xdebug.", "keywords": [ - "saml" + "Xdebug", + "performance" ], "support": { - "email": "ruben@conduction.nl", - "issues": "https://github.com/ConductionNL/digid-bundle/issues", - "source": "https://github.com/ConductionNL/digid-bundle" - }, - "time": "2021-12-14T13:16:02+00:00" - }, - { - "name": "conduction/samlbundle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/ConductionNL/saml-bundle.git", - "reference": "8d8eb8a4fa362b9b678fc288ead2880a43154714" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ConductionNL/saml-bundle/zipball/8d8eb8a4fa362b9b678fc288ead2880a43154714", - "reference": "8d8eb8a4fa362b9b678fc288ead2880a43154714", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.3", - "onelogin/php-saml": "^4.0", - "php": "^7.4.0", - "ramsey/uuid": "^3.8", - "symfony/cache": "^5.0@stable", - "symfony/console": "^5.0@stable", - "symfony/event-dispatcher": "^5.0" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, - "default-branch": true, - "type": "symfony-bundle", - "autoload": { - "psr-4": { - "Conduction\\SamlBundle\\": "" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ { - "name": "Robert Zondervan", - "email": "robert@conduction.nl" + "url": "https://github.com/composer", + "type": "github" }, { - "name": "Conduction", - "homepage": "https://conduction.nl" + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "description": "Symfony Bundle for SAML configuration", - "homepage": "https://conduction.nl", - "keywords": [ - "saml" - ], - "support": { - "email": "ruben@conduction.nl", - "issues": "https://github.com/ConductionNL/ConductionCommonGroundBundle/issues", - "source": "https://github.com/ConductionNL/ConductionCommonGroundBundle" - }, - "time": "2021-12-13T18:14:43+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "dasprid/enum", @@ -1987,34 +1729,36 @@ }, { "name": "doctrine/doctrine-fixtures-bundle", - "version": "3.4.0", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "870189619a7770f468ffb0b80925302e065a3b34" + "reference": "9ec3139c52a42e94c9fd1e95f8d2bca94326edfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/870189619a7770f468ffb0b80925302e065a3b34", - "reference": "870189619a7770f468ffb0b80925302e065a3b34", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/9ec3139c52a42e94c9fd1e95f8d2bca94326edfb", + "reference": "9ec3139c52a42e94c9fd1e95f8d2bca94326edfb", "shasum": "" }, "require": { "doctrine/data-fixtures": "^1.3", "doctrine/doctrine-bundle": "^1.11|^2.0", "doctrine/orm": "^2.6.0", - "doctrine/persistence": "^1.3.7|^2.0", + "doctrine/persistence": "^1.3.7|^2.0|^3.0", "php": "^7.1 || ^8.0", - "symfony/config": "^3.4|^4.3|^5.0", - "symfony/console": "^3.4|^4.3|^5.0", - "symfony/dependency-injection": "^3.4|^4.3|^5.0", - "symfony/doctrine-bridge": "^3.4|^4.1|^5.0", - "symfony/http-kernel": "^3.4|^4.3|^5.0" + "symfony/config": "^3.4|^4.3|^5.0|^6.0", + "symfony/console": "^3.4|^4.3|^5.0|^6.0", + "symfony/dependency-injection": "^3.4.47|^4.3|^5.0|^6.0", + "symfony/doctrine-bridge": "^3.4|^4.1|^5.0|^6.0", + "symfony/http-kernel": "^3.4|^4.3|^5.0|^6.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpunit/phpunit": "^7.4 || ^8.0 || ^9.2", - "symfony/phpunit-bridge": "^4.1|^5.0" + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "^1.4.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "symfony/phpunit-bridge": "^6.0.8", + "vimeo/psalm": "^4.22" }, "type": "symfony-bundle", "autoload": { @@ -2033,22 +1777,22 @@ }, { "name": "Doctrine Project", - "homepage": "http://www.doctrine-project.org" + "homepage": "https://www.doctrine-project.org" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony DoctrineFixturesBundle", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org", "keywords": [ "Fixture", "persistence" ], "support": { "issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues", - "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.0" + "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.4" }, "funding": [ { @@ -2064,7 +1808,7 @@ "type": "tidelift" } ], - "time": "2020-11-14T09:36:49+00:00" + "time": "2023-05-02T15:12:16+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", @@ -2920,87 +2664,12 @@ "time": "2022-01-18T15:43:28+00:00" }, { - "name": "easyrdf/easyrdf", - "version": "1.1.1", + "name": "egulias/email-validator", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/easyrdf/easyrdf.git", - "reference": "c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/easyrdf/easyrdf/zipball/c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64", - "reference": "c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-mbstring": "*", - "ext-pcre": "*", - "ext-xmlreader": "*", - "lib-libxml": "*", - "php": ">=7.1.0" - }, - "require-dev": { - "code-lts/doctum": "^5", - "ml/json-ld": "~1.0", - "phpunit/phpunit": "^7", - "semsol/arc2": "^2.4", - "squizlabs/php_codesniffer": "3.*", - "zendframework/zend-http": "~2.3" - }, - "suggest": { - "ml/json-ld": "~1.0", - "semsol/arc2": "~2.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "EasyRdf\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nicholas Humfrey", - "email": "njh@aelius.com", - "homepage": "http://www.aelius.com/njh/", - "role": "Developer" - }, - { - "name": "Alexey Zakhlestin", - "email": "indeyets@gmail.com", - "homepage": "http://indeyets.ru/", - "role": "Developer" - } - ], - "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", - "homepage": "http://www.easyrdf.org/", - "keywords": [ - "Linked Data", - "RDF", - "Semantic Web", - "Turtle", - "rdfa", - "sparql" - ], - "support": { - "forum": "http://groups.google.com/group/easyrdf/", - "issues": "http://github.com/easyrdf/easyrdf/issues", - "source": "https://github.com/easyrdf/easyrdf/tree/1.1.1" - }, - "time": "2020-12-02T08:47:31+00:00" - }, - { - "name": "egulias/email-validator", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715" + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715" }, "dist": { "type": "zip", @@ -3387,24 +3056,24 @@ }, { "name": "fgrosse/phpasn1", - "version": "v2.3.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/fgrosse/PHPASN1.git", - "reference": "20299033c35f4300eb656e7e8e88cf52d1d6694e" + "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/20299033c35f4300eb656e7e8e88cf52d1d6694e", - "reference": "20299033c35f4300eb656e7e8e88cf52d1d6694e", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/42060ed45344789fb9f21f9f1864fc47b9e3507b", + "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b", "shasum": "" }, "require": { - "php": ">=7.0.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "~6.3", - "satooshi/php-coveralls": "~2.0" + "php-coveralls/php-coveralls": "~2.0", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "suggest": { "ext-bcmath": "BCmath is the fallback extension for big integer calculations", @@ -3456,9 +3125,10 @@ ], "support": { "issues": "https://github.com/fgrosse/PHPASN1/issues", - "source": "https://github.com/fgrosse/PHPASN1/tree/v2.3.0" + "source": "https://github.com/fgrosse/PHPASN1/tree/v2.5.0" }, - "time": "2021-04-24T19:01:55+00:00" + "abandoned": true, + "time": "2022-12-19T11:08:26+00:00" }, { "name": "fig/link-util", @@ -3517,133 +3187,24 @@ ], "time": "2021-02-03T23:36:04+00:00" }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.2", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5c737c2e18ba502b75b44832b31fe627f82e307", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.2" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2021-08-18T19:55:46+00:00" - }, { "name": "friendsofphp/proxy-manager-lts", - "version": "v1.0.5", + "version": "v1.0.16", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/proxy-manager-lts.git", - "reference": "006aa5d32f887a4db4353b13b5b5095613e0611f" + "reference": "ecadbdc9052e4ad08c60c8a02268712e50427f7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/proxy-manager-lts/zipball/006aa5d32f887a4db4353b13b5b5095613e0611f", - "reference": "006aa5d32f887a4db4353b13b5b5095613e0611f", + "url": "https://api.github.com/repos/FriendsOfPHP/proxy-manager-lts/zipball/ecadbdc9052e4ad08c60c8a02268712e50427f7c", + "reference": "ecadbdc9052e4ad08c60c8a02268712e50427f7c", "shasum": "" }, "require": { "laminas/laminas-code": "~3.4.1|^4.0", "php": ">=7.1", - "symfony/filesystem": "^4.4.17|^5.0|^6.0" + "symfony/filesystem": "^4.4.17|^5.0|^6.0|^7.0" }, "conflict": { "laminas/laminas-stdlib": "<3.2.1", @@ -3654,7 +3215,7 @@ }, "require-dev": { "ext-phar": "*", - "symfony/phpunit-bridge": "^5.2|^6.0" + "symfony/phpunit-bridge": "^5.4|^6.0|^7.0" }, "type": "library", "extra": { @@ -3676,7 +3237,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.io/" + "homepage": "https://ocramius.github.io/" }, { "name": "Nicolas Grekas", @@ -3692,6 +3253,10 @@ "proxy pattern", "service proxies" ], + "support": { + "issues": "https://github.com/FriendsOfPHP/proxy-manager-lts/issues", + "source": "https://github.com/FriendsOfPHP/proxy-manager-lts/tree/v1.0.16" + }, "funding": [ { "url": "https://github.com/Ocramius", @@ -3702,20 +3267,20 @@ "type": "tidelift" } ], - "time": "2021-05-22T16:11:15+00:00" + "time": "2023-05-24T07:17:17+00:00" }, { "name": "gedmo/doctrine-extensions", - "version": "v3.1.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/doctrine-extensions/DoctrineExtensions.git", - "reference": "0803fa56b13cf858951599027f451738078c49f8" + "reference": "8c02cee09e3dd43799ec3b84b619b19982c47f43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine-extensions/DoctrineExtensions/zipball/0803fa56b13cf858951599027f451738078c49f8", - "reference": "0803fa56b13cf858951599027f451738078c49f8", + "url": "https://api.github.com/repos/doctrine-extensions/DoctrineExtensions/zipball/8c02cee09e3dd43799ec3b84b619b19982c47f43", + "reference": "8c02cee09e3dd43799ec3b84b619b19982c47f43", "shasum": "" }, "require": { @@ -3729,6 +3294,7 @@ "conflict": { "doctrine/mongodb": "<1.3", "doctrine/mongodb-odm": "<2.0", + "doctrine/orm": ">=2.10", "sebastian/comparator": "<2.0" }, "provide": { @@ -3737,10 +3303,11 @@ "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", "doctrine/cache": "^1.11 || ^2.0", + "doctrine/dbal": "^2.13", "doctrine/doctrine-bundle": "^2.3", "doctrine/mongodb-odm": "^2.0", - "doctrine/orm": "^2.6.3", - "friendsofphp/php-cs-fixer": "^2.16", + "doctrine/orm": "^2.9.6", + "friendsofphp/php-cs-fixer": "^3.0", "phpunit/phpunit": "^8.5", "symfony/cache": "^4.4 || ^5.0", "symfony/yaml": "^4.1" @@ -3799,10 +3366,10 @@ "support": { "email": "gediminas.morkevicius@gmail.com", "issues": "https://github.com/doctrine-extensions/DoctrineExtensions/issues", - "source": "https://github.com/doctrine-extensions/DoctrineExtensions/tree/v3.1.0", + "source": "https://github.com/doctrine-extensions/DoctrineExtensions/tree/v3.2.0", "wiki": "https://github.com/Atlantic18/DoctrineExtensions/tree/main/doc" }, - "time": "2021-06-22T11:23:22+00:00" + "time": "2021-10-05T15:25:14+00:00" }, { "name": "guzzlehttp/guzzle", @@ -4320,106 +3887,35 @@ }, "time": "2022-06-29T09:25:13+00:00" }, - { - "name": "knplabs/knp-markdown-bundle", - "version": "1.9.0", - "source": { - "type": "git", - "url": "https://github.com/KnpLabs/KnpMarkdownBundle.git", - "reference": "843b3d0c9b741a3cf46296e9f326026b210e66c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/KnpMarkdownBundle/zipball/843b3d0c9b741a3cf46296e9f326026b210e66c1", - "reference": "843b3d0c9b741a3cf46296e9f326026b210e66c1", - "shasum": "" - }, - "require": { - "michelf/php-markdown": "~1.4", - "php": "^7.1.3|^8.0", - "symfony/dependency-injection": "~3.4|^4.0|^5.0", - "symfony/framework-bundle": "~3.4|^4.0|^5.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4.0 || ^5.0", - "symfony/templating": "~3.4|^4.0|^5.0" - }, - "suggest": { - "ext-sundown": "to use optional support for php-sundown extension instead of php implementation", - "symfony/twig-bundle": "to use the Twig markdown filter" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "autoload": { - "psr-4": { - "Knp\\Bundle\\MarkdownBundle\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - }, - { - "name": "Symfony Community", - "homepage": "http://github.com/KnpLabs/KnpMarkdownBundle/contributors" - } - ], - "description": "Knplabs markdown bundle transforms markdown into html", - "homepage": "http://github.com/KnpLabs/KnpMarkdownBundle", - "keywords": [ - "bundle", - "knp", - "knplabs", - "markdown" - ], - "support": { - "issues": "https://github.com/KnpLabs/KnpMarkdownBundle/issues", - "source": "https://github.com/KnpLabs/KnpMarkdownBundle/tree/1.9.0" - }, - "time": "2021-03-03T20:01:32+00:00" - }, { "name": "laminas/laminas-code", - "version": "4.4.2", + "version": "4.12.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-code.git", - "reference": "54251ab2b16c41c6980387839496b235f5f6e10b" + "reference": "36cbee228b427446419dd51944bdfb6bb8ddbcd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/54251ab2b16c41c6980387839496b235f5f6e10b", - "reference": "54251ab2b16c41c6980387839496b235f5f6e10b", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/36cbee228b427446419dd51944bdfb6bb8ddbcd0", + "reference": "36cbee228b427446419dd51944bdfb6bb8ddbcd0", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0.0" - }, - "conflict": { - "phpspec/prophecy": "<1.9.0" + "php": "~8.1.0 || ~8.2.0" }, "require-dev": { - "doctrine/annotations": "^1.10.4", + "doctrine/annotations": "^2.0.0", "ext-phar": "*", - "laminas/laminas-coding-standard": "^2.1.4", - "laminas/laminas-stdlib": "^3.3.0", - "phpunit/phpunit": "^9.4.2", - "psalm/plugin-phpunit": "^0.14.0", - "vimeo/psalm": "^4.3.1" + "laminas/laminas-coding-standard": "^2.3.0", + "laminas/laminas-stdlib": "^3.6.1", + "phpunit/phpunit": "^10.0.9", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.7.1" }, "suggest": { "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", - "laminas/laminas-stdlib": "Laminas\\Stdlib component", - "laminas/laminas-zendframework-bridge": "A bridge with Zend Framework" + "laminas/laminas-stdlib": "Laminas\\Stdlib component" }, "type": "library", "autoload": { @@ -4438,43 +3934,51 @@ "laminas", "laminasframework" ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-code/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-code/issues", + "rss": "https://github.com/laminas/laminas-code/releases.atom", + "source": "https://github.com/laminas/laminas-code" + }, "funding": [ { "url": "https://funding.communitybridge.org/projects/laminas-project", "type": "community_bridge" } ], - "time": "2021-07-09T11:58:40+00:00" + "time": "2023-09-06T14:56:25+00:00" }, { "name": "laminas/laminas-escaper", - "version": "2.9.0", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "891ad70986729e20ed2e86355fcf93c9dc238a5f" + "reference": "ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/891ad70986729e20ed2e86355fcf93c9dc238a5f", - "reference": "891ad70986729e20ed2e86355fcf93c9dc238a5f", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490", + "reference": "ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" + "ext-ctype": "*", + "ext-mbstring": "*", + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.12.2", - "vimeo/psalm": "^3.16" - }, - "suggest": { - "ext-iconv": "*", - "ext-mbstring": "*" + "infection/infection": "^0.26.6", + "laminas/laminas-coding-standard": "~2.4.0", + "maglnet/composer-require-checker": "^3.8.0", + "phpunit/phpunit": "^9.5.18", + "psalm/plugin-phpunit": "^0.17.0", + "vimeo/psalm": "^4.22.0" }, "type": "library", "autoload": { @@ -4506,7 +4010,7 @@ "type": "community_bridge" } ], - "time": "2021-09-02T17:10:53+00:00" + "time": "2022-10-10T10:11:09+00:00" }, { "name": "league/flysystem", @@ -4772,27 +4276,30 @@ }, { "name": "league/html-to-markdown", - "version": "4.10.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "0868ae7a552e809e5cd8f93ba022071640408e88" + "reference": "0b4066eede55c48f38bcee4fb8f0aa85654390fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/0868ae7a552e809e5cd8f93ba022071640408e88", - "reference": "0868ae7a552e809e5cd8f93ba022071640408e88", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/0b4066eede55c48f38bcee4fb8f0aa85654390fd", + "reference": "0b4066eede55c48f38bcee4fb8f0aa85654390fd", "shasum": "" }, "require": { "ext-dom": "*", "ext-xml": "*", - "php": ">=5.3.3" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "mikehaertl/php-shellcommand": "~1.1.0", - "phpunit/phpunit": "^4.8|^5.7", - "scrutinizer/ocular": "~1.1" + "mikehaertl/php-shellcommand": "^1.1.0", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^8.5 || ^9.2", + "scrutinizer/ocular": "^1.6", + "unleashedtech/php-coding-standard": "^2.7 || ^3.0", + "vimeo/psalm": "^4.22 || ^5.0" }, "bin": [ "bin/html-to-markdown" @@ -4800,7 +4307,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.10-dev" + "dev-master": "5.2-dev" } }, "autoload": { @@ -4834,7 +4341,7 @@ ], "support": { "issues": "https://github.com/thephpleague/html-to-markdown/issues", - "source": "https://github.com/thephpleague/html-to-markdown/tree/4.10.0" + "source": "https://github.com/thephpleague/html-to-markdown/tree/5.1.1" }, "funding": [ { @@ -4850,11 +4357,11 @@ "type": "github" }, { - "url": "https://www.patreon.com/colinodell", - "type": "patreon" + "url": "https://tidelift.com/funding/github/packagist/league/html-to-markdown", + "type": "tidelift" } ], - "time": "2020-07-01T00:34:03+00:00" + "time": "2023-07-12T21:21:09+00:00" }, { "name": "league/mime-type-detection", @@ -5166,150 +4673,6 @@ }, "time": "2021-07-01T14:25:37+00:00" }, - { - "name": "michelf/php-markdown", - "version": "1.9.0", - "source": { - "type": "git", - "url": "https://github.com/michelf/php-markdown.git", - "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/c83178d49e372ca967d1a8c77ae4e051b3a3c75c", - "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4.3 <5.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Michelf\\": "Michelf/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Michel Fortin", - "email": "michel.fortin@michelf.ca", - "homepage": "https://michelf.ca/", - "role": "Developer" - }, - { - "name": "John Gruber", - "homepage": "https://daringfireball.net/" - } - ], - "description": "PHP Markdown", - "homepage": "https://michelf.ca/projects/php-markdown/", - "keywords": [ - "markdown" - ], - "support": { - "issues": "https://github.com/michelf/php-markdown/issues", - "source": "https://github.com/michelf/php-markdown/tree/1.9.0" - }, - "time": "2019-12-02T02:32:27+00:00" - }, - { - "name": "mollie/mollie-api-php", - "version": "v2.37.1", - "source": { - "type": "git", - "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "260adf68db65edd82b6c11f8fa58622ff72b717c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/260adf68db65edd82b6c11f8fa58622ff72b717c", - "reference": "260adf68db65edd82b6c11f8fa58622ff72b717c", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.1", - "ext-curl": "*", - "ext-json": "*", - "ext-openssl": "*", - "php": ">=5.6" - }, - "require-dev": { - "eloquent/liberator": "^2.0", - "friendsofphp/php-cs-fixer": "^3.0", - "guzzlehttp/guzzle": "^6.3 || ^7.0", - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.1 || ^8.5" - }, - "suggest": { - "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information." - }, - "type": "library", - "autoload": { - "psr-4": { - "Mollie\\Api\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Mollie B.V.", - "email": "info@mollie.com" - } - ], - "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", - "homepage": "https://www.mollie.com/en/developers", - "keywords": [ - "Apple Pay", - "CBC", - "Przelewy24", - "api", - "bancontact", - "banktransfer", - "belfius", - "belfius direct net", - "charges", - "creditcard", - "direct debit", - "fashioncheque", - "gateway", - "gift cards", - "ideal", - "inghomepay", - "intersolve", - "kbc", - "klarna", - "mistercash", - "mollie", - "paylater", - "payment", - "payments", - "paypal", - "paysafecard", - "podiumcadeaukaart", - "recurring", - "refunds", - "sepa", - "service", - "sliceit", - "sofort", - "sofortbanking", - "subscriptions" - ], - "support": { - "issues": "https://github.com/mollie/mollie-api-php/issues", - "source": "https://github.com/mollie/mollie-api-php/tree/v2.37.1" - }, - "time": "2021-08-09T09:30:47+00:00" - }, { "name": "mongodb/mongodb", "version": "1.15.0", @@ -5750,168 +5113,6 @@ ], "time": "2021-04-20T08:27:05+00:00" }, - { - "name": "nikic/php-parser", - "version": "v4.12.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" - }, - "time": "2021-07-21T10:44:31+00:00" - }, - { - "name": "onelogin/php-saml", - "version": "4.0.0", - "source": { - "type": "git", - "url": "https://github.com/onelogin/php-saml.git", - "reference": "f30f5062f3653c4d2082892d207f4dc3e577d979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/onelogin/php-saml/zipball/f30f5062f3653c4d2082892d207f4dc3e577d979", - "reference": "f30f5062f3653c4d2082892d207f4dc3e577d979", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "robrichards/xmlseclibs": ">=3.1.1" - }, - "require-dev": { - "pdepend/pdepend": "^2.8.0", - "php-coveralls/php-coveralls": "^2.0", - "phploc/phploc": "^4.0 || ^5.0 || ^6.0 || ^7.0", - "phpunit/phpunit": "^9.5", - "sebastian/phpcpd": "^4.0 || ^5.0 || ^6.0 ", - "squizlabs/php_codesniffer": "^3.5.8" - }, - "suggest": { - "ext-curl": "Install curl lib to be able to use the IdPMetadataParser for parsing remote XMLs", - "ext-dom": "Install xml lib", - "ext-openssl": "Install openssl lib in order to handle with x509 certs (require to support sign and encryption)", - "ext-zlib": "Install zlib" - }, - "type": "library", - "autoload": { - "psr-4": { - "OneLogin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "OneLogin PHP SAML Toolkit", - "homepage": "https://developers.onelogin.com/saml/php", - "keywords": [ - "SAML2", - "onelogin", - "saml" - ], - "support": { - "email": "sixto.garcia@onelogin.com", - "issues": "https://github.com/onelogin/php-saml/issues", - "source": "https://github.com/onelogin/php-saml/" - }, - "time": "2021-03-02T10:19:19+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v9.99.100", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", - "shasum": "" - }, - "require": { - "php": ">= 7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" - }, - "time": "2020-10-15T08:29:30+00:00" - }, { "name": "phenx/php-font-lib", "version": "0.5.4", @@ -6001,61 +5202,6 @@ }, "time": "2021-10-18T02:13:32+00:00" }, - { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" - } - ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" - }, - "time": "2020-10-14T08:39:05+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -6899,9 +6045,80 @@ }, "type": "library", "autoload": { - "files": [ - "src/getallheaders.php" - ] + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", + "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "symfony/polyfill-php81": "^1.23" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6909,97 +6126,113 @@ ], "authors": [ { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" } ], - "description": "A polyfill for getallheaders.", + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.3.0" }, - "time": "2019-03-08T08:55:37+00:00" + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-27T19:12:24+00:00" }, { "name": "ramsey/uuid", - "version": "3.9.4", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "be2451bef8147b7352a28fb4cddb08adc497ada3" + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/be2451bef8147b7352a28fb4cddb08adc497ada3", - "reference": "be2451bef8147b7352a28fb4cddb08adc497ada3", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", "shasum": "" }, "require": { + "brick/math": "^0.8 || ^0.9", "ext-json": "*", - "paragonie/random_compat": "^1 | ^2 | ^9.99.99", - "php": "^5.4 | ^7 | ^8", - "symfony/polyfill-ctype": "^1.8" + "php": "^7.2 || ^8.0", + "ramsey/collection": "^1.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php80": "^1.14" }, "replace": { "rhumsaa/uuid": "self.version" }, "require-dev": { - "codeception/aspect-mock": "^1 | ^2", - "doctrine/annotations": "^1.2", - "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", - "jakub-onderka/php-parallel-lint": "^1", - "mockery/mockery": "^0.9.11 | ^1", + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", "moontoast/math": "^1.1", "paragonie/random-lib": "^2", - "php-mock/php-mock-phpunit": "^0.3 | ^1.1", - "phpunit/phpunit": "^4.8 | ^5.4 | ^6.5", - "squizlabs/php_codesniffer": "^3.5" + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5 || ^9", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" }, "suggest": { - "ext-ctype": "Provides support for PHP Ctype functions", - "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", - "ext-openssl": "Provides the OpenSSL extension for use with the OpenSslGenerator", - "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", - "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-ctype": "Enables faster processing of character classification using ctype functions.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "4.x-dev" + }, + "captainhook": { + "force-install": true } }, "autoload": { - "psr-4": { - "Ramsey\\Uuid\\": "src/" - }, "files": [ "src/functions.php" - ] + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - }, - { - "name": "Marijn Huizendveld", - "email": "marijn.huizendveld@gmail.com" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io" - } - ], - "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", - "homepage": "https://github.com/ramsey/uuid", + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", "keywords": [ "guid", "identifier", @@ -7007,9 +6240,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "rss": "https://github.com/ramsey/uuid/releases.atom", - "source": "https://github.com/ramsey/uuid", - "wiki": "https://github.com/ramsey/uuid/wiki" + "source": "https://github.com/ramsey/uuid/tree/4.2.3" }, "funding": [ { @@ -7021,35 +6252,55 @@ "type": "tidelift" } ], - "time": "2021-08-06T20:32:15+00:00" + "time": "2021-09-25T23:10:38+00:00" }, { "name": "ramsey/uuid-doctrine", - "version": "1.7.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid-doctrine.git", - "reference": "b250b9d425d5e806cd56a3ab8c60a575a611d786" + "reference": "b002676be0e5e342d857c47f1b68e24de6841d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid-doctrine/zipball/b250b9d425d5e806cd56a3ab8c60a575a611d786", - "reference": "b250b9d425d5e806cd56a3ab8c60a575a611d786", + "url": "https://api.github.com/repos/ramsey/uuid-doctrine/zipball/b002676be0e5e342d857c47f1b68e24de6841d08", + "reference": "b002676be0e5e342d857c47f1b68e24de6841d08", "shasum": "" }, "require": { - "doctrine/dbal": "^2.5", - "php": "^5.4 || ^7 || ^8", - "ramsey/uuid": "^3.5 || ^4" + "doctrine/dbal": "^2.8 || ^3.0", + "php": "^7.4 || ^8.0", + "ramsey/uuid": "^3.9.7 || ^4.0" }, "require-dev": { + "captainhook/plugin-composer": "^5.3", "doctrine/orm": "^2.5", - "mockery/mockery": "^0.9.11 || ^1", - "php-parallel-lint/php-parallel-lint": "^1", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7 || ^8 || ^9", - "squizlabs/php_codesniffer": "^3.5" + "ergebnis/composer-normalize": "^2.28.3", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-alpha4", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" }, "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, "autoload": { "psr-4": { "Ramsey\\Uuid\\Doctrine\\": "src/" @@ -7076,7 +6327,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid-doctrine/issues", - "source": "https://github.com/ramsey/uuid-doctrine/tree/1.7.0" + "source": "https://github.com/ramsey/uuid-doctrine/tree/2.0.0" }, "funding": [ { @@ -7084,11 +6335,11 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid-doctrine", "type": "tidelift" } ], - "time": "2021-08-07T16:48:33+00:00" + "time": "2022-12-20T23:38:28+00:00" }, { "name": "respect/stringifier", @@ -7214,48 +6465,6 @@ }, "time": "2021-03-19T14:12:45+00:00" }, - { - "name": "robrichards/xmlseclibs", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/robrichards/xmlseclibs.git", - "reference": "f8f19e58f26cdb42c54b214ff8a820760292f8df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/f8f19e58f26cdb42c54b214ff8a820760292f8df", - "reference": "f8f19e58f26cdb42c54b214ff8a820760292f8df", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "php": ">= 5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "RobRichards\\XMLSecLibs\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "A PHP library for XML Security", - "homepage": "https://github.com/robrichards/xmlseclibs", - "keywords": [ - "security", - "signature", - "xml", - "xmldsig" - ], - "support": { - "issues": "https://github.com/robrichards/xmlseclibs/issues", - "source": "https://github.com/robrichards/xmlseclibs/tree/3.1.1" - }, - "time": "2020-09-05T13:00:25+00:00" - }, { "name": "sabberworm/php-css-parser", "version": "8.4.0", @@ -7780,133 +6989,6 @@ ], "time": "2020-11-03T09:10:25+00:00" }, - { - "name": "stof/doctrine-extensions-bundle", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/stof/StofDoctrineExtensionsBundle.git", - "reference": "ef469a9d3b8be23d4c746d558742cc1b3e2588cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/stof/StofDoctrineExtensionsBundle/zipball/ef469a9d3b8be23d4c746d558742cc1b3e2588cb", - "reference": "ef469a9d3b8be23d4c746d558742cc1b3e2588cb", - "shasum": "" - }, - "require": { - "gedmo/doctrine-extensions": "^2.3.4 || ^3.0.0", - "php": "^7.1.3 || ^8.0", - "symfony/config": "^4.4 || ^5.2", - "symfony/dependency-injection": "^4.4 || ^5.2", - "symfony/event-dispatcher": "^4.4 || ^5.2", - "symfony/http-kernel": "^4.4 || ^5.2" - }, - "require-dev": { - "symfony/mime": "^4.4 || ^5.2", - "symfony/phpunit-bridge": "^v5.2.4", - "symfony/security-core": "^4.4 || ^5.2" - }, - "suggest": { - "doctrine/doctrine-bundle": "to use the ORM extensions", - "doctrine/mongodb-odm-bundle": "to use the MongoDB ODM extensions", - "symfony/mime": "To use the Mime component integration for Uploadable" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Stof\\DoctrineExtensionsBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Coevoet", - "email": "stof@notk.org" - } - ], - "description": "Integration of the gedmo/doctrine-extensions with Symfony", - "homepage": "https://github.com/stof/StofDoctrineExtensionsBundle", - "keywords": [ - "behaviors", - "doctrine2", - "extensions", - "gedmo", - "loggable", - "nestedset", - "sluggable", - "sortable", - "timestampable", - "translatable", - "tree" - ], - "support": { - "issues": "https://github.com/stof/StofDoctrineExtensionsBundle/issues", - "source": "https://github.com/stof/StofDoctrineExtensionsBundle/tree/v1.6.0" - }, - "time": "2021-03-05T13:09:06+00:00" - }, - { - "name": "sumup/sumup-ecom-php-sdk", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sumup/sumup-ecom-php-sdk.git", - "reference": "b294963b9861abaae53adb6db5ca209059fcf845" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sumup/sumup-ecom-php-sdk/zipball/b294963b9861abaae53adb6db5ca209059fcf845", - "reference": "b294963b9861abaae53adb6db5ca209059fcf845", - "shasum": "" - }, - "require": { - "php": "^5.6|^7.0" - }, - "suggest": { - "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client" - }, - "type": "library", - "autoload": { - "psr-4": { - "SumUp\\": "src/SumUp/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "proprietary" - ], - "authors": [ - { - "name": "SumUp", - "email": "integration@sumup.com", - "homepage": "https://github.com/sumup" - } - ], - "description": "SumUp eCom SDK for PHP", - "homepage": "https://developer.sumup.com", - "keywords": [ - "checkout", - "ecommerce", - "payment", - "payment processing", - "sdk", - "sumup" - ], - "support": { - "issues": "https://github.com/sumup/sumup-ecom-php-sdk/issues", - "source": "https://github.com/sumup/sumup-ecom-php-sdk/tree/master" - }, - "time": "2019-08-28T14:48:03+00:00" - }, { "name": "symfony/amqp-messenger", "version": "v5.3.14", @@ -9841,94 +8923,6 @@ ], "time": "2022-01-02T09:51:59+00:00" }, - { - "name": "symfony/maker-bundle", - "version": "v1.36.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/maker-bundle.git", - "reference": "716eee9c8b10b33e682df1b7d80b9061887e9691" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/716eee9c8b10b33e682df1b7d80b9061887e9691", - "reference": "716eee9c8b10b33e682df1b7d80b9061887e9691", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^1.2|^2.0", - "nikic/php-parser": "^4.11", - "php": ">=7.1.3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/deprecation-contracts": "^2.2|^3", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0" - }, - "require-dev": { - "composer/semver": "^3.0", - "doctrine/doctrine-bundle": "^1.12.3|^2.0", - "doctrine/orm": "^2.3", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/phpunit-bridge": "^4.4|^5.0|^6.0", - "symfony/polyfill-php80": "^1.16.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/security-core": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0", - "twig/twig": "^2.0|^3.0" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-main": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bundle\\MakerBundle\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.", - "homepage": "https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html", - "keywords": [ - "code generator", - "generator", - "scaffold", - "scaffolding" - ], - "support": { - "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.36.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-12-01T00:27:38+00:00" - }, { "name": "symfony/messenger", "version": "v5.3.14", @@ -10311,61 +9305,14 @@ } ], "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.3.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-08-04T21:20:46+00:00" - }, - { - "name": "symfony/orm-pack", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/orm-pack.git", - "reference": "357f6362067b1ebb94af321b79f8939fc9118751" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/orm-pack/zipball/357f6362067b1ebb94af321b79f8939fc9118751", - "reference": "357f6362067b1ebb94af321b79f8939fc9118751", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "*", - "doctrine/doctrine-bundle": "*", - "doctrine/doctrine-migrations-bundle": "*", - "doctrine/orm": "*", - "symfony/proxy-manager-bridge": "*" - }, - "type": "symfony-pack", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" ], - "description": "A pack for the Doctrine ORM", "support": { - "issues": "https://github.com/symfony/orm-pack/issues", - "source": "https://github.com/symfony/orm-pack/tree/v2.1.0" + "source": "https://github.com/symfony/options-resolver/tree/v5.3.7" }, "funding": [ { @@ -10381,7 +9328,7 @@ "type": "tidelift" } ], - "time": "2020-12-22T16:33:52+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/password-hasher", @@ -10878,74 +9825,6 @@ ], "time": "2022-11-03T14:55:06+00:00" }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, { "name": "symfony/polyfill-php73", "version": "v1.27.0", @@ -11189,16 +10068,16 @@ }, { "name": "symfony/process", - "version": "v5.3.12", + "version": "v5.3.14", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e498803a6e95ede78e9d5646ad32a2255c033a6a" + "reference": "8bbae08c19308b9493ad235386144cbefec83cb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e498803a6e95ede78e9d5646ad32a2255c033a6a", - "reference": "e498803a6e95ede78e9d5646ad32a2255c033a6a", + "url": "https://api.github.com/repos/symfony/process/zipball/8bbae08c19308b9493ad235386144cbefec83cb0", + "reference": "8bbae08c19308b9493ad235386144cbefec83cb0", "shasum": "" }, "require": { @@ -11231,7 +10110,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.12" + "source": "https://github.com/symfony/process/tree/v5.3.14" }, "funding": [ { @@ -11247,7 +10126,7 @@ "type": "tidelift" } ], - "time": "2021-11-22T22:39:13+00:00" + "time": "2022-01-24T19:35:44+00:00" }, { "name": "symfony/property-access", @@ -12243,53 +11122,6 @@ ], "time": "2021-11-24T08:13:09+00:00" }, - { - "name": "symfony/serializer-pack", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/serializer-pack.git", - "reference": "61173947057d5e1bf1c79e2a6ab6a8430be0602e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer-pack/zipball/61173947057d5e1bf1c79e2a6ab6a8430be0602e", - "reference": "61173947057d5e1bf1c79e2a6ab6a8430be0602e", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.0", - "phpdocumentor/reflection-docblock": "*", - "symfony/property-access": "*", - "symfony/property-info": "*", - "symfony/serializer": "*" - }, - "type": "symfony-pack", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A pack for the Symfony serializer", - "support": { - "issues": "https://github.com/symfony/serializer-pack/issues", - "source": "https://github.com/symfony/serializer-pack/tree/v1.0.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-19T08:52:16+00:00" - }, { "name": "symfony/stopwatch", "version": "v5.3.4", @@ -12435,101 +11267,6 @@ ], "time": "2021-10-27T18:21:46+00:00" }, - { - "name": "symfony/translation", - "version": "v5.3.11", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "17a965c8f3b1b348cf15d903ac53942984561f8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/17a965c8f3b1b348cf15d903ac53942984561f8a", - "reference": "17a965c8f3b1b348cf15d903ac53942984561f8a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" - }, - "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" - }, - "provide": { - "symfony/translation-implementation": "2.3" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to internationalize your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.11" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-04T16:37:19+00:00" - }, { "name": "symfony/twig-bridge", "version": "v5.3.11", @@ -13280,13 +12017,6 @@ } }, "autoload": { - "psr-4": { - "Safe\\": [ - "lib/", - "deprecated/", - "generated/" - ] - }, "files": [ "deprecated/apc.php", "deprecated/libevent.php", @@ -13377,7 +12107,14 @@ "generated/yaz.php", "generated/zip.php", "generated/zlib.php" - ] + ], + "psr-4": { + "Safe\\": [ + "lib/", + "deprecated/", + "generated/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -13660,6 +12397,9 @@ "autoload": { "psr-4": { "Jose\\": "src/", + "Jose\\Component\\Core\\Util\\Ecc\\": [ + "src/Ecc" + ], "Jose\\Component\\Signature\\Algorithm\\": [ "src/SignatureAlgorithm/ECDSA", "src/SignatureAlgorithm/EdDSA", @@ -13668,9 +12408,6 @@ "src/SignatureAlgorithm/RSA", "src/SignatureAlgorithm/Experimental" ], - "Jose\\Component\\Core\\Util\\Ecc\\": [ - "src/Ecc" - ], "Jose\\Component\\Encryption\\Algorithm\\": [ "src/EncryptionAlgorithm/Experimental" ], @@ -13842,6 +12579,62 @@ } ], "packages-dev": [ + { + "name": "nikic/php-parser", + "version": "v4.12.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + }, + "time": "2021-07-21T10:44:31+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -13955,27 +12748,28 @@ }, { "name": "phpspec/prophecy", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/15873c65b207b07765dbc3c95d20fdf4a320cbe2", + "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "doctrine/instantiator": "^1.2 || ^2.0", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { "phpspec/phpspec": "^6.0 || ^7.0", + "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", @@ -14016,9 +12810,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.17.0" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2023-02-02T15:41:36+00:00" }, { "name": "phpunit/php-code-coverage", @@ -15473,21 +14267,19 @@ } ], "aliases": [], - "minimum-stability": "stable", + "minimum-stability": "dev", "stability-flags": { - "conduction/commongroundbundle": 20, - "conduction/digidbundle": 20, - "conduction/samlbundle": 20 + "commongateway/corebundle": 20 }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.4.0", + "php": "^7.4.0 || ^8.1.0 || ^8.2.0", "ext-ctype": "*", "ext-fileinfo": "*", "ext-iconv": "*", "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/api/config/bundles.php b/api/config/bundles.php index e3ff55319..432377853 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -18,5 +18,4 @@ Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], - Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], ]; diff --git a/api/public/bundles/commonground/images/conduction/conduction_white_on_blue.svg b/api/public/bundles/commonground/images/conduction/conduction_white_on_blue.svg deleted file mode 100644 index 5652f3b72..000000000 --- a/api/public/bundles/commonground/images/conduction/conduction_white_on_blue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/public/bundles/commonground/images/conduction/condution_blue_on_transparant.svg b/api/public/bundles/commonground/images/conduction/condution_blue_on_transparant.svg deleted file mode 100644 index 1603bca89..000000000 --- a/api/public/bundles/commonground/images/conduction/condution_blue_on_transparant.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/public/bundles/commonground/images/conduction/condution_blue_on_white.svg b/api/public/bundles/commonground/images/conduction/condution_blue_on_white.svg deleted file mode 100644 index f02ee545d..000000000 --- a/api/public/bundles/commonground/images/conduction/condution_blue_on_white.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/public/bundles/commonground/images/conduction/condution_white_on_transparant.svg b/api/public/bundles/commonground/images/conduction/condution_white_on_transparant.svg deleted file mode 100644 index 3bd4bcce3..000000000 --- a/api/public/bundles/commonground/images/conduction/condution_white_on_transparant.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/public/bundles/commonground/images/municipalities/s-hertogenbosch.svg b/api/public/bundles/commonground/images/municipalities/s-hertogenbosch.svg deleted file mode 100644 index 1c558d0c0..000000000 --- a/api/public/bundles/commonground/images/municipalities/s-hertogenbosch.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api/public/bundles/commonground/images/municipalities/utrecht.svg b/api/public/bundles/commonground/images/municipalities/utrecht.svg deleted file mode 100644 index 7ba03c2af..000000000 --- a/api/public/bundles/commonground/images/municipalities/utrecht.svg +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/api/symfony.lock b/api/symfony.lock index c09d89550..728077e7c 100644 --- a/api/symfony.lock +++ b/api/symfony.lock @@ -215,9 +215,6 @@ "khanamiryan/qrcode-detector-decoder": { "version": "1.0.6" }, - "knplabs/knp-markdown-bundle": { - "version": "1.10.0" - }, "laminas/laminas-code": { "version": "4.4.2" }, @@ -252,9 +249,6 @@ "masterminds/html5": { "version": "2.7.5" }, - "michelf/php-markdown": { - "version": "1.9.1" - }, "mongodb/mongodb": { "version": "1.15.0" }, @@ -664,6 +658,9 @@ "symfony/polyfill-php81": { "version": "v1.23.0" }, + "symfony/process": { + "version": "v5.3.14" + }, "symfony/property-access": { "version": "v5.3.4" }, From ea88f5ce014ef38ef3ca74002593e9d339b37a3e Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Tue, 30 Jan 2024 11:33:09 +0100 Subject: [PATCH 3/5] Require symfony sendinblue mailer and ext-ftp --- api/.env | 5 +++ api/Dockerfile | 1 + api/composer.json | 1 + api/composer.lock | 77 +++++++++++++++++++++++++++++++++++++++++++---- api/symfony.lock | 9 ++++++ 5 files changed, 87 insertions(+), 6 deletions(-) diff --git a/api/.env b/api/.env index 8caf27abc..06c02c64d 100644 --- a/api/.env +++ b/api/.env @@ -30,3 +30,8 @@ DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVers ###> nelmio/cors-bundle ### CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$' ###< nelmio/cors-bundle ### + +###> symfony/sendinblue-mailer ### +# MAILER_DSN=sendinblue+api://KEY@default +# MAILER_DSN=sendinblue+smtp://USERNAME:PASSWORD@default +###< symfony/sendinblue-mailer ### diff --git a/api/Dockerfile b/api/Dockerfile index a075b9ea6..e12296318 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -48,6 +48,7 @@ RUN set -eux; \ pcntl \ gd \ gmp \ + ftp \ ; \ pecl install \ apcu-${APCU_VERSION} \ diff --git a/api/composer.json b/api/composer.json index 16b81286e..0f25fc202 100644 --- a/api/composer.json +++ b/api/composer.json @@ -62,6 +62,7 @@ "symfony/proxy-manager-bridge": "5.3.*", "symfony/runtime": "5.3.*", "symfony/security-bundle": "5.3.*", + "symfony/sendinblue-mailer": "5.3.*", "symfony/serializer": "5.3.*", "symfony/twig-bundle": "5.3.*", "symfony/validator": "5.3.*", diff --git a/api/composer.lock b/api/composer.lock index 3491c9121..4c74785ae 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b06ff88d1873f12139f276bf48c7d1d1", + "content-hash": "48e6767cf9de82cabd41909b54ab0163", "packages": [ { "name": "adbario/php-dot-notation", @@ -552,12 +552,12 @@ "source": { "type": "git", "url": "https://github.com/CommonGateway/CoreBundle.git", - "reference": "8349de2b20097e5fc4d7a29f283f949c01d870eb" + "reference": "081a03a639680a32db5d70bd5a44090caaffa113" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CommonGateway/CoreBundle/zipball/8349de2b20097e5fc4d7a29f283f949c01d870eb", - "reference": "8349de2b20097e5fc4d7a29f283f949c01d870eb", + "url": "https://api.github.com/repos/CommonGateway/CoreBundle/zipball/081a03a639680a32db5d70bd5a44090caaffa113", + "reference": "081a03a639680a32db5d70bd5a44090caaffa113", "shasum": "" }, "require": { @@ -586,7 +586,7 @@ "mongodb/mongodb": "^1.15", "monolog/monolog": "^2.8.0", "nelmio/cors-bundle": "^2.1", - "php": "^7.4.0 || ^8.1.0 || ^8.2.0", + "php": "^7.4.0 || ^8.0.0 || ^8.1.0 || ^8.2.0", "phpdocumentor/reflection-docblock": "^5.2", "phpoffice/phpspreadsheet": "^1.29", "phpoffice/phpword": "^0.18.2", @@ -668,7 +668,7 @@ "issues": "https://github.com/CommonGateway/CoreBundle/issues", "source": "https://github.com/CommonGateway/CoreBundle" }, - "time": "2023-10-13T10:59:01+00:00" + "time": "2023-10-20T11:20:11+00:00" }, { "name": "composer/ca-bundle", @@ -11020,6 +11020,71 @@ ], "time": "2021-11-05T16:25:46+00:00" }, + { + "name": "symfony/sendinblue-mailer", + "version": "v5.3.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/sendinblue-mailer.git", + "reference": "269383a0dac2ab4d5a1a0f0c042ba114d132cb24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/sendinblue-mailer/zipball/269383a0dac2ab4d5a1a0f0c042ba114d132cb24", + "reference": "269383a0dac2ab4d5a1a0f0c042ba114d132cb24", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/mailer": "^5.1" + }, + "require-dev": { + "symfony/http-client": "^4.4|^5.0" + }, + "type": "symfony-bridge", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\Bridge\\Sendinblue\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Sendinblue Mailer Bridge", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/sendinblue-mailer/tree/v5.3.14" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:51:59+00:00" + }, { "name": "symfony/serializer", "version": "v5.3.12", diff --git a/api/symfony.lock b/api/symfony.lock index 728077e7c..685f5f154 100644 --- a/api/symfony.lock +++ b/api/symfony.lock @@ -713,6 +713,15 @@ "symfony/security-http": { "version": "v5.3.6" }, + "symfony/sendinblue-mailer": { + "version": "5.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.2", + "ref": "ae1cf494ce06b9a4578a8445c610402a1676ee8d" + } + }, "symfony/serializer": { "version": "v5.3.4" }, From a3193c7865768096aa106258eb43dd82f1388702 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Tue, 30 Jan 2024 14:32:57 +0100 Subject: [PATCH 4/5] Update doctrine to highest version before updating symfony --- api/composer.json | 19 +- api/composer.lock | 799 ++++++++++++++++++++++++---------------------- api/symfony.lock | 7 +- 3 files changed, 436 insertions(+), 389 deletions(-) diff --git a/api/composer.json b/api/composer.json index 0f25fc202..e560556ac 100644 --- a/api/composer.json +++ b/api/composer.json @@ -12,21 +12,23 @@ "adbario/php-dot-notation": "^3", "alcaeus/mongo-php-adapter": "^1.2", "api-platform/core": "^2.6", - "beberlei/doctrineextensions": "^1.3", - "commongateway/corebundle": "dev-feature/MF-62/PHP-8.2", + "commongateway/corebundle": "dev-feature/MF-62/doctrine", "composer/ca-bundle": "*", "composer/package-versions-deprecated": "1.11.99.3", "composer/semver": "*", "composer/xdebug-handler": "*", - "doctrine/annotations": "^1.0", - "doctrine/doctrine-bundle": "^2.4", - "doctrine/doctrine-fixtures-bundle": "*", + "doctrine/annotations": "^1.14", + "doctrine/doctrine-bundle": "^2.7", + "doctrine/doctrine-fixtures-bundle": "^3.2", "doctrine/doctrine-migrations-bundle": "^3.1", - "doctrine/orm": "^2.9", + "doctrine/event-manager": "^1.2", + "doctrine/lexer": "^2.0", + "doctrine/orm": "2.14", + "doctrine/persistence": "^2.4", "dompdf/dompdf": "^2", "endroid/qr-code-bundle": "3.4", "friendsofphp/proxy-manager-lts": "*", - "gedmo/doctrine-extensions": "*", + "gedmo/doctrine-extensions": "^3.5", "guzzlehttp/guzzle": "6.5.8", "guzzlehttp/psr7": "1.9", "hautelook/alice-bundle": "^2.9.0", @@ -42,7 +44,8 @@ "phpdocumentor/reflection-docblock": "^5.2", "phpoffice/phpspreadsheet": "^1.29", "phpoffice/phpword": "^0.18.2", - "ramsey/uuid-doctrine": "*", + "ramsey/uuid": "*", + "ramsey/uuid-doctrine": "^2.0", "respect/validation": "^2.2", "setono/cron-expression-bundle": "^1.5", "symfony/asset": "5.3.*", diff --git a/api/composer.lock b/api/composer.lock index 4c74785ae..f8869c88b 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "48e6767cf9de82cabd41909b54ab0163", + "content-hash": "9172b94c1940b3c315290de2051834c0", "packages": [ { "name": "adbario/php-dot-notation", @@ -337,63 +337,6 @@ }, "time": "2022-03-14T02:02:36+00:00" }, - { - "name": "beberlei/doctrineextensions", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/beberlei/DoctrineExtensions.git", - "reference": "008f162f191584a6c37c03a803f718802ba9dd9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/beberlei/DoctrineExtensions/zipball/008f162f191584a6c37c03a803f718802ba9dd9a", - "reference": "008f162f191584a6c37c03a803f718802ba9dd9a", - "shasum": "" - }, - "require": { - "doctrine/orm": "^2.7", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", - "nesbot/carbon": "*", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "symfony/yaml": "^4.2 || ^5.0", - "zf1/zend-date": "^1.12", - "zf1/zend-registry": "^1.12" - }, - "type": "library", - "autoload": { - "psr-4": { - "DoctrineExtensions\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Steve Lacey", - "email": "steve@steve.ly" - } - ], - "description": "A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.", - "keywords": [ - "database", - "doctrine", - "orm" - ], - "support": { - "source": "https://github.com/beberlei/DoctrineExtensions/tree/v1.3.0" - }, - "time": "2020-11-29T07:37:23+00:00" - }, { "name": "behat/transliterator", "version": "v1.5.0", @@ -548,28 +491,27 @@ }, { "name": "commongateway/corebundle", - "version": "dev-feature/MF-62/PHP-8.2", + "version": "dev-feature/MF-62/doctrine", "source": { "type": "git", "url": "https://github.com/CommonGateway/CoreBundle.git", - "reference": "081a03a639680a32db5d70bd5a44090caaffa113" + "reference": "5623500a4258c4eb02f9d5d8e93976db79be8088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CommonGateway/CoreBundle/zipball/081a03a639680a32db5d70bd5a44090caaffa113", - "reference": "081a03a639680a32db5d70bd5a44090caaffa113", + "url": "https://api.github.com/repos/CommonGateway/CoreBundle/zipball/5623500a4258c4eb02f9d5d8e93976db79be8088", + "reference": "5623500a4258c4eb02f9d5d8e93976db79be8088", "shasum": "" }, "require": { "adbario/php-dot-notation": "^3", "alcaeus/mongo-php-adapter": "^1.2", "api-platform/core": "^2.6", - "beberlei/doctrineextensions": "^1.3", "composer/package-versions-deprecated": "1.11.99.3", - "doctrine/annotations": "^1.0", - "doctrine/doctrine-bundle": "^2.4", + "doctrine/annotations": "^1.14 | ^2.0", + "doctrine/doctrine-bundle": "^2.7", "doctrine/doctrine-migrations-bundle": "^3.1", - "doctrine/orm": "^2.9", + "doctrine/orm": "^2.14", "dompdf/dompdf": "^2", "endroid/qr-code-bundle": "3.4", "ext-ctype": "*", @@ -668,7 +610,7 @@ "issues": "https://github.com/CommonGateway/CoreBundle/issues", "source": "https://github.com/CommonGateway/CoreBundle" }, - "time": "2023-10-20T11:20:11+00:00" + "time": "2024-01-30T13:09:04+00:00" }, { "name": "composer/ca-bundle", @@ -1082,30 +1024,34 @@ }, { "name": "doctrine/annotations", - "version": "1.13.2", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", + "doctrine/lexer": "^1 || ^2", "ext-tokenizer": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" }, "type": "library", "autoload": { @@ -1146,20 +1092,24 @@ "docblock", "parser" ], - "time": "2021-08-05T19:00:23+00:00" + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.14.3" + }, + "time": "2023-02-01T09:20:38+00:00" }, { "name": "doctrine/cache", - "version": "2.1.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce" + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce", - "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", "shasum": "" }, "require": { @@ -1169,18 +1119,12 @@ "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", "cache/integration-tests": "dev-master", - "doctrine/coding-standard": "^8.0", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "predis/predis": "~1.0", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", - "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" }, "type": "library", "autoload": { @@ -1227,6 +1171,10 @@ "redis", "xcache" ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1241,30 +1189,31 @@ "type": "tidelift" } ], - "time": "2021-07-17T14:49:29+00:00" + "time": "2022-05-20T20:07:39+00:00" }, { "name": "doctrine/collections", - "version": "1.6.8", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1958a744696c6bb3bb0d28db2611dc11610e78af" + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1958a744696c6bb3bb0d28db2611dc11610e78af", - "reference": "1958a744696c6bb3bb0d28db2611dc11610e78af", + "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", "shasum": "" }, "require": { + "doctrine/deprecations": "^0.5.3 || ^1", "php": "^7.1.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^0.12", + "doctrine/coding-standard": "^9.0 || ^10.0", + "phpstan/phpstan": "^1.4.8", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", - "vimeo/psalm": "^4.2.1" + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -1306,39 +1255,44 @@ "iterators", "php" ], - "time": "2021-08-10T18:51:53+00:00" + "support": { + "issues": "https://github.com/doctrine/collections/issues", + "source": "https://github.com/doctrine/collections/tree/1.8.0" + }, + "time": "2022-09-01T20:12:10+00:00" }, { "name": "doctrine/common", - "version": "3.1.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "a036d90c303f3163b5be8b8fde9b6755b2be4a3a" + "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/a036d90c303f3163b5be8b8fde9b6755b2be4a3a", - "reference": "a036d90c303f3163b5be8b8fde9b6755b2be4a3a", + "url": "https://api.github.com/repos/doctrine/common/zipball/8b5e5650391f851ed58910b3e3d48a71062eeced", + "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced", "shasum": "" }, "require": { - "doctrine/persistence": "^2.0", + "doctrine/persistence": "^2.0 || ^3.0", "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0 || ^8.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "doctrine/coding-standard": "^9.0 || ^10.0", + "doctrine/collections": "^1", + "phpstan/phpstan": "^1.4.1", + "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", "squizlabs/php_codesniffer": "^3.0", - "symfony/phpunit-bridge": "^4.0.5", + "symfony/phpunit-bridge": "^6.1", "vimeo/psalm": "^4.4" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" + "Doctrine\\Common\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1378,6 +1332,10 @@ "doctrine", "php" ], + "support": { + "issues": "https://github.com/doctrine/common/issues", + "source": "https://github.com/doctrine/common/tree/3.4.3" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1392,37 +1350,44 @@ "type": "tidelift" } ], - "time": "2021-02-10T20:18:51+00:00" + "time": "2022-10-09T11:47:59+00:00" }, { "name": "doctrine/data-fixtures", - "version": "1.5.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/doctrine/data-fixtures.git", - "reference": "51d3d4880d28951fff42a635a2389f8c63baddc5" + "reference": "bbcb74f2ac6dbe81a14b3c3687d7623490a0448f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/51d3d4880d28951fff42a635a2389f8c63baddc5", - "reference": "51d3d4880d28951fff42a635a2389f8c63baddc5", + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/bbcb74f2ac6dbe81a14b3c3687d7623490a0448f", + "reference": "bbcb74f2ac6dbe81a14b3c3687d7623490a0448f", "shasum": "" }, "require": { - "doctrine/common": "^2.13|^3.0", - "doctrine/persistence": "^1.3.3|^2.0", - "php": "^7.2 || ^8.0" + "doctrine/deprecations": "^0.5.3 || ^1.0", + "doctrine/persistence": "^2.0|^3.0", + "php": "^7.4 || ^8.0" }, "conflict": { + "doctrine/dbal": "<3.5 || >=5", + "doctrine/orm": "<2.14 || >=4", "doctrine/phpcr-odm": "<1.3.0" }, "require-dev": { - "doctrine/coding-standard": "^8.2", - "doctrine/dbal": "^2.5.4", + "doctrine/annotations": "^1.12 || ^2", + "doctrine/coding-standard": "^12", + "doctrine/dbal": "^3.5 || ^4", "doctrine/mongodb-odm": "^1.3.0 || ^2.0.0", - "doctrine/orm": "^2.7.0", + "doctrine/orm": "^2.14 || ^3", "ext-sqlite3": "*", - "phpunit/phpunit": "^8.0" + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.6.13 || ^10.4.2", + "symfony/cache": "^5.4 || ^6.3 || ^7", + "symfony/var-exporter": "^5.4 || ^6.3 || ^7", + "vimeo/psalm": "^5.9" }, "suggest": { "alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)", @@ -1433,7 +1398,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\DataFixtures\\": "lib/Doctrine/Common/DataFixtures" + "Doctrine\\Common\\DataFixtures\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1447,13 +1412,13 @@ } ], "description": "Data Fixtures for all Doctrine Object Managers", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org", "keywords": [ "database" ], "support": { "issues": "https://github.com/doctrine/data-fixtures/issues", - "source": "https://github.com/doctrine/data-fixtures/tree/1.5.0" + "source": "https://github.com/doctrine/data-fixtures/tree/1.7.0" }, "funding": [ { @@ -1469,38 +1434,44 @@ "type": "tidelift" } ], - "time": "2021-01-23T10:20:43+00:00" + "time": "2023-11-24T11:18:31+00:00" }, { "name": "doctrine/dbal", - "version": "2.13.2", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "8dd39d2ead4409ce652fd4f02621060f009ea5e4" + "reference": "d244f2e6e6bf32bff5174e6729b57214923ecec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/8dd39d2ead4409ce652fd4f02621060f009ea5e4", - "reference": "8dd39d2ead4409ce652fd4f02621060f009ea5e4", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/d244f2e6e6bf32bff5174e6729b57214923ecec9", + "reference": "d244f2e6e6bf32bff5174e6729b57214923ecec9", "shasum": "" }, "require": { - "doctrine/cache": "^1.0|^2.0", - "doctrine/deprecations": "^0.5.3", - "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "9.0.0", - "jetbrains/phpstorm-stubs": "2020.2", - "phpstan/phpstan": "0.12.81", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.5", - "squizlabs/php_codesniffer": "3.6.0", - "symfony/cache": "^4.4", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.6.4" + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.56", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.15", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.8.1", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", + "vimeo/psalm": "4.30.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -1511,7 +1482,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + "Doctrine\\DBAL\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1554,11 +1525,14 @@ "queryobject", "sasql", "sql", - "sqlanywhere", "sqlite", "sqlserver", "sqlsrv" ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.8.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1573,29 +1547,33 @@ "type": "tidelift" } ], - "time": "2021-06-18T21:48:39+00:00" + "time": "2024-01-25T21:44:02+00:00" }, { "name": "doctrine/deprecations", - "version": "v0.5.3", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314" + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0|^7.0|^8.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0", - "psr/log": "^1.0" + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1612,27 +1590,31 @@ ], "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", "homepage": "https://www.doctrine-project.org/", - "time": "2021-03-21T12:59:47+00:00" + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.2" + }, + "time": "2023-09-27T20:04:15+00:00" }, { "name": "doctrine/doctrine-bundle", - "version": "2.5.7", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "1e0d1d7a5982eeebc37dcb4d77bb1a5c5961d96d" + "reference": "d2088fc50494e4e7441fecca54732245a613eeb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/1e0d1d7a5982eeebc37dcb4d77bb1a5c5961d96d", - "reference": "1e0d1d7a5982eeebc37dcb4d77bb1a5c5961d96d", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/d2088fc50494e4e7441fecca54732245a613eeb6", + "reference": "d2088fc50494e4e7441fecca54732245a613eeb6", "shasum": "" }, "require": { "doctrine/annotations": "^1", "doctrine/cache": "^1.11 || ^2.0", "doctrine/dbal": "^2.13.1|^3.3.2", - "doctrine/persistence": "^2.2", + "doctrine/persistence": "^2.2|^3", "doctrine/sql-formatter": "^1.0.1", "php": "^7.1 || ^8.0", "symfony/cache": "^4.3.3|^5.0|^6.0", @@ -1645,16 +1627,17 @@ "symfony/service-contracts": "^1.1.1|^2.0|^3" }, "conflict": { - "doctrine/orm": "<2.9|>=3.0", + "doctrine/orm": "<2.10|>=3.0", "twig/twig": "<1.34|>=2.0,<2.4" }, "require-dev": { "doctrine/coding-standard": "^9.0", - "doctrine/orm": "^2.9 || ^3.0", + "doctrine/orm": "^2.11 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0", "phpunit/phpunit": "^7.5 || ^8.0 || ^9.3 || ^10.0", "psalm/plugin-phpunit": "^0.16.1", "psalm/plugin-symfony": "^3", + "psr/log": "^1.1.4|^2.0|^3.0", "symfony/phpunit-bridge": "^5.2|^6.0", "symfony/property-info": "^4.3.3|^5.0|^6.0", "symfony/proxy-manager-bridge": "^3.4|^4.3.3|^5.0|^6.0", @@ -1709,7 +1692,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineBundle/issues", - "source": "https://github.com/doctrine/DoctrineBundle/tree/2.5.7" + "source": "https://github.com/doctrine/DoctrineBundle/tree/2.7.0" }, "funding": [ { @@ -1725,20 +1708,20 @@ "type": "tidelift" } ], - "time": "2022-03-05T10:29:13+00:00" + "time": "2022-06-10T10:55:26+00:00" }, { "name": "doctrine/doctrine-fixtures-bundle", - "version": "3.4.4", + "version": "3.4.5", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "9ec3139c52a42e94c9fd1e95f8d2bca94326edfb" + "reference": "5988484f79362cd7d06564bd11be7ce622e08c87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/9ec3139c52a42e94c9fd1e95f8d2bca94326edfb", - "reference": "9ec3139c52a42e94c9fd1e95f8d2bca94326edfb", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/5988484f79362cd7d06564bd11be7ce622e08c87", + "reference": "5988484f79362cd7d06564bd11be7ce622e08c87", "shasum": "" }, "require": { @@ -1754,7 +1737,7 @@ "symfony/http-kernel": "^3.4|^4.3|^5.0|^6.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^12", "phpstan/phpstan": "^1.4.10", "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", "symfony/phpunit-bridge": "^6.0.8", @@ -1792,7 +1775,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues", - "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.4" + "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.5" }, "funding": [ { @@ -1808,37 +1791,38 @@ "type": "tidelift" } ], - "time": "2023-05-02T15:12:16+00:00" + "time": "2023-10-29T18:36:06+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", - "version": "3.1.1", + "version": "3.2.5", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", - "reference": "91f0a5e2356029575f3038432cc188b12f9d5da5" + "reference": "90be4395597432a05ae9aad5e6fe490622226a77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/91f0a5e2356029575f3038432cc188b12f9d5da5", - "reference": "91f0a5e2356029575f3038432cc188b12f9d5da5", + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/90be4395597432a05ae9aad5e6fe490622226a77", + "reference": "90be4395597432a05ae9aad5e6fe490622226a77", "shasum": "" }, "require": { "doctrine/doctrine-bundle": "~1.0|~2.0", - "doctrine/migrations": "^3.1", + "doctrine/migrations": "^3.2", "php": "^7.2|^8.0", - "symfony/framework-bundle": "~3.4|~4.0|~5.0" + "symfony/framework-bundle": "~3.4|~4.0|~5.0|~6.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "doctrine/orm": "^2.6", "doctrine/persistence": "^1.3||^2.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0|^8.0|^9.0" + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5|^9.5", + "vimeo/psalm": "^4.22" }, "type": "symfony-bundle", "autoload": { @@ -1860,11 +1844,11 @@ }, { "name": "Doctrine Project", - "homepage": "http://www.doctrine-project.org" + "homepage": "https://www.doctrine-project.org" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony DoctrineMigrationsBundle", @@ -1874,6 +1858,10 @@ "migrations", "schema" ], + "support": { + "issues": "https://github.com/doctrine/DoctrineMigrationsBundle/issues", + "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.2.5" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1888,41 +1876,39 @@ "type": "tidelift" } ], - "time": "2021-04-10T16:48:53+00:00" + "time": "2023-11-13T08:28:17+00:00" }, { "name": "doctrine/event-manager", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", "shasum": "" }, "require": { + "doctrine/deprecations": "^0.5.3 || ^1", "php": "^7.1 || ^8.0" }, "conflict": { - "doctrine/common": "<2.9@dev" + "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpunit/phpunit": "^7.0" + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" + "Doctrine\\Common\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1964,6 +1950,10 @@ "event system", "events" ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1978,38 +1968,34 @@ "type": "tidelift" } ], - "time": "2020-05-29T18:28:51+00:00" + "time": "2022-10-12T20:51:15+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.3", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "reference": "2930cd5ef353871c821d5c43ed030d39ac8cfe65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/2930cd5ef353871c821d5c43ed030d39ac8cfe65", + "reference": "2930cd5ef353871c821d5c43ed030d39ac8cfe65", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" @@ -2055,6 +2041,10 @@ "uppercase", "words" ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.9" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -2069,33 +2059,34 @@ "type": "tidelift" } ], - "time": "2020-05-29T15:13:26+00:00" + "time": "2024-01-15T18:05:13+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -2120,6 +2111,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -2134,39 +2129,37 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.1", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "doctrine/deprecations": "^1.0", + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2196,6 +2189,10 @@ "parser", "php" ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/2.1.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -2210,49 +2207,49 @@ "type": "tidelift" } ], - "time": "2020-05-25T17:44:05+00:00" + "time": "2022-12-14T08:49:07+00:00" }, { "name": "doctrine/migrations", - "version": "3.2.1", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "818e31703b4fb353c0c23caa714273fc64efa675" + "reference": "362f07ff732a2b4498be919561536800cec29500" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/818e31703b4fb353c0c23caa714273fc64efa675", - "reference": "818e31703b4fb353c0c23caa714273fc64efa675", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/362f07ff732a2b4498be919561536800cec29500", + "reference": "362f07ff732a2b4498be919561536800cec29500", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.8", - "doctrine/dbal": "^2.11", - "doctrine/deprecations": "^0.5.3", + "composer-runtime-api": "^2", + "doctrine/dbal": "^2.11 || ^3.0", + "doctrine/deprecations": "^0.5.3 || ^1", "doctrine/event-manager": "^1.0", "friendsofphp/proxy-manager-lts": "^1.0", "php": "^7.2 || ^8.0", "psr/log": "^1.1.3 || ^2 || ^3", - "symfony/console": "^3.4 || ^4.4.16 || ^5.0", - "symfony/stopwatch": "^3.4 || ^4.0 || ^5.0" + "symfony/console": "^3.4 || ^4.4.16 || ^5.0 || ^6.0", + "symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "doctrine/orm": "^2.6", "doctrine/persistence": "^1.3 || ^2.0", "doctrine/sql-formatter": "^1.0", "ergebnis/composer-normalize": "^2.9", "ext-pdo_sqlite": "*", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpstan/phpstan-symfony": "^0.12", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan-symfony": "^1.1", "phpunit/phpunit": "^8.5 || ^9.4", - "symfony/cache": "^3.4 || ^4.0 || ^5.0", - "symfony/process": "^3.4 || ^4.0 || ^5.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0" + "symfony/cache": "^3.4.26 || ^4.2.12 || ^5.0 || ^6.0", + "symfony/process": "^3.4 || ^4.0 || ^5.0 || ^6.0", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "suggest": { "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", @@ -2298,6 +2295,10 @@ "dbal", "migrations" ], + "support": { + "issues": "https://github.com/doctrine/migrations/issues", + "source": "https://github.com/doctrine/migrations/tree/3.4.3" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -2312,52 +2313,59 @@ "type": "tidelift" } ], - "time": "2021-08-03T11:49:27+00:00" + "time": "2023-09-07T12:23:11+00:00" }, { "name": "doctrine/orm", - "version": "2.9.5", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "77cc86ed880e3f1f6c9c5819e131a8aaeeeee0da" + "reference": "f82485e651763fbd1b34879726f4d3b91c358bd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/77cc86ed880e3f1f6c9c5819e131a8aaeeeee0da", - "reference": "77cc86ed880e3f1f6c9c5819e131a8aaeeeee0da", + "url": "https://api.github.com/repos/doctrine/orm/zipball/f82485e651763fbd1b34879726f4d3b91c358bd9", + "reference": "f82485e651763fbd1b34879726f4d3b91c358bd9", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.8", - "doctrine/annotations": "^1.13", + "composer-runtime-api": "^2", "doctrine/cache": "^1.12.1 || ^2.1.1", - "doctrine/collections": "^1.5", + "doctrine/collections": "^1.5 || ^2.0", "doctrine/common": "^3.0.3", - "doctrine/dbal": "^2.13.0", - "doctrine/deprecations": "^0.5.3", - "doctrine/event-manager": "^1.1", + "doctrine/dbal": "^2.13.1 || ^3.2", + "doctrine/deprecations": "^0.5.3 || ^1", + "doctrine/event-manager": "^1.2 || ^2", "doctrine/inflector": "^1.4 || ^2.0", "doctrine/instantiator": "^1.3", - "doctrine/lexer": "^1.0", - "doctrine/persistence": "^2.2", + "doctrine/lexer": "^1.2.3 || ^2", + "doctrine/persistence": "^2.4 || ^3", "ext-ctype": "*", - "ext-pdo": "*", - "php": "^7.1 ||^8.0", + "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3", - "symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/console": "^4.2 || ^5.0 || ^6.0", + "symfony/polyfill-php72": "^1.23", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "doctrine/annotations": "<1.13 || >= 3.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", + "doctrine/annotations": "^1.13 || ^2", + "doctrine/coding-standard": "^9.0.2 || ^11.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "0.12.94", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", - "squizlabs/php_codesniffer": "3.6.0", - "symfony/cache": "^4.4 || ^5.2", + "phpstan/phpstan": "~1.4.10 || 1.9.4", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/log": "^1 || ^2 || ^3", + "squizlabs/php_codesniffer": "3.7.1", + "symfony/cache": "^4.4 || ^5.4 || ^6.0", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2", "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.7.0" + "vimeo/psalm": "4.30.0 || 5.3.0" }, "suggest": { + "ext-dom": "Provides support for XSD validation for XML mapping files", "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0", "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" }, @@ -2402,48 +2410,53 @@ "database", "orm" ], - "time": "2021-08-23T10:20:22+00:00" + "support": { + "issues": "https://github.com/doctrine/orm/issues", + "source": "https://github.com/doctrine/orm/tree/2.14.0" + }, + "time": "2022-12-19T21:51:58+00:00" }, { "name": "doctrine/persistence", - "version": "2.2.2", + "version": "2.5.7", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "4ce4712e6dc84a156176a0fbbb11954a25c93103" + "reference": "e36f22765f4d10a7748228babbf73da5edfeed3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/4ce4712e6dc84a156176a0fbbb11954a25c93103", - "reference": "4ce4712e6dc84a156176a0fbbb11954a25c93103", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/e36f22765f4d10a7748228babbf73da5edfeed3c", + "reference": "e36f22765f4d10a7748228babbf73da5edfeed3c", "shasum": "" }, "require": { - "doctrine/annotations": "^1.0", "doctrine/cache": "^1.11 || ^2.0", "doctrine/collections": "^1.0", - "doctrine/deprecations": "^0.5.3", - "doctrine/event-manager": "^1.0", + "doctrine/deprecations": "^0.5.3 || ^1", + "doctrine/event-manager": "^1 || ^2", "php": "^7.1 || ^8.0", - "psr/cache": "^1.0|^2.0|^3.0" + "psr/cache": "^1.0 || ^2.0 || ^3.0" }, "conflict": { - "doctrine/common": "<2.10@dev" + "doctrine/annotations": "<1.0 || >=3.0", + "doctrine/common": "<2.10" }, "require-dev": { "composer/package-versions-deprecated": "^1.11", - "doctrine/coding-standard": "^6.0 || ^9.0", + "doctrine/annotations": "^1 || ^2", + "doctrine/coding-standard": "^9 || ^11", "doctrine/common": "^3.0", - "phpstan/phpstan": "0.12.84", - "phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0", - "symfony/cache": "^4.4|^5.0", - "vimeo/psalm": "4.7.0" + "phpstan/phpstan": "~1.4.10 || 1.9.4", + "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0", + "vimeo/psalm": "4.30.0 || 5.3.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common", - "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" + "Doctrine\\Common\\": "src/Common", + "Doctrine\\Persistence\\": "src/Persistence" } }, "notification-url": "https://packagist.org/downloads/", @@ -2485,20 +2498,38 @@ "orm", "persistence" ], - "time": "2021-08-10T19:01:29+00:00" + "support": { + "issues": "https://github.com/doctrine/persistence/issues", + "source": "https://github.com/doctrine/persistence/tree/2.5.7" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence", + "type": "tidelift" + } + ], + "time": "2023-02-03T15:51:16+00:00" }, { "name": "doctrine/sql-formatter", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/doctrine/sql-formatter.git", - "reference": "56070bebac6e77230ed7d306ad13528e60732871" + "reference": "25a06c7bf4c6b8218f47928654252863ffc890a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/56070bebac6e77230ed7d306ad13528e60732871", - "reference": "56070bebac6e77230ed7d306ad13528e60732871", + "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/25a06c7bf4c6b8218f47928654252863ffc890a5", + "reference": "25a06c7bf4c6b8218f47928654252863ffc890a5", "shasum": "" }, "require": { @@ -2511,11 +2542,6 @@ "bin/sql-formatter" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\SqlFormatter\\": "src" @@ -2529,7 +2555,7 @@ { "name": "Jeremy Dorn", "email": "jeremy@jeremydorn.com", - "homepage": "http://jeremydorn.com/" + "homepage": "https://jeremydorn.com/" } ], "description": "a PHP SQL highlighting library", @@ -2538,7 +2564,11 @@ "highlight", "sql" ], - "time": "2020-07-30T16:57:33+00:00" + "support": { + "issues": "https://github.com/doctrine/sql-formatter/issues", + "source": "https://github.com/doctrine/sql-formatter/tree/1.1.3" + }, + "time": "2022-05-23T21:33:49+00:00" }, { "name": "dompdf/dompdf", @@ -2665,25 +2695,24 @@ }, { "name": "egulias/email-validator", - "version": "3.2.1", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715" + "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/f88dcf4b14af14a98ad96b14b2b317969eab6715", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", + "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", "shasum": "" }, "require": { - "doctrine/lexer": "^1.2", + "doctrine/lexer": "^1.2|^2", "php": ">=7.2", "symfony/polyfill-intl-idn": "^1.15" }, "require-dev": { - "php-coveralls/php-coveralls": "^2.2", "phpunit/phpunit": "^8.5.8|^9.3.3", "vimeo/psalm": "^4" }, @@ -2721,7 +2750,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.2.1" + "source": "https://github.com/egulias/EmailValidator/tree/3.2.6" }, "funding": [ { @@ -2729,7 +2758,7 @@ "type": "github" } ], - "time": "2022-06-18T20:57:19+00:00" + "time": "2023-06-01T07:04:22+00:00" }, { "name": "endroid/installer", @@ -3271,56 +3300,61 @@ }, { "name": "gedmo/doctrine-extensions", - "version": "v3.2.0", + "version": "v3.13.0", "source": { "type": "git", "url": "https://github.com/doctrine-extensions/DoctrineExtensions.git", - "reference": "8c02cee09e3dd43799ec3b84b619b19982c47f43" + "reference": "291d0c527d2dc9ee07b888c9a4e2a179893f08ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine-extensions/DoctrineExtensions/zipball/8c02cee09e3dd43799ec3b84b619b19982c47f43", - "reference": "8c02cee09e3dd43799ec3b84b619b19982c47f43", + "url": "https://api.github.com/repos/doctrine-extensions/DoctrineExtensions/zipball/291d0c527d2dc9ee07b888c9a4e2a179893f08ab", + "reference": "291d0c527d2dc9ee07b888c9a4e2a179893f08ab", "shasum": "" }, "require": { - "behat/transliterator": "~1.2", - "doctrine/annotations": "^1.13", - "doctrine/collections": "^1.0", + "behat/transliterator": "^1.2", + "doctrine/annotations": "^1.13 || ^2.0", + "doctrine/collections": "^1.2 || ^2.0", "doctrine/common": "^2.13 || ^3.0", - "doctrine/event-manager": "^1.0", - "php": "^7.2 || ^8.0" + "doctrine/event-manager": "^1.2 || ^2.0", + "doctrine/persistence": "^2.2 || ^3.0", + "php": "^7.2 || ^8.0", + "psr/cache": "^1 || ^2 || ^3", + "symfony/cache": "^4.4 || ^5.3 || ^6.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0" }, "conflict": { - "doctrine/mongodb": "<1.3", - "doctrine/mongodb-odm": "<2.0", - "doctrine/orm": ">=2.10", + "doctrine/dbal": "<2.13.1 || ^3.0 <3.2", + "doctrine/mongodb-odm": "<2.3", + "doctrine/orm": "<2.10.2 || 2.16.0 || 2.16.1", "sebastian/comparator": "<2.0" }, - "provide": { - "ext-mongo": "1.6.12" - }, "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", "doctrine/cache": "^1.11 || ^2.0", - "doctrine/dbal": "^2.13", + "doctrine/dbal": "^2.13.1 || ^3.2", "doctrine/doctrine-bundle": "^2.3", - "doctrine/mongodb-odm": "^2.0", - "doctrine/orm": "^2.9.6", - "friendsofphp/php-cs-fixer": "^3.0", - "phpunit/phpunit": "^8.5", - "symfony/cache": "^4.4 || ^5.0", - "symfony/yaml": "^4.1" + "doctrine/mongodb-odm": "^2.3", + "doctrine/orm": "^2.10.2", + "friendsofphp/php-cs-fixer": "^3.4.0 <3.10", + "nesbot/carbon": "^2.55", + "phpstan/phpstan": "^1.10.2", + "phpstan/phpstan-doctrine": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.5", + "rector/rector": "^0.15.20", + "symfony/console": "^4.4 || ^5.3 || ^6.0", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^4.4 || ^5.3 || ^6.0" }, "suggest": { "doctrine/mongodb-odm": "to use the extensions with the MongoDB ODM", - "doctrine/orm": "to use the extensions with the ORM", - "symfony/cache": "to cache parsed annotations" + "doctrine/orm": "to use the extensions with the ORM" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.13-dev" } }, "autoload": { @@ -3346,16 +3380,18 @@ "email": "david@liip.ch" } ], - "description": "Doctrine2 behavioral extensions", + "description": "Doctrine behavioral extensions", "homepage": "http://gediminasm.org/", "keywords": [ "Blameable", "behaviors", - "doctrine2", + "doctrine", "extensions", "gedmo", "loggable", "nestedset", + "odm", + "orm", "sluggable", "sortable", "timestampable", @@ -3366,10 +3402,28 @@ "support": { "email": "gediminas.morkevicius@gmail.com", "issues": "https://github.com/doctrine-extensions/DoctrineExtensions/issues", - "source": "https://github.com/doctrine-extensions/DoctrineExtensions/tree/v3.2.0", + "source": "https://github.com/doctrine-extensions/DoctrineExtensions/tree/v3.13.0", "wiki": "https://github.com/Atlantic18/DoctrineExtensions/tree/main/doc" }, - "time": "2021-10-05T15:25:14+00:00" + "funding": [ + { + "url": "https://github.com/l3pp4rd", + "type": "github" + }, + { + "url": "https://github.com/mbabker", + "type": "github" + }, + { + "url": "https://github.com/phansys", + "type": "github" + }, + { + "url": "https://github.com/stof", + "type": "github" + } + ], + "time": "2023-09-06T13:16:12+00:00" }, { "name": "guzzlehttp/guzzle", @@ -6068,21 +6122,20 @@ }, { "name": "ramsey/collection", - "version": "1.3.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { "captainhook/plugin-composer": "^5.3", @@ -6142,7 +6195,7 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.3.0" + "source": "https://github.com/ramsey/collection/tree/2.0.0" }, "funding": [ { @@ -6154,29 +6207,27 @@ "type": "tidelift" } ], - "time": "2022-12-27T19:12:24+00:00" + "time": "2022-12-31T21:50:55+00:00" }, { "name": "ramsey/uuid", - "version": "4.2.3", + "version": "4.7.5", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", "ext-json": "*", - "php": "^7.2 || ^8.0", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" }, "replace": { "rhumsaa/uuid": "self.version" @@ -6188,24 +6239,23 @@ "doctrine/annotations": "^1.8", "ergebnis/composer-normalize": "^2.15", "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", "paragonie/random-lib": "^2", "php-mock/php-mock": "^2.2", "php-mock/php-mock-mockery": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.1", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.9" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -6213,9 +6263,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - }, "captainhook": { "force-install": true } @@ -6240,7 +6287,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.3" + "source": "https://github.com/ramsey/uuid/tree/4.7.5" }, "funding": [ { @@ -6252,7 +6299,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T23:10:38+00:00" + "time": "2023-11-08T05:53:05+00:00" }, { "name": "ramsey/uuid-doctrine", diff --git a/api/symfony.lock b/api/symfony.lock index 685f5f154..446751279 100644 --- a/api/symfony.lock +++ b/api/symfony.lock @@ -22,9 +22,6 @@ "bacon/bacon-qr-code": { "version": "2.0.7" }, - "beberlei/doctrineextensions": { - "version": "v1.3.0" - }, "behat/transliterator": { "version": "v1.5.0" }, @@ -373,10 +370,10 @@ "version": "3.0.3" }, "ramsey/collection": { - "version": "1.3.0" + "version": "2.0.0" }, "ramsey/uuid": { - "version": "4.2.3" + "version": "4.7.5" }, "ramsey/uuid-doctrine": { "version": "2.0", From ea8dd48bc4e32444c7a59c4d843c6c835ced08a9 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Tue, 30 Jan 2024 14:40:26 +0100 Subject: [PATCH 5/5] update doctrine/orm --- api/composer.json | 2 +- api/composer.lock | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/composer.json b/api/composer.json index e560556ac..edc22315f 100644 --- a/api/composer.json +++ b/api/composer.json @@ -23,7 +23,7 @@ "doctrine/doctrine-migrations-bundle": "^3.1", "doctrine/event-manager": "^1.2", "doctrine/lexer": "^2.0", - "doctrine/orm": "2.14", + "doctrine/orm": "^2.14", "doctrine/persistence": "^2.4", "dompdf/dompdf": "^2", "endroid/qr-code-bundle": "3.4", diff --git a/api/composer.lock b/api/composer.lock index f8869c88b..f20988f42 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9172b94c1940b3c315290de2051834c0", + "content-hash": "1a0148fcf7c84b2e64b78ba0d451a2b0", "packages": [ { "name": "adbario/php-dot-notation", @@ -2317,34 +2317,34 @@ }, { "name": "doctrine/orm", - "version": "2.14.0", + "version": "2.17.4", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "f82485e651763fbd1b34879726f4d3b91c358bd9" + "reference": "ccfc97c32f63aaa0988ac6aa42e71c5590bb794d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/f82485e651763fbd1b34879726f4d3b91c358bd9", - "reference": "f82485e651763fbd1b34879726f4d3b91c358bd9", + "url": "https://api.github.com/repos/doctrine/orm/zipball/ccfc97c32f63aaa0988ac6aa42e71c5590bb794d", + "reference": "ccfc97c32f63aaa0988ac6aa42e71c5590bb794d", "shasum": "" }, "require": { "composer-runtime-api": "^2", "doctrine/cache": "^1.12.1 || ^2.1.1", - "doctrine/collections": "^1.5 || ^2.0", + "doctrine/collections": "^1.5 || ^2.1", "doctrine/common": "^3.0.3", "doctrine/dbal": "^2.13.1 || ^3.2", "doctrine/deprecations": "^0.5.3 || ^1", "doctrine/event-manager": "^1.2 || ^2", "doctrine/inflector": "^1.4 || ^2.0", - "doctrine/instantiator": "^1.3", - "doctrine/lexer": "^1.2.3 || ^2", + "doctrine/instantiator": "^1.3 || ^2", + "doctrine/lexer": "^2", "doctrine/persistence": "^2.4 || ^3", "ext-ctype": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3", - "symfony/console": "^4.2 || ^5.0 || ^6.0", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", "symfony/polyfill-php72": "^1.23", "symfony/polyfill-php80": "^1.16" }, @@ -2353,16 +2353,16 @@ }, "require-dev": { "doctrine/annotations": "^1.13 || ^2", - "doctrine/coding-standard": "^9.0.2 || ^11.0", + "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "~1.4.10 || 1.9.4", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpstan/phpstan": "~1.4.10 || 1.10.35", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", - "squizlabs/php_codesniffer": "3.7.1", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.30.0 || 5.3.0" + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "vimeo/psalm": "4.30.0 || 5.16.0" }, "suggest": { "ext-dom": "Provides support for XSD validation for XML mapping files", @@ -2412,9 +2412,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.14.0" + "source": "https://github.com/doctrine/orm/tree/2.17.4" }, - "time": "2022-12-19T21:51:58+00:00" + "time": "2024-01-26T19:41:16+00:00" }, { "name": "doctrine/persistence",