From 8494978ec59a3dd03185074fb9f1149ac85cde71 Mon Sep 17 00:00:00 2001 From: d1ff1cult0 Date: Mon, 4 Nov 2024 11:12:25 +0100 Subject: [PATCH] Updated gitlab-ci.yml --- .gitlab-ci.yml | 8 ++++++-- module/ShopBundle/Controller/ShopController.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b95feb23c..1532c5f1e6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,9 +6,11 @@ variables: COMPOSER_HOME: $CI_PROJECT_DIR/.composer NO_PROXY: "gitlab.vtk.be" - build: stage: build + before_script: + - export PATH="/usr/bin/php7.4:$PATH" + - php -v script: - composer update --no-dev - composer install --no-dev @@ -28,9 +30,12 @@ build: .deploy: &deploy stage: deploy before_script: + - export PATH="/usr/bin/php7.4:$PATH" + - php -v - eval $(ssh-agent -s) - ssh-add <(echo $SSH_PRIVATE_KEY | base64 -d) script: + - export SENTRY_LOG_LEVEL=debug - scp -o StrictHostKeyChecking=no litus.tar.gz root@$SSH_HOSTNAME:/tmp - ssh -o StrictHostKeyChecking=no root@$SSH_HOSTNAME /usr/local/sbin/deploy.sh only: @@ -54,4 +59,3 @@ deploy_liv: environment: name: liv url: https://vtk.be - diff --git a/module/ShopBundle/Controller/ShopController.php b/module/ShopBundle/Controller/ShopController.php index c6b98d63fa..4def14116a 100644 --- a/module/ShopBundle/Controller/ShopController.php +++ b/module/ShopBundle/Controller/ShopController.php @@ -31,7 +31,7 @@ public function reserveproductsAction() ); } - if(!$this->saleSessionIsOpen()){ + if (!$this->saleSessionIsOpen()){ $this->flashMessenger()->error( 'Error', 'No session was found!' @@ -555,12 +555,16 @@ private function getStockEntries($salesSession) ); } - private function saleSessionIsOpen(){ + private function saleSessionIsOpen() + { $salesSessionId = $this->getSalesSessionEntity()->getId(); $openSaleSessions = $this->getSalesSessions(); - $openSaleSessionsIds = array_map(function($session) { - return $session->getId(); - }, $openSaleSessions); + $openSaleSessionsIds = array_map( + function ($session) { + return $session->getId(); + }, + $openSaleSessions + ); return in_array($salesSessionId, $openSaleSessionsIds); }