diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 57f376e2c..79cef0eeb 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -7,7 +7,7 @@ jobs: module-test: runs-on: ubuntu-latest container: - image: "registry.gitlab.com/eappointment/php-base:${{ matrix.php_version }}-dev" + image: "ghcr.io/it-at-m/eappointment-php-base:${{ matrix.php_version }}-dev" steps: - name: Checkout GitHub Action uses: actions/checkout@main @@ -44,7 +44,7 @@ jobs: zmsapi-test: runs-on: ubuntu-latest container: - image: "registry.gitlab.com/eappointment/php-base:8.0-dev" + image: "ghcr.io/it-at-m/eappointment-php-base:8.0-dev" services: mariadb: image: mariadb:10.6 @@ -96,7 +96,7 @@ jobs: zmsdb-test: runs-on: ubuntu-latest container: - image: "registry.gitlab.com/eappointment/php-base:8.0-dev" + image: "ghcr.io/it-at-m/eappointment-php-base:8.0-dev" services: mariadb: image: mariadb:10.6 diff --git a/.resources/Containerfile b/.resources/Containerfile index 93011d48e..48b04b778 100644 --- a/.resources/Containerfile +++ b/.resources/Containerfile @@ -1,5 +1,5 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build RUN useradd --shell /bin/bash --create-home build COPY --chown=build:build . /build ARG MODULE @@ -8,8 +8,7 @@ USER build:build RUN make live ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base RUN docker-apt-clean-install libfcgi-bin ARG MODULE COPY --from=build --chown=0:0 /build/${MODULE} /var/www/html - diff --git a/zmsadmin/.gitlab-ci.yml b/zmsadmin/.gitlab-ci.yml index eafacbb2d..e2cc82aa8 100644 --- a/zmsadmin/.gitlab-ci.yml +++ b/zmsadmin/.gitlab-ci.yml @@ -1,10 +1,10 @@ include: remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml -test-php-73: +test-php-80: variables: - PHP_VERSION: 7.3 - image: registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev + PHP_VERSION: 8.0 + image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev script: - $CLI_COMPOSER - $CLI_PHPCS @@ -19,7 +19,7 @@ test-php-73: - npm install --legacy-peer-deps - make css variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" only: changes: - .gitlab-ci.yml diff --git a/zmsadmin/Dockerfile b/zmsadmin/Dockerfile index 09c7a8859..485cc6232 100644 --- a/zmsadmin/Dockerfile +++ b/zmsadmin/Dockerfile @@ -1,9 +1,9 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build COPY --chown=1000:1000 . /build WORKDIR /build USER 1000:1000 RUN make live -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base COPY --from=build --chown=0:0 /build /var/www/html \ No newline at end of file diff --git a/zmsapi/.gitlab-ci.yml b/zmsapi/.gitlab-ci.yml index 6af55b7e3..3bc5197e7 100644 --- a/zmsapi/.gitlab-ci.yml +++ b/zmsapi/.gitlab-ci.yml @@ -4,8 +4,8 @@ include: .test-php-custom: stage: test variables: - PHP_VERSION: 7.3 - image: registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev + PHP_VERSION: 8.0 + image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev cache: key: "zmsbase" paths: @@ -25,7 +25,7 @@ include: junit: public/_tests/junit.xml -test-php-73: +test-php-80: extends: .test-php-custom allow_failure: true services: @@ -38,7 +38,7 @@ test-php-73: - ln -s vendor/eappointment/zmsdb/tests/Zmsdb/fixtures data - vendor/bin/importTestData --commit variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" MYSQL_PORT: "tcp://mysql:3306" MYSQL_DATABASE: zmsbo MYSQL_ROOT_PASSWORD: zmsapi @@ -73,8 +73,8 @@ outdated: apidoc: stage: .pre variables: - PHP_VERSION: "7.3" - image: registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev + PHP_VERSION: "8.0" + image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev before_script: - $CLI_COMPOSER --no-scripts - bin/configure diff --git a/zmsapi/Dockerfile b/zmsapi/Dockerfile index 18621a79e..f7b275514 100644 --- a/zmsapi/Dockerfile +++ b/zmsapi/Dockerfile @@ -1,10 +1,10 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build COPY --chown=1000:1000 . /var/www/html WORKDIR /var/www/html USER 1000 RUN make live -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base COPY --from=build --chown=0:0 /var/www/html /var/www/html RUN chmod -R 1777 /var/www/html/data diff --git a/zmscalldisplay/.gitlab-ci.yml b/zmscalldisplay/.gitlab-ci.yml index 0b22ae495..5ca67bd2d 100644 --- a/zmscalldisplay/.gitlab-ci.yml +++ b/zmscalldisplay/.gitlab-ci.yml @@ -1,11 +1,11 @@ include: remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml -test-php-73: +test-php-80: extends: .test-php allow_failure: false variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" only: changes: - .gitlab-ci.yml @@ -53,7 +53,7 @@ pages: build-docker: extends: .build-docker variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" only: - tags - main diff --git a/zmscalldisplay/Dockerfile b/zmscalldisplay/Dockerfile index fab01f868..bb9da849a 100644 --- a/zmscalldisplay/Dockerfile +++ b/zmscalldisplay/Dockerfile @@ -1,9 +1,9 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build COPY --chown=1000:1000 . /var/www/html WORKDIR /var/www/html USER 1000 RUN make live -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base COPY --from=build --chown=0:0 /var/www/html /var/www/html diff --git a/zmsclient/.gitlab-ci.yml b/zmsclient/.gitlab-ci.yml index 4a7e770aa..0c1cca9d1 100644 --- a/zmsclient/.gitlab-ci.yml +++ b/zmsclient/.gitlab-ci.yml @@ -16,11 +16,11 @@ build-mockup: - docker build --pull -t "${MOCKUP_IMAGE}" tests/mockup/ - docker push "${MOCKUP_IMAGE}" -test-php-73: +test-php-80: extends: .test-php allow_failure: false variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" ZMS_API_URL: http://mockupserver:8083 services: - name: $MOCKUP_IMAGE diff --git a/zmsclient/docker-compose.yml b/zmsclient/docker-compose.yml index 374627e33..3fa9d8fc3 100644 --- a/zmsclient/docker-compose.yml +++ b/zmsclient/docker-compose.yml @@ -14,7 +14,7 @@ services: test: depends_on: - mockup - image: registry.gitlab.com/eappointment/php-base:7.3-base + image: ghcr.io/it-at-m/eappointment-php-base:8.0-base volumes: - type: bind source: "." diff --git a/zmsclient/phpunit.xml b/zmsclient/phpunit.xml index 3857e96b5..93362f937 100644 --- a/zmsclient/phpunit.xml +++ b/zmsclient/phpunit.xml @@ -10,7 +10,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" forceCoversAnnotation="false" - stopOnFailure="true" + stopOnFailure="false" verbose="true" processIsolation="false" > diff --git a/zmsclient/src/Zmsclient/Result.php b/zmsclient/src/Zmsclient/Result.php index bffdb36f5..2000403d3 100644 --- a/zmsclient/src/Zmsclient/Result.php +++ b/zmsclient/src/Zmsclient/Result.php @@ -32,8 +32,8 @@ class Result protected $data = null; /** - * @var Metaresult|null - */ + * @var Metaresult|null + */ protected $meta = null; /** @@ -55,7 +55,7 @@ public function __construct( */ public function setResponse(ResponseInterface $response) { - $body = Validator::value((string)$response->getBody())->isJson(); + $body = Validator::value((string) $response->getBody())->isJson(); $this->testMeta($body, $response); $result = $body->getValue(); if (array_key_exists("data", $result)) { @@ -74,10 +74,10 @@ public function setResponse(ResponseInterface $response) protected function testMeta($body, ResponseInterface $response) { if ($body->hasFailed()) { - $content = (string)$response->getBody(); + $content = (string) $response->getBody(); throw new Exception\ApiFailed( 'API-Call failed, JSON parsing with error: ' . $body->getMessages() - . ' - Snippet: ' .substr(\strip_tags($content), 0, 2000) . '[...]', + . ' - Snippet: ' . substr(\strip_tags($content), 0, 2000) . '[...]', $response, $this->request ); @@ -203,20 +203,26 @@ public function getMeta() } /** - * Description + * Get the list of IDs from the data * - * @return String + * @return string */ public function getIds() { $data = $this->getData(); - $idList = array(); + $idList = []; + foreach ($data as $item) { - if (array_key_exists('id', $item)) { + if (is_object($item) && method_exists($item, 'getId')) { + $idList[] = $item->getId(); + } elseif (is_array($item) && array_key_exists('id', $item)) { $idList[] = $item['id']; + } else { + throw new \UnexpectedValueException('Item is neither array nor object with getId() method'); } } - return join(',', array_unique($idList)); + + return implode(',', array_unique($idList)); } /** @@ -232,7 +238,7 @@ public function setData(array $data) $data = [$data]; } foreach ($data as $entityData) { - if (! array_key_exists('$schema', $entityData)) { + if (!array_key_exists('$schema', $entityData)) { $entityData['$schema'] = $data[0]['$schema']; } $this->data[] = Factory::create($entityData)->getEntity(); diff --git a/zmsdb/.gitlab-ci.yml b/zmsdb/.gitlab-ci.yml index c86be91f7..f8044bd22 100644 --- a/zmsdb/.gitlab-ci.yml +++ b/zmsdb/.gitlab-ci.yml @@ -1,7 +1,7 @@ include: remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml -test-php-73: +test-php-80: extends: .test-php cache: [] allow_failure: false @@ -13,7 +13,7 @@ test-php-73: - $CLI_COMPOSER - bin/importTestData --commit variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" MYSQL_DATABASE: zmsbo MYSQL_ROOT_PASSWORD: mysql only: diff --git a/zmsdldb/.gitlab-ci.yml b/zmsdldb/.gitlab-ci.yml index 6a8edac0d..3cdf3883b 100644 --- a/zmsdldb/.gitlab-ci.yml +++ b/zmsdldb/.gitlab-ci.yml @@ -1,11 +1,11 @@ include: remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml -test-php-73: +test-php-80: extends: .test-php allow_failure: false variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" only: changes: - composer.lock diff --git a/zmsentities/.gitlab-ci.yml b/zmsentities/.gitlab-ci.yml index 1416de2fb..0baa7fb8f 100644 --- a/zmsentities/.gitlab-ci.yml +++ b/zmsentities/.gitlab-ci.yml @@ -1,11 +1,11 @@ include: remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml -test-php-73: +test-php-80: extends: .test-php allow_failure: false variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" only: changes: - composer.lock diff --git a/zmsmessaging/Dockerfile b/zmsmessaging/Dockerfile index fab01f868..bb9da849a 100644 --- a/zmsmessaging/Dockerfile +++ b/zmsmessaging/Dockerfile @@ -1,9 +1,9 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build COPY --chown=1000:1000 . /var/www/html WORKDIR /var/www/html USER 1000 RUN make live -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base COPY --from=build --chown=0:0 /var/www/html /var/www/html diff --git a/zmsstatistic/.gitlab-ci.yml b/zmsstatistic/.gitlab-ci.yml index 57eb87cba..176580e11 100644 --- a/zmsstatistic/.gitlab-ci.yml +++ b/zmsstatistic/.gitlab-ci.yml @@ -1,11 +1,11 @@ include: remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml -test-php-73: +test-php-80: extends: .test-php allow_failure: false variables: - PHP_VERSION: "7.3" + PHP_VERSION: "8.0" only: changes: - .gitlab-ci.yml diff --git a/zmsstatistic/Dockerfile b/zmsstatistic/Dockerfile index ccc7c0595..11ae4924e 100644 --- a/zmsstatistic/Dockerfile +++ b/zmsstatistic/Dockerfile @@ -1,9 +1,9 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build COPY --chown=1000:1000 . /build WORKDIR /build USER 1000:1000 RUN make live -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base COPY --from=build --chown=0:0 /build /var/www/html diff --git a/zmsticketprinter/Dockerfile b/zmsticketprinter/Dockerfile index fab01f868..bb9da849a 100644 --- a/zmsticketprinter/Dockerfile +++ b/zmsticketprinter/Dockerfile @@ -1,9 +1,9 @@ ARG PHP_VERSION -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build COPY --chown=1000:1000 . /var/www/html WORKDIR /var/www/html USER 1000 RUN make live -FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base +FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base COPY --from=build --chown=0:0 /var/www/html /var/www/html