diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8e558483 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: Tests + +on: [pull_request] + +jobs: + testing: + name: Testing + + runs-on: ubuntu-latest + + strategy: + fail-fast: true + + matrix: + php: + - '8.1' + - '8.2' + - '8.3' + + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Lint PHP' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint + + - name: 'Install testing system' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate + + - name: 'Composer validate' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate + + - name: 'Composer normalize' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerNormalize -n + + - name: 'CGL' + run: Build/Scripts/runTests.sh -n -p ${{ matrix.php }} -s cgl + + - name: 'Execute unit tests' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit + + - name: 'Execute functional tests with mysql database' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mysql -s functional + + - name: 'Execute functional tests with mariadb database' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -s functional + + - name: 'Execute functional tests with postgres database' + run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d postgres -s functional diff --git a/.github/workflows/typo3_12.yml b/.github/workflows/typo3_12.yml deleted file mode 100644 index 642aea89..00000000 --- a/.github/workflows/typo3_12.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Test maps2 against TYPO3 12 - -on: [pull_request] - -jobs: - CGL: - name: Coding Style - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Composer - run: Build/Scripts/runTests.sh -t 12 -p 8.1 -s composerUpdate - - - name: Lint PHP - run: Build/Scripts/runTests.sh -t 12 -p 8.1 -s lint - - - name: Validate code against CGL - run: Build/Scripts/runTests.sh -t 12 -p 8.1 -s cgl -n - - testing: - name: PHP Unit and Functional Tests - needs: CGL - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - - matrix: - php: [ '8.1', '8.2' ] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Composer - run: Build/Scripts/runTests.sh -t 12 -p 8.1 -s composerUpdate - - - name: Unit tests - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit - - - name: Functional tests with mariadb - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -s functional - - - name: Functional tests with postgres - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d postgres -s functional - - - name: Functional tests with sqlite - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d sqlite -s functional diff --git a/Build/FunctionalTests.xml b/Build/FunctionalTests.xml deleted file mode 100644 index 6067666c..00000000 --- a/Build/FunctionalTests.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - ../Tests/Functional/ - - - - - - - - - diff --git a/Build/FunctionalTestsBootstrap.php b/Build/FunctionalTestsBootstrap.php deleted file mode 100644 index 443197d7..00000000 --- a/Build/FunctionalTestsBootstrap.php +++ /dev/null @@ -1,20 +0,0 @@ -defineOriginalRootPath(); - $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests'); - $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient'); -}); diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index c25bc144..843bb0a5 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -1,88 +1,164 @@ #!/usr/bin/env bash # -# TYPO3 core test runner based on docker and docker-compose. +# EXT:examples test runner based on docker/podman. # -# Function to write a .env file in Build/testing-docker -# This is read by docker-compose and vars defined here are -# used in Build/testing-docker/docker-compose.yml -setUpDockerComposeDotEnv() { - # Delete possibly existing local .env file if exists - [ -e .env ] && rm .env - # Set up a new .env file for docker-compose - { - echo "COMPOSE_PROJECT_NAME=local" - # To prevent access rights of files created by the testing, the docker image later - # runs with the same user that is currently executing the script. docker-compose can't - # use $UID directly itself since it is a shell variable and not an env variable, so - # we have to set it explicitly here. - echo "HOST_UID=`id -u`" - # Your local user - echo "ROOT_DIR=${ROOT_DIR}" - echo "HOST_USER=${USER}" - echo "TEST_FILE=${TEST_FILE}" - echo "TYPO3_VERSION=${TYPO3_VERSION}" - echo "PHP_XDEBUG_ON=${PHP_XDEBUG_ON}" - echo "DOCKER_PHP_IMAGE=${DOCKER_PHP_IMAGE}" - echo "EXTRA_TEST_OPTIONS=${EXTRA_TEST_OPTIONS}" - echo "SCRIPT_VERBOSE=${SCRIPT_VERBOSE}" - echo "CGLCHECK_DRY_RUN=${CGLCHECK_DRY_RUN}" - echo "DATABASE_DRIVER=${DATABASE_DRIVER}" - } > .env +trap 'cleanUp;exit 2' SIGINT + +waitFor() { + local HOST=${1} + local PORT=${2} + local TESTCOMMAND=" + COUNT=0; + while ! nc -z ${HOST} ${PORT}; do + if [ \"\${COUNT}\" -gt 10 ]; then + echo \"Can not connect to ${HOST} port ${PORT}. Aborting.\"; + exit 1; + fi; + sleep 1; + COUNT=\$((COUNT + 1)); + done; + " + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name wait-for-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_ALPINE} /bin/sh -c "${TESTCOMMAND}" + if [[ $? -gt 0 ]]; then + kill -SIGINT -$$ + fi } -# Options -a and -d depend on each other. The function -# validates input combinations and sets defaults. -handleDbmsAndDriverOptions() { +cleanUp() { + ATTACHED_CONTAINERS=$(${CONTAINER_BIN} ps --filter network=${NETWORK} --format='{{.Names}}') + for ATTACHED_CONTAINER in ${ATTACHED_CONTAINERS}; do + ${CONTAINER_BIN} rm -f ${ATTACHED_CONTAINER} >/dev/null + done + ${CONTAINER_BIN} network rm ${NETWORK} >/dev/null +} + +cleanCacheFiles() { + echo -n "Clean caches ... " + rm -rf \ + .Build/.cache \ + .php-cs-fixer.cache + echo "done" +} + +cleanRenderedDocumentationFiles() { + echo -n "Clean rendered documentation files ... " + rm -rf \ + Documentation-GENERATED-temp + echo "done" +} + +handleDbmsOptions() { + # -a, -d, -i depend on each other. Validate input combinations and set defaults. case ${DBMS} in - mysql|mariadb) + mariadb) [ -z "${DATABASE_DRIVER}" ] && DATABASE_DRIVER="mysqli" if [ "${DATABASE_DRIVER}" != "mysqli" ] && [ "${DATABASE_DRIVER}" != "pdo_mysql" ]; then - echo "Invalid option -a ${DATABASE_DRIVER} with -d ${DBMS}" >&2 + echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + fi + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.4" + if ! [[ ${DBMS_VERSION} =~ ^(10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1)$ ]]; then + echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 - echo "call \"./Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi ;; - postgres|sqlite) + mysql) + [ -z "${DATABASE_DRIVER}" ] && DATABASE_DRIVER="mysqli" + if [ "${DATABASE_DRIVER}" != "mysqli" ] && [ "${DATABASE_DRIVER}" != "pdo_mysql" ]; then + echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + fi + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="8.0" + if ! [[ ${DBMS_VERSION} =~ ^(8.0|8.1|8.2|8.3)$ ]]; then + echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + fi + ;; + postgres) if [ -n "${DATABASE_DRIVER}" ]; then - echo "Invalid option -a ${DATABASE_DRIVER} with -d ${DBMS}" >&2 + echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + fi + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10" + if ! [[ ${DBMS_VERSION} =~ ^(10|11|12|13|14|15|16)$ ]]; then + echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 - echo "call \"./Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi ;; + sqlite) + if [ -n "${DATABASE_DRIVER}" ]; then + echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + fi + if [ -n "${DBMS_VERSION}" ]; then + echo "Invalid combination -d ${DBMS} -i ${DATABASE_DRIVER}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + fi + ;; + *) + echo "Invalid option -d ${DBMS}" >&2 + echo >&2 + echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 + exit 1 + ;; esac } -# Load help text into $HELP -read -r -d '' HELP <=20.10 for xdebug break pointing to work reliably, and -a recent docker-compose (tested >=1.21.2) is needed. +loadHelp() { + # Load help text into $HELP + read -r -d '' HELP < Specifies which test suite to run - - acceptance: backend acceptance tests - cgl: cgl test and fix all php files - - clean: clean up build and testing related files + - clean: Clean temporary files + - cleanCache: Clean cache folds for files. + - cleanRenderedDocumentation: Clean existing rendered documentation output. + - composer: "composer" with all remaining arguments dispatched. + - composerNormalize: "composer normalize" - composerUpdate: "composer update", handy if host has no PHP - - functional: functional tests + - composerUpdateRector: "composer update", for rector subdirectory + - composerValidate: "composer validate" + - functional: PHP functional tests - lint: PHP linting - - phpstan: phpstan analyze - - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - - unit (default): PHP unit tests + - phpstan: PHPStan static analysis + - phpstanBaseline: Generate PHPStan baseline + - unit: PHP unit tests + - rector: Apply Rector rules + - renderDocumentation + - testRenderDocumentation + + -b + Container environment: + - docker + - podman + + If not specified, podman will be used if available. Otherwise, docker is used. -a - Only with -s acceptance,functional + Only with -s functional|functionalDeprecated Specifies to use another driver, following combinations are available: - mysql - mysqli (default) @@ -92,145 +168,155 @@ Options: - pdo_mysql -d - Only with -s acceptance,functional + Only with -s functional|functionalDeprecated|acceptance|acceptanceComposer|acceptanceInstall Specifies on which DBMS tests are performed - - sqlite: (default) use sqlite + - sqlite: (default): use sqlite - mariadb: use mariadb - - mysql: use mysql + - mysql: use MySQL - postgres: use postgres + -i version + Specify a specific database version + With "-d mariadb": + - 10.4 short-term, maintained until 2024-06-18 (default) + - 10.5 short-term, maintained until 2025-06-24 + - 10.6 long-term, maintained until 2026-06 + - 10.7 short-term, no longer maintained + - 10.8 short-term, maintained until 2023-05 + - 10.9 short-term, maintained until 2023-08 + - 10.10 short-term, maintained until 2023-11 + - 10.11 long-term, maintained until 2028-02 + - 11.0 development series + - 11.1 short-term development series + With "-d mysql": + - 8.0 maintained until 2026-04 (default) LTS + - 8.1 unmaintained since 2023-10 + - 8.2 unmaintained since 2024-01 + - 8.3 maintained until 2024-04 + With "-d postgres": + - 10 unmaintained since 2022-11-10 (default) + - 11 unmaintained since 2023-11-09 + - 12 maintained until 2024-11-14 + - 13 maintained until 2025-11-13 + - 14 maintained until 2026-11-12 + - 15 maintained until 2027-11-11 + - 16 maintained until 2028-11-09 - -p <7.4|8.0|8.1|8.2> + -p <8.1|8.2|8.3> Specifies the PHP minor version to be used - - 7.4 (default): use PHP 7.4 - - 8.0: use PHP 8.0 - 8.1: use PHP 8.1 - 8.2: use PHP 8.2 - - -t <11|12> - Only with -s composerUpdate - Specifies the TYPO3 core major version to be used - - 11 (default): use TYPO3 core v11 - - 12: Use TYPO3 core v12 - - -e "" - Only with -s acceptance|functional|unit - Additional options to send to phpunit (unit & functional tests) or codeception (acceptance - tests). For phpunit, options starting with "--" must be added after options starting with "-". - Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests - named "canRetrieveValueWithGP" + - 8.3: use PHP 8.3 -x - Only with -s functional|unit|acceptance + Only with -s functional|unit Send information to host instance for test or system under test break points. This is especially useful if a local PhpStorm instance is listening on default xdebug port 9003. A different port can be selected with -y + -y + Send xdebug information to a different port than default 9003 if an IDE like PhpStorm + is not listening on default port. + -n - Only with -s cgl - Activate dry-run in CGL check that does not actively change files and only prints broken ones. + Only with -s cgl, composerNormalize, rector + Activate dry-run in CGL check and composer normalize that does not actively change files and only prints broken ones. -u - Update existing typo3/core-testing-*:latest docker images. Maintenance call to docker pull latest - versions of the main php images. The images are updated once in a while and only the youngest - ones are supported by core testing. Use this if weird test errors occur. Also removes obsolete - image versions of typo3/core-testing-*. - - -v - Enable verbose script output. Shows variables and docker commands. + Update existing typo3/core-testing-*:latest container images and remove dangling local volumes. + New images are published once in a while and only the latest ones are supported by core testing. + Use this if weird test errors occur. Also removes obsolete image versions of typo3/core-testing-*. -h Show this help. Examples: - # Run unit tests using PHP 7.4 - ./Build/Scripts/runTests.sh -EOF + # Run unit tests using PHP 8.2 + ./Build/Scripts/runTests.sh -p 8.2 -s unit -# Test if docker-compose exists, else exit out with error -if ! type "docker-compose" > /dev/null; then - echo "This script relies on docker and docker-compose. Please install" >&2 - exit 1 -fi + # Run functional tests using PHP 8.3 and MariaDB 10.6 using pdo_mysql + ./Build/Scripts/runTests.sh -p 8.3 -s functional -d mariadb -i 10.6 -a pdo_mysql -# Go to the directory this script is located, so everything else is relative -# to this dir, no matter from where this script is called. -THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -cd "$THIS_SCRIPT_DIR" || exit 1 + # Run functional tests on postgres with xdebug, php 8.3 and execute a restricted set of tests + ./Build/Scripts/runTests.sh -x -p 8.3 -s functional -d postgres -- Tests/Functional/DummyTest.php +EOF +} -# Go to directory that contains the local docker-compose.yml file -cd ../testing-docker || exit 1 +# Test if docker exists, else exit out with error +if ! type "docker" >/dev/null 2>&1 && ! type "podman" >/dev/null 2>&1; then + echo "This script relies on docker or podman. Please install" >&2 + exit 1 +fi # Option defaults -if ! command -v realpath &> /dev/null; then - echo "This script works best with realpath installed" >&2 - ROOT_DIR="${PWD}/../../" -else - ROOT_DIR=`realpath ${PWD}/../../` -fi -TEST_SUITE="unit" +# @todo Consider to switch from cgl to help as default +TEST_SUITE="cgl" +DATABASE_DRIVER="" DBMS="sqlite" -PHP_VERSION="7.4" -TYPO3_VERSION="11" +DBMS_VERSION="" +PHP_VERSION="8.1" PHP_XDEBUG_ON=0 -EXTRA_TEST_OPTIONS="" -SCRIPT_VERBOSE=0 -CGLCHECK_DRY_RUN="" -DATABASE_DRIVER="" +PHP_XDEBUG_PORT=9003 +CGLCHECK_DRY_RUN=0 +CI_PARAMS="${CI_PARAMS:-}" +DOCS_PARAMS="${DOCS_PARAMS:=--pull always}" +CONTAINER_BIN="" +CONTAINER_HOST="host.docker.internal" -# Option parsing +# Option parsing updates above default vars # Reset in case getopts has been used previously in the shell OPTIND=1 # Array for invalid options -INVALID_OPTIONS=(); +INVALID_OPTIONS=() # Simple option parsing based on getopts (! not getopt) -while getopts ":s:a:d:p:t:e:xnhuv" OPT; do +while getopts "a:b:d:i:s:p:xy:nhu" OPT; do case ${OPT} in + a) + DATABASE_DRIVER=${OPTARG} + ;; s) TEST_SUITE=${OPTARG} ;; - a) - DATABASE_DRIVER=${OPTARG} + b) + if ! [[ ${OPTARG} =~ ^(docker|podman)$ ]]; then + INVALID_OPTIONS+=("${OPTARG}") + fi + CONTAINER_BIN=${OPTARG} ;; d) DBMS=${OPTARG} ;; + i) + DBMS_VERSION=${OPTARG} + ;; p) PHP_VERSION=${OPTARG} - if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2)$ ]]; then - INVALID_OPTIONS+=("p ${OPTARG}") - fi - ;; - t) - TYPO3_VERSION=${OPTARG} - if ! [[ ${TYPO3_VERSION} =~ ^(11|12)$ ]]; then + if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3)$ ]]; then INVALID_OPTIONS+=("p ${OPTARG}") fi ;; - e) - EXTRA_TEST_OPTIONS=${OPTARG} - ;; x) PHP_XDEBUG_ON=1 ;; + y) + PHP_XDEBUG_PORT=${OPTARG} + ;; + n) + CGLCHECK_DRY_RUN=1 + ;; h) + loadHelp echo "${HELP}" exit 0 ;; - n) - CGLCHECK_DRY_RUN="-n" - ;; u) TEST_SUITE=update ;; - v) - SCRIPT_VERBOSE=1 - ;; \?) - INVALID_OPTIONS+=(${OPTARG}) + INVALID_OPTIONS+=("${OPTARG}") ;; :) - INVALID_OPTIONS+=(${OPTARG}) + INVALID_OPTIONS+=("${OPTARG}") ;; esac done @@ -242,149 +328,279 @@ if [ ${#INVALID_OPTIONS[@]} -ne 0 ]; then echo "-"${I} >&2 done echo >&2 - echo "${HELP}" >&2 + echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options" exit 1 fi -# Move "7.4" to "php74", the latter is the docker container name -DOCKER_PHP_IMAGE=`echo "php${PHP_VERSION}" | sed -e 's/\.//'` +handleDbmsOptions + +COMPOSER_ROOT_VERSION="13.0.x-dev" +HOST_UID=$(id -u) +USERSET="" +if [ $(uname) != "Darwin" ]; then + USERSET="--user $HOST_UID" +fi + +# Go to the directory this script is located, so everything else is relative +# to this dir, no matter from where this script is called, then go up two dirs. +THIS_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" +cd "$THIS_SCRIPT_DIR" || exit 1 +cd ../../ || exit 1 +ROOT_DIR="${PWD}" + +# Create .cache dir: composer need this. +mkdir -p .Build/.cache +mkdir -p .Build/web/typo3temp/var/tests + +IMAGE_PREFIX="docker.io/" +# Non-CI fetches TYPO3 images (php and nodejs) from ghcr.io +TYPO3_IMAGE_PREFIX="ghcr.io/typo3/" +CONTAINER_INTERACTIVE="-it --init" + +IS_CORE_CI=0 +# ENV var "CI" is set by gitlab-ci. We use it here to distinct 'local' and 'CI' environment. +if [ "${CI}" == "true" ]; then + IS_CORE_CI=1 + IMAGE_PREFIX="" + CONTAINER_INTERACTIVE="" +fi + +# determine default container binary to use: 1. podman 2. docker +if [[ -z "${CONTAINER_BIN}" ]]; then + if type "podman" >/dev/null 2>&1; then + CONTAINER_BIN="podman" + elif type "docker" >/dev/null 2>&1; then + CONTAINER_BIN="docker" + fi +fi + +IMAGE_PHP="${TYPO3_IMAGE_PREFIX}core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest" +IMAGE_ALPINE="${IMAGE_PREFIX}alpine:3.8" +IMAGE_MARIADB="docker.io/mariadb:${DBMS_VERSION}" +IMAGE_MYSQL="docker.io/mysql:${DBMS_VERSION}" +IMAGE_POSTGRES="docker.io/postgres:${DBMS_VERSION}-alpine" +IMAGE_DOCS="ghcr.io/typo3-documentation/render-guides:latest" # Set $1 to first mass argument, this is the optional test file or test directory to execute shift $((OPTIND - 1)) -TEST_FILE=${1} -if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x +SUFFIX=$(echo $RANDOM) +NETWORK="t3docsexamples-${SUFFIX}" +${CONTAINER_BIN} network create ${NETWORK} >/dev/null + +if [ ${CONTAINER_BIN} = "docker" ]; then + # docker needs the add-host for xdebug remote debugging. podman has host.container.internal built in + CONTAINER_COMMON_PARAMS="${CONTAINER_INTERACTIVE} --rm --network ${NETWORK} --add-host "${CONTAINER_HOST}:host-gateway" ${USERSET} -v ${ROOT_DIR}:${ROOT_DIR} -w ${ROOT_DIR}" + CONTAINER_DOCS_PARAMS="${CONTAINER_INTERACTIVE} ${DOCS_PARAMS} --rm --network ${NETWORK} --add-host "${CONTAINER_HOST}:host-gateway" ${USERSET} -v ${ROOT_DIR}:/project" +else + # podman + CONTAINER_HOST="host.containers.internal" + CONTAINER_COMMON_PARAMS="${CONTAINER_INTERACTIVE} ${CI_PARAMS} --rm --network ${NETWORK} -v ${ROOT_DIR}:${ROOT_DIR} -w ${ROOT_DIR}" + CONTAINER_DOCS_PARAMS="${CONTAINER_INTERACTIVE} ${DOCS_PARAMS} --rm --network ${NETWORK} -v ${ROOT_DIR}:/project" +fi + +if [ ${PHP_XDEBUG_ON} -eq 0 ]; then + XDEBUG_MODE="-e XDEBUG_MODE=off" + XDEBUG_CONFIG=" " +else + XDEBUG_MODE="-e XDEBUG_MODE=debug -e XDEBUG_TRIGGER=foo" + XDEBUG_CONFIG="client_port=${PHP_XDEBUG_PORT} client_host=${CONTAINER_HOST}" fi # Suite execution case ${TEST_SUITE} in - acceptance) - handleDbmsAndDriverOptions - setUpDockerComposeDotEnv - case ${DBMS} in - sqlite) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run acceptance_cli_sqlite - SUITE_EXIT_CODE=$? - ;; - mysql) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run acceptance_cli_mysql80 - SUITE_EXIT_CODE=$? - ;; - mariadb) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run acceptance_cli_mariadb10 - SUITE_EXIT_CODE=$? - ;; - postgres) - docker-compose run acceptance_cli_postgres10 - SUITE_EXIT_CODE=$? - ;; - *) - echo "Acceptance tests don't run with DBMS ${DBMS}" >&2 - echo >&2 - echo "call \"./Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 - exit 1 - esac - docker-compose down - ;; cgl) - # Active dry-run for cgl needs not "-n" but specific options - if [[ ! -z ${CGLCHECK_DRY_RUN} ]]; then - CGLCHECK_DRY_RUN="--dry-run --diff" + if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then + COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v --dry-run --diff --config=Build/cgl/.php-cs-fixer.dist.php --using-cache=no ." + else + COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v --config=Build/cgl/.php-cs-fixer.dist.php --using-cache=no ." fi - setUpDockerComposeDotEnv - docker-compose run cgl + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name cgl-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" SUITE_EXIT_CODE=$? - docker-compose down ;; clean) - rm -rf ../../composer.lock ../../.Build/ ../../Tests/Acceptance/Support/_generated/ ../../composer.json.testing + cleanCacheFiles + cleanRenderedDocumentationFiles + ;; + cleanCache) + cleanCacheFiles + ;; + cleanRenderedDocumentation) + cleanRenderedDocumentationFiles + ;; + composer) + COMMAND=(composer "$@") + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? + ;; + composerNormalize) + if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then + COMMAND=(composer normalize -n) + else + COMMAND=(composer normalize) + fi + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? ;; composerUpdate) - setUpDockerComposeDotEnv - cp ../../composer.json ../../composer.json.orig - if [ -f "../../composer.json.testing" ]; then - cp ../../composer.json ../../composer.json.orig + rm -rf .Build/bin/ .Build/typo3 .Build/vendor .Build/Web ./composer.lock + cp ${ROOT_DIR}/composer.json ${ROOT_DIR}/composer.json.orig + if [ -f "${ROOT_DIR}/composer.json.testing" ]; then + cp ${ROOT_DIR}/composer.json ${ROOT_DIR}/composer.json.orig fi - docker-compose run composer_update - cp ../../composer.json ../../composer.json.testing - mv ../../composer.json.orig ../../composer.json + COMMAND=(composer require --no-ansi --no-interaction --no-progress) + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? + cp ${ROOT_DIR}/composer.json ${ROOT_DIR}/composer.json.testing + mv ${ROOT_DIR}/composer.json.orig ${ROOT_DIR}/composer.json + ;; + composerUpdateRector) + rm -rf Build/rector/.Build/bin/ Build/rector/.Build/vendor Build/rector/composer.lock + cp ${ROOT_DIR}/Build/rector/composer.json ${ROOT_DIR}/Build/rector/composer.json.orig + if [ -f "${ROOT_DIR}/Build/rector/composer.json.testing" ]; then + cp ${ROOT_DIR}/Build/rector/composer.json ${ROOT_DIR}/Build/rector/composer.json.orig + fi + COMMAND=(composer require --working-dir=${ROOT_DIR}/Build/rector --no-ansi --no-interaction --no-progress) + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? + cp ${ROOT_DIR}/Build/rector/composer.json ${ROOT_DIR}/Build/rector/composer.json.testing + mv ${ROOT_DIR}/Build/rector/composer.json.orig ${ROOT_DIR}/Build/rector/composer.json + ;; + composerValidate) + COMMAND=(composer validate "$@") + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? - docker-compose down ;; functional) - handleDbmsAndDriverOptions - setUpDockerComposeDotEnv + CONTAINER_PARAMS="" + COMMAND=(.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} "$@") case ${DBMS} in mariadb) echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run functional_mariadb10 + ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name mariadb-func-${SUFFIX} --network ${NETWORK} -d -e MYSQL_ROOT_PASSWORD=funcp --tmpfs /var/lib/mysql/:rw,noexec,nosuid ${IMAGE_MARIADB} >/dev/null + waitFor mariadb-func-${SUFFIX} 3306 + CONTAINERPARAMS="-e typo3DatabaseDriver=${DATABASE_DRIVER} -e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabaseHost=mariadb-func-${SUFFIX} -e typo3DatabasePassword=funcp" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; mysql) echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run functional_mysql80 + ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name mysql-func-${SUFFIX} --network ${NETWORK} -d -e MYSQL_ROOT_PASSWORD=funcp --tmpfs /var/lib/mysql/:rw,noexec,nosuid ${IMAGE_MYSQL} >/dev/null + waitFor mysql-func-${SUFFIX} 3306 + CONTAINERPARAMS="-e typo3DatabaseDriver=${DATABASE_DRIVER} -e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabaseHost=mysql-func-${SUFFIX} -e typo3DatabasePassword=funcp" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; postgres) - docker-compose run functional_postgres10 + ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-func-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs /var/lib/postgresql/data:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null + waitFor postgres-func-${SUFFIX} 5432 + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=bamboo -e typo3DatabaseUsername=funcu -e typo3DatabaseHost=postgres-func-${SUFFIX} -e typo3DatabasePassword=funcp" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; sqlite) - # sqlite has a tmpfs as Web/typo3temp/var/tests/functional-sqlite-dbs/ - # Since docker is executed as root (yay!), the path to this dir is owned by - # root if docker creates it. Thank you, docker. We create the path beforehand - # to avoid permission issues. - mkdir -p ${ROOT_DIR}/Web/typo3temp/var/tests/functional-sqlite-dbs/ - docker-compose run functional_sqlite + # create sqlite tmpfs mount typo3temp/var/tests/functional-sqlite-dbs/ to avoid permission issues + mkdir -p "${ROOT_DIR}/.Build/web/typo3temp/var/tests/functional-sqlite-dbs/" + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite --tmpfs ${ROOT_DIR}/.Build/web/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; - *) - echo "Invalid -d option argument ${DBMS}" >&2 - echo >&2 - echo "${HELP}" >&2 - exit 1 esac - docker-compose down ;; lint) - setUpDockerComposeDotEnv - docker-compose run lint + COMMAND="find . -name \\*.php ! -path "./.Build/\\*" -print0 | xargs -0 -n1 -P4 php -dxdebug.mode=off -l >/dev/null" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" SUITE_EXIT_CODE=$? - docker-compose down ;; phpstan) - setUpDockerComposeDotEnv - docker-compose run phpstan + COMMAND="php -dxdebug.mode=off .Build/bin/phpstan --configuration=Build/phpstan/phpstan.neon" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name phpstan-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" + SUITE_EXIT_CODE=$? + ;; + phpstanBaseline) + COMMAND="php -dxdebug.mode=off .Build/bin/phpstan --configuration=Build/phpstan/phpstan.neon --generate-baseline=Build/phpstan/phpstan-baseline.neon -v" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name phpstan-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" SUITE_EXIT_CODE=$? - docker-compose down ;; - phpstanGenerateBaseline) - setUpDockerComposeDotEnv - docker-compose run phpstan_generate_baseline + rector) + if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then + COMMAND=(php -dxdebug.mode=off Build/rector/.Build/bin/rector -n --config=Build/rector/rector.php --clear-cache "$@") + else + COMMAND=(php -dxdebug.mode=off Build/rector/.Build/bin/rector --config=Build/rector/rector.php --clear-cache "$@") + fi + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name rector-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? + ;; + renderDocumentation) + COMMAND=(--config=Documentation "$@") + mkdir -p Documentation-GENERATED-temp + ${CONTAINER_BIN} run ${CONTAINER_INTERACTIVE} ${CONTAINER_DOCS_PARAMS} --name render-documentation-${SUFFIX} ${IMAGE_DOCS} "${COMMAND[@]}" + SUITE_EXIT_CODE=$? + ;; + testRenderDocumentation) + COMMAND=(--config=Documentation --no-progress --fail-on-log "$@") + mkdir -p Documentation-GENERATED-temp + ${CONTAINER_BIN} run ${CONTAINER_INTERACTIVE} ${CONTAINER_DOCS_PARAMS} --name render-documentation-test-${SUFFIX} ${IMAGE_DOCS} "${COMMAND[@]}" SUITE_EXIT_CODE=$? - docker-compose down ;; unit) - setUpDockerComposeDotEnv - docker-compose run unit + COMMAND=(.Build/bin/phpunit -c Build/phpunit/UnitTests.xml ${EXTRA_TEST_OPTIONS} "$@") + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? - docker-compose down ;; update) - # pull typo3/core-testing-*:latest versions of those ones that exist locally - docker images typo3/core-testing-*:latest --format "{{.Repository}}:latest" | xargs -I {} docker pull {} + # pull typo3/core-testing-* versions of those ones that exist locally + echo "> pull ${TYPO3_IMAGE_PREFIX}core-testing-* versions of those ones that exist locally" + ${CONTAINER_BIN} images "${TYPO3_IMAGE_PREFIX}core-testing-*" --format "{{.Repository}}:{{.Tag}}" | xargs -I {} ${CONTAINER_BIN} pull {} + echo "" # remove "dangling" typo3/core-testing-* images (those tagged as ) - docker images typo3/core-testing-* --filter "dangling=true" --format "{{.ID}}" | xargs -I {} docker rmi {} + echo "> remove \"dangling\" ${TYPO3_IMAGE_PREFIX}/core-testing-* images (those tagged as )" + ${CONTAINER_BIN} images --filter "reference=${TYPO3_IMAGE_PREFIX}/core-testing-*" --filter "dangling=true" --format "{{.ID}}" | xargs -I {} ${CONTAINER_BIN} rmi -f {} + echo "" ;; *) + loadHelp echo "Invalid -s option argument ${TEST_SUITE}" >&2 echo >&2 echo "${HELP}" >&2 exit 1 + ;; esac +cleanUp + +# Print summary +echo "" >&2 +echo "###########################################################################" >&2 +echo "Result of ${TEST_SUITE}" >&2 +echo "Container runtime: ${CONTAINER_BIN}" >&2 +if [[ ${IS_CORE_CI} -eq 1 ]]; then + echo "Environment: CI" >&2 +else + echo "Environment: local" >&2 +fi +echo "PHP: ${PHP_VERSION}" >&2 +echo "TYPO3: ${CORE_VERSION}" >&2 +if [[ ${TEST_SUITE} =~ ^functional$ ]]; then + case "${DBMS}" in + mariadb|mysql) + echo "DBMS: ${DBMS} version ${DBMS_VERSION} driver ${DATABASE_DRIVER}" >&2 + ;; + postgres) + echo "DBMS: ${DBMS} version ${DBMS_VERSION} driver pdo_pgsql" >&2 + ;; + sqlite) + echo "DBMS: ${DBMS} driver pdo_sqlite" >&2 + ;; + esac +fi +if [[ ${SUITE_EXIT_CODE} -eq 0 ]]; then + echo "SUCCESS" >&2 +else + echo "FAILURE" >&2 +fi +echo "###########################################################################" >&2 +echo "" >&2 + +# Exit with code of test suite - This script return non-zero if the executed test failed. exit $SUITE_EXIT_CODE diff --git a/Build/UnitTests.xml b/Build/UnitTests.xml deleted file mode 100644 index a90da4c8..00000000 --- a/Build/UnitTests.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - ../Tests/Unit/ - - - - - - - diff --git a/Build/php-cs-fixer/config.php b/Build/cgl/.php-cs-fixer.dist.php similarity index 74% rename from Build/php-cs-fixer/config.php rename to Build/cgl/.php-cs-fixer.dist.php index 623089da..7b10290b 100644 --- a/Build/php-cs-fixer/config.php +++ b/Build/cgl/.php-cs-fixer.dist.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use PhpCsFixer\Config; +use PhpCsFixer\Finder; + /* * This file is part of the package jweiland/maps2. * @@ -9,9 +12,6 @@ * LICENSE file that was distributed with this source code. */ -use PhpCsFixer\Config; -use PhpCsFixer\Finder; - if (PHP_SAPI !== 'cli') { die('This script supports command line usage only. Please check your command.'); } @@ -23,35 +23,39 @@ LICENSE file that was distributed with this source code. COMMENT; -$finder = Finder::create() - ->name('*.php') - ->exclude('.Build') - ->ignoreVCSIgnored(true) - ->in([ - __DIR__ . '/../../Classes/', - __DIR__ . '/../../Tests/', - ]); - return (new Config()) - ->setFinder($finder) - ->setUsingCache(false) + ->setFinder( + (new Finder()) + ->in(__DIR__ . '/../../') + ->exclude(__DIR__ . '/../../.Build') + ->exclude(__DIR__ . '/../../var') + ) ->setRiskyAllowed(true) ->setRules([ '@DoctrineAnnotation' => true, - '@PER' => true, 'header_comment' => [ 'header' => $headerComment, ], + // @todo: Switch to @PER-CS2.0 once php-cs-fixer's todo list is done: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7247 + '@PER-CS1.0' => true, + 'array_indentation' => true, 'array_syntax' => ['syntax' => 'short'], 'cast_spaces' => ['space' => 'none'], + // @todo: Can be dropped once we enable @PER-CS2.0 'concat_space' => ['spacing' => 'one'], 'declare_equal_normalize' => ['space' => 'none'], 'declare_parentheses' => true, 'dir_constant' => true, + // @todo: Can be dropped once we enable @PER-CS2.0 + 'function_declaration' => [ + 'closure_fn_spacing' => 'none', + ], 'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']], 'type_declaration_spaces' => true, 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], 'list_syntax' => ['syntax' => 'short'], + // @todo: Can be dropped once we enable @PER-CS2.0 + 'method_argument_space' => true, 'modernize_strpos' => true, 'modernize_types_casting' => true, 'native_function_casing' => true, @@ -68,7 +72,6 @@ 'no_trailing_comma_in_singleline' => true, 'no_unneeded_control_parentheses' => true, 'no_unused_imports' => true, - 'no_useless_else' => true, 'no_useless_nullsafe_operator' => true, 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], 'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], @@ -85,7 +88,15 @@ 'single_quote' => true, 'single_space_around_construct' => true, 'single_line_comment_style' => ['comment_types' => ['hash']], - 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + // @todo: Can be dropped once we enable @PER-CS2.0 + 'single_line_empty_body' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arguments', 'arrays', 'match', 'parameters']], 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], + + // We need this for documentation! + 'no_useless_else' => false, // We want to preserve else with comments only + + // Add this rule to convert FQCN to use statements + 'full_opening_tag' => true, ]); diff --git a/Build/phpunit/FunctionalTests.xml b/Build/phpunit/FunctionalTests.xml new file mode 100644 index 00000000..7c503be9 --- /dev/null +++ b/Build/phpunit/FunctionalTests.xml @@ -0,0 +1,26 @@ + + + + + + + ../../Tests/Functional/ + + + + + + + diff --git a/Build/phpunit/FunctionalTestsBootstrap.php b/Build/phpunit/FunctionalTestsBootstrap.php new file mode 100644 index 00000000..651eba2a --- /dev/null +++ b/Build/phpunit/FunctionalTestsBootstrap.php @@ -0,0 +1,17 @@ +defineOriginalRootPath(); + $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests'); + $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient'); +})(); diff --git a/Build/phpunit/UnitTests.xml b/Build/phpunit/UnitTests.xml new file mode 100644 index 00000000..de0b0ae5 --- /dev/null +++ b/Build/phpunit/UnitTests.xml @@ -0,0 +1,31 @@ + + + + + + + ../../Tests/Unit/ + + + + + + + diff --git a/Build/phpunit/UnitTestsBootstrap.php b/Build/phpunit/UnitTestsBootstrap.php new file mode 100644 index 00000000..3113798d --- /dev/null +++ b/Build/phpunit/UnitTestsBootstrap.php @@ -0,0 +1,97 @@ +getWebRoot(), '/')); + } + if (!getenv('TYPO3_PATH_WEB')) { + putenv('TYPO3_PATH_WEB=' . rtrim($testbase->getWebRoot(), '/')); + } + + $testbase->defineSitePath(); + + // We can use the "typo3/cms-composer-installers" constant "TYPO3_COMPOSER_MODE" to determine composer mode. + // This should be always true except for TYPO3 mono repository. + $composerMode = defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE === true; + + // @todo: Remove else branch when dropping support for v12 + $hasConsolidatedHttpEntryPoint = class_exists(CoreHttpApplication::class); + if ($hasConsolidatedHttpEntryPoint) { + SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI, $composerMode); + } else { + $requestType = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI; + SystemEnvironmentBuilder::run(0, $requestType, $composerMode); + } + + $testbase->createDirectory(Environment::getPublicPath() . '/typo3conf/ext'); + $testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/assets'); + $testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/var/tests'); + $testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/var/transient'); + + // Retrieve an instance of class loader and inject to core bootstrap + $classLoader = require $testbase->getPackagesPath() . '/autoload.php'; + Bootstrap::initializeClassLoader($classLoader); + + // Initialize default TYPO3_CONF_VARS + $configurationManager = new ConfigurationManager(); + $GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration(); + + $cache = new PhpFrontend( + 'core', + new NullBackend('production', []), + ); + $packageManager = Bootstrap::createPackageManager( + UnitTestPackageManager::class, + Bootstrap::createPackageCache($cache), + ); + + GeneralUtility::setSingletonInstance(PackageManager::class, $packageManager); + ExtensionManagementUtility::setPackageManager($packageManager); + + $testbase->dumpClassLoadingInformation(); + + GeneralUtility::purgeInstances(); +})(); diff --git a/Build/testing-docker/docker-compose.yml b/Build/testing-docker/docker-compose.yml deleted file mode 100644 index 1ae1c6e5..00000000 --- a/Build/testing-docker/docker-compose.yml +++ /dev/null @@ -1,398 +0,0 @@ -version: '2.3' -services: - mariadb10: - # not using mariadb:10 for the time being, because 10.5.7 (currently latest) is broken - image: mariadb:10.5.6 - environment: - MYSQL_ROOT_PASSWORD: funcp - tmpfs: - - /var/lib/mysql/:rw,noexec,nosuid - - mysql80: - image: mysql:8.0 - environment: - MYSQL_ROOT_PASSWORD: funcp - tmpfs: - - /var/lib/mysql/:rw,noexec,nosuid - - postgres10: - image: postgres:10-alpine - environment: - POSTGRES_PASSWORD: funcp - POSTGRES_USER: ${HOST_USER} - tmpfs: - - /var/lib/postgresql/data:rw,noexec,nosuid - - acceptance_cli_mariadb10: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mariadb10 - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mariadb10 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR}/ - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mariadb10 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - mkdir -p .Build/Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Cli -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" $${COMMAND}; - fi - " - - acceptance_cli_mysql80: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mysql80 - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mysql80 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mysql80 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - mkdir -p .Build/Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Cli -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" $${COMMAND}; - fi - " - - acceptance_cli_postgres10: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - postgres10 - environment: - typo3DatabaseDriver: pdo_pgsql - typo3DatabaseName: bamboo - typo3DatabaseUsername: ${HOST_USER} - typo3DatabaseHost: postgres10 - typo3DatabasePassword: funcp - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z postgres10 5432; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - mkdir -p .Build/Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Cli -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" $${COMMAND}; - fi - " - - acceptance_cli_sqlite: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - environment: - typo3DatabaseDriver: pdo_sqlite - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - mkdir -p Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Cli -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" $${COMMAND}; - fi - " - - cgl: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v ${CGLCHECK_DRY_RUN} --config=Build/php-cs-fixer/config.php - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" PHP_CS_FIXER_ALLOW_XDEBUG=1 .Build/bin/php-cs-fixer fix -v ${CGLCHECK_DRY_RUN} --config=Build/php-cs-fixer/config.php - fi - " - - composer_update: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - environment: - COMPOSER_CACHE_DIR: ".cache/composer" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - if [ ${TYPO3_VERSION} -eq 11 ]; then - composer req --dev --no-update typo3/cms-composer-installers:^3.0 typo3/cms-workspaces:^11.5 typo3/cms-impexp:^11.5 - composer req typo3/cms-core:^11.5 --no-update - fi - if [ ${TYPO3_VERSION} -eq 12 ]; then - composer req --dev --no-update "typo3/cms-composer-installers:^5.0" typo3/cms-impexp:^12.4 typo3/cms-workspaces:^12.4 - composer req typo3/cms-core:^12.4 --no-update - fi - composer update --no-progress --no-interaction; - " - - functional_mariadb10: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mariadb10 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mariadb10 - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mariadb10 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - fi - " - - functional_mysql80: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mysql80 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mysql80 - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mysql80 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - fi - " - - functional_postgres10: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - postgres10 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - environment: - typo3DatabaseDriver: pdo_pgsql - typo3DatabaseName: bamboo - typo3DatabaseUsername: ${HOST_USER} - typo3DatabaseHost: postgres10 - typo3DatabasePassword: funcp - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z postgres10 5432; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE}; - fi - " - - functional_sqlite: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - tmpfs: - - ${ROOT_DIR}/Web/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid,uid=${HOST_UID} - environment: - typo3DatabaseDriver: pdo_sqlite - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE}; - fi - " - - lint: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - find . -name \\*.php ! -path "./.Build/\\*" -print0 | xargs -0 -n1 -P4 php -dxdebug.mode=off -l >/dev/null - " - - phpstan: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - mkdir -p .Build/.cache - php -v | grep '^PHP'; - php -dxdebug.mode=off .Build/bin/phpstan analyze -c Build/phpstan.neon --no-progress - " - - phpstan_generate_baseline: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - mkdir -p .Build/.cache - php -v | grep '^PHP'; - php -dxdebug.mode=off .Build/bin/phpstan analyze -c Build/phpstan.neon --generate-baseline=Build/phpstan-baseline.neon - " - - unit: - image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" .Build/bin/phpunit -c Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" XDEBUG_TRIGGER=\"foo\" XDEBUG_CONFIG=\"client_host=host.docker.internal\" .Build/bin/phpunit -c Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - fi - " diff --git a/Classes/Backend/Preview/Maps2PluginPreview.php b/Classes/Backend/Preview/Maps2PluginPreview.php index 38de1eee..e54380d4 100644 --- a/Classes/Backend/Preview/Maps2PluginPreview.php +++ b/Classes/Backend/Preview/Maps2PluginPreview.php @@ -80,12 +80,12 @@ protected function addPluginName(StandaloneView $view, array $ttContentRecord): $langKey = sprintf( 'plugin.%s.title', - $pluginName + $pluginName, ); $view->assign( 'pluginName', - LocalizationUtility::translate('LLL:EXT:maps2/Resources/Private/Language/locallang_db.xlf:' . $langKey) + LocalizationUtility::translate('LLL:EXT:maps2/Resources/Private/Language/locallang_db.xlf:' . $langKey), ); } @@ -121,7 +121,7 @@ protected function addPoiCollection(StandaloneView $view, array $piFlexformData) 'tx_maps2_domain_model_poicollection', [ 'uid' => (int)$piFlexformData['settings']['poiCollection'], - ] + ], ); $poiCollectionRecord = $statement->fetchAssociative() ?: []; if ($poiCollectionRecord !== []) { diff --git a/Classes/Client/AbstractClient.php b/Classes/Client/AbstractClient.php index 44d74df0..63efb1cf 100644 --- a/Classes/Client/AbstractClient.php +++ b/Classes/Client/AbstractClient.php @@ -38,7 +38,7 @@ public function processRequest(RequestInterface $request): array $this->messageHelper->addFlashMessage( 'URI is empty or contains invalid chars. URI: ' . $request->getUri(), 'Invalid request URI', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return []; } @@ -52,7 +52,7 @@ public function processRequest(RequestInterface $request): array $this->messageHelper->addFlashMessage( 'MapProvider returns a response with a status code different than 200', 'Client Error', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } diff --git a/Classes/Client/ClientFactory.php b/Classes/Client/ClientFactory.php index 23a64faa..d751e4aa 100644 --- a/Classes/Client/ClientFactory.php +++ b/Classes/Client/ClientFactory.php @@ -38,7 +38,7 @@ public function create(): ClientInterface { /** @var ClientInterface $client */ $client = GeneralUtility::makeInstance( - $this->mapping[$this->mapHelper->getMapProvider()] + $this->mapping[$this->mapHelper->getMapProvider()], ); return $client; diff --git a/Classes/Client/GoogleMapsClient.php b/Classes/Client/GoogleMapsClient.php index cc8baa58..12b740d6 100644 --- a/Classes/Client/GoogleMapsClient.php +++ b/Classes/Client/GoogleMapsClient.php @@ -27,7 +27,7 @@ protected function checkResponseForErrors(?array $processedResponse): void $this->messageHelper->addFlashMessage( 'The response of Google Maps was not a valid JSON response.', 'Invalid JSON response', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } elseif ($processedResponse['status'] !== 'OK') { if ($processedResponse['status'] === 'ZERO_RESULTS') { @@ -37,19 +37,19 @@ protected function checkResponseForErrors(?array $processedResponse): void 'maps2', [ 0 => $this->title, - ] + ], ), LocalizationUtility::translate( 'error.noPositionsFound.title', - 'maps2' + 'maps2', ), - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } else { $this->messageHelper->addFlashMessage( $processedResponse['error_message'], 'Error', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } } diff --git a/Classes/Client/OpenStreetMapClient.php b/Classes/Client/OpenStreetMapClient.php index e5f17e17..ccce7666 100644 --- a/Classes/Client/OpenStreetMapClient.php +++ b/Classes/Client/OpenStreetMapClient.php @@ -27,7 +27,7 @@ protected function checkResponseForErrors(?array $processedResponse): void $this->messageHelper->addFlashMessage( 'The response of Open Street Map was not a valid JSON response.', 'Invalid JSON response', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } elseif ($processedResponse === []) { $this->messageHelper->addFlashMessage( @@ -36,13 +36,13 @@ protected function checkResponseForErrors(?array $processedResponse): void 'maps2', [ 0 => $this->title, - ] + ], ), LocalizationUtility::translate( 'error.noPositionsFound.title', - 'maps2' + 'maps2', ), - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } } diff --git a/Classes/Client/Request/GoogleMaps/GeocodeRequest.php b/Classes/Client/Request/GoogleMaps/GeocodeRequest.php index 8fed6d3b..66a2b3c3 100644 --- a/Classes/Client/Request/GoogleMaps/GeocodeRequest.php +++ b/Classes/Client/Request/GoogleMaps/GeocodeRequest.php @@ -46,9 +46,9 @@ public function getUri(): string return sprintf( $this->uri, $this->updateAddressForUri( - (string)$this->getParameter('address') + (string)$this->getParameter('address'), ), - $this->extConf->getGoogleMapsGeocodeApiKey() + $this->extConf->getGoogleMapsGeocodeApiKey(), ); } } diff --git a/Classes/Client/Request/OpenStreetMap/GeocodeRequest.php b/Classes/Client/Request/OpenStreetMap/GeocodeRequest.php index 3964854f..92bd5383 100644 --- a/Classes/Client/Request/OpenStreetMap/GeocodeRequest.php +++ b/Classes/Client/Request/OpenStreetMap/GeocodeRequest.php @@ -46,8 +46,8 @@ public function getUri(): string return sprintf( $this->uri, $this->updateAddressForUri( - (string)$this->getParameter('address') - ) + (string)$this->getParameter('address'), + ), ); } } diff --git a/Classes/Client/Request/RequestFactory.php b/Classes/Client/Request/RequestFactory.php index 90f533ee..e983d9e1 100644 --- a/Classes/Client/Request/RequestFactory.php +++ b/Classes/Client/Request/RequestFactory.php @@ -42,13 +42,13 @@ public function create(string $filename): RequestInterface $className = sprintf( '%s\\%s', $this->mapping[$this->mapHelper->getMapProvider()], - $this->sanitizeFilename($filename) + $this->sanitizeFilename($filename), ); if (!class_exists($className)) { throw new \RuntimeException(sprintf( 'Class "%s" to create a new Request could not be found', - $className + $className, )); } diff --git a/Classes/Controller/AjaxController.php b/Classes/Controller/AjaxController.php index a64d54e6..7292c53a 100644 --- a/Classes/Controller/AjaxController.php +++ b/Classes/Controller/AjaxController.php @@ -43,7 +43,7 @@ public function processAction(string $method): ResponseInterface && array_key_exists('poiCollection', $postData) ) { $response['content'] = $this->renderInfoWindowContentAction( - (int)$postData['poiCollection'] + (int)$postData['poiCollection'], ); } else { $this->errors[] = 'Given method "' . $method . '" is not allowed here.'; @@ -72,7 +72,7 @@ public function renderInfoWindowContentAction(int $poiCollectionUid): string if (!$poiCollection instanceof PoiCollection) { $this->errors[] = sprintf( 'PoiCollection with UID %d could not be found in AjaxController', - $poiCollectionUid + $poiCollectionUid, ); return ''; } @@ -99,8 +99,8 @@ protected function emitRenderInfoWindowEvent(int $poiCollectionUid): string new RenderInfoWindowContentEvent( $poiCollectionUid, '', - $this->getContentObjectRenderer() - ) + $this->getContentObjectRenderer(), + ), ); return $event->getInfoWindowContent(); diff --git a/Classes/Controller/CityMapController.php b/Classes/Controller/CityMapController.php index ee554871..f1beb63a 100644 --- a/Classes/Controller/CityMapController.php +++ b/Classes/Controller/CityMapController.php @@ -50,7 +50,7 @@ protected function initializeView($view): void // Remove unneeded columns from tt_content array unset( $contentRecord['pi_flexform'], - $contentRecord['l18n_diffsource'] + $contentRecord['l18n_diffsource'], ); $view->assign('data', $contentRecord); @@ -76,7 +76,7 @@ protected function getPreparedSettings(): array FlashMessage::class, 'You have forgotten to add maps2 static template for either Google Maps or OpenStreetMap', 'Missing static template', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, )); } @@ -91,7 +91,7 @@ public function showAction(): ResponseInterface public function searchAction(string $street): ResponseInterface { $position = $this->geoCodeService->getFirstFoundPositionByAddress( - strip_tags($street) . ' ' . $this->settings['autoAppend'] + strip_tags($street) . ' ' . $this->settings['autoAppend'], ); if ($position instanceof Position) { diff --git a/Classes/Controller/PoiCollectionController.php b/Classes/Controller/PoiCollectionController.php index d4e4632b..ac449f0c 100644 --- a/Classes/Controller/PoiCollectionController.php +++ b/Classes/Controller/PoiCollectionController.php @@ -48,7 +48,7 @@ protected function initializeView($view): void // Remove unneeded columns from tt_content array unset( $contentRecord['pi_flexform'], - $contentRecord['l18n_diffsource'] + $contentRecord['l18n_diffsource'], ); $view->assign('data', $contentRecord); @@ -64,7 +64,7 @@ protected function initializeView($view): void 'method' => 'renderInfoWindowContent', ], ], - $this->request + $this->request, ), 'contentRecord' => $contentRecord, ]); @@ -84,7 +84,7 @@ protected function getPreparedSettings(): array FlashMessage::class, 'You have forgotten to add maps2 static template for either Google Maps or OpenStreetMap', 'Missing static template', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, )); } @@ -136,7 +136,7 @@ public function listRadiusAction(Search $search): ResponseInterface $poiCollections = $this->poiCollectionRepository->searchWithinRadius( $position->getLatitude(), $position->getLongitude(), - $search->getRadius() + $search->getRadius(), ); } @@ -155,8 +155,8 @@ protected function postProcessAndAssignFluidVariables(array $variables = []): vo new PostProcessFluidVariablesEvent( $this->request, $this->settings, - $variables - ) + $variables, + ), ); $this->view->assignMultiple($event->getFluidVariables()); diff --git a/Classes/Domain/Repository/PoiCollectionRepository.php b/Classes/Domain/Repository/PoiCollectionRepository.php index d974269c..af25210d 100644 --- a/Classes/Domain/Repository/PoiCollectionRepository.php +++ b/Classes/Domain/Repository/PoiCollectionRepository.php @@ -60,13 +60,13 @@ public function findPoiCollections(array $settings, int $poiCollectionUid = 0): $queryBuilder->andWhere( $queryBuilder->expr()->eq( 'pc.uid', - $queryBuilder->createNamedParameter($poiCollectionUid, Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($poiCollectionUid, Connection::PARAM_INT), + ), ); } elseif (array_key_exists('categories', $settings) && $settings['categories'] !== '') { $this->addConstraintForCategories( $queryBuilder, - GeneralUtility::intExplode(',', $settings['categories'], true) + GeneralUtility::intExplode(',', $settings['categories'], true), ); } @@ -74,8 +74,8 @@ public function findPoiCollections(array $settings, int $poiCollectionUid = 0): new ModifyQueryOfFindPoiCollectionsEvent( $queryBuilder, $settings, - $poiCollectionUid - ) + $poiCollectionUid, + ), ); return $extbaseQuery->statement($queryBuilder)->execute(); @@ -100,13 +100,13 @@ public function searchWithinRadius(float $latitude, float $longitude, int $radiu return $query->statement( $sql, - [$latitude, $latitude, $longitude, $radiusOfEarth, $radius] + [$latitude, $latitude, $longitude, $radiusOfEarth, $radius], )->execute(); } protected function addConstraintForCategories( QueryBuilder $queryBuilder, - array $categories + array $categories, ): void { $queryBuilder->leftJoin( 'pc', @@ -115,21 +115,21 @@ protected function addConstraintForCategories( (string)$queryBuilder->expr()->and( $queryBuilder->expr()->eq( 'pc.uid', - $queryBuilder->quoteIdentifier('category_mm.uid_foreign') + $queryBuilder->quoteIdentifier('category_mm.uid_foreign'), ), $queryBuilder->expr()->eq( 'category_mm.tablenames', $queryBuilder->createNamedParameter( - 'tx_maps2_domain_model_poicollection' - ) + 'tx_maps2_domain_model_poicollection', + ), ), $queryBuilder->expr()->eq( 'category_mm.fieldname', $queryBuilder->createNamedParameter( - 'categories' - ) - ) - ) + 'categories', + ), + ), + ), ); $queryBuilder->andWhere( @@ -137,9 +137,9 @@ protected function addConstraintForCategories( 'category_mm.uid_local', $queryBuilder->createNamedParameter( $categories, - Connection::PARAM_INT_ARRAY - ) - ) + Connection::PARAM_INT_ARRAY, + ), + ), ); $queryBuilder->addGroupBy(...$this->getColumnsForPoiCollectionTable()); @@ -158,9 +158,9 @@ protected function getQueryBuilderForTable(string $table, string $alias, bool $u 'pid', $queryBuilder->createNamedParameter( $extbaseQuery->getQuerySettings()->getStoragePageIds(), - Connection::PARAM_INT_ARRAY - ) - ) + Connection::PARAM_INT_ARRAY, + ), + ), ); $this->overlayHelper->addWhereForOverlay($queryBuilder, $table, $alias, $useLangStrict); @@ -182,8 +182,8 @@ protected function getColumnsForPoiCollectionTable(): array $columns = array_map( static fn($column): string => 'pc.' . $column, array_keys( - $schemaManager->listTableColumns('tx_maps2_domain_model_poicollection') ?? [] - ) + $schemaManager->listTableColumns('tx_maps2_domain_model_poicollection') ?? [], + ), ); } catch (Exception $e) { } diff --git a/Classes/Event/AllowCreationOfPoiCollectionEvent.php b/Classes/Event/AllowCreationOfPoiCollectionEvent.php index 8e44b222..6e47cef6 100644 --- a/Classes/Event/AllowCreationOfPoiCollectionEvent.php +++ b/Classes/Event/AllowCreationOfPoiCollectionEvent.php @@ -31,7 +31,7 @@ public function __construct( string $foreignTableName, string $foreignColumnName, array $options, - bool $isValid + bool $isValid, ) { $this->foreignLocationRecord = $foreignLocationRecord; $this->foreignTableName = $foreignTableName; diff --git a/Classes/Event/ModifyQueryOfFindPoiCollectionsEvent.php b/Classes/Event/ModifyQueryOfFindPoiCollectionsEvent.php index 48082a90..257afa5c 100644 --- a/Classes/Event/ModifyQueryOfFindPoiCollectionsEvent.php +++ b/Classes/Event/ModifyQueryOfFindPoiCollectionsEvent.php @@ -28,7 +28,7 @@ class ModifyQueryOfFindPoiCollectionsEvent public function __construct( QueryBuilder $queryBuilder, array $settings, - int $poiCollectionUid + int $poiCollectionUid, ) { $this->queryBuilder = $queryBuilder; $this->settings = $settings; diff --git a/Classes/Event/PostProcessFluidVariablesEvent.php b/Classes/Event/PostProcessFluidVariablesEvent.php index 938f91f9..3237f3c0 100644 --- a/Classes/Event/PostProcessFluidVariablesEvent.php +++ b/Classes/Event/PostProcessFluidVariablesEvent.php @@ -28,7 +28,7 @@ class PostProcessFluidVariablesEvent implements ControllerActionEventInterface public function __construct( Request $request, array $settings, - array $fluidVariables + array $fluidVariables, ) { $this->request = $request; $this->settings = $settings; diff --git a/Classes/Event/PostProcessPoiCollectionRecordEvent.php b/Classes/Event/PostProcessPoiCollectionRecordEvent.php index 7b3a07f8..f19a136f 100644 --- a/Classes/Event/PostProcessPoiCollectionRecordEvent.php +++ b/Classes/Event/PostProcessPoiCollectionRecordEvent.php @@ -31,7 +31,7 @@ public function __construct( int $poiCollectionUid, string $foreignTableName, array $foreignLocationRecord, - array $options + array $options, ) { $this->poiCollectionTableName = $poiCollectionTableName; $this->poiCollectionUid = $poiCollectionUid; diff --git a/Classes/Event/PreAddForeignRecordEvent.php b/Classes/Event/PreAddForeignRecordEvent.php index 62e8d671..791e3e26 100644 --- a/Classes/Event/PreAddForeignRecordEvent.php +++ b/Classes/Event/PreAddForeignRecordEvent.php @@ -25,7 +25,7 @@ class PreAddForeignRecordEvent public function __construct( array $foreignRecord, string $tableName, - string $columnName + string $columnName, ) { $this->foreignRecord = $foreignRecord; $this->tableName = $tableName; diff --git a/Classes/Event/RenderInfoWindowContentEvent.php b/Classes/Event/RenderInfoWindowContentEvent.php index f08c8908..d07144e0 100644 --- a/Classes/Event/RenderInfoWindowContentEvent.php +++ b/Classes/Event/RenderInfoWindowContentEvent.php @@ -30,7 +30,7 @@ class RenderInfoWindowContentEvent public function __construct( int $poiCollectionUid, string $infoWindowContent, - ?ContentObjectRenderer $contentObjectRenderer + ?ContentObjectRenderer $contentObjectRenderer, ) { $this->poiCollectionUid = $poiCollectionUid; $this->infoWindowContent = $infoWindowContent; diff --git a/Classes/ExpressionLanguage/AllowMapProviderRequestFunctionsProvider.php b/Classes/ExpressionLanguage/AllowMapProviderRequestFunctionsProvider.php index d1e448a5..c9207dbc 100644 --- a/Classes/ExpressionLanguage/AllowMapProviderRequestFunctionsProvider.php +++ b/Classes/ExpressionLanguage/AllowMapProviderRequestFunctionsProvider.php @@ -50,7 +50,7 @@ static function (): void { }, static function ($existingVariables) use ($mapHelper) { return $mapHelper->isRequestToMapProviderAllowed(); - } + }, ); } } diff --git a/Classes/Form/Element/GoogleMapsElement.php b/Classes/Form/Element/GoogleMapsElement.php index 54045730..3600a298 100644 --- a/Classes/Form/Element/GoogleMapsElement.php +++ b/Classes/Form/Element/GoogleMapsElement.php @@ -59,7 +59,7 @@ public function render(): array $resultArray['stylesheetFiles'][] = $publicResourcesPath . 'Css/GoogleMapsModule.css'; $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create( - '@jweiland/maps2/GoogleMapsModule.min.js' + '@jweiland/maps2/GoogleMapsModule.min.js', ); $fieldInformationResult = $this->renderFieldInformation(); @@ -100,7 +100,7 @@ public function render(): array $resultArray['html'] = sprintf( '
%s%s
', $fieldInformationHtml, - implode(LF, $html) + implode(LF, $html), ); return $resultArray; @@ -131,7 +131,7 @@ protected function getMapHtml(array $poiCollectionRecord): string $view->assign('poiCollection', json_encode($poiCollectionRecord, JSON_THROW_ON_ERROR)); $view->assign('extConf', json_encode( ObjectAccess::getGettableProperties($this->getExtConf()), - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, )); return $view->render(); diff --git a/Classes/Form/Element/OpenStreetMapElement.php b/Classes/Form/Element/OpenStreetMapElement.php index d26d2421..f4c77cc6 100644 --- a/Classes/Form/Element/OpenStreetMapElement.php +++ b/Classes/Form/Element/OpenStreetMapElement.php @@ -68,11 +68,11 @@ public function render(): array $this->pageRenderer->loadJavaScriptModule('@jweiland/maps2/leaflet.min.js'); $resultArray['stylesheetFiles'][] = PathUtility::getPublicResourceWebPath( - 'EXT:maps2/Resources/Public/Css/Leaflet/Leaflet.css' + 'EXT:maps2/Resources/Public/Css/Leaflet/Leaflet.css', ); $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create( - '@jweiland/maps2/OpenStreetMapModule.min.js' + '@jweiland/maps2/OpenStreetMapModule.min.js', ); $fieldInformationResult = $this->renderFieldInformation(); @@ -113,7 +113,7 @@ public function render(): array $resultArray['html'] = sprintf( '
%s%s
', $fieldInformationHtml, - implode(LF, $html) + implode(LF, $html), ); return $resultArray; @@ -143,7 +143,7 @@ protected function getMapHtml(array $poiCollectionRecord): string $view->assign('poiCollection', json_encode($poiCollectionRecord, JSON_THROW_ON_ERROR)); $view->assign('extConf', json_encode( ObjectAccess::getGettableProperties($this->extConf), - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, )); return $view->render(); diff --git a/Classes/Form/Element/ReadOnlyInputTextElement.php b/Classes/Form/Element/ReadOnlyInputTextElement.php index 4c36943f..cb4a8d15 100644 --- a/Classes/Form/Element/ReadOnlyInputTextElement.php +++ b/Classes/Form/Element/ReadOnlyInputTextElement.php @@ -76,7 +76,7 @@ public function render(): array $itemValue = $parameterArray['itemFormElValue']; $width = $this->formMaxWidth( - MathUtility::forceIntegerInRange($config['size'] ?? $this->defaultInputWidth, $this->minimumInputWidth, $this->maxInputWidth) + MathUtility::forceIntegerInRange($config['size'] ?? $this->defaultInputWidth, $this->minimumInputWidth, $this->maxInputWidth), ); $fieldId = StringUtility::getUniqueId('formengine-input-'); $renderedLabel = $this->renderLabel($fieldId); @@ -173,7 +173,7 @@ public function render(): array [ 'class' => 'form-select form-control-adapt', ], - $this->getOnFieldChangeAttrs('change', $parameterArray['fieldChangeFunc'] ?? []) + $this->getOnFieldChangeAttrs('change', $parameterArray['fieldChangeFunc'] ?? []), ); $valuePickerHtml[] = ''; @@ -244,17 +244,17 @@ public function render(): array if ($placeholder !== $shortenedPlaceholder) { $overrideLabel = sprintf( $languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), - '' . htmlspecialchars($shortenedPlaceholder) . '' + '' . htmlspecialchars($shortenedPlaceholder) . '', ); } else { $overrideLabel = sprintf( $languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), - htmlspecialchars($placeholder) + htmlspecialchars($placeholder), ); } } else { $overrideLabel = $languageService->sL( - 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available' + 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available', ); } $fullElement = []; diff --git a/Classes/Helper/AddressHelper.php b/Classes/Helper/AddressHelper.php index 3ec6d813..d66f672a 100644 --- a/Classes/Helper/AddressHelper.php +++ b/Classes/Helper/AddressHelper.php @@ -69,13 +69,13 @@ public function isSameAddress(string $address, array $foreignLocationRecord, arr // Convert formatted address like "Mainstreet 15, 51324 Cologne, Germany" into array $poiCollectionAddressParts = GeneralUtility::trimExplode( ' ', - str_replace(',', '', strtolower($address)) + str_replace(',', '', strtolower($address)), ); foreach ($options['addressColumns'] as $addressColumn) { if (in_array( strtolower($foreignLocationRecord[$addressColumn]), $poiCollectionAddressParts, - true + true, )) { continue; } @@ -117,7 +117,7 @@ protected function getFallbackCountryName(array $options): string $this->messageHelper->addFlashMessage( 'We can not find any country information within your extension. Either in Maps2 Registry nor in this record. Please check your configuration or update your extension.', 'No country information found', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); $defaultCountry = $this->extConf->getDefaultCountry(); @@ -128,7 +128,7 @@ protected function getFallbackCountryName(array $options): string $this->messageHelper->addFlashMessage( 'Default country in maps2 of extension manager configuration is empty. Request to Google Maps GeoCode will start without any country information, which may lead to curious results.', 'Default country of maps2 is not configured', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); return ''; @@ -144,8 +144,8 @@ protected function getCountryNameFromStaticCountries(int $uid): string ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT), + ), ) ->executeQuery() ->fetchAssociative(); @@ -157,7 +157,7 @@ protected function getCountryNameFromStaticCountries(int $uid): string $this->messageHelper->addFlashMessage( 'Country with UID "' . $uid . '" could not be found in static_countries table. Please check your record for correct country field.', 'Country not found in DB', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); return ''; @@ -219,7 +219,7 @@ protected function isValidOptionConfiguration(array $options): bool $this->messageHelper->addFlashMessage( 'Array key "addressColumns" does not exist in your maps2 registration. This field must be filled to prevent creating empty GeoCode requests to google.', 'Key addressColumns is missing', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return false; } @@ -228,7 +228,7 @@ protected function isValidOptionConfiguration(array $options): bool $this->messageHelper->addFlashMessage( 'Array key "addressColumns" is a required field in maps2 registraton. Please fill it with column names of your table.', 'Key addressColumns is empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return false; } diff --git a/Classes/Helper/LinkHelper.php b/Classes/Helper/LinkHelper.php index 05feade3..20bd3103 100644 --- a/Classes/Helper/LinkHelper.php +++ b/Classes/Helper/LinkHelper.php @@ -46,7 +46,7 @@ public function buildUriToCurrentPage(array $parameters, ServerRequestInterface return (string)$router->generateUri( $this->getCurrentPageUid($request), $mergedParameters, - RouterInterface::ABSOLUTE_URL + RouterInterface::ABSOLUTE_URL, ); } diff --git a/Classes/Helper/MapHelper.php b/Classes/Helper/MapHelper.php index 49286217..16a6866e 100644 --- a/Classes/Helper/MapHelper.php +++ b/Classes/Helper/MapHelper.php @@ -102,7 +102,7 @@ public function convertPoisAsJsonToArray(string $poisAsJson): array 'latitude', 'longitude', ], - GeneralUtility::trimExplode(',', $poi) + GeneralUtility::trimExplode(',', $poi), ); } } catch (\JsonException $jsonException) { diff --git a/Classes/Helper/MessageHelper.php b/Classes/Helper/MessageHelper.php index ad2ccc80..136d48a4 100644 --- a/Classes/Helper/MessageHelper.php +++ b/Classes/Helper/MessageHelper.php @@ -40,7 +40,7 @@ public function addFlashMessage(string $message, string $title = '', ContextualF $message, $title, $severity, - !Environment::isCli() + !Environment::isCli(), ); $this->getFlashMessageQueue()->enqueue($flashMessage); diff --git a/Classes/Helper/OverlayHelper.php b/Classes/Helper/OverlayHelper.php index bb5a8f1c..64340543 100644 --- a/Classes/Helper/OverlayHelper.php +++ b/Classes/Helper/OverlayHelper.php @@ -31,7 +31,7 @@ public function addWhereForOverlay( QueryBuilder $queryBuilder, string $tableName, string $tableAlias, - bool $useLangStrict = false + bool $useLangStrict = false, ): void { $this->addWhereForWorkspaces($queryBuilder, $tableName, $tableAlias); $this->addWhereForTranslation($queryBuilder, $tableName, $tableAlias, $useLangStrict); @@ -41,7 +41,7 @@ protected function addWhereForWorkspaces(QueryBuilder $queryBuilder, string $tab { if ($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS']) { $queryBuilder->andWhere( - $queryBuilder->expr()->eq($tableAlias . '.t3ver_oid', 0) + $queryBuilder->expr()->eq($tableAlias . '.t3ver_oid', 0), ); } } @@ -59,7 +59,7 @@ protected function addWhereForTranslation( string $tableName, string $tableAlias, bool $useLangStrict = false, - int $overrideLanguageUid = -1 + int $overrideLanguageUid = -1, ): void { // Column: sys_language_uid $languageField = $GLOBALS['TCA'][$tableName]['ctrl']['languageField']; @@ -72,12 +72,12 @@ protected function addWhereForTranslation( $queryBuilder->andWhere( $queryBuilder->expr()->in( $tableAlias . '.' . $languageField, - [0, -1] + [0, -1], ), $queryBuilder->expr()->eq( $tableAlias . '.' . $transOrigPointerField, - 0 - ) + 0, + ), ); } elseif ($useLangStrict && $overrideLanguageUid >= 0) { // Strict mode for f.e. backend (TCEFORM) @@ -86,8 +86,8 @@ protected function addWhereForTranslation( $queryBuilder->andWhere( $queryBuilder->expr()->in( $tableAlias . '.' . $languageField, - [$overrideLanguageUid] - ) + [$overrideLanguageUid], + ), ); } else { // strict mode @@ -95,8 +95,8 @@ protected function addWhereForTranslation( $queryBuilder->andWhere( $queryBuilder->expr()->in( $tableAlias . '.' . $languageField, - [$this->getLanguageAspect()->getContentId(), -1] - ) + [$this->getLanguageAspect()->getContentId(), -1], + ), ); } } diff --git a/Classes/Helper/SettingsHelper.php b/Classes/Helper/SettingsHelper.php index f7783a1e..750a4863 100644 --- a/Classes/Helper/SettingsHelper.php +++ b/Classes/Helper/SettingsHelper.php @@ -39,12 +39,12 @@ public function getMergedSettings(): array $typoScriptSettings = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'maps2', - 'invalid' // invalid plugin name, to get fresh unmerged settings + 'invalid', // invalid plugin name, to get fresh unmerged settings ); // In context of a maps2 plugin this will return the merged (TS and FlexForm) settings $mergedSettings = $this->configurationManager->getConfiguration( - ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS + ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, ); foreach ($mergedSettings as $setting => $value) { @@ -72,7 +72,7 @@ public function getPreparedSettings(array $settings = []): array $settings['mapTile'] = str_replace( ['${s}', '${x}', '${y}', '${z}'], ['{s}', '{x}', '{y}', '{z}'], - $settings['mapTile'] + $settings['mapTile'], ); } @@ -86,8 +86,8 @@ public function getPreparedSettings(array $settings = []): array } else { $settings['markerClusterer']['imagePath'] = PathUtility::getAbsoluteWebPath( GeneralUtility::getFileAbsFileName( - $settings['markerClusterer']['imagePath'] - ) + $settings['markerClusterer']['imagePath'], + ), ); } } @@ -100,7 +100,7 @@ protected function getTypoScriptSettings(): array return $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'Maps2', - 'Maps2' + 'Maps2', ) ?? []; } } diff --git a/Classes/Helper/StoragePidHelper.php b/Classes/Helper/StoragePidHelper.php index 0898a644..17f798b4 100644 --- a/Classes/Helper/StoragePidHelper.php +++ b/Classes/Helper/StoragePidHelper.php @@ -40,7 +40,7 @@ public function getDefaultStoragePidForNewPoiCollection(array $foreignLocationRe if (empty($defaultStoragePid)) { $this->messageHelper->addFlashMessage( 'No PID found to store POI collection. Please check various places like pageTSconfig, Maps2 Registry and PID of this currently saved record.', - 'Can not find a valid PID to store EXT:maps2 records' + 'Can not find a valid PID to store EXT:maps2 records', ); } @@ -53,7 +53,7 @@ public function getDefaultStoragePidForNewPoiCollection(array $foreignLocationRe */ protected function updateStoragePidFromForeignLocationRecord( int &$defaultStoragePid, - array $foreignLocationRecord + array $foreignLocationRecord, ): void { if (!array_key_exists('pid', $foreignLocationRecord)) { return; @@ -72,7 +72,7 @@ protected function updateStoragePidFromForeignLocationRecord( protected function updateStoragePidFromMaps2Registry( int &$defaultStoragePid, array $options, - array $foreignLocationRecord + array $foreignLocationRecord, ): void { if (array_key_exists('defaultStoragePid', $options)) { $storagePid = $this->getHardCodedStoragePidFromMaps2Registry($options); @@ -84,7 +84,7 @@ protected function updateStoragePidFromMaps2Registry( $this->messageHelper->addFlashMessage( 'You have configured a defaultStoragePid in maps2 registration, but returned value is still 0. Please check Maps2 Registry', 'Invalid defaultStoragePid configuration found', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); } else { $defaultStoragePid = $storagePid; @@ -136,7 +136,7 @@ protected function getDynamicStoragePidFromMaps2Registry(array $options, array $ if (empty($defaultStoragePid)) { $defaultStoragePid = $this->getDynamicStoragePidBySingleArray( $configuration, - $foreignLocationRecord + $foreignLocationRecord, ); } } @@ -201,7 +201,7 @@ protected function getDynamicStoragePidBySingleArray(array $configuration, array $defaultStoragePid, $foreignLocationRecord, $extKey, - $property + $property, ); } } @@ -216,7 +216,7 @@ protected function updateDefaultStoragePidFromPageTsConfig( int &$defaultStoragePid, array $foreignLocationRecord, string $extKey = 'maps2', - string $property = 'defaultStoragePid' + string $property = 'defaultStoragePid', ): void { $tsConfig = $this->getTsConfig($foreignLocationRecord, $extKey); if (!array_key_exists($property, $tsConfig)) { diff --git a/Classes/Hook/CreateMaps2RecordHook.php b/Classes/Hook/CreateMaps2RecordHook.php index e07a78ab..b42c272d 100644 --- a/Classes/Hook/CreateMaps2RecordHook.php +++ b/Classes/Hook/CreateMaps2RecordHook.php @@ -61,7 +61,7 @@ public function __construct( StoragePidHelper $storagePidHelper, MapService $mapService, Maps2Registry $maps2Registry, - EventDispatcher $eventDispatcher + EventDispatcher $eventDispatcher, ) { $this->geoCodeService = $geoCodeService; $this->addressHelper = $addressHelper; @@ -95,7 +95,7 @@ public function processDatamap_afterAllOperations(DataHandler $dataHandler): voi $foreignLocationRecord = $this->getForeignLocationRecord( $foreignTableName, - $this->getRealUid($uid, $dataHandler) + $this->getRealUid($uid, $dataHandler), ); if (empty($foreignLocationRecord)) { continue; @@ -124,7 +124,7 @@ public function processDatamap_afterAllOperations(DataHandler $dataHandler): voi $this->synchronizeColumnsFromForeignRecordWithPoiCollection($foreignLocationRecord, $foreignTableName, $foreignColumnName, $options); $this->messageHelper->addFlashMessage( 'While creating this record, we have automatically inserted a new maps2 record, too', - 'Maps2 record creation successful' + 'Maps2 record creation successful', ); } } else { @@ -132,7 +132,7 @@ public function processDatamap_afterAllOperations(DataHandler $dataHandler): voi $this->synchronizeColumnsFromForeignRecordWithPoiCollection($foreignLocationRecord, $foreignTableName, $foreignColumnName, $options); $this->messageHelper->addFlashMessage( 'While updating this record, we have automatically updated the related maps2 record, too', - 'Maps2 record update successful' + 'Maps2 record update successful', ); } @@ -141,7 +141,7 @@ public function processDatamap_afterAllOperations(DataHandler $dataHandler): voi (int)$foreignLocationRecord[$foreignColumnName], $foreignTableName, $foreignLocationRecord, - $options + $options, ); $this->clearHtmlCache((int)$foreignLocationRecord[$foreignColumnName]); @@ -180,7 +180,7 @@ protected function isForeignLocationRecordAllowedToCreateNewPoiCollectionRecords array $foreignLocationRecord, string $foreignTableName, string $foreignColumnName, - array $options + array $options, ): bool { $isValid = true; @@ -231,7 +231,7 @@ protected function isForeignLocationRecordAllowedToCreateNewPoiCollectionRecords if (!in_array( $foreignValue, GeneralUtility::trimExplode(',', $configuration['value'], true), - true + true, )) { $isValid = false; } @@ -253,7 +253,7 @@ protected function isForeignLocationRecordAllowedToCreateNewPoiCollectionRecords $foreignTableName, $foreignColumnName, $options, - $isValid + $isValid, ); return $isValid; @@ -308,7 +308,7 @@ protected function clearHtmlCache(int $poiCollectionUid): void protected function updateAddressInPoiCollectionIfNecessary( array $foreignLocationRecord, string $foreignColumnName, - array $options + array $options, ): void { $poiCollection = $this->getPoiCollection((int)$foreignLocationRecord[$foreignColumnName]); if (!$this->addressHelper->isSameAddress($poiCollection['address'], $foreignLocationRecord, $options)) { @@ -326,7 +326,7 @@ protected function updateAddressInPoiCollectionIfNecessary( ], [ 'uid' => (int)$foreignLocationRecord[$foreignColumnName], - ] + ], ); } } @@ -339,7 +339,7 @@ protected function updateAddressInPoiCollectionIfNecessary( */ protected function updateForeignLocationRecordIfPoiCollectionDoesNotExist( array &$foreignLocationRecord, - string $foreignColumnName + string $foreignColumnName, ): void { $poiCollection = $this->getPoiCollection((int)$foreignLocationRecord[$foreignColumnName], ['uid']); if (empty($poiCollection)) { @@ -352,7 +352,7 @@ protected function getPoiCollection(int $poiCollectionUid, array $columnsToSelec { $queryBuilder = $this->getConnectionPool()->getQueryBuilderForTable('tx_maps2_domain_model_poicollection'); $queryBuilder->getRestrictions()->removeAll()->add( - GeneralUtility::makeInstance(DeletedRestriction::class) + GeneralUtility::makeInstance(DeletedRestriction::class), ); try { @@ -362,8 +362,8 @@ protected function getPoiCollection(int $poiCollectionUid, array $columnsToSelec ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($poiCollectionUid, Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($poiCollectionUid, Connection::PARAM_INT), + ), ) ->executeQuery() ->fetchAssociative(); @@ -386,11 +386,11 @@ protected function createNewMapsRecord( array &$foreignLocationRecord, string $foreignTableName, string $foreignColumnName, - array $options + array $options, ): bool { $defaultStoragePid = $this->storagePidHelper->getDefaultStoragePidForNewPoiCollection( $foreignLocationRecord, - $options + $options, ); if (empty($defaultStoragePid)) { return false; @@ -404,7 +404,7 @@ protected function createNewMapsRecord( $this->mapService->createNewPoiCollection($defaultStoragePid, $position), $foreignLocationRecord, $foreignTableName, - $foreignColumnName + $foreignColumnName, ); return true; @@ -413,7 +413,7 @@ protected function createNewMapsRecord( $this->messageHelper->addFlashMessage( 'While saving this record, we tried to automatically create a new maps2 record, but Map Providers GeoCode API can not find your address: ' . $address, 'Map Provider has not found your address', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return false; @@ -432,7 +432,7 @@ protected function getForeignLocationRecord(string $foreignTableName, int $uid): $queryBuilder = $this->getConnectionPool()->getQueryBuilderForTable($foreignTableName); $queryBuilder->getRestrictions()->removeAll()->add( - GeneralUtility::makeInstance(DeletedRestriction::class) + GeneralUtility::makeInstance(DeletedRestriction::class), ); try { @@ -442,8 +442,8 @@ protected function getForeignLocationRecord(string $foreignTableName, int $uid): ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT), + ), ) ->executeQuery() ->fetchAssociative(); @@ -480,13 +480,13 @@ public function synchronizeColumnsFromForeignRecordWithPoiCollection( array $foreignLocationRecord, string $foreignTableName, string $maps2ColumnName, - array $columnOptions = [] + array $columnOptions = [], ): bool { if (!array_key_exists('synchronizeColumns', $columnOptions)) { $this->messageHelper->addFlashMessage( 'There are no synchronizationColumns configured in your maps2 registration, so we are using the address as maps2 title', 'Using address as record title', - ContextualFeedbackSeverity::INFO + ContextualFeedbackSeverity::INFO, ); return false; @@ -499,8 +499,8 @@ public function synchronizeColumnsFromForeignRecordWithPoiCollection( ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($foreignLocationRecord[$maps2ColumnName], Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($foreignLocationRecord[$maps2ColumnName], Connection::PARAM_INT), + ), ); $tableNeedsUpdate = false; @@ -511,7 +511,7 @@ public function synchronizeColumnsFromForeignRecordWithPoiCollection( $queryBuilder = $queryBuilder->set( $synchronizeColumns['poiCollectionColumnName'], - $foreignLocationRecord[$synchronizeColumns['foreignColumnName']] + $foreignLocationRecord[$synchronizeColumns['foreignColumnName']], ); $tableNeedsUpdate = true; } @@ -542,7 +542,7 @@ protected function isValidSynchronizeConfiguration(array $synchronizeColumns, st $this->messageHelper->addFlashMessage( 'Please check your Maps registration. The keys foreignColumnName and poiCollectionColumnName have to be set.', 'Missing registration keys', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return false; @@ -558,7 +558,7 @@ protected function isValidSynchronizeConfiguration(array $synchronizeColumns, st $this->messageHelper->addFlashMessage( 'Error while trying to synchronize columns of your record with maps2 record. It seems that "' . $foreignTableName . '" is not registered as table or "' . $foreignColumnName . '" is not a valid column in ' . $foreignTableName, 'Missing table/column in TCA', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return false; @@ -576,7 +576,7 @@ protected function emitPostUpdatePoiCollectionEvent( int $poiCollectionUid, string $foreignTableName, array $foreignLocationRecord, - array $options + array $options, ): void { $this->eventDispatcher->dispatch( new PostProcessPoiCollectionRecordEvent( @@ -584,7 +584,7 @@ protected function emitPostUpdatePoiCollectionEvent( $poiCollectionUid, $foreignTableName, $foreignLocationRecord, - $options + $options, ), ); } @@ -597,14 +597,14 @@ protected function emitIsRecordAllowedToCreatePoiCollection( string $foreignTableName, string $foreignColumnName, array $options, - bool &$isValid + bool &$isValid, ): void { $event = new AllowCreationOfPoiCollectionEvent( $foreignLocationRecord, $foreignTableName, $foreignColumnName, $options, - $isValid + $isValid, ); /** @var AllowCreationOfPoiCollectionEvent $event */ $event = $this->eventDispatcher->dispatch($event); diff --git a/Classes/Mapper/MapperFactory.php b/Classes/Mapper/MapperFactory.php index 97452d02..5f98004a 100644 --- a/Classes/Mapper/MapperFactory.php +++ b/Classes/Mapper/MapperFactory.php @@ -35,7 +35,7 @@ public function create(): MapperInterface { /** @var MapperInterface $client */ $client = GeneralUtility::makeInstance( - $this->mapping[$this->mapHelper->getMapProvider()] + $this->mapping[$this->mapHelper->getMapProvider()], ); return $client; diff --git a/Classes/Mapper/OpenStreetMapMapper.php b/Classes/Mapper/OpenStreetMapMapper.php index 3368b02f..9ca122e9 100644 --- a/Classes/Mapper/OpenStreetMapMapper.php +++ b/Classes/Mapper/OpenStreetMapMapper.php @@ -54,7 +54,7 @@ protected function getFormattedAddress(array $data): string $data['address']['house_number'] ?? '', $data['address']['postcode'] ?? '', $data['address']['city'], - $data['address']['country'] ?? '' + $data['address']['country'] ?? '', ); } else { // 'display_name' can be a very long name. diff --git a/Classes/Middleware/InitFeSessionMiddleware.php b/Classes/Middleware/InitFeSessionMiddleware.php index 033fdc1c..edae0430 100644 --- a/Classes/Middleware/InitFeSessionMiddleware.php +++ b/Classes/Middleware/InitFeSessionMiddleware.php @@ -59,7 +59,7 @@ protected function createCookie(ServerRequestInterface $request): Cookie // Store consent in COOKIE $cookieSameSite = $this->sanitizeSameSiteCookieValue( - strtolower($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieSameSite'] ?? Cookie::SAMESITE_STRICT) + strtolower($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieSameSite'] ?? Cookie::SAMESITE_STRICT), ); // SameSite Cookie = None needs the secure option (only allowed on HTTPS) @@ -74,7 +74,7 @@ protected function createCookie(ServerRequestInterface $request): Cookie $isSecure, false, // Should be false to allow JS based consent tools to delete this cookie false, - $cookieSameSite + $cookieSameSite, ); } diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index bb62a2d0..beecb680 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -43,7 +43,7 @@ public function getCacheIdentifier(array $poiCollection, string $prefix = 'infoW $prefix, GeneralUtility::hmac( \json_encode(array_diff_key($poiCollection, ['uid', 'pid', 'language', 'title', 'address'])), - ) + ), ); } @@ -59,7 +59,7 @@ public function getCacheTags(array $poiCollection, array $cacheTags = []): array [ 'infoWindowPid' . ($poiCollection['pid'] ?? 0), 'infoWindowUid' . ($poiCollection['uid'] ?? 0), - ] + ], ); } diff --git a/Classes/Service/GeoCodeService.php b/Classes/Service/GeoCodeService.php index 990e951c..1b81a3a9 100644 --- a/Classes/Service/GeoCodeService.php +++ b/Classes/Service/GeoCodeService.php @@ -38,7 +38,7 @@ class GeoCodeService implements SingletonInterface public function __construct( ClientFactory $clientFactory, RequestFactory $requestFactory, - MapperFactory $mapperFactory + MapperFactory $mapperFactory, ) { $this->client = $clientFactory->create(); $this->requestFactory = $requestFactory; diff --git a/Classes/Service/MapService.php b/Classes/Service/MapService.php index 6bdf7c12..6908ad62 100644 --- a/Classes/Service/MapService.php +++ b/Classes/Service/MapService.php @@ -52,7 +52,7 @@ public function __construct( MessageHelper $messageHelper, Maps2Registry $maps2Registry, ExtConf $extConf, - EventDispatcher $eventDispatcher + EventDispatcher $eventDispatcher, ) { $this->configurationManager = $configurationManager; $this->messageHelper = $messageHelper; @@ -69,7 +69,7 @@ public function renderInfoWindow(PoiCollection $poiCollection): string $typoScriptConfiguration = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'Maps2', - 'Maps2' + 'Maps2', ); $view = GeneralUtility::makeInstance(StandaloneView::class); @@ -79,8 +79,8 @@ public function renderInfoWindow(PoiCollection $poiCollection): string $view->assign('poiCollection', $poiCollection); $view->setTemplatePathAndFilename( GeneralUtility::getFileAbsFileName( - $this->getInfoWindowContentTemplatePath() - ) + $this->getInfoWindowContentTemplatePath(), + ), ); return $view->render(); @@ -113,7 +113,7 @@ protected function getSettings(): array $settings = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'Maps2', - 'Maps2' + 'Maps2', ); } @@ -140,7 +140,7 @@ public function createNewPoiCollection(int $pid, Position $position, array $over $this->messageHelper->addFlashMessage( 'The is no latitude or longitude in Response of Map Provider.', 'Missing Lat or Lng', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return 0; } @@ -166,13 +166,13 @@ public function createNewPoiCollection(int $pid, Position $position, array $over // remove all fields, which are not set in DB $fieldValues = array_intersect_key( $fieldValues, - DatabaseUtility::getColumnsFromTable('tx_maps2_domain_model_poicollection') + DatabaseUtility::getColumnsFromTable('tx_maps2_domain_model_poicollection'), ); $connection = $this->getConnectionPool()->getConnectionForTable('tx_maps2_domain_model_poicollection'); $connection->insert( 'tx_maps2_domain_model_poicollection', - $fieldValues + $fieldValues, ); return (int)$connection->lastInsertId('tx_maps2_domain_model_poicollection'); @@ -192,7 +192,7 @@ public function assignPoiCollectionToForeignRecord( int $poiCollectionUid, array &$foreignRecord, string $foreignTableName, - string $foreignFieldName = 'tx_maps2_uid' + string $foreignFieldName = 'tx_maps2_uid', ): void { $hasErrors = false; @@ -201,7 +201,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'PoiCollection UID can not be empty. Please check your values near method assignPoiCollectionToForeignRecord', 'PoiCollection empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } @@ -210,7 +210,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'Foreign record can not be empty. Please check your values near method assignPoiCollectionToForeignRecord', 'Foreign record empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } @@ -219,7 +219,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'Foreign record must have the array key "uid" which is currently not present. Please check your values near method assignPoiCollectionToForeignRecord', 'UID not filled', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } @@ -228,7 +228,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'Foreign table name is a must have value, which is currently not present. Please check your values near method assignPoiCollectionToForeignRecord', 'Foreign table name empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } @@ -237,7 +237,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'Foreign field name is a must have value, which is currently not present. Please check your values near method assignPoiCollectionToForeignRecord', 'Foreign field name empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); } @@ -249,7 +249,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'Table "' . $foreignTableName . '" is not configured in TCA', 'Table not found', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return; } @@ -258,7 +258,7 @@ public function assignPoiCollectionToForeignRecord( $this->messageHelper->addFlashMessage( 'Field "' . $foreignFieldName . '" is not configured in TCA', 'Field not found', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); return; } @@ -267,7 +267,7 @@ public function assignPoiCollectionToForeignRecord( $connection->update( $foreignTableName, [$foreignFieldName => $poiCollectionUid], - ['uid' => (int)$foreignRecord['uid']] + ['uid' => (int)$foreignRecord['uid']], ); $foreignRecord[$foreignFieldName] = $poiCollectionUid; @@ -292,7 +292,7 @@ public function addForeignRecordsToPoiCollection(PoiCollection $poiCollection): foreach ($columns as $columnName => $configuration) { $queryBuilder = $this->getConnectionPool()->getQueryBuilderForTable($tableName); $queryBuilder->setRestrictions( - GeneralUtility::makeInstance(FrontendRestrictionContainer::class) + GeneralUtility::makeInstance(FrontendRestrictionContainer::class), ); try { @@ -302,8 +302,8 @@ public function addForeignRecordsToPoiCollection(PoiCollection $poiCollection): ->where( $queryBuilder->expr()->eq( $columnName, - $queryBuilder->createNamedParameter($poiCollection->getUid(), Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($poiCollection->getUid(), Connection::PARAM_INT), + ), ) ->executeQuery(); @@ -317,7 +317,7 @@ public function addForeignRecordsToPoiCollection(PoiCollection $poiCollection): $foreignRecord = $this->emitPreAddForeignRecordToPoiCollectionEvent( $foreignRecord, $tableName, - $columnName + $columnName, ); $poiCollection->addForeignRecord($foreignRecord); @@ -336,13 +336,13 @@ public function addForeignRecordsToPoiCollection(PoiCollection $poiCollection): protected function emitPreAddForeignRecordToPoiCollectionEvent( array $foreignRecord, string $tableName, - string $columnName + string $columnName, ): array { /** @var PreAddForeignRecordEvent $event */ $event = $this->eventDispatcher->dispatch(new PreAddForeignRecordEvent( $foreignRecord, $tableName, - $columnName + $columnName, )); return $event->getForeignRecord(); diff --git a/Classes/Tca/Maps2Registry.php b/Classes/Tca/Maps2Registry.php index 70028398..12ae79a5 100644 --- a/Classes/Tca/Maps2Registry.php +++ b/Classes/Tca/Maps2Registry.php @@ -54,7 +54,7 @@ protected function initialize(): void file_get_contents($this->configurationFile), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ); if ( @@ -103,7 +103,7 @@ public function add( string $tableName, array $options = [], string $fieldName = 'tx_maps2_uid', - bool $override = false + bool $override = false, ): bool { $this->initialize(); $didRegister = false; @@ -129,7 +129,7 @@ public function add( json_encode([ 'registry' => $this->registry, 'extensions' => $this->extensions, - ], JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT) + ], JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT), ); $didRegister = true; } @@ -152,7 +152,7 @@ public function getColumnRegistry(): array file_get_contents($this->configurationFile), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ); } catch (\JsonException $jsonException) { $configuration = []; @@ -364,7 +364,7 @@ public static function getTcaFieldConfiguration(array $fieldConfigurationOverrid if (!empty($fieldConfigurationOverride)) { ArrayUtility::mergeRecursiveWithOverrule( $fieldConfiguration, - $fieldConfigurationOverride + $fieldConfigurationOverride, ); } @@ -388,7 +388,7 @@ public function addMaps2DatabaseSchemaToTablesDefinition(array $sqlString, strin * various extensions to the table definition string */ public function addMaps2DatabaseSchemasToTablesDefinition( - AlterTableDefinitionStatementsEvent $alterTableDefinitionStatementsEvent + AlterTableDefinitionStatementsEvent $alterTableDefinitionStatementsEvent, ): void { $this->initialize(); $alterTableDefinitionStatementsEvent->addSqlData($this->getDatabaseTableDefinitions()); diff --git a/Classes/Update/MigratePoiRecordsToConfigurationMapUpdate.php b/Classes/Update/MigratePoiRecordsToConfigurationMapUpdate.php index 72d86866..d9797f69 100644 --- a/Classes/Update/MigratePoiRecordsToConfigurationMapUpdate.php +++ b/Classes/Update/MigratePoiRecordsToConfigurationMapUpdate.php @@ -50,7 +50,7 @@ public function getConfirmation(): Confirmation 'This UpgradeWizards needs column "configuration_map" of table "tx_maps2_domain_model_poicollection" ' . 'to be of type TEXT in database. Else it may happen that POIs will be stored as incomplete JSON string ' . 'in configuration_map column. Further table "tx_maps2_domain_model_poi" should not be deleted.', - false + false, ); } @@ -90,23 +90,23 @@ public function updateNecessary(): bool 'p', $queryBuilder->expr()->eq( 'pc.uid', - $queryBuilder->quoteIdentifier('p.poicollection') - ) + $queryBuilder->quoteIdentifier('p.poicollection'), + ), ) ->where( $queryBuilder->expr()->isNotNull( - 'p.pid' - ) + 'p.pid', + ), ) ->orWhere( $queryBuilder->expr()->eq( 'collection_type', - $queryBuilder->createNamedParameter('Area') + $queryBuilder->createNamedParameter('Area'), ), $queryBuilder->expr()->eq( 'collection_type', - $queryBuilder->createNamedParameter('Route') - ) + $queryBuilder->createNamedParameter('Route'), + ), ) ->executeQuery() ->fetchOne(); @@ -138,14 +138,14 @@ public function executeUpdate(): bool [ 'configuration_map' => json_encode( $this->migratePoiRecords( - $poiCollectionRecord['uid'] + $poiCollectionRecord['uid'], ), - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ), ], [ 'uid' => (int)$poiCollectionRecord['uid'], - ] + ], ); } } catch (Exception $e) { @@ -180,8 +180,8 @@ protected function getPoiRecords(int $poiCollectionUid): array ->where( $queryBuilder->expr()->eq( 'poicollection', - $queryBuilder->createNamedParameter($poiCollectionUid, Connection::PARAM_INT) - ) + $queryBuilder->createNamedParameter($poiCollectionUid, Connection::PARAM_INT), + ), ) ->executeQuery(); diff --git a/Classes/Update/MoveOldFlexFormSettingsUpdate.php b/Classes/Update/MoveOldFlexFormSettingsUpdate.php index a2e267d6..59c9c27a 100644 --- a/Classes/Update/MoveOldFlexFormSettingsUpdate.php +++ b/Classes/Update/MoveOldFlexFormSettingsUpdate.php @@ -75,7 +75,7 @@ public function updateNecessary(): bool if ( ArrayUtility::getValueByPath( $valueFromDatabase, - 'data/sGoogleMapsOptions/lDEF/settings.activateScrollWheel' + 'data/sGoogleMapsOptions/lDEF/settings.activateScrollWheel', ) ) { return true; @@ -143,7 +143,7 @@ public function executeUpdate(): bool ], [ 'pi_flexform' => Connection::PARAM_STR, - ] + ], ); } @@ -175,22 +175,22 @@ protected function getTtContentRecordsWithMaps2Plugin(): array ->where( $queryBuilder->expr()->eq( 'CType', - $queryBuilder->createNamedParameter('list') + $queryBuilder->createNamedParameter('list'), ), $queryBuilder->expr()->or( $queryBuilder->expr()->eq( 'list_type', - $queryBuilder->createNamedParameter('maps2_citymap') + $queryBuilder->createNamedParameter('maps2_citymap'), ), $queryBuilder->expr()->eq( 'list_type', - $queryBuilder->createNamedParameter('maps2_maps2') + $queryBuilder->createNamedParameter('maps2_maps2'), ), $queryBuilder->expr()->eq( 'list_type', - $queryBuilder->createNamedParameter('maps2_searchwithinradius') - ) - ) + $queryBuilder->createNamedParameter('maps2_searchwithinradius'), + ), + ), ) ->executeQuery(); @@ -227,7 +227,7 @@ protected function moveFieldFromOldToNewSheet( array &$valueFromDatabase, string $field, string $oldSheet, - string $newSheet + string $newSheet, ): void { try { $value = ArrayUtility::getValueByPath( @@ -235,8 +235,8 @@ protected function moveFieldFromOldToNewSheet( sprintf( 'data/%s/lDEF/%s', $oldSheet, - $field - ) + $field, + ), ); // Create base sheet, if not exist diff --git a/Classes/Update/NewGeocodeUriForOsmUpdate.php b/Classes/Update/NewGeocodeUriForOsmUpdate.php index b740621b..a6063a5c 100644 --- a/Classes/Update/NewGeocodeUriForOsmUpdate.php +++ b/Classes/Update/NewGeocodeUriForOsmUpdate.php @@ -61,7 +61,7 @@ public function executeUpdate(): bool $maps2ExtensionConfiguration['openStreetMapGeocodeUri'] = $this->newOsmGeocodeUri; $this->getExtensionConfiguration()->set( 'maps2', - $maps2ExtensionConfiguration + $maps2ExtensionConfiguration, ); } diff --git a/Classes/ViewHelpers/Cache/GetCacheViewHelper.php b/Classes/ViewHelpers/Cache/GetCacheViewHelper.php index 8c402fda..cc34adf7 100644 --- a/Classes/ViewHelpers/Cache/GetCacheViewHelper.php +++ b/Classes/ViewHelpers/Cache/GetCacheViewHelper.php @@ -40,13 +40,13 @@ public function initializeArguments(): void 'string', 'A prefix for the cache identifier.', false, - 'infoWindow' + 'infoWindow', ); $this->registerArgument( 'poiCollection', PoiCollection::class, 'We need the PoiCollection to build a better language independent CacheIdentifier.', - true + true, ); } @@ -57,7 +57,7 @@ public function initializeArguments(): void public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): string { $cacheService = GeneralUtility::makeInstance(CacheService::class); $poiCollection = $cacheService->preparePoiCollectionForCacheMethods($arguments['poiCollection']); @@ -66,8 +66,8 @@ public static function renderStatic( return $cache->get( $cacheService->getCacheIdentifier( $poiCollection, - $arguments['prefix'] - ) + $arguments['prefix'], + ), ); } } diff --git a/Classes/ViewHelpers/Cache/HasCacheViewHelper.php b/Classes/ViewHelpers/Cache/HasCacheViewHelper.php index 6a8367d4..d6b0f5ac 100644 --- a/Classes/ViewHelpers/Cache/HasCacheViewHelper.php +++ b/Classes/ViewHelpers/Cache/HasCacheViewHelper.php @@ -33,13 +33,13 @@ public function initializeArguments(): void 'string', 'A prefix for the cache identifier.', false, - 'infoWindow' + 'infoWindow', ); $this->registerArgument( 'poiCollection', PoiCollection::class, 'We need the PoiCollection to build a better language independent CacheIdentifier.', - true + true, ); } @@ -49,7 +49,7 @@ public function initializeArguments(): void public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): bool { $cacheService = GeneralUtility::makeInstance(CacheService::class); $poiCollection = $cacheService->preparePoiCollectionForCacheMethods($arguments['poiCollection']); @@ -58,8 +58,8 @@ public static function renderStatic( return $cache->has( $cacheService->getCacheIdentifier( $poiCollection, - $arguments['prefix'] - ) + $arguments['prefix'], + ), ); } } diff --git a/Classes/ViewHelpers/Cache/SetCacheViewHelper.php b/Classes/ViewHelpers/Cache/SetCacheViewHelper.php index 3be57a6f..d23c507c 100644 --- a/Classes/ViewHelpers/Cache/SetCacheViewHelper.php +++ b/Classes/ViewHelpers/Cache/SetCacheViewHelper.php @@ -40,31 +40,31 @@ public function initializeArguments(): void 'string', 'A prefix for the cache identifier.', false, - 'infoWindow' + 'infoWindow', ); $this->registerArgument( 'poiCollection', PoiCollection::class, 'We need the PoiCollection to build a better language independent CacheIdentifier.', - true + true, ); $this->registerArgument( 'data', 'string', 'The data to be stored', - true + true, ); $this->registerArgument( 'tags', 'array', 'Tags to associate with this cache entry', false, - [] + [], ); $this->registerArgument( 'lifetime', 'int', - 'Lifetime of this cache entry in seconds. If null is specified, the default lifetime is used. "0" means unlimited lifetime' + 'Lifetime of this cache entry in seconds. If null is specified, the default lifetime is used. "0" means unlimited lifetime', ); } @@ -74,7 +74,7 @@ public function initializeArguments(): void public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): void { $cacheService = GeneralUtility::makeInstance(CacheService::class); $poiCollection = $cacheService->preparePoiCollectionForCacheMethods($arguments['poiCollection']); @@ -84,7 +84,7 @@ public static function renderStatic( $cacheService->getCacheIdentifier($poiCollection, $arguments['prefix']), $arguments['data'], $cacheService->getCacheTags($poiCollection, $arguments['tags']), - ($arguments['lifetime'] === null ? null : (int)$arguments['lifetime']) + ($arguments['lifetime'] === null ? null : (int)$arguments['lifetime']), ); } } diff --git a/Classes/ViewHelpers/ConvertToJsonViewHelper.php b/Classes/ViewHelpers/ConvertToJsonViewHelper.php index 2ae5c2e9..54b71afa 100644 --- a/Classes/ViewHelpers/ConvertToJsonViewHelper.php +++ b/Classes/ViewHelpers/ConvertToJsonViewHelper.php @@ -44,7 +44,7 @@ class ConvertToJsonViewHelper extends AbstractViewHelper public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): string { $poiCollections = $renderChildrenClosure(); diff --git a/Classes/ViewHelpers/Form/RenderHiddenFieldsForGetViewHelper.php b/Classes/ViewHelpers/Form/RenderHiddenFieldsForGetViewHelper.php index 767fff45..faec0976 100644 --- a/Classes/ViewHelpers/Form/RenderHiddenFieldsForGetViewHelper.php +++ b/Classes/ViewHelpers/Form/RenderHiddenFieldsForGetViewHelper.php @@ -44,19 +44,19 @@ public function initializeArguments(): void $this->registerArgument( 'pageUid', 'int', - 'The target page UID' + 'The target page UID', ); $this->registerArgument( 'action', 'string', - 'Target action' + 'Target action', ); $this->registerArgument( 'controller', 'string', - 'Target controller. If null current controllerName is used' + 'Target controller. If null current controllerName is used', ); } @@ -66,7 +66,7 @@ public function initializeArguments(): void public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): string { $extensionService = GeneralUtility::makeInstance(ExtensionService::class); $cacheHashCalculator = GeneralUtility::makeInstance(CacheHashCalculator::class); @@ -77,7 +77,7 @@ public static function renderStatic( $pluginNamespace = $extensionService->getPluginNamespace( $extbaseRequest->getControllerExtensionName(), - $extbaseRequest->getPluginName() + $extbaseRequest->getPluginName(), ); // get pageUid @@ -95,32 +95,32 @@ public static function renderStatic( $parameters[$pluginNamespace]['controller'] = $arguments['controller']; $parameters[$pluginNamespace]['action'] = $arguments['action']; $cacheHashArray = $cacheHashCalculator->getRelevantParameters( - GeneralUtility::implodeArrayForUrl('', $parameters) + GeneralUtility::implodeArrayForUrl('', $parameters), ); // create array of hidden fields for GET forms $fields = []; $fields[] = sprintf( '', - $pageUid + $pageUid, ); $fields[] = sprintf( '', $pluginNamespace, - $arguments['controller'] + $arguments['controller'], ); $fields[] = sprintf( '', $pluginNamespace, - $arguments['action'] + $arguments['action'], ); // add cHash $fields[] = sprintf( '', $cacheHashCalculator->calculateCacheHash( - $cacheHashArray - ) + $cacheHashArray, + ), ); return implode(chr(10), $fields); diff --git a/Classes/ViewHelpers/GetEnvironmentViewHelper.php b/Classes/ViewHelpers/GetEnvironmentViewHelper.php index 229e7edc..c4310cd0 100644 --- a/Classes/ViewHelpers/GetEnvironmentViewHelper.php +++ b/Classes/ViewHelpers/GetEnvironmentViewHelper.php @@ -40,7 +40,7 @@ class GetEnvironmentViewHelper extends AbstractViewHelper public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): string { $templateVariableContainer = $renderingContext->getVariableProvider(); $extbaseRequest = self::getExtbaseRequest($renderingContext); @@ -55,7 +55,7 @@ public static function renderStatic( 'extConf' => ObjectAccess::getGettableProperties(self::getExtConf()), 'id' => (int)($extbaseRequest->getQueryParams()['id'] ?? 0), 'contentRecord' => $extbaseRequest->getAttribute('currentContentObject')->data, - ] + ], ); $content = $renderChildrenClosure(); diff --git a/Classes/ViewHelpers/IsRequestToMapProviderAllowedViewHelper.php b/Classes/ViewHelpers/IsRequestToMapProviderAllowedViewHelper.php index 4e519975..441ff81e 100644 --- a/Classes/ViewHelpers/IsRequestToMapProviderAllowedViewHelper.php +++ b/Classes/ViewHelpers/IsRequestToMapProviderAllowedViewHelper.php @@ -30,7 +30,7 @@ class IsRequestToMapProviderAllowedViewHelper extends AbstractConditionViewHelpe public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): bool { return GeneralUtility::makeInstance(MapHelper::class) ->isRequestToMapProviderAllowed(); diff --git a/Classes/ViewHelpers/RequestUriForOverlayViewHelper.php b/Classes/ViewHelpers/RequestUriForOverlayViewHelper.php index 36be603c..10ca8d28 100644 --- a/Classes/ViewHelpers/RequestUriForOverlayViewHelper.php +++ b/Classes/ViewHelpers/RequestUriForOverlayViewHelper.php @@ -33,7 +33,7 @@ public function initializeArguments(): void 'int', 'The tt_content UID of the record which shows the map', false, - 0 + 0, ); } @@ -43,7 +43,7 @@ public function initializeArguments(): void public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): string { $uriBuilder = self::getUriBuilder() ->reset() diff --git a/Classes/ViewHelpers/TrimExplodeViewHelper.php b/Classes/ViewHelpers/TrimExplodeViewHelper.php index f8a4062e..b7fe8dcc 100644 --- a/Classes/ViewHelpers/TrimExplodeViewHelper.php +++ b/Classes/ViewHelpers/TrimExplodeViewHelper.php @@ -30,7 +30,7 @@ public function initializeArguments(): void 'string', 'The delimiter where the string should be exploded', false, - ',' + ',', ); } @@ -42,7 +42,7 @@ public function initializeArguments(): void public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ): array { return GeneralUtility::trimExplode($arguments['delimiter'], $renderChildrenClosure()); } diff --git a/Configuration/Icons.php b/Configuration/Icons.php index f31df1c4..58db7ea1 100644 --- a/Configuration/Icons.php +++ b/Configuration/Icons.php @@ -1,24 +1,31 @@ [ 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - 'source' => 'EXT:maps2/Resources/Public/Icons/plugin_wizard.svg' + 'source' => 'EXT:maps2/Resources/Public/Icons/plugin_wizard.svg', ], 'ext-maps2-record-type-point' => [ 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, - 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypePoint.png' + 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypePoint.png', ], 'ext-maps2-record-type-area' => [ 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, - 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypeArea.png' + 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypeArea.png', ], 'ext-maps2-record-type-route' => [ 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, - 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypeRoute.png' + 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypeRoute.png', ], 'ext-maps2-record-type-radius' => [ 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, - 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypeRadius.png' + 'source' => 'EXT:maps2/Resources/Public/Icons/RecordTypeRadius.png', ], ]; diff --git a/Configuration/JavaScriptModules.php b/Configuration/JavaScriptModules.php index 2a566afd..d2364b3d 100644 --- a/Configuration/JavaScriptModules.php +++ b/Configuration/JavaScriptModules.php @@ -1,5 +1,12 @@ [ 'backend', diff --git a/Configuration/TCA/Overrides/sys_category.php b/Configuration/TCA/Overrides/sys_category.php index 01c61221..43f90dc6 100644 --- a/Configuration/TCA/Overrides/sys_category.php +++ b/Configuration/TCA/Overrides/sys_category.php @@ -1,5 +1,12 @@ getMapProvider() . ', maps2_marker_icons, maps2_marker_icon_width, maps2_marker_icon_height, maps2_marker_icon_anchor_pos_x, maps2_marker_icon_anchor_pos_y' + '--div--;LLL:EXT:maps2/Resources/Private/Language/locallang_db.xlf:tab.maps2.' . $mapHelper->getMapProvider() . ', maps2_marker_icons, maps2_marker_icon_width, maps2_marker_icon_height, maps2_marker_icon_anchor_pos_x, maps2_marker_icon_anchor_pos_y', ); }); diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index 1890aa56..5c88a011 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -1,5 +1,12 @@ getMapProvider() === 'both' || $extConf->getMapProvider() === 'gm') { ExtensionManagementUtility::addStaticFile( 'maps2', 'Configuration/TypoScript/GoogleMaps', - 'Maps2 for Google Maps' + 'Maps2 for Google Maps', ); } @@ -32,7 +39,7 @@ ExtensionManagementUtility::addStaticFile( 'maps2', 'Configuration/TypoScript/OpenStreetMap', - 'Maps2 for Open Street Map' + 'Maps2 for Open Street Map', ); } }); diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 8254ae67..7f417a61 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,5 +1,12 @@ getDefaultLatitude(), - 6 + 6, ); $GLOBALS['TCA']['tx_maps2_domain_model_poicollection']['columns']['longitude']['config']['default'] = number_format( $extConf->getDefaultLongitude(), - 6 + 6, ); // If both map providers are allowed in ExtensionManager we have to add a selectbox for map provider to TCA @@ -41,7 +48,7 @@ 'tx_maps2_domain_model_poicollection', 'map_provider', '', - 'before:configuration_map' + 'before:configuration_map', ); } }); diff --git a/Configuration/TCA/tx_maps2_domain_model_poicollection.php b/Configuration/TCA/tx_maps2_domain_model_poicollection.php index 862a19ee..0bcbf90f 100644 --- a/Configuration/TCA/tx_maps2_domain_model_poicollection.php +++ b/Configuration/TCA/tx_maps2_domain_model_poicollection.php @@ -1,5 +1,12 @@ subject = new ClientFactory( new MapHelper( - $this->extConf - ) + $this->extConf, + ), ); } @@ -49,7 +49,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->extConf + $this->extConf, ); parent::tearDown(); @@ -65,7 +65,7 @@ public function createCreatesGoogleMapsClient(): void self::assertInstanceOf( GoogleMapsClient::class, - $this->subject->create() + $this->subject->create(), ); } @@ -79,7 +79,7 @@ public function createCreatesOpenStreetMapClient(): void self::assertInstanceOf( OpenStreetMapClient::class, - $this->subject->create() + $this->subject->create(), ); } } diff --git a/Tests/Functional/Client/GoogleMapsClientTest.php b/Tests/Functional/Client/GoogleMapsClientTest.php index f7872452..5714ba6f 100644 --- a/Tests/Functional/Client/GoogleMapsClientTest.php +++ b/Tests/Functional/Client/GoogleMapsClientTest.php @@ -54,7 +54,7 @@ protected function setUp(): void $this->subject = new GoogleMapsClient( $this->messageHelperMock, - $this->requestFactoryMock + $this->requestFactoryMock, ); } @@ -64,7 +64,7 @@ protected function tearDown(): void $this->subject, $this->extConf, $this->messageHelperMock, - $this->requestFactoryMock + $this->requestFactoryMock, ); parent::tearDown(); @@ -84,12 +84,12 @@ public function processRequestWithEmptyUriAddsFlashMessage(): void ->with( 'URI is empty or contains invalid chars. URI: ', 'Invalid request URI', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); self::assertSame( [], - $this->subject->processRequest($geocodeRequest) + $this->subject->processRequest($geocodeRequest), ); } @@ -107,12 +107,12 @@ public function processRequestWithInvalidRequestAddsFlashMessage(): void ->with( 'URI is empty or contains invalid chars. URI: https://www.jweiländ.net', 'Invalid request URI', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); self::assertSame( [], - $this->subject->processRequest($geocodeRequest) + $this->subject->processRequest($geocodeRequest), ); } } diff --git a/Tests/Functional/Client/OpenStreetMapClientTest.php b/Tests/Functional/Client/OpenStreetMapClientTest.php index 4ca4170a..46fbdbd6 100644 --- a/Tests/Functional/Client/OpenStreetMapClientTest.php +++ b/Tests/Functional/Client/OpenStreetMapClientTest.php @@ -54,7 +54,7 @@ protected function setUp(): void $this->subject = new OpenStreetMapClient( $this->messageHelperMock, - $this->requestFactoryMock + $this->requestFactoryMock, ); } @@ -64,7 +64,7 @@ protected function tearDown(): void $this->subject, $this->extConf, $this->messageHelperMock, - $this->requestFactoryMock + $this->requestFactoryMock, ); parent::tearDown(); @@ -84,12 +84,12 @@ public function processRequestWithEmptyUriAddsFlashMessage(): void ->with( 'URI is empty or contains invalid chars. URI: ', 'Invalid request URI', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); self::assertSame( [], - $this->subject->processRequest($geocodeRequest) + $this->subject->processRequest($geocodeRequest), ); } @@ -107,12 +107,12 @@ public function processRequestWithInvalidRequestAddsFlashMessage(): void ->with( 'URI is empty or contains invalid chars. URI: https://www.jweiländ.net', 'Invalid request URI', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); self::assertSame( [], - $this->subject->processRequest($geocodeRequest) + $this->subject->processRequest($geocodeRequest), ); } } diff --git a/Tests/Functional/Client/Request/GoogleMaps/GeocodeRequestTest.php b/Tests/Functional/Client/Request/GoogleMaps/GeocodeRequestTest.php index 7b363d55..8e2d904f 100644 --- a/Tests/Functional/Client/Request/GoogleMaps/GeocodeRequestTest.php +++ b/Tests/Functional/Client/Request/GoogleMaps/GeocodeRequestTest.php @@ -36,7 +36,7 @@ protected function setUp(): void $this->extConf = GeneralUtility::makeInstance(ExtConf::class); $this->subject = new GeocodeRequest( - $this->extConf + $this->extConf, ); } @@ -44,7 +44,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->extConf + $this->extConf, ); parent::tearDown(); @@ -59,7 +59,7 @@ public function setUriSetsUri(): void $this->subject->setUri($uri); self::assertSame( $uri, - $this->subject->getUri() + $this->subject->getUri(), ); } @@ -75,7 +75,7 @@ public function setParametersSetsParameters(): void $this->subject->setParameters($parameters); self::assertSame( $parameters, - $this->subject->getParameters() + $this->subject->getParameters(), ); } @@ -92,11 +92,11 @@ public function addParameterSetsParameter(): void $this->subject->addParameter('city', 'Filderstadt'); self::assertSame( 'Filderstadt', - $this->subject->getParameter('city') + $this->subject->getParameter('city'), ); self::assertCount( 3, - $this->subject->getParameters() + $this->subject->getParameters(), ); } @@ -111,7 +111,7 @@ public function hasParameterReturnsTrue(): void ]; $this->subject->setParameters($parameters); self::assertTrue( - $this->subject->hasParameter('uri') + $this->subject->hasParameter('uri'), ); } @@ -126,7 +126,7 @@ public function hasParameterReturnsFalse(): void ]; $this->subject->setParameters($parameters); self::assertFalse( - $this->subject->hasParameter('city') + $this->subject->hasParameter('city'), ); } @@ -137,7 +137,7 @@ public function isValidRequestWithEmptyUriReturnsFalse(): void { $this->subject->setUri(' '); self::assertFalse( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } @@ -148,7 +148,7 @@ public function isValidRequestWithInvalidUriReturnsFalse(): void { $this->subject->setUri('nice try'); self::assertFalse( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } @@ -159,7 +159,7 @@ public function isValidRequestWithValidUriReturnsTrue(): void { $this->subject->setUri('https://www.jweiland.net/%s/what/ever/%s.html'); self::assertTrue( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } @@ -174,7 +174,7 @@ public function getUriWillAddAddressAndApiKeyToUri(): void $this->subject->addParameter('address', 'My Address'); self::assertSame( 'My%20Address:MyApiKey', - $this->subject->getUri() + $this->subject->getUri(), ); } @@ -188,7 +188,7 @@ public function getUriAddsAddressAndApiKeyToUriButUriIsInvalid(): void $this->subject->setUri('%s:%s'); $this->subject->addParameter('address', 'My Address'); self::assertFalse( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } } diff --git a/Tests/Functional/Client/Request/OpenStreetMap/GeocodeRequestTest.php b/Tests/Functional/Client/Request/OpenStreetMap/GeocodeRequestTest.php index 846efbc2..1be5ca78 100644 --- a/Tests/Functional/Client/Request/OpenStreetMap/GeocodeRequestTest.php +++ b/Tests/Functional/Client/Request/OpenStreetMap/GeocodeRequestTest.php @@ -36,7 +36,7 @@ protected function setUp(): void $this->extConf = GeneralUtility::makeInstance(ExtConf::class); $this->subject = new GeocodeRequest( - $this->extConf + $this->extConf, ); } @@ -44,7 +44,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->extConf + $this->extConf, ); parent::tearDown(); } @@ -58,7 +58,7 @@ public function setUriSetsUri(): void $this->subject->setUri($uri); self::assertSame( $uri, - $this->subject->getUri() + $this->subject->getUri(), ); } @@ -74,7 +74,7 @@ public function setParametersSetsParameters(): void $this->subject->setParameters($parameters); self::assertSame( $parameters, - $this->subject->getParameters() + $this->subject->getParameters(), ); } @@ -91,11 +91,11 @@ public function addParameterSetsParameter(): void $this->subject->addParameter('city', 'Filderstadt'); self::assertSame( 'Filderstadt', - $this->subject->getParameter('city') + $this->subject->getParameter('city'), ); self::assertCount( 3, - $this->subject->getParameters() + $this->subject->getParameters(), ); } @@ -110,7 +110,7 @@ public function hasParameterReturnsTrue(): void ]; $this->subject->setParameters($parameters); self::assertTrue( - $this->subject->hasParameter('uri') + $this->subject->hasParameter('uri'), ); } @@ -125,7 +125,7 @@ public function hasParameterReturnsFalse(): void ]; $this->subject->setParameters($parameters); self::assertFalse( - $this->subject->hasParameter('city') + $this->subject->hasParameter('city'), ); } @@ -136,7 +136,7 @@ public function isValidRequestWithEmptyUriReturnsFalse(): void { $this->subject->setUri(' '); self::assertFalse( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } @@ -147,7 +147,7 @@ public function isValidRequestWithInvalidUriReturnsFalse(): void { $this->subject->setUri('nice try'); self::assertFalse( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } @@ -158,7 +158,7 @@ public function isValidRequestWithValidUriReturnsTrue(): void { $this->subject->setUri('https://www.jweiland.net/what/ever/%s.html'); self::assertTrue( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } @@ -172,7 +172,7 @@ public function getUriWillAddAddressAndApiKeyToUri(): void $this->subject->addParameter('address', 'My Address'); self::assertSame( 'https://www.jweiland.net/what/ever/My%20Address.html', - $this->subject->getUri() + $this->subject->getUri(), ); } @@ -185,7 +185,7 @@ public function getUriAddsAddressAndApiKeyToUriButUriIsInvalid(): void $this->subject->setUri('nice try'); $this->subject->addParameter('address', 'My Address'); self::assertFalse( - $this->subject->isValidRequest() + $this->subject->isValidRequest(), ); } } diff --git a/Tests/Functional/Client/Request/RequestFactoryTest.php b/Tests/Functional/Client/Request/RequestFactoryTest.php index 6f519f2f..13ca4fa3 100644 --- a/Tests/Functional/Client/Request/RequestFactoryTest.php +++ b/Tests/Functional/Client/Request/RequestFactoryTest.php @@ -39,15 +39,15 @@ protected function setUp(): void $this->subject = new RequestFactory( new MapHelper( - $this->extConf - ) + $this->extConf, + ), ); } protected function tearDown(): void { unset( - $this->subject + $this->subject, ); parent::tearDown(); } @@ -62,7 +62,7 @@ public function createCreatesGoogleMapsGeocodeRequest(): void self::assertInstanceOf( GeocodeRequest::class, - $this->subject->create('GeocodeRequest') + $this->subject->create('GeocodeRequest'), ); } @@ -76,7 +76,7 @@ public function createCreatesOpenStreetMapGeocodeRequest(): void self::assertInstanceOf( \JWeiland\Maps2\Client\Request\OpenStreetMap\GeocodeRequest::class, - $this->subject->create('GeocodeRequest') + $this->subject->create('GeocodeRequest'), ); } @@ -90,7 +90,7 @@ public function createSanitizesFilenameWithExtension(): void self::assertInstanceOf( GeocodeRequest::class, - $this->subject->create('GeocodeRequest.php') + $this->subject->create('GeocodeRequest.php'), ); } @@ -104,7 +104,7 @@ public function createSanitizesFilenameWithLowerCamelCase(): void self::assertInstanceOf( GeocodeRequest::class, - $this->subject->create('geocodeRequest') + $this->subject->create('geocodeRequest'), ); } diff --git a/Tests/Functional/Configuration/ExtConfTest.php b/Tests/Functional/Configuration/ExtConfTest.php index 8b6e257b..cd99dd23 100644 --- a/Tests/Functional/Configuration/ExtConfTest.php +++ b/Tests/Functional/Configuration/ExtConfTest.php @@ -36,7 +36,7 @@ protected function setUp(): void protected function tearDown(): void { unset( - $this->subject + $this->subject, ); parent::tearDown(); @@ -49,7 +49,7 @@ public function getMapProviderInitiallyReturnsBothAsString(): void { self::assertSame( 'both', - $this->subject->getMapProvider() + $this->subject->getMapProvider(), ); } @@ -62,7 +62,7 @@ public function setMapProviderSetsMapProvider(): void self::assertSame( 'foo bar', - $this->subject->getMapProvider() + $this->subject->getMapProvider(), ); } @@ -73,7 +73,7 @@ public function getDefaultMapProviderInitiallyReturnsGoogleMapsAsString(): void { self::assertSame( 'gm', - $this->subject->getDefaultMapProvider() + $this->subject->getDefaultMapProvider(), ); } @@ -86,7 +86,7 @@ public function setDefaultMapProviderSetsDefaultMapProvider(): void self::assertSame( 'foo bar', - $this->subject->getDefaultMapProvider() + $this->subject->getDefaultMapProvider(), ); } @@ -97,7 +97,7 @@ public function getDefaultCountryInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getDefaultCountry() + $this->subject->getDefaultCountry(), ); } @@ -110,7 +110,7 @@ public function setDefaultCountrySetsDefaultCountry(): void self::assertSame( 'foo bar', - $this->subject->getDefaultCountry() + $this->subject->getDefaultCountry(), ); } @@ -121,7 +121,7 @@ public function getDefaultLatitudeInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getDefaultLatitude() + $this->subject->getDefaultLatitude(), ); } @@ -134,7 +134,7 @@ public function setDefaultLatitudeSetsDefaultLatitude(): void self::assertSame( 1234.56, - $this->subject->getDefaultLatitude() + $this->subject->getDefaultLatitude(), ); } @@ -145,7 +145,7 @@ public function getDefaultLongitudeInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getDefaultLongitude() + $this->subject->getDefaultLongitude(), ); } @@ -158,7 +158,7 @@ public function setDefaultLongitudeSetsDefaultLongitude(): void self::assertSame( 1234.56, - $this->subject->getDefaultLongitude() + $this->subject->getDefaultLongitude(), ); } @@ -169,7 +169,7 @@ public function getDefaultRadiusInitiallyReturns250(): void { self::assertSame( 250, - $this->subject->getDefaultRadius() + $this->subject->getDefaultRadius(), ); } @@ -182,7 +182,7 @@ public function setDefaultRadiusSetsDefaultRadius(): void self::assertSame( 123456, - $this->subject->getDefaultRadius() + $this->subject->getDefaultRadius(), ); } @@ -195,7 +195,7 @@ public function setDefaultRadiusWithStringResultsInInteger(): void self::assertSame( 123, - $this->subject->getDefaultRadius() + $this->subject->getDefaultRadius(), ); } @@ -208,7 +208,7 @@ public function setDefaultRadiusWithBooleanResultsInInteger(): void self::assertSame( 1, - $this->subject->getDefaultRadius() + $this->subject->getDefaultRadius(), ); } @@ -218,7 +218,7 @@ public function setDefaultRadiusWithBooleanResultsInInteger(): void public function getExplicitAllowMapProviderRequestsInitiallyReturnsFalse(): void { self::assertFalse( - $this->subject->getExplicitAllowMapProviderRequests() + $this->subject->getExplicitAllowMapProviderRequests(), ); } @@ -229,7 +229,7 @@ public function setExplicitAllowMapProviderRequestsSetsExplicitAllowGoogleMaps() { $this->subject->setExplicitAllowMapProviderRequests(true); self::assertTrue( - $this->subject->getExplicitAllowMapProviderRequests() + $this->subject->getExplicitAllowMapProviderRequests(), ); } @@ -257,7 +257,7 @@ public function setExplicitAllowMapProviderRequestsWithZeroReturnsFalse(): void public function getExplicitAllowMapProviderRequestsBySessionOnlyInitiallyReturnsFalse(): void { self::assertFalse( - $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly() + $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly(), ); } @@ -268,7 +268,7 @@ public function setExplicitAllowMapProviderRequestsBySessionOnlySetsExplicitAllo { $this->subject->setExplicitAllowMapProviderRequestsBySessionOnly(true); self::assertTrue( - $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly() + $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly(), ); } @@ -279,7 +279,7 @@ public function setExplicitAllowMapProviderRequestsBySessionOnlyWithStringReturn { $this->subject->setExplicitAllowMapProviderRequestsBySessionOnly('foo bar'); self::assertTrue( - $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly() + $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly(), ); } @@ -290,7 +290,7 @@ public function setExplicitAllowMapProviderRequestsBySessionOnlyWithZeroReturnsF { $this->subject->setExplicitAllowMapProviderRequestsBySessionOnly(0); self::assertFalse( - $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly() + $this->subject->getExplicitAllowMapProviderRequestsBySessionOnly(), ); } @@ -301,7 +301,7 @@ public function getInfoWindowContentTemplatePathInitiallyReturnsDefaultPath(): v { self::assertSame( 'EXT:maps2/Resources/Private/Templates/InfoWindowContent.html', - $this->subject->getInfoWindowContentTemplatePath() + $this->subject->getInfoWindowContentTemplatePath(), ); } @@ -314,7 +314,7 @@ public function setInfoWindowContentTemplatePathSetsInfoWindowContentTemplatePat self::assertSame( 'foo bar', - $this->subject->getInfoWindowContentTemplatePath() + $this->subject->getInfoWindowContentTemplatePath(), ); } @@ -326,7 +326,7 @@ public function getGoogleMapsLibraryInitiallyReturnsEmptyString(): void $this->subject->setGoogleMapsJavaScriptApiKey('myApiKey'); self::assertSame( 'https://maps.googleapis.com/maps/api/js?key=myApiKey&libraries=places', - $this->subject->getGoogleMapsLibrary() + $this->subject->getGoogleMapsLibrary(), ); } @@ -340,7 +340,7 @@ public function setGoogleMapsLibraryWithNoPipeWillNotSetGoogleMapsLibrary(): voi self::assertSame( '', - $this->subject->getGoogleMapsLibrary() + $this->subject->getGoogleMapsLibrary(), ); } @@ -354,7 +354,7 @@ public function setGoogleMapsLibraryWithNoHttpInFrontWillNotSetGoogleMapsLibrary self::assertSame( '', - $this->subject->getGoogleMapsLibrary() + $this->subject->getGoogleMapsLibrary(), ); } @@ -368,7 +368,7 @@ public function setGoogleMapsLibraryWithPipeAndHttpWillSetGoogleMapsLibrary(): v self::assertSame( 'https://www.domain.de/api=myApiKey&mobile=1', - $this->subject->getGoogleMapsLibrary() + $this->subject->getGoogleMapsLibrary(), ); } @@ -382,7 +382,7 @@ public function setGoogleMapsLibraryWithPipeAndHttpsWillSetGoogleMapsLibrary(): self::assertSame( 'https://www.domain.de/api=myApiKey&mobile=1', - $this->subject->getGoogleMapsLibrary() + $this->subject->getGoogleMapsLibrary(), ); } @@ -396,7 +396,7 @@ public function setGoogleMapsLibraryWithHttpUriAndActivatedHttpsWillSetGoogleMap self::assertSame( 'https://www.domain.de/api=myApiKey&mobile=1', - $this->subject->getGoogleMapsLibrary() + $this->subject->getGoogleMapsLibrary(), ); } @@ -407,7 +407,7 @@ public function getGoogleMapsGeocodeUriInitiallyReturnsPreConfiguredUri(): void { self::assertSame( 'https://maps.googleapis.com/maps/api/geocode/json?address=%s&key=%s', - $this->subject->getGoogleMapsGeocodeUri() + $this->subject->getGoogleMapsGeocodeUri(), ); } @@ -420,7 +420,7 @@ public function setGoogleMapsGeocodeUriSetsGoogleMapsGeocodeUri(): void self::assertSame( 'foo bar', - $this->subject->getGoogleMapsGeocodeUri() + $this->subject->getGoogleMapsGeocodeUri(), ); } @@ -433,7 +433,7 @@ public function setGoogleMapsJavaScriptApiKeySetsGoogleMapsJavaScriptApiKey(): v self::assertSame( 'foo bar', - $this->subject->getGoogleMapsJavaScriptApiKey() + $this->subject->getGoogleMapsJavaScriptApiKey(), ); } @@ -447,7 +447,7 @@ public function setGoogleMapsGeocodeApiKeySetsGoogleMapsGeocodeApiKey(): void self::assertSame( 'foo bar', - $this->subject->getGoogleMapsGeocodeApiKey() + $this->subject->getGoogleMapsGeocodeApiKey(), ); } @@ -458,7 +458,7 @@ public function getOpenStreetMapGeocodeUriInitiallyReturnsPreConfiguredUri(): vo { self::assertSame( 'https://nominatim.openstreetmap.org/search?q=%s&format=json&addressdetails=1', - $this->subject->getOpenStreetMapGeocodeUri() + $this->subject->getOpenStreetMapGeocodeUri(), ); } @@ -471,7 +471,7 @@ public function setOpenStreetMapGeocodeUriSetsOpenStreetMapGeocodeUri(): void self::assertSame( 'foo bar', - $this->subject->getOpenStreetMapGeocodeUri() + $this->subject->getOpenStreetMapGeocodeUri(), ); } @@ -482,7 +482,7 @@ public function getStrokeColorInitiallyReturnsRedColor(): void { self::assertSame( '#FF0000', - $this->subject->getStrokeColor() + $this->subject->getStrokeColor(), ); } @@ -495,7 +495,7 @@ public function setStrokeColorSetsStrokeColor(): void self::assertSame( 'foo bar', - $this->subject->getStrokeColor() + $this->subject->getStrokeColor(), ); } @@ -506,7 +506,7 @@ public function getStrokeOpacityInitiallyReturns0point8(): void { self::assertSame( 0.8, - $this->subject->getStrokeOpacity() + $this->subject->getStrokeOpacity(), ); } @@ -519,7 +519,7 @@ public function setStrokeOpacitySetsStrokeOpacity(): void self::assertSame( 1234.56, - $this->subject->getStrokeOpacity() + $this->subject->getStrokeOpacity(), ); } @@ -530,7 +530,7 @@ public function getStrokeWeightInitiallyReturnsTwo(): void { self::assertSame( 2, - $this->subject->getStrokeWeight() + $this->subject->getStrokeWeight(), ); } @@ -543,7 +543,7 @@ public function setStrokeWeightSetsStrokeWeight(): void self::assertSame( 123456, - $this->subject->getStrokeWeight() + $this->subject->getStrokeWeight(), ); } @@ -556,7 +556,7 @@ public function setStrokeWeightWithStringResultsInInteger(): void self::assertSame( 123, - $this->subject->getStrokeWeight() + $this->subject->getStrokeWeight(), ); } @@ -569,7 +569,7 @@ public function setStrokeWeightWithBooleanResultsInInteger(): void self::assertSame( 1, - $this->subject->getStrokeWeight() + $this->subject->getStrokeWeight(), ); } @@ -580,7 +580,7 @@ public function getFillColorInitiallyReturnsRedColor(): void { self::assertSame( '#FF0000', - $this->subject->getFillColor() + $this->subject->getFillColor(), ); } @@ -593,7 +593,7 @@ public function setFillColorSetsFillColor(): void self::assertSame( 'foo bar', - $this->subject->getFillColor() + $this->subject->getFillColor(), ); } @@ -604,7 +604,7 @@ public function getFillOpacityInitiallyReturns0point35(): void { self::assertSame( 0.35, - $this->subject->getFillOpacity() + $this->subject->getFillOpacity(), ); } @@ -617,7 +617,7 @@ public function setFillOpacitySetsFillOpacity(): void self::assertSame( 1234.56, - $this->subject->getFillOpacity() + $this->subject->getFillOpacity(), ); } @@ -628,7 +628,7 @@ public function getMarkerIconWidthInitiallyReturns25(): void { self::assertSame( 25, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -641,7 +641,7 @@ public function setMarkerIconWidthSetsMarkerIconWidth(): void self::assertSame( 123456, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -654,7 +654,7 @@ public function setMarkerIconWidthWithStringResultsInInteger(): void self::assertSame( 123, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -667,7 +667,7 @@ public function setMarkerIconWidthWithBooleanResultsInInteger(): void self::assertSame( 1, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -678,7 +678,7 @@ public function getMarkerIconHeightInitiallyReturns40(): void { self::assertSame( 40, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -691,7 +691,7 @@ public function setMarkerIconHeightSetsMarkerIconHeight(): void self::assertSame( 123456, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -704,7 +704,7 @@ public function setMarkerIconHeightWithStringResultsInInteger(): void self::assertSame( 123, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -717,7 +717,7 @@ public function setMarkerIconHeightWithBooleanResultsInInteger(): void self::assertSame( 1, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -728,7 +728,7 @@ public function getMarkerIconAnchorPosXInitiallyReturns13(): void { self::assertSame( 13, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -741,7 +741,7 @@ public function setMarkerIconAnchorPosXSetsMarkerIconAnchorPosX(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -754,7 +754,7 @@ public function setMarkerIconAnchorPosXWithStringResultsInInteger(): void self::assertSame( 123, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -767,7 +767,7 @@ public function setMarkerIconAnchorPosXWithBooleanResultsInInteger(): void self::assertSame( 1, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -778,7 +778,7 @@ public function getMarkerIconAnchorPosYInitiallyReturns40(): void { self::assertSame( 40, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -791,7 +791,7 @@ public function setMarkerIconAnchorPosYSetsMarkerIconAnchorPosY(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -804,7 +804,7 @@ public function setMarkerIconAnchorPosYWithStringResultsInInteger(): void self::assertSame( 123, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -817,7 +817,7 @@ public function setMarkerIconAnchorPosYWithBooleanResultsInInteger(): void self::assertSame( 1, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } } diff --git a/Tests/Functional/Controller/PoiCollectionControllerTest.php b/Tests/Functional/Controller/PoiCollectionControllerTest.php index 6f49cd87..77f17759 100644 --- a/Tests/Functional/Controller/PoiCollectionControllerTest.php +++ b/Tests/Functional/Controller/PoiCollectionControllerTest.php @@ -45,7 +45,7 @@ protected function setUp(): void protected function tearDown(): void { unset( - $this->subject + $this->subject, ); parent::tearDown(); @@ -59,7 +59,7 @@ public function showActionWillShowPoiCollectionDefinedInPlugin(): void $this->importCSVDataSet(__DIR__ . '/../Fixtures/tt_content-with-poicollection.csv'); $response = $this->executeFrontendSubRequest( - (new InternalRequest())->withPageId(1) + (new InternalRequest())->withPageId(1), ); self::assertSame(200, $response->getStatusCode()); @@ -68,12 +68,12 @@ public function showActionWillShowPoiCollectionDefinedInPlugin(): void self::assertStringContainsString( '"title":"Jochen"', - $content + $content, ); self::assertStringNotContainsString( 'data-pois="{}"', - $content + $content, ); } @@ -85,7 +85,7 @@ public function showActionWithCategoriesButWithoutPoiCollectionsAddsEmptyPois(): $this->importCSVDataSet(__DIR__ . '/../Fixtures/tt_content-with-category-uid-2.csv'); $response = $this->executeFrontendSubRequest( - (new InternalRequest())->withPageId(1) + (new InternalRequest())->withPageId(1), ); self::assertSame(200, $response->getStatusCode()); @@ -94,7 +94,7 @@ public function showActionWithCategoriesButWithoutPoiCollectionsAddsEmptyPois(): self::assertStringContainsString( 'data-pois="{}"', - $content + $content, ); } @@ -108,7 +108,7 @@ public function showActionWithCategoriesWillShowPoiCollection(): void $this->importCSVDataSet(__DIR__ . '/../Fixtures/tt_content-with-category-uid-1.csv'); $response = $this->executeFrontendSubRequest( - (new InternalRequest())->withPageId(1) + (new InternalRequest())->withPageId(1), ); self::assertSame(200, $response->getStatusCode()); @@ -117,12 +117,12 @@ public function showActionWithCategoriesWillShowPoiCollection(): void self::assertStringContainsString( '"title":"Jochen"', - $content + $content, ); self::assertStringNotContainsString( 'data-pois="{}"', - $content + $content, ); } @@ -134,7 +134,7 @@ public function showActionWithStorageFoldersWithPoiCollections(): void $this->importCSVDataSet(__DIR__ . '/../Fixtures/tt_content-with-pages.csv'); $response = $this->executeFrontendSubRequest( - (new InternalRequest())->withPageId(1) + (new InternalRequest())->withPageId(1), ); self::assertSame(200, $response->getStatusCode()); @@ -143,16 +143,16 @@ public function showActionWithStorageFoldersWithPoiCollections(): void self::assertStringContainsString( '"title":"Jochen"', - $content + $content, ); self::assertStringContainsString( '"title":"Stefan"', - $content + $content, ); self::assertStringNotContainsString( 'data-pois="{}"', - $content + $content, ); } } diff --git a/Tests/Functional/Domain/Model/CategoryTest.php b/Tests/Functional/Domain/Model/CategoryTest.php index 12e7e05b..95ddc6f2 100644 --- a/Tests/Functional/Domain/Model/CategoryTest.php +++ b/Tests/Functional/Domain/Model/CategoryTest.php @@ -47,7 +47,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->extConf + $this->extConf, ); parent::tearDown(); @@ -60,7 +60,7 @@ public function getMaps2MarkerIconsInitiallyReturnsObjectStorage(): void { self::assertEquals( new ObjectStorage(), - $this->subject->getMaps2MarkerIcons() + $this->subject->getMaps2MarkerIcons(), ); } @@ -77,7 +77,7 @@ public function setMaps2MarkerIconsSetsMaps2MarkerIcons(): void self::assertSame( $objectStorage, - $this->subject->getMaps2MarkerIcons() + $this->subject->getMaps2MarkerIcons(), ); } @@ -88,7 +88,7 @@ public function getMaps2MarkerIconWithEmptyStorageWillReturnEmptyString(): void { self::assertSame( '', - $this->subject->getMaps2MarkerIcon() + $this->subject->getMaps2MarkerIcon(), ); } @@ -108,7 +108,7 @@ public function getMaps2MarkerIconWithMissingCoreFileReferenceWillReturnEmptyStr self::assertSame( '', - $this->subject->getMaps2MarkerIcon() + $this->subject->getMaps2MarkerIcon(), ); } @@ -121,7 +121,7 @@ public function getMaps2MarkerIconWithWrongObjectInStorageWillReturnEmptyString( self::assertSame( '', - $this->subject->getMaps2MarkerIcon() + $this->subject->getMaps2MarkerIcon(), ); } @@ -153,7 +153,7 @@ public function getMaps2MarkerIconWillReturnIconPath(): void self::assertStringEndsWith( 'ImagePath', - $this->subject->getMaps2MarkerIcon() + $this->subject->getMaps2MarkerIcon(), ); } @@ -164,7 +164,7 @@ public function getMaps2MarkerIconWidthInitiallyReturns25(): void { self::assertSame( 25, - $this->subject->getMaps2MarkerIconWidth() + $this->subject->getMaps2MarkerIconWidth(), ); } @@ -182,7 +182,7 @@ public function getMaps2MarkerIconWidthReturnsValueFromExtConfIfEmpty(): void self::assertSame( 123, - $this->subject->getMaps2MarkerIconWidth() + $this->subject->getMaps2MarkerIconWidth(), ); } @@ -195,7 +195,7 @@ public function getMaps2MarkerIconWidthReturnsValueFromExtConfIfImageIsEmpty(): $this->extConf->setMarkerIconWidth(321); self::assertSame( 321, - $this->subject->getMaps2MarkerIconWidth() + $this->subject->getMaps2MarkerIconWidth(), ); } @@ -212,7 +212,7 @@ public function setMaps2MarkerIconWidthSetsMaps2MarkerIconWidth(): void $this->subject->setMaps2MarkerIconWidth(123456); self::assertSame( 123456, - $this->subject->getMaps2MarkerIconWidth() + $this->subject->getMaps2MarkerIconWidth(), ); } @@ -223,7 +223,7 @@ public function getMaps2MarkerIconHeightInitiallyReturnsZero(): void { self::assertSame( 40, - $this->subject->getMaps2MarkerIconHeight() + $this->subject->getMaps2MarkerIconHeight(), ); } @@ -240,7 +240,7 @@ public function getMaps2MarkerIconHeightReturnsValueFromExtConfIfEmpty(): void $this->extConf->setMarkerIconHeight(123); self::assertSame( 123, - $this->subject->getMaps2MarkerIconHeight() + $this->subject->getMaps2MarkerIconHeight(), ); } @@ -253,7 +253,7 @@ public function getMaps2MarkerIconHeightReturnsValueFromExtConfIfImageIsEmpty(): $this->extConf->setMarkerIconHeight(321); self::assertSame( 321, - $this->subject->getMaps2MarkerIconHeight() + $this->subject->getMaps2MarkerIconHeight(), ); } @@ -270,7 +270,7 @@ public function setMaps2MarkerIconHeightSetsMaps2MarkerIconHeight(): void $this->subject->setMaps2MarkerIconHeight(123456); self::assertSame( 123456, - $this->subject->getMaps2MarkerIconHeight() + $this->subject->getMaps2MarkerIconHeight(), ); } @@ -281,7 +281,7 @@ public function getMaps2MarkerIconAnchorPosXInitiallyReturnsZero(): void { self::assertSame( 13, - $this->subject->getMaps2MarkerIconAnchorPosX() + $this->subject->getMaps2MarkerIconAnchorPosX(), ); } @@ -298,7 +298,7 @@ public function getMaps2MarkerIconAnchorPosXReturnsValueFromExtConfIfEmpty(): vo $this->extConf->setMarkerIconAnchorPosX(123); self::assertSame( 123, - $this->subject->getMaps2MarkerIconAnchorPosX() + $this->subject->getMaps2MarkerIconAnchorPosX(), ); } @@ -311,7 +311,7 @@ public function getMaps2MarkerIconAnchorPosXReturnsValueFromExtConfIfImageIsEmpt $this->extConf->setMarkerIconAnchorPosX(321); self::assertSame( 321, - $this->subject->getMaps2MarkerIconAnchorPosX() + $this->subject->getMaps2MarkerIconAnchorPosX(), ); } @@ -328,7 +328,7 @@ public function setMaps2MarkerIconAnchorPosXSetsMaps2MarkerIconAnchorPosX(): voi $this->subject->setMaps2MarkerIconAnchorPosX(123456); self::assertSame( 123456, - $this->subject->getMaps2MarkerIconAnchorPosX() + $this->subject->getMaps2MarkerIconAnchorPosX(), ); } @@ -339,7 +339,7 @@ public function getMaps2MarkerIconAnchorPosYInitiallyReturnsZero(): void { self::assertSame( 40, - $this->subject->getMaps2MarkerIconAnchorPosY() + $this->subject->getMaps2MarkerIconAnchorPosY(), ); } @@ -356,7 +356,7 @@ public function getMaps2MarkerIconAnchorPosYReturnsValueFromExtConfIfEmpty(): vo $this->extConf->setMarkerIconAnchorPosY(123); self::assertSame( 123, - $this->subject->getMaps2MarkerIconAnchorPosY() + $this->subject->getMaps2MarkerIconAnchorPosY(), ); } @@ -369,7 +369,7 @@ public function getMaps2MarkerIconAnchorPosYWidthReturnsValueFromExtConfIfImageI $this->extConf->setMarkerIconAnchorPosY(321); self::assertSame( 321, - $this->subject->getMaps2MarkerIconAnchorPosY() + $this->subject->getMaps2MarkerIconAnchorPosY(), ); } @@ -386,7 +386,7 @@ public function setMaps2MarkerIconAnchorPosYSetsMaps2MarkerIconAnchorPosY(): voi $this->subject->setMaps2MarkerIconAnchorPosY(123456); self::assertSame( 123456, - $this->subject->getMaps2MarkerIconAnchorPosY() + $this->subject->getMaps2MarkerIconAnchorPosY(), ); } @@ -397,7 +397,7 @@ public function getSortingInitiallyReturnsZero(): void { self::assertSame( 0, - $this->subject->getSorting() + $this->subject->getSorting(), ); } @@ -410,7 +410,7 @@ public function setSortingSetsSorting(): void self::assertSame( 123456, - $this->subject->getSorting() + $this->subject->getSorting(), ); } } diff --git a/Tests/Functional/Domain/Model/PoiCollectionTest.php b/Tests/Functional/Domain/Model/PoiCollectionTest.php index a4819c63..d5be69a0 100644 --- a/Tests/Functional/Domain/Model/PoiCollectionTest.php +++ b/Tests/Functional/Domain/Model/PoiCollectionTest.php @@ -50,7 +50,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->extConf + $this->extConf, ); parent::tearDown(); @@ -63,7 +63,7 @@ public function getCollectionTypeInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getCollectionType() + $this->subject->getCollectionType(), ); } @@ -76,7 +76,7 @@ public function setCollectionTypeSetsCollectionType(): void self::assertSame( 'foo bar', - $this->subject->getCollectionType() + $this->subject->getCollectionType(), ); } @@ -87,7 +87,7 @@ public function getTitleInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getTitle() + $this->subject->getTitle(), ); } @@ -100,7 +100,7 @@ public function setTitleSetsTitle(): void self::assertSame( 'foo bar', - $this->subject->getTitle() + $this->subject->getTitle(), ); } @@ -111,7 +111,7 @@ public function getAddressInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getAddress() + $this->subject->getAddress(), ); } @@ -124,7 +124,7 @@ public function setAddressSetsAddress(): void self::assertSame( 'foo bar', - $this->subject->getAddress() + $this->subject->getAddress(), ); } @@ -135,7 +135,7 @@ public function getLatitudeInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getLatitude() + $this->subject->getLatitude(), ); } @@ -148,7 +148,7 @@ public function setLatitudeSetsLatitude(): void self::assertSame( 1234.56, - $this->subject->getLatitude() + $this->subject->getLatitude(), ); } @@ -159,7 +159,7 @@ public function getLongitudeInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getLongitude() + $this->subject->getLongitude(), ); } @@ -172,7 +172,7 @@ public function setLongitudeSetsLongitude(): void self::assertSame( 1234.56, - $this->subject->getLongitude() + $this->subject->getLongitude(), ); } @@ -183,7 +183,7 @@ public function getRadiusInitiallyReturnsZero(): void { self::assertSame( 0, - $this->subject->getRadius() + $this->subject->getRadius(), ); } @@ -196,7 +196,7 @@ public function setRadiusSetsRadius(): void self::assertSame( 123456, - $this->subject->getRadius() + $this->subject->getRadius(), ); } @@ -207,7 +207,7 @@ public function getPoisInitiallyReturnsEmptyArray(): void { self::assertSame( [], - $this->subject->getPois() + $this->subject->getPois(), ); } @@ -218,7 +218,7 @@ public function getStrokeColorInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getStrokeColor() + $this->subject->getStrokeColor(), ); } @@ -231,7 +231,7 @@ public function setStrokeColorSetsStrokeColor(): void self::assertSame( 'foo bar', - $this->subject->getStrokeColor() + $this->subject->getStrokeColor(), ); } @@ -242,7 +242,7 @@ public function getStrokeOpacityInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getStrokeOpacity() + $this->subject->getStrokeOpacity(), ); } @@ -255,7 +255,7 @@ public function setStrokeOpacitySetsStrokeOpacity(): void self::assertSame( 'foo bar', - $this->subject->getStrokeOpacity() + $this->subject->getStrokeOpacity(), ); } @@ -266,7 +266,7 @@ public function getStrokeWeightInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getStrokeWeight() + $this->subject->getStrokeWeight(), ); } @@ -279,7 +279,7 @@ public function setStrokeWeightSetsStrokeWeight(): void self::assertSame( 'foo bar', - $this->subject->getStrokeWeight() + $this->subject->getStrokeWeight(), ); } @@ -290,7 +290,7 @@ public function getFillColorInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getFillColor() + $this->subject->getFillColor(), ); } @@ -303,7 +303,7 @@ public function setFillColorSetsFillColor(): void self::assertSame( 'foo bar', - $this->subject->getFillColor() + $this->subject->getFillColor(), ); } @@ -314,7 +314,7 @@ public function getFillOpacityInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getFillOpacity() + $this->subject->getFillOpacity(), ); } @@ -327,7 +327,7 @@ public function setFillOpacitySetsFillOpacity(): void self::assertSame( 'foo bar', - $this->subject->getFillOpacity() + $this->subject->getFillOpacity(), ); } @@ -338,7 +338,7 @@ public function getInfoWindowContentInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getInfoWindowContent() + $this->subject->getInfoWindowContent(), ); } @@ -351,7 +351,7 @@ public function setInfoWindowContentSetsInfoWindowContent(): void self::assertSame( 'foo bar', - $this->subject->getInfoWindowContent() + $this->subject->getInfoWindowContent(), ); } @@ -362,7 +362,7 @@ public function getInfoWindowImagesInitiallyReturnsObjectStorage(): void { self::assertEquals( new ObjectStorage(), - $this->subject->getInfoWindowImages() + $this->subject->getInfoWindowImages(), ); } @@ -379,7 +379,7 @@ public function setInfoWindowImagesSetsInfoWindowImages(): void self::assertSame( $objectStorage, - $this->subject->getInfoWindowImages() + $this->subject->getInfoWindowImages(), ); } @@ -398,7 +398,7 @@ public function addInfoWindowImageAddsOneInfoWindowImage(): void self::assertSame( $objectStorage, - $this->subject->getInfoWindowImages() + $this->subject->getInfoWindowImages(), ); } @@ -418,7 +418,7 @@ public function removeInfoWindowImageRemovesOneInfoWindowImage(): void self::assertSame( $objectStorage, - $this->subject->getInfoWindowImages() + $this->subject->getInfoWindowImages(), ); } @@ -429,7 +429,7 @@ public function getMarkerIconsInitiallyReturnsObjectStorage(): void { self::assertEquals( new ObjectStorage(), - $this->subject->getMarkerIcons() + $this->subject->getMarkerIcons(), ); } @@ -446,7 +446,7 @@ public function setMarkerIconsSetsMarkerIcons(): void self::assertSame( $objectStorage, - $this->subject->getMarkerIcons() + $this->subject->getMarkerIcons(), ); } @@ -466,7 +466,7 @@ public function addMarkerIconAddsOneMarkerIcon(): void self::assertSame( $objectStorage, - $this->subject->getMarkerIcons() + $this->subject->getMarkerIcons(), ); } @@ -486,7 +486,7 @@ public function removeMarkerIconRemovesOneMarkerIcon(): void self::assertSame( $objectStorage, - $this->subject->getMarkerIcons() + $this->subject->getMarkerIcons(), ); } @@ -497,7 +497,7 @@ public function getMarkerIconWidthInitiallyReturnsZero(): void { self::assertSame( 25, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -515,7 +515,7 @@ public function setMarkerIconWidthSetsMarkerIconWidth(): void self::assertSame( 123456, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -534,7 +534,7 @@ public function setMarkerIconWidthWillGetValueFromCategoryIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -554,7 +554,7 @@ public function setMarkerIconWidthWillGetValueFromCategoryIfImageIsEmpty(): void self::assertSame( 654321, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -567,7 +567,7 @@ public function setMarkerIconWidthWillGetValueFromExtConfIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -581,7 +581,7 @@ public function setMarkerIconWidthWillGetValueFromExtConfIfImageIsEmpty(): void self::assertSame( 654321, - $this->subject->getMarkerIconWidth() + $this->subject->getMarkerIconWidth(), ); } @@ -592,7 +592,7 @@ public function getMarkerIconHeightInitiallyReturnsZero(): void { self::assertSame( 40, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -610,7 +610,7 @@ public function setMarkerIconHeightSetsMarkerIconHeight(): void self::assertSame( 123456, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -629,7 +629,7 @@ public function setMarkerIconHeightWillGetValueFromCategoryIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -649,7 +649,7 @@ public function setMarkerIconHeightWillGetValueFromCategoryIfImageIsEmpty(): voi self::assertSame( 654321, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -662,7 +662,7 @@ public function setMarkerIconHeightWillGetValueFromExtConfIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -673,7 +673,7 @@ public function getMarkerIconAnchorPosXInitiallyReturnsZero(): void { self::assertSame( 13, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -692,7 +692,7 @@ public function setMarkerIconAnchorPosXSetsMarkerIconAnchorPosX(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -711,7 +711,7 @@ public function setMarkerIconAnchorPosXWillGetValueFromCategoryIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -731,7 +731,7 @@ public function setMarkerIconAnchorPosXWillGetValueFromCategoryIfImageIsEmpty(): self::assertSame( 654321, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -744,7 +744,7 @@ public function setMarkerIconAnchorPosXWillGetValueFromExtConfIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -758,7 +758,7 @@ public function setMarkerIconAnchorPosXWillGetValueFromExtConfIfImageIsEmpty(): self::assertSame( 654321, - $this->subject->getMarkerIconAnchorPosX() + $this->subject->getMarkerIconAnchorPosX(), ); } @@ -772,7 +772,7 @@ public function setMarkerIconHeightWillGetValueFromExtConfIfImageIsEmpty(): void self::assertSame( 654321, - $this->subject->getMarkerIconHeight() + $this->subject->getMarkerIconHeight(), ); } @@ -783,7 +783,7 @@ public function getMarkerIconAnchorPosYInitiallyReturnsZero(): void { self::assertSame( 40, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -802,7 +802,7 @@ public function setMarkerIconAnchorPosYSetsMarkerIconAnchorPosY(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -821,7 +821,7 @@ public function setMarkerIconAnchorPosYWillGetValueFromCategoryIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -841,7 +841,7 @@ public function setMarkerIconAnchorPosYWillGetValueFromCategoryIfImageIsEmpty(): self::assertSame( 654321, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -854,7 +854,7 @@ public function setMarkerIconAnchorPosYWillGetValueFromExtConfIfEmpty(): void self::assertSame( 123456, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -868,7 +868,7 @@ public function setMarkerIconAnchorPosYWillGetValueFromExtConfIfImageIsEmpty(): self::assertSame( 654321, - $this->subject->getMarkerIconAnchorPosY() + $this->subject->getMarkerIconAnchorPosY(), ); } @@ -879,7 +879,7 @@ public function getCategoriesInitiallyReturnsObjectStorage(): void { self::assertEquals( new ObjectStorage(), - $this->subject->getCategories() + $this->subject->getCategories(), ); } @@ -896,7 +896,7 @@ public function setCategoriesSetsCategories(): void self::assertSame( $objectStorage, - $this->subject->getCategories() + $this->subject->getCategories(), ); } @@ -916,7 +916,7 @@ public function addCategoryAddsOneCategory(): void self::assertSame( $objectStorage, - $this->subject->getCategories() + $this->subject->getCategories(), ); } @@ -937,7 +937,7 @@ public function removeCategoryRemovesOneCategory(): void self::assertSame( $objectStorage, - $this->subject->getCategories() + $this->subject->getCategories(), ); } @@ -948,7 +948,7 @@ public function getDistanceInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getDistance() + $this->subject->getDistance(), ); } @@ -961,7 +961,7 @@ public function setDistanceSetsDistance(): void self::assertSame( 1234.56, - $this->subject->getDistance() + $this->subject->getDistance(), ); } @@ -972,7 +972,7 @@ public function getForeignRecordsInitiallyReturnsArray(): void { self::assertSame( [], - $this->subject->getForeignRecords() + $this->subject->getForeignRecords(), ); } @@ -986,7 +986,7 @@ public function setForeignRecordsSetsForeignRecords(): void [ 'uid' => 12, ], - ] + ], ); self::assertSame( @@ -995,7 +995,7 @@ public function setForeignRecordsSetsForeignRecords(): void 'uid' => 12, ], ], - $this->subject->getForeignRecords() + $this->subject->getForeignRecords(), ); } @@ -1007,7 +1007,7 @@ public function addForeignRecordAddsOneForeignRecord(): void $this->subject->addForeignRecord( [ 'uid' => 12, - ] + ], ); self::assertSame( @@ -1016,7 +1016,7 @@ public function addForeignRecordAddsOneForeignRecord(): void 'uid' => 12, ], ], - $this->subject->getForeignRecords() + $this->subject->getForeignRecords(), ); } @@ -1030,18 +1030,18 @@ public function removeForeignRecordRemovesOneForeignRecord(): void [ 'uid' => 12, ], - ] + ], ); $this->subject->removeForeignRecord( [ 'uid' => 12, - ] + ], ); self::assertSame( [], - $this->subject->getForeignRecords() + $this->subject->getForeignRecords(), ); } } diff --git a/Tests/Functional/ExpressionLanguage/AllowMapProviderRequestFunctionsProviderTest.php b/Tests/Functional/ExpressionLanguage/AllowMapProviderRequestFunctionsProviderTest.php index 2fc95392..d03875f4 100644 --- a/Tests/Functional/ExpressionLanguage/AllowMapProviderRequestFunctionsProviderTest.php +++ b/Tests/Functional/ExpressionLanguage/AllowMapProviderRequestFunctionsProviderTest.php @@ -46,7 +46,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->mapHelperMock + $this->mapHelperMock, ); parent::tearDown(); @@ -78,15 +78,15 @@ public function getFunctionsWillReturnSpecificExpressionFunction(): void self::assertSame( 'isRequestToMapProviderAllowed', - $expressionFunction->getName() + $expressionFunction->getName(), ); self::assertNull( - call_user_func($expressionFunction->getCompiler()) + call_user_func($expressionFunction->getCompiler()), ); self::assertTrue( - call_user_func($expressionFunction->getEvaluator(), ['foo' => 'bar']) + call_user_func($expressionFunction->getEvaluator(), ['foo' => 'bar']), ); } } diff --git a/Tests/Functional/Form/Element/GoogleMapsElementTest.php b/Tests/Functional/Form/Element/GoogleMapsElementTest.php index 99536385..308965bc 100644 --- a/Tests/Functional/Form/Element/GoogleMapsElementTest.php +++ b/Tests/Functional/Form/Element/GoogleMapsElementTest.php @@ -86,7 +86,7 @@ protected function setUp(): void $this->subject = new GoogleMapsElement( GeneralUtility::makeInstance(NodeFactory::class), - $this->data + $this->data, ); } @@ -97,7 +97,7 @@ protected function tearDown(): void $this->extConf, $this->pageRendererMock, $this->mapHelperMock, - $this->viewMock + $this->viewMock, ); parent::tearDown(); @@ -115,7 +115,7 @@ public function renderWillCleanUpCurrentRecord(): void ->expects(self::atLeastOnce()) ->method('setTemplatePathAndFilename') ->with( - self::stringContains('Resources/Private/Templates/Tca/GoogleMaps.html') + self::stringContains('Resources/Private/Templates/Tca/GoogleMaps.html'), ); $this->viewMock ->expects(self::atLeastOnce()) diff --git a/Tests/Functional/Form/Element/OpenStreetMapElementTest.php b/Tests/Functional/Form/Element/OpenStreetMapElementTest.php index 5b646a98..461973da 100644 --- a/Tests/Functional/Form/Element/OpenStreetMapElementTest.php +++ b/Tests/Functional/Form/Element/OpenStreetMapElementTest.php @@ -86,7 +86,7 @@ protected function setUp(): void $this->subject = new OpenStreetMapElement( GeneralUtility::makeInstance(NodeFactory::class), - $this->data + $this->data, ); } @@ -97,7 +97,7 @@ protected function tearDown(): void $this->extConf, $this->pageRendererMock, $this->mapHelperMock, - $this->viewMock + $this->viewMock, ); parent::tearDown(); @@ -115,7 +115,7 @@ public function renderWillCleanUpCurrentRecord(): void ->expects(self::atLeastOnce()) ->method('setTemplatePathAndFilename') ->with( - self::stringContains('Resources/Private/Templates/Tca/OpenStreetMap.html') + self::stringContains('Resources/Private/Templates/Tca/OpenStreetMap.html'), ); $this->viewMock ->expects(self::atLeastOnce()) diff --git a/Tests/Functional/Helper/AddressHelperTest.php b/Tests/Functional/Helper/AddressHelperTest.php index 44cc22a5..534d19c8 100644 --- a/Tests/Functional/Helper/AddressHelperTest.php +++ b/Tests/Functional/Helper/AddressHelperTest.php @@ -52,7 +52,7 @@ protected function setUp(): void $this->subject = new AddressHelper( $this->messageHelperMock, - $this->extConf + $this->extConf, ); } @@ -61,7 +61,7 @@ protected function tearDown(): void unset( $this->subject, $this->messageHelperMock, - $this->extConf + $this->extConf, ); parent::tearDown(); @@ -78,7 +78,7 @@ public function getAddressWithMissingAddressColumnsKeyAddsFlashMessage(): void ->with( self::stringContains('addressColumns'), 'Key addressColumns is missing', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $record = [ @@ -89,7 +89,7 @@ public function getAddressWithMissingAddressColumnsKeyAddsFlashMessage(): void self::assertSame( '', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -104,7 +104,7 @@ public function getAddressWithEmptyAddressColumnsAddsFlashMessage(): void ->with( self::stringContains('required field'), 'Key addressColumns is empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $record = [ @@ -117,7 +117,7 @@ public function getAddressWithEmptyAddressColumnsAddsFlashMessage(): void self::assertSame( '', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -162,7 +162,7 @@ public function getAddressWithoutCountryAndNoFallbackGeneratesTwoFlashMessages() self::assertSame( 'Mainstreet 17 23145 Munich', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -177,7 +177,7 @@ public function getAddressWithoutCountryButWithMaps2FallbackGeneratesOneFlashMes ->with( self::stringContains('We can not find any country information within your extension'), 'No country information found', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); $this->extConf->setDefaultCountry('Germany'); @@ -196,7 +196,7 @@ public function getAddressWithoutCountryButWithMaps2FallbackGeneratesOneFlashMes self::assertSame( 'Mainstreet 17 23145 Munich Germany', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -219,7 +219,7 @@ public function getAddressWithoutCountryButWithMaps2RegistryFallbackGeneratesNoF self::assertSame( 'Mainstreet 17 23145 Paris France', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -244,7 +244,7 @@ public function getAddressWithCountryUidWillGetCountryNameFromStaticCountries(): ->with( self::stringContains('We can not find any country information within your extension'), 'No country information found', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); /** @var PackageManager|MockObject $packageManagerMock */ @@ -271,7 +271,7 @@ public function getAddressWithCountryUidWillGetCountryNameFromStaticCountries(): self::assertSame( 'Mainstreet 17 23145 Filderstadt Germany', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -295,7 +295,7 @@ public function getAddressWithCountryUidWillNotFindCountryNameFromStaticCountrie ->with( self::stringContains('static_countries table'), 'Country not found in DB', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); $record = [ @@ -313,7 +313,7 @@ public function getAddressWithCountryUidWillNotFindCountryNameFromStaticCountrie self::assertSame( 'Mainstreet 17 23145 Warschau', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -337,7 +337,7 @@ public function getAddressWillUnifyMaps2RegistryOptions(): void self::assertSame( 'Mainstreet 17 23145 Madrid Spain', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -361,7 +361,7 @@ public function getAddressWillRemoveCountryFromAddressColumnsIfAvailable(): void self::assertSame( 'Mainstreet 17 23145 Madrid Spain', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -386,7 +386,7 @@ public function getAddressWillConvertCommaSeparatedAddressColumnsIntoArray(): vo self::assertSame( 'Mainstreet 23 00367 Madrid Spain', - $this->subject->getAddress($record, $options) + $this->subject->getAddress($record, $options), ); } @@ -428,7 +428,7 @@ public function isSameAddressWithCommaAndSpacesWillReturnTrue(string $address): ]; self::assertTrue( - $this->subject->isSameAddress($address, $foreignLocationRecord, $options) + $this->subject->isSameAddress($address, $foreignLocationRecord, $options), ); } } diff --git a/Tests/Functional/Helper/MessageHelperTest.php b/Tests/Functional/Helper/MessageHelperTest.php index fca9312f..cb23a7fd 100644 --- a/Tests/Functional/Helper/MessageHelperTest.php +++ b/Tests/Functional/Helper/MessageHelperTest.php @@ -36,14 +36,14 @@ protected function setUp(): void $this->setUpBackendUser(1); $this->subject = new MessageHelper( - new FlashMessageService() + new FlashMessageService(), ); } protected function tearDown(): void { unset( - $this->subject + $this->subject, ); parent::tearDown(); @@ -58,14 +58,14 @@ public function addFlashMessageWithMessageCallsEnqueue(): void 'Hello', '', ContextualFeedbackSeverity::OK, - false + false, ); $this->subject->addFlashMessage('Hello'); self::assertEquals( [$expectedFlashMessage], - $this->subject->getAllFlashMessages() + $this->subject->getAllFlashMessages(), ); } @@ -78,14 +78,14 @@ public function addFlashMessageWithMessageAndSubjectCallsEnqueue(): void 'Hello', 'Subject', ContextualFeedbackSeverity::OK, - false + false, ); $this->subject->addFlashMessage('Hello', 'Subject'); self::assertEquals( [$expectedFlashMessage], - $this->subject->getAllFlashMessages() + $this->subject->getAllFlashMessages(), ); } @@ -98,14 +98,14 @@ public function addFlashMessageWithAllArgumentsCallsEnqueue(): void 'Hello', 'Subject', ContextualFeedbackSeverity::ERROR, - false + false, ); $this->subject->addFlashMessage('Hello', 'Subject', ContextualFeedbackSeverity::ERROR); self::assertEquals( [$expectedFlashMessage], - $this->subject->getAllFlashMessages() + $this->subject->getAllFlashMessages(), ); } @@ -121,11 +121,11 @@ public function getAllFlashMessagesReturnsAllFlashMessages(): void // Test two times, to be safe that messages were NOT flushed self::assertCount( 3, - $this->subject->getAllFlashMessages(false) + $this->subject->getAllFlashMessages(false), ); self::assertCount( 3, - $this->subject->getAllFlashMessages(false) + $this->subject->getAllFlashMessages(false), ); } @@ -141,11 +141,11 @@ public function getAllFlashMessagesReturnsAllFlashMessagesAndFlush(): void // Test two times, to be safe that messages were flushed self::assertCount( 3, - $this->subject->getAllFlashMessages() + $this->subject->getAllFlashMessages(), ); self::assertCount( 0, - $this->subject->getAllFlashMessages() + $this->subject->getAllFlashMessages(), ); } @@ -159,7 +159,7 @@ public function hasMessagesChecksQueueIfThereAreAnyMessages(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::ERROR); self::assertTrue( - $this->subject->hasMessages() + $this->subject->hasMessages(), ); } @@ -175,21 +175,21 @@ public function getFlashMessagesBySeverityAndFlushReturnsFlashMessages(): void // Test two times, to be save that messages were flushed self::assertCount( 1, - $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::ERROR) + $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::ERROR), ); self::assertCount( 0, - $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::ERROR) + $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::ERROR), ); // Test two times, to be save that messages were flushed self::assertCount( 2, - $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::WARNING) + $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::WARNING), ); self::assertCount( 0, - $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::WARNING) + $this->subject->getFlashMessagesBySeverityAndFlush(ContextualFeedbackSeverity::WARNING), ); } @@ -203,7 +203,7 @@ public function hasErrorMessagesReturnsTrue(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::ERROR); self::assertTrue( - $this->subject->hasErrorMessages() + $this->subject->hasErrorMessages(), ); } @@ -217,7 +217,7 @@ public function hasErrorMessagesReturnsFalse(): void $this->subject->addFlashMessage('together', 'together'); self::assertFalse( - $this->subject->hasErrorMessages() + $this->subject->hasErrorMessages(), ); } @@ -232,7 +232,7 @@ public function getErrorMessagesReturnsErrorMessages(): void self::assertCount( 2, - $this->subject->getErrorMessages() + $this->subject->getErrorMessages(), ); } @@ -246,7 +246,7 @@ public function hasWarningMessagesReturnsTrue(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::WARNING); self::assertTrue( - $this->subject->hasWarningMessages() + $this->subject->hasWarningMessages(), ); } @@ -260,7 +260,7 @@ public function hasWarningMessagesReturnsFalse(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::ERROR); self::assertFalse( - $this->subject->hasWarningMessages() + $this->subject->hasWarningMessages(), ); } @@ -275,7 +275,7 @@ public function getWarningMessagesReturnsErrorMessages(): void self::assertCount( 2, - $this->subject->getWarningMessages() + $this->subject->getWarningMessages(), ); } @@ -289,7 +289,7 @@ public function hasOkMessagesReturnsTrue(): void $this->subject->addFlashMessage('together', 'together'); self::assertTrue( - $this->subject->hasOkMessages() + $this->subject->hasOkMessages(), ); } @@ -303,7 +303,7 @@ public function hasOkMessagesReturnsFalse(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::WARNING); self::assertFalse( - $this->subject->hasOkMessages() + $this->subject->hasOkMessages(), ); } @@ -318,7 +318,7 @@ public function getOkMessagesReturnsErrorMessages(): void self::assertCount( 2, - $this->subject->getOkMessages() + $this->subject->getOkMessages(), ); } @@ -332,7 +332,7 @@ public function hasInfoMessagesReturnsTrue(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::INFO); self::assertTrue( - $this->subject->hasInfoMessages() + $this->subject->hasInfoMessages(), ); } @@ -346,7 +346,7 @@ public function hasInfoMessagesReturnsFalse(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::WARNING); self::assertFalse( - $this->subject->hasInfoMessages() + $this->subject->hasInfoMessages(), ); } @@ -361,7 +361,7 @@ public function getInfoMessagesReturnsErrorMessages(): void self::assertCount( 2, - $this->subject->getInfoMessages() + $this->subject->getInfoMessages(), ); } @@ -375,7 +375,7 @@ public function hasNoticeMessagesReturnsTrue(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::NOTICE); self::assertTrue( - $this->subject->hasNoticeMessages() + $this->subject->hasNoticeMessages(), ); } @@ -389,7 +389,7 @@ public function hasNoticeMessagesReturnsFalse(): void $this->subject->addFlashMessage('together', 'together', ContextualFeedbackSeverity::WARNING); self::assertFalse( - $this->subject->hasNoticeMessages() + $this->subject->hasNoticeMessages(), ); } @@ -404,7 +404,7 @@ public function getNoticeMessagesReturnsErrorMessages(): void self::assertCount( 2, - $this->subject->getNoticeMessages() + $this->subject->getNoticeMessages(), ); } } diff --git a/Tests/Functional/Helper/SettingsHelperTest.php b/Tests/Functional/Helper/SettingsHelperTest.php index 5982b1bd..e1ded060 100644 --- a/Tests/Functional/Helper/SettingsHelperTest.php +++ b/Tests/Functional/Helper/SettingsHelperTest.php @@ -96,7 +96,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->configurationManagerMock + $this->configurationManagerMock, ); parent::tearDown(); @@ -127,7 +127,7 @@ public function getMergedSettingsWillNotChangeAnySettings(): void self::assertSame( $this->mergedScriptSettings, - $this->subject->getMergedSettings() + $this->subject->getMergedSettings(), ); } @@ -160,7 +160,7 @@ public function getMergedSettingsWillOverrideEmptyInfoWindowContentTemplateWithT self::assertSame( 'EXT:maps2/Resources/Private/Templates/InfoWindowContent.html', - $this->subject->getMergedSettings()['infoWindowContentTemplatePath'] + $this->subject->getMergedSettings()['infoWindowContentTemplatePath'], ); } @@ -192,7 +192,7 @@ public function getMergedSettingsWithDeactivatedFullscreenMapControlWillKeepFlex self::assertSame( '0', - $this->subject->getMergedSettings()['fullscreenMapControl'] + $this->subject->getMergedSettings()['fullscreenMapControl'], ); } @@ -224,7 +224,7 @@ public function getMergedSettingsWithActivatedStreetViewControlWillKeepFlexFormS self::assertSame( '1', - $this->subject->getMergedSettings()['streetViewControl'] + $this->subject->getMergedSettings()['streetViewControl'], ); } } diff --git a/Tests/Functional/Helper/StoragePidHelperTest.php b/Tests/Functional/Helper/StoragePidHelperTest.php index ca3a01a3..6989a719 100644 --- a/Tests/Functional/Helper/StoragePidHelperTest.php +++ b/Tests/Functional/Helper/StoragePidHelperTest.php @@ -53,7 +53,7 @@ protected function tearDown(): void { unset( $this->subject, - $this->messageHelperMock + $this->messageHelperMock, ); parent::tearDown(); @@ -69,7 +69,7 @@ public function getStoragePidWithoutPidAndNoRegistryConfigurationWillAddFlashMes ->method('addFlashMessage') ->with( self::stringContains('Please check various places'), - 'Can not find a valid PID to store EXT:maps2 records' + 'Can not find a valid PID to store EXT:maps2 records', ); $recordWithoutPid = [ @@ -80,7 +80,7 @@ public function getStoragePidWithoutPidAndNoRegistryConfigurationWillAddFlashMes self::assertSame( 0, - $this->subject->getDefaultStoragePidForNewPoiCollection($recordWithoutPid, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($recordWithoutPid, $options), ); } @@ -120,7 +120,7 @@ public function getStoragePidWithPidInForeignRecordWillReturnStoragePid(): void self::assertSame( 200, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -162,7 +162,7 @@ public function getStoragePidWithHardCodedMaps2RegistryWillReturnStoragePid(): v self::assertSame( 428, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -204,7 +204,7 @@ public function getStoragePidWithHardCodedMaps2RegistryWillReturnUnifiedStorageP self::assertSame( 428, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -239,7 +239,7 @@ public function getStoragePidWithoutPidWillReturnPidFromExtensionManager(): void self::assertSame( 385, - $this->subject->getDefaultStoragePidForNewPoiCollection($recordWithoutPid, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($recordWithoutPid, $options), ); } @@ -297,7 +297,7 @@ public function getStoragePidWithPidWillReturnPidFromExtensionManager(): void self::assertSame( 197, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -356,7 +356,7 @@ public function getStoragePidWithPidAndTypeWillReturnPidFromExtensionManager(): self::assertSame( 197, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -402,7 +402,7 @@ public function getStoragePidWithPidWillReturnPidFromDefaultPageTsConfigPath(): self::assertSame( 582, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -454,7 +454,7 @@ public function getStoragePidWithPidWillReturnPidFromConfiguredPageTsConfigPath( self::assertSame( 582, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -506,7 +506,7 @@ public function getStoragePidWithPidWillOverridePidOfForeignExtWithPidOfDefaultP self::assertSame( 927, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -554,7 +554,7 @@ public function getStoragePidWithPidWillOverridePidOfExtensionManagerWithPidOfPa self::assertSame( 582, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -641,7 +641,7 @@ public function getStoragePidWithPidWillProcessVariousRegistryConfiguration(): v self::assertSame( 4297, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -728,7 +728,7 @@ public function getStoragePidWithPidWillProcessTwoRegistryConfiguration(): void self::assertSame( 4867, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } @@ -815,7 +815,7 @@ public function getStoragePidWithPidWillOverrideForeignPidWithPidOfDefaultPageTs self::assertSame( 5837, - $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options) + $this->subject->getDefaultStoragePidForNewPoiCollection($record, $options), ); } } diff --git a/Tests/Functional/Hook/CreateMaps2RecordHookTest.php b/Tests/Functional/Hook/CreateMaps2RecordHookTest.php index 2863d258..9f84cdd2 100644 --- a/Tests/Functional/Hook/CreateMaps2RecordHookTest.php +++ b/Tests/Functional/Hook/CreateMaps2RecordHookTest.php @@ -130,10 +130,10 @@ protected function setUp(): void $this->messageHelperMock, $this->maps2RegistryMock, GeneralUtility::makeInstance(ExtConf::class), - GeneralUtility::makeInstance(EventDispatcher::class) + GeneralUtility::makeInstance(EventDispatcher::class), ), $this->maps2RegistryMock, - $this->eventDispatcherMock + $this->eventDispatcherMock, ); } @@ -146,7 +146,7 @@ protected function tearDown(): void $this->mapService, $this->eventDispatcher, $this->maps2RegistryMock, - $this->eventDispatcherMock + $this->eventDispatcherMock, ); parent::tearDown(); @@ -183,7 +183,7 @@ public function processDatamapWithInvalidTableNameWillNotStartRecordCreation(): ->method('dispatch'); $this->subject->processDatamap_afterAllOperations( - new DataHandler() + new DataHandler(), ); } @@ -199,7 +199,7 @@ public function processDatamapClearsInfoWindowContentCacheIfTableIsPoiCollection ->method('flushByTag') ->with(self::logicalOr( self::equalTo('infoWindowUid123'), - self::equalTo('infoWindowUid234') + self::equalTo('infoWindowUid234'), )); $cacheManagerMock = $this->createMock(CacheManager::class); @@ -313,7 +313,7 @@ public function dataProcessorForExpressions(): array */ public function processDatamapInvalidForeignRecordBecauseExpressionsAreNotEqual( array $columnMatch, - bool $isValid + bool $isValid, ): void { $this->creationAllowed = $isValid; diff --git a/Tests/Functional/OverlayTest.php b/Tests/Functional/OverlayTest.php index d8222ded..9171b414 100644 --- a/Tests/Functional/OverlayTest.php +++ b/Tests/Functional/OverlayTest.php @@ -39,7 +39,7 @@ protected function setUp(): void [ 'EXT:maps2/Tests/Functional/Fixtures/TypoScript/setup.typoscript', 'EXT:maps2/Tests/Functional/Fixtures/TypoScript/activate-plugin-overlay.typoscript', - ] + ], ); } @@ -49,12 +49,12 @@ protected function setUp(): void public function overlayWillAskForConsent(): void { $response = $this->executeFrontendSubRequest( - (new InternalRequest())->withPageId(1) + (new InternalRequest())->withPageId(1), ); self::assertStringContainsString( 'The protection of your data is important for us', - (string)$response->getBody() + (string)$response->getBody(), ); } } diff --git a/Tests/Functional/Service/MapServiceTest.php b/Tests/Functional/Service/MapServiceTest.php index c4e5e536..9605c1de 100644 --- a/Tests/Functional/Service/MapServiceTest.php +++ b/Tests/Functional/Service/MapServiceTest.php @@ -88,7 +88,7 @@ protected function setUp(): void $this->messageHelperMock, $this->maps2RegistryMock, $this->extConfMock, - $this->eventDispatcherMock + $this->eventDispatcherMock, ); } @@ -100,7 +100,7 @@ protected function tearDown(): void $this->messageHelperMock, $this->maps2RegistryMock, $this->extConfMock, - $this->eventDispatcherMock + $this->eventDispatcherMock, ); parent::tearDown(); @@ -147,7 +147,7 @@ public function renderInfoWindowWillLoadTemplatePathFromTypoScript(): void self::assertStringContainsString( 'Test 123', - $this->subject->renderInfoWindow($poiCollection) + $this->subject->renderInfoWindow($poiCollection), ); } @@ -191,7 +191,7 @@ public function renderInfoWindowWillRenderPoiCollectionTitle(): void self::assertStringContainsString( 'Test 123', - $this->subject->renderInfoWindow($poiCollection) + $this->subject->renderInfoWindow($poiCollection), ); } @@ -238,20 +238,20 @@ public function renderInfoWindowWillRenderPoiCollectionAddress(): void self::assertStringContainsString( 'Echterdinger Straße 57', - $renderedContent + $renderedContent, ); self::assertStringContainsString( 'Gebäude 9', - $renderedContent + $renderedContent, ); self::assertStringContainsString( '70794 Filderstadt', - $renderedContent + $renderedContent, ); self::assertStringNotContainsString( 'Germany', - $renderedContent + $renderedContent, ); } @@ -296,7 +296,7 @@ public function renderInfoWindowWillRenderPoiCollectionInfoWindowContent(): void self::assertStringContainsString( 'Hello all together', - $this->subject->renderInfoWindow($poiCollection) + $this->subject->renderInfoWindow($poiCollection), ); } @@ -309,8 +309,8 @@ public function createNewPoiCollectionWithEmptyLatitudeReturnsZero(): void 0, $this->subject->createNewPoiCollection( 1, - new Position() - ) + new Position(), + ), ); } @@ -328,8 +328,8 @@ public function createNewPoiCollectionWillCreateNewPoiCollectionRecord(): void 1, $this->subject->createNewPoiCollection( 1, - $position - ) + $position, + ), ); } @@ -348,7 +348,7 @@ public function createNewPoiCollectionWithOverrideWillCreateNewPoiCollectionReco $position, [ 'longitude' => 12.3, - ] + ], ); $poiCollectionRecord = $this->getConnectionPool() @@ -358,7 +358,7 @@ public function createNewPoiCollectionWithOverrideWillCreateNewPoiCollectionReco $poiCollectionRecord = array_intersect_key( $poiCollectionRecord, - ['uid' => 1, 'longitude' => 1] + ['uid' => 1, 'longitude' => 1], ); // DB systems other than MySQL collect float values as string. Convert them back to float. @@ -369,7 +369,7 @@ public function createNewPoiCollectionWithOverrideWillCreateNewPoiCollectionReco 'uid' => 1, 'longitude' => 12.3, ], - $poiCollectionRecord + $poiCollectionRecord, ); } @@ -384,7 +384,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyPoiCollectionUidAddsF ->with( self::stringContains('PoiCollection UID can not be empty'), 'PoiCollection empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $foreignRecord = [ @@ -394,7 +394,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyPoiCollectionUidAddsF $this->subject->assignPoiCollectionToForeignRecord( 0, $foreignRecord, - 'tx_events2_domain_model_location' + 'tx_events2_domain_model_location', ); } @@ -424,7 +424,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyForeignRecordAddsFlas $this->subject->assignPoiCollectionToForeignRecord( 1, $foreignRecord, - 'tx_events2_domain_model_location' + 'tx_events2_domain_model_location', ); } @@ -439,7 +439,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyForeignTableNameAddsF ->with( self::stringContains('Foreign table name is a must have value'), 'Foreign table name empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $foreignRecord = [ @@ -449,7 +449,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyForeignTableNameAddsF $this->subject->assignPoiCollectionToForeignRecord( 1, $foreignRecord, - '' + '', ); } @@ -464,7 +464,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyForeignFieldNameAddsF ->with( self::stringContains('Foreign field name is a must have value'), 'Foreign field name empty', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $foreignRecord = [ @@ -475,7 +475,7 @@ public function assignPoiCollectionToForeignRecordWithEmptyForeignFieldNameAddsF 1, $foreignRecord, 'tx_events2_domain_model_location', - ' ' + ' ', ); } @@ -490,7 +490,7 @@ public function assignPoiCollectionToForeignRecordWithInvalidTableNameAddsFlashM ->with( self::stringContains('Table "invalidTable" is not configured in TCA'), 'Table not found', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $foreignRecord = [ @@ -500,7 +500,7 @@ public function assignPoiCollectionToForeignRecordWithInvalidTableNameAddsFlashM $this->subject->assignPoiCollectionToForeignRecord( 1, $foreignRecord, - 'invalidTable' + 'invalidTable', ); } @@ -515,7 +515,7 @@ public function assignPoiCollectionToForeignRecordWithInvalidFieldNameAddsFlashM ->with( self::stringContains('Field "invalidField" is not configured in TCA'), 'Field not found', - ContextualFeedbackSeverity::ERROR + ContextualFeedbackSeverity::ERROR, ); $foreignRecord = [ @@ -526,7 +526,7 @@ public function assignPoiCollectionToForeignRecordWithInvalidFieldNameAddsFlashM 1, $foreignRecord, 'tx_events2_domain_model_location', - 'invalidField' + 'invalidField', ); } @@ -542,7 +542,7 @@ public function assignPoiCollectionToForeignRecordWillUpdateForeignRecord(): voi $newUid = $this->subject->createNewPoiCollection( 12, - $position + $position, ); $this->messageHelperMock @@ -556,12 +556,12 @@ public function assignPoiCollectionToForeignRecordWillUpdateForeignRecord(): voi $this->subject->assignPoiCollectionToForeignRecord( 1, $foreignRecord, - 'tx_events2_domain_model_location' + 'tx_events2_domain_model_location', ); self::assertSame( $foreignRecord['tx_maps2_uid'], - $newUid + $newUid, ); $locationRecord = $this->getConnectionPool() @@ -571,7 +571,7 @@ public function assignPoiCollectionToForeignRecordWillUpdateForeignRecord(): voi self::assertSame( $locationRecord['tx_maps2_uid'], - $newUid + $newUid, ); } @@ -635,19 +635,19 @@ public function addForeignRecordsToPoiCollectionWillAddForeignRecord(): void $newUid = $this->subject->createNewPoiCollection( 12, - $position + $position, ); $foreignRecord = ['uid' => 1]; $this->subject->assignPoiCollectionToForeignRecord( $newUid, $foreignRecord, - 'tx_events2_domain_model_location' + 'tx_events2_domain_model_location', ); $event = new PreAddForeignRecordEvent( $foreignRecord, 'tx_events2_domain_model_location', - 'tx_maps2_uid' + 'tx_maps2_uid', ); $this->eventDispatcherMock diff --git a/Tests/Functional/ViewHelpers/ConvertToJsonViewHelperTest.php b/Tests/Functional/ViewHelpers/ConvertToJsonViewHelperTest.php index b7a122b8..2501c85f 100644 --- a/Tests/Functional/ViewHelpers/ConvertToJsonViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/ConvertToJsonViewHelperTest.php @@ -49,7 +49,7 @@ protected function setUp(): void protected function tearDown(): void { unset( - $this->poiCollection + $this->poiCollection, ); parent::tearDown(); @@ -75,7 +75,7 @@ public function renderWithStringWillJustCallJsonEncode(): void self::assertStringContainsString( '"simpleString"', - $contentWithJson + $contentWithJson, ); } @@ -99,7 +99,7 @@ public function renderWithSimpleArrayWillJustCallJsonEncode(): void self::assertStringContainsString( '{"foo":"bar"}', - $contentWithJson + $contentWithJson, ); } @@ -124,7 +124,7 @@ public function renderWithPoiCollectionWillSetItToArrayAndConvertItToJson(): voi // a property of PoiCollection should be found in string self::assertStringContainsString( 'address', - $contentWithJson + $contentWithJson, ); } @@ -149,7 +149,7 @@ public function renderWithPoiCollectionsWillConvertItToJson(): void // a property of PoiCollection should be found in string self::assertStringContainsString( 'address', - $contentWithJson + $contentWithJson, ); // we have set PoiCollection into an array, so JSON should start with [{ @@ -179,11 +179,11 @@ public function renderWithPoiCollectionsWillRemoveMaps2MarkerIconsFromCategories self::assertStringNotContainsString( 'maps2MarkerIcons', - $contentWithJson + $contentWithJson, ); self::assertStringNotContainsString( 'parent', - $contentWithJson + $contentWithJson, ); } @@ -207,7 +207,7 @@ public function renderWithPoiCollectionsWillRemoveMarkerIconsFromPoiCollection() self::assertStringNotContainsString( 'markerIcons', - $contentWithJson + $contentWithJson, ); } } diff --git a/Tests/Unit/Domain/Model/PositionTest.php b/Tests/Unit/Domain/Model/PositionTest.php index c453bdac..4b37577a 100644 --- a/Tests/Unit/Domain/Model/PositionTest.php +++ b/Tests/Unit/Domain/Model/PositionTest.php @@ -29,7 +29,7 @@ protected function setUp(): void protected function tearDown(): void { unset( - $this->subject + $this->subject, ); parent::tearDown(); @@ -42,7 +42,7 @@ public function getFormattedAddressInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getFormattedAddress() + $this->subject->getFormattedAddress(), ); } @@ -55,7 +55,7 @@ public function setFormattedAddressSetsFormattedAddress(): void self::assertSame( 'foo bar', - $this->subject->getFormattedAddress() + $this->subject->getFormattedAddress(), ); } @@ -66,7 +66,7 @@ public function getLatitudeInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getLatitude() + $this->subject->getLatitude(), ); } @@ -79,7 +79,7 @@ public function setLatitudeSetsLatitude(): void self::assertSame( 1234.56, - $this->subject->getLatitude() + $this->subject->getLatitude(), ); } @@ -90,7 +90,7 @@ public function getLongitudeInitiallyReturnsZero(): void { self::assertSame( 0.0, - $this->subject->getLongitude() + $this->subject->getLongitude(), ); } @@ -103,7 +103,7 @@ public function setLongitudeSetsLongitude(): void self::assertSame( 1234.56, - $this->subject->getLongitude() + $this->subject->getLongitude(), ); } } diff --git a/Tests/Unit/Domain/Model/SearchTest.php b/Tests/Unit/Domain/Model/SearchTest.php index 05d87fff..5776cbfc 100644 --- a/Tests/Unit/Domain/Model/SearchTest.php +++ b/Tests/Unit/Domain/Model/SearchTest.php @@ -29,7 +29,7 @@ protected function setUp(): void protected function tearDown(): void { unset( - $this->subject + $this->subject, ); parent::tearDown(); @@ -42,7 +42,7 @@ public function getAddressInitiallyReturnsEmptyString(): void { self::assertSame( '', - $this->subject->getAddress() + $this->subject->getAddress(), ); } @@ -55,7 +55,7 @@ public function setAddressSetsAddress(): void self::assertSame( 'foo bar', - $this->subject->getAddress() + $this->subject->getAddress(), ); } @@ -66,7 +66,7 @@ public function getRadiusInitiallyReturnsZero(): void { self::assertSame( 50, - $this->subject->getRadius() + $this->subject->getRadius(), ); } @@ -79,7 +79,7 @@ public function setRadiusSetsRadius(): void self::assertSame( 123456, - $this->subject->getRadius() + $this->subject->getRadius(), ); } } diff --git a/Tests/Unit/Service/GeoCodeServiceTest.php b/Tests/Unit/Service/GeoCodeServiceTest.php index 318382a9..caed6099 100644 --- a/Tests/Unit/Service/GeoCodeServiceTest.php +++ b/Tests/Unit/Service/GeoCodeServiceTest.php @@ -70,7 +70,7 @@ protected function setUp(): void $this->subject = new GeoCodeService( $this->clientFactoryMock, $this->requestFactoryMock, - $this->mapperFactoryMock + $this->mapperFactoryMock, ); } @@ -82,7 +82,7 @@ protected function tearDown(): void $this->googleMapsClientMock, $this->requestFactoryMock, $this->mapperFactoryMock, - $this->gmGeocodeRequestMock + $this->gmGeocodeRequestMock, ); GeneralUtility::purgeInstances(); @@ -101,12 +101,12 @@ public function getPositionsByAddressWithEmptyAddressWillReturnEmptyObjectStorag self::assertInstanceOf( ObjectStorage::class, - $positions + $positions, ); self::assertSame( $objectStorage->toArray(), - $positions->toArray() + $positions->toArray(), ); } @@ -121,12 +121,12 @@ public function getPositionsByAddressWithAddressFilledWithSpacesWillReturnEmptyO self::assertInstanceOf( ObjectStorage::class, - $positions + $positions, ); self::assertSame( $objectStorage->toArray(), - $positions->toArray() + $positions->toArray(), ); } @@ -145,7 +145,7 @@ public function getPositionsByAddressWithEmptyResponseWillReturnEmptyObjectStora ->method('addParameter') ->with( 'address', - $address + $address, ); $this->requestFactoryMock @@ -164,12 +164,12 @@ public function getPositionsByAddressWithEmptyResponseWillReturnEmptyObjectStora self::assertInstanceOf( ObjectStorage::class, - $positions + $positions, ); self::assertSame( $objectStorage->toArray(), - $positions->toArray() + $positions->toArray(), ); } @@ -195,7 +195,7 @@ public function getPositionsByAddressWillReturnFilledObjectStorage(): void ->method('addParameter') ->with( 'address', - 'My private address' + 'My private address', ); $this->requestFactoryMock @@ -219,7 +219,7 @@ public function getPositionsByAddressWillReturnFilledObjectStorage(): void self::assertCount( 1, - $this->subject->getPositionsByAddress('My private address') + $this->subject->getPositionsByAddress('My private address'), ); } @@ -233,7 +233,7 @@ public function getFirstFoundPositionByAddressWithEmptyAddressWillReturnNull(): GeneralUtility::addInstance(ObjectStorage::class, $objectStorage); self::assertNull( - $this->subject->getFirstFoundPositionByAddress('') + $this->subject->getFirstFoundPositionByAddress(''), ); } @@ -247,7 +247,7 @@ public function getFirstFoundPositionByAddressWithAddressFilledWithSpacesWillRet GeneralUtility::addInstance(ObjectStorage::class, $objectStorage); self::assertNull( - $this->subject->getFirstFoundPositionByAddress(' ') + $this->subject->getFirstFoundPositionByAddress(' '), ); } @@ -265,7 +265,7 @@ public function getFirstFoundPositionByAddressWithAddressWillReturnNull(): void ->method('addParameter') ->with( 'address', - 'My private address' + 'My private address', ); $this->requestFactoryMock @@ -281,7 +281,7 @@ public function getFirstFoundPositionByAddressWithAddressWillReturnNull(): void ->willReturn([]); self::assertNull( - $this->subject->getFirstFoundPositionByAddress('My private address') + $this->subject->getFirstFoundPositionByAddress('My private address'), ); } @@ -310,7 +310,7 @@ public function getFirstFoundPositionByAddressWillReturnRadiusResult(): void ->method('addParameter') ->with( 'address', - 'My private address' + 'My private address', ); $this->requestFactoryMock @@ -334,7 +334,7 @@ public function getFirstFoundPositionByAddressWillReturnRadiusResult(): void self::assertEquals( $expectedPosition, - $this->subject->getFirstFoundPositionByAddress('My private address') + $this->subject->getFirstFoundPositionByAddress('My private address'), ); } } diff --git a/composer.json b/composer.json index 3ed15122..3de1362d 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,17 @@ { "name": "jweiland/maps2", - "type": "typo3-cms-extension", "description": "Create maps with Marker, Area, Routes or Radius based on Google Maps or OpenStreetMap", "license": "GPL-2.0-or-later", - "keywords": ["typo3", "TYPO3 CMS", "google maps", "osm", "open street map", "openstreetmap", "maps2"], - "homepage": "https://jweiland.net/", + "type": "typo3-cms-extension", + "keywords": [ + "typo3", + "TYPO3 CMS", + "google maps", + "osm", + "open street map", + "openstreetmap", + "maps2" + ], "authors": [ { "name": "Stefan Froemken", @@ -12,26 +19,28 @@ "role": "Lead Developer" } ], + "homepage": "https://jweiland.net/", "support": { - "docs": "https://docs.typo3.org/p/jweiland/maps2/main/en-us/", "email": "projects@jweiland.net", "issues": "https://github.com/jweiland-net/maps2/issues", - "source": "https://github.com/jweiland-net/maps2" + "source": "https://github.com/jweiland-net/maps2", + "docs": "https://docs.typo3.org/p/jweiland/maps2/main/en-us/" }, "require": { "ext-json": "*", "typo3/cms-core": "^12.4.11" }, "require-dev": { - "typo3/testing-framework": "^7.0.2", - "phpunit/phpunit": "^9.6", - "typo3/coding-standards": "^0.6", + "ergebnis/composer-normalize": "~2.42.0", "friendsofphp/php-cs-fixer": "^3.14", "jweiland/events2": "^9.0", - "sjbr/static-info-tables": "^12.4" + "phpunit/phpunit": "^9.6", + "sjbr/static-info-tables": "^12.4", + "typo3/coding-standards": "^0.6", + "typo3/testing-framework": "^7.0.2" }, "suggest": { - "sjbr/static-info-tables": "Install this package, if you want to choose from contained contries instead of typing them" + "sjbr/static-info-tables": "Install this package, if you want to choose from contained countries instead of typing them" }, "autoload": { "psr-4": { @@ -44,17 +53,18 @@ } }, "config": { - "vendor-dir": ".Build/vendor", - "bin-dir": ".Build/bin", "allow-plugins": { + "ergebnis/composer-normalize": true, "typo3/class-alias-loader": true, "typo3/cms-composer-installers": true - } + }, + "bin-dir": ".Build/bin", + "vendor-dir": ".Build/vendor" }, "extra": { "typo3/cms": { - "extension-key": "maps2", "app-dir": ".Build", + "extension-key": "maps2", "web-dir": ".Build/Web" } } diff --git a/ext_emconf.php b/ext_emconf.php index 20f5ea9f..ebcc3cb0 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,5 +1,12 @@ 'Maps2', 'description' => 'Create maps with Marker, Area, Routes or Radius based on Google Maps or OpenStreetMap', diff --git a/ext_localconf.php b/ext_localconf.php index 09dad516..e298e17d 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,5 +1,12 @@ 'show', AjaxController::class => 'process', - ] + ], ); ExtensionUtility::configurePlugin( @@ -36,7 +42,7 @@ // non-cacheable actions [ PoiCollectionController::class => 'overlay', - ] + ], ); ExtensionUtility::configurePlugin( @@ -48,7 +54,7 @@ // non-cacheable actions [ PoiCollectionController::class => 'listRadius', - ] + ], ); ExtensionUtility::configurePlugin( @@ -60,7 +66,7 @@ // non-cacheable actions [ CityMapController::class => 'search', - ] + ], ); // Activate caching for info window content diff --git a/ext_tables.php b/ext_tables.php index a4bc14bc..36bad11b 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,5 +1,12 @@