From b7a810f94bc11135215524ecce6631a22af43284 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 10:01:31 +0100 Subject: [PATCH 001/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 375 +++++++++++++------------------------- Taskfile.yml | 107 ++++++++++- docker-compose.yml | 2 - docs/local-development.md | 38 ++++ 4 files changed, 270 insertions(+), 252 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a145de8da1..f5a481de51 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,272 +1,153 @@ -version: 2 +version: 2.1 -dependencies: - pre: - - curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - - sudo dpkg -i google-chrome.deb - - sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome - - rm google-chrome.deb jobs: build: - docker: - - image: cimg/php:8.1.12-node - name: restarters.test - environment: - - DB_CONNECTION: mysql - - DB_HOST: 127.0.0.1 - - DB_PORT: 3306 - - DB_DATABASE: restarters_db - - DB_USERNAME: restarters - - DB_PASSWORD: s3cr3t - - TZ: "UTC" - - image: cimg/mysql:8.0 - environment: - # You can connect once ssh'd in using mysql -u root -p -h 127.0.0.1 - - MYSQL_ROOT_PASSWORD: s3cr3t - - MYSQL_DATABASE: restarters_db - - MYSQL_USER: restarters - - MYSQL_PASSWORD: s3cr3t - - image: mcr.microsoft.com/playwright:focal - environment: - NODE_ENV: development - TZ: "UTC" - - image: 'bitnami/mariadb:latest' - name: mariadb - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MARIADB_PORT_NUMBER=3307 - - MARIADB_USER=bn_mediawiki - - MARIADB_DATABASE=bitnami_mediawiki - - image: 'bitnami/mediawiki:1' - name: mediawiki - labels: - kompose.service.type: nodeport - environment: - - MEDIAWIKI_DATABASE_HOST=mariadb - - MEDIAWIKI_DATABASE_PORT_NUMBER=3307 - - MEDIAWIKI_DATABASE_USER=bn_mediawiki - - MEDIAWIKI_DATABASE_NAME=bitnami_mediawiki - - ALLOW_EMPTY_PASSWORD=yes - - MEDIAWIKI_EXTERNAL_HTTP_PORT_NUMBER=8080 - - MEDIAWIKI_HOST=mediawiki - - TZ: "UTC" - depends_on: - - mariadb - entrypoint: - - /bin/bash - - -c - - sleep 60; /opt/bitnami/scripts/mediawiki/entrypoint.sh "/opt/bitnami/scripts/apache/run.sh" - - image: 'docker.io/bitnami/postgresql:11' - name: postgresql -# No volumes on CircleCI -# volumes: -# - 'postgresql_data:/bitnami/postgresql' - environment: - - ALLOW_EMPTY_PASSWORD=yes - - POSTGRESQL_USERNAME=bn_discourse - - POSTGRESQL_DATABASE=bitnami_discourse -# No networks on CircleCI -# networks: -# - app-network - - - image: docker.io/bitnami/redis:6.0 - name: restarters_discourse_redis - environment: - - ALLOW_EMPTY_PASSWORD=yes -# volumes: -# - 'redis_data:/bitnami/discourse' -# networks: -# - app-network - - - image: docker.io/bitnami/discourse:2 - name: restarters_discourse -# No ports on CircleCI -# ports: -# - '8003:80' -# volumes: -# - 'discourse_data:/bitnami/discourse' - depends_on: - - postgresql - - restarters_discourse_redis - environment: - - ALLOW_EMPTY_PASSWORD=yes - - DISCOURSE_USERNAME=someuser - - DISCOURSE_PASSWORD=mustbetencharacters - - DISCOURSE_HOST=www.example.com:8003 - - DISCOURSE_PORT_NUMBER=80 - - DISCOURSE_DATABASE_HOST=postgresql - - DISCOURSE_DATABASE_PORT_NUMBER=5432 - - DISCOURSE_DATABASE_USER=bn_discourse - - DISCOURSE_DATABASE_NAME=bitnami_discourse - - DISCOURSE_REDIS_HOST=restarters_discourse_redis - - DISCOURSE_REDIS_PORT_NUMBER=6379 - - POSTGRESQL_CLIENT_POSTGRES_USER=postgres - - POSTGRESQL_CLIENT_CREATE_DATABASE_NAME=bitnami_discourse - - POSTGRESQL_CLIENT_CREATE_DATABASE_EXTENSIONS=hstore,pg_trgm - - DISCOURSE_EXTRA_CONF_CONTENT=personal_message_enabled_groups \= 10 -# networks: -# - app-network - - - image: docker.io/bitnami/discourse:latest - name: restarters_discourse_sidekiq - depends_on: - - restarters_discourse -# volumes: -# - 'sidekiq_data:/bitnami/discourse' - command: /opt/bitnami/scripts/discourse-sidekiq/run.sh - environment: - - ALLOW_EMPTY_PASSWORD=yes - - DISCOURSE_HOST=www.example.com - - DISCOURSE_DATABASE_HOST=postgresql - - DISCOURSE_DATABASE_PORT_NUMBER=5432 - - DISCOURSE_DATABASE_USER=bn_discourse - - DISCOURSE_DATABASE_NAME=bitnami_discourse - - DISCOURSE_REDIS_HOST=restarters_discourse_redis - - DISCOURSE_REDIS_PORT_NUMBER=6379 -# networks: -# - app-network + machine: + image: ubuntu-2204:2023.07.1 + environment: + - TZ: "UTC" steps: - checkout - - run: sudo bash -c "echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries" - - run: sudo apt update - - run: sudo apt install dnsutils openssl zip unzip git libxml2-dev libzip-dev zlib1g-dev libcurl4-openssl-dev iputils-ping default-mysql-client vim libpng-dev libgmp-dev libjpeg-turbo8-dev - - run: sudo apt-get install php-xmlrpc php8.1-intl php8.1-xdebug php8.1-mbstring php8.1-simplexml php8.1-curl php8.1-zip postgresql-client php8.1-gd php8.1-xmlrpc php8.1-mysql php-mysql - - run: sudo pecl install xdebug - - # We now need Node 18 for Playwright. - - run: sudo curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - - - run: sudo apt update - - run: sudo apt -y install nodejs - - run: sudo rm /usr/local/bin/node - - - run: cp .env.example .env - - # Need access to timezones. - - run: mysql --host="127.0.0.1" -u root -ps3cr3t -e "GRANT SELECT ON mysql.time_zone_name TO 'restarters'@'%';" - - # We have Discourse on CircleCI. The API key is inserted using psql below. - - run: sed -i 's/FEATURE__DISCOURSE_INTEGRATION=.*$/FEATURE__DISCOURSE_INTEGRATION=true/g' .env - - run: sed -i 's/DISCOURSE_URL=.*$/DISCOURSE_URL=http:\/\/restarters_discourse/g' .env - - run: sed -i 's/DISCOURSE_APIKEY=.*$/DISCOURSE_APIKEY=fb71f38ca2b8b7cd6a041e57fd8202c9937088f0ecae7db40722bd758dda92fc/g' .env - - run: sed -i 's/DISCOURSE_APIUSER=.*$/DISCOURSE_APIUSER=someuser/g' .env - - # ...and Mediawiki. - # Disable wiki as problems getting that running. - # - run: sed -i 's/FEATURE__WIKI_INTEGRATION=.*$/FEATURE__WIKI_INTEGRATION=true/g' .env - - run: sed -i 's/WIKI_URL=.*$/WIKI_URL=http:\/\/mediawiki:8080/g' .env - - run: sed -i 's/WIKI_DB=.*$/WIKI_DB=bitnami_mediawiki/g' .env - - run: sed -i 's/WIKI_USER=.*$/WIKI_USER=user/g' .env - - run: sed -i 's/WIKI_PASSWORD=.*$/WIKI_PASSWORD=bitnami123/g' .env - - run: sed -i 's/WIKI_APIUSER=.*$/WIKI_APIUSER=user/g' .env - - run: sed -i 's/WIKI_APIPASSWORD=.*$/WIKI_APIPASSWORD=bitnami123/g' .env - - # Playwright needs the debug bar not to appear - - run: sed -i 's/APP_DEBUG=.*$/APP_DEBUG=FALSE/g' .env - - # ...and runs on localhost. - - run: sed -i 's/SESSION_DOMAIN=.*$/SESSION_DOMAIN=localhost/g' .env - - # ...and needs honeypot rate-limiting needs to be turned off. - - run: sed -i 's/HONEYPOT_DISABLE=.*$/HONEYPOT_DISABLE=TRUE/g' .env - - - run: wget https://getcomposer.org/composer-2.phar -O composer.phar; rm -rf vendor; echo Y | php8.1 composer.phar install - - run: npm install - - run: php artisan lang:js --no-lib resources/js/translations.js - - run: npx playwright install - - run: npx playwright install-deps - - run: npm install -D @playwright/test - - - run: php artisan key:generate - - run: mysql --host="127.0.0.1" -u root -ps3cr3t -e "SET PERSIST log_bin_trust_function_creators = 1;" - - run: php artisan migrate - - run: php artisan l5-swagger:generate - - - run: wget -O phpunit https://phar.phpunit.de/phpunit-9.phar ; chmod +x phpunit - - # The phpunit and playwright tests require an uploads directory in a slightly different place. Not really - # worth fixing. - - run: mkdir uploads - - run: mkdir public/uploads + + # Install Task + - run: + name: Install Task + command: | + sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin + task --version - # Wait for Discourse to finish initialising. - - run: while ! nc -z restarters_discourse 80; do sleep 1 ; done + # Set up environment file + - run: + name: Setup environment + command: | + cp .env.example .env + + # Configure for Docker Compose setup + sed -i 's/DB_HOST=.*$/DB_HOST=restarters_db/g' .env + sed -i 's/DB_DATABASE=.*$/DB_DATABASE=restarters_db_test/g' .env + sed -i 's/DB_USERNAME=.*$/DB_USERNAME=restarters/g' .env + sed -i 's/DB_PASSWORD=.*$/DB_PASSWORD=s3cr3t/g' .env + + # Configure Discourse integration + sed -i 's/FEATURE__DISCOURSE_INTEGRATION=.*$/FEATURE__DISCOURSE_INTEGRATION=true/g' .env + sed -i 's/DISCOURSE_URL=.*$/DISCOURSE_URL=http:\/\/restarters_discourse/g' .env + sed -i 's/DISCOURSE_APIKEY=.*$/DISCOURSE_APIKEY=fb71f38ca2b8b7cd6a041e57fd8202c9937088f0ecae7db40722bd758dda92fc/g' .env + sed -i 's/DISCOURSE_APIUSER=.*$/DISCOURSE_APIUSER=someuser/g' .env + + # Configure for testing + sed -i 's/APP_DEBUG=.*$/APP_DEBUG=FALSE/g' .env + sed -i 's/SESSION_DOMAIN=.*$/SESSION_DOMAIN=localhost/g' .env + sed -i 's/HONEYPOT_DISABLE=.*$/HONEYPOT_DISABLE=TRUE/g' .env + sed -i 's/APP_URL=.*$/APP_URL=http:\/\/localhost:8001/g' .env + + # Add environment variables from CircleCI + echo "" >> .env + echo "GOOGLE_API_CONSOLE_KEY=$GOOGLE_API_CONSOLE_KEY" >> .env + echo "MAPBOX_TOKEN=$MAPBOX_TOKEN" >> .env + + # Start Docker services using Task + - run: + name: Start Docker services + command: | + # Start all services using Task + task docker:up-all + no_output_timeout: 10m - # Add the config we need. - - run: psql -h postgresql -U postgres -c "INSERT INTO api_keys (id, user_id, created_by_id, created_at, updated_at, allowed_ips, hidden, last_used_at, revoked_at, description, key_hash, truncated_key) VALUES (1, NULL, 1, '2021-10-25 13:56:20.033338', '2021-10-25 13:56:20.033338', NULL, false, NULL, NULL, 'Restarters', 'd89e9dfacfb611fbaf004807648187ce7ed474df44dcb0ada230fab5c8dd6a5b', '9fd7');" bitnami_discourse - - run: php artisan discourse:setting personal_message_enabled_groups 10 + # Wait for services to be ready + - run: + name: Wait for services + command: | + task docker:wait-for-services-all - # Run phpunit. Discourse makes things slow, so up the timeout. + # Setup database and application + - run: + name: Setup application + command: | + # Grant timezone access + task docker:run:bash -- "mysql -h restarters_db -u root -ps3cr3t -e \"GRANT SELECT ON mysql.time_zone_name TO 'restarters'@'%';\"" + + # Setup Laravel (some commands are already handled by docker setup) + task docker:run:artisan -- "key:generate" + task docker:run:bash -- "mysql -h restarters_db -u root -ps3cr3t -e \"SET PERSIST log_bin_trust_function_creators = 1;\"" + task docker:run:artisan -- "migrate" + task docker:run:artisan -- "l5-swagger:generate" + + # Install test dependencies + task docker:run:bash -- "npm install" + task docker:run:artisan -- "lang:js --no-lib resources/js/translations.js" + task docker:run:bash -- "npx playwright install" + task docker:run:bash -- "npx playwright install-deps" + task docker:run:bash -- "npm install -D @playwright/test" + + # Create uploads directories + task docker:run:bash -- "mkdir -p uploads public/uploads" + + # Setup Discourse API - run: - command: export XDEBUG_MODE=coverage;./phpunit -d memory_limit=1024M --bootstrap vendor/autoload.php --coverage-clover tests/clover.xml --configuration ./phpunit.xml - no_output_timeout: 45m + name: Setup Discourse + command: | + # Add API key to Discourse + task docker:run:bash -- "docker exec postgresql psql -U postgres -c \"INSERT INTO api_keys (id, user_id, created_by_id, created_at, updated_at, allowed_ips, hidden, last_used_at, revoked_at, description, key_hash, truncated_key) VALUES (1, NULL, 1, '2021-10-25 13:56:20.033338', '2021-10-25 13:56:20.033338', NULL, false, NULL, NULL, 'Restarters', 'd89e9dfacfb611fbaf004807648187ce7ed474df44dcb0ada230fab5c8dd6a5b', '9fd7');\" bitnami_discourse" + + # Configure Discourse settings + task docker:run:artisan -- "discourse:setting personal_message_enabled_groups 10" - # Coveralls is pernickety about the location it uploads from existing. - - run: mkdir build; mkdir build/logs; php vendor/bin/php-coveralls -v -x tests/clover.xml + # Run PHPUnit tests + - run: + name: Run PHPUnit tests + command: | + task docker:run:bash -- "export XDEBUG_MODE=coverage; ./vendor/bin/phpunit -d memory_limit=1024M --bootstrap vendor/autoload.php --coverage-clover tests/clover.xml --configuration ./phpunit.xml" + no_output_timeout: 45m - # Run the Jest tests. - - run: npm run jest + # Upload coverage + - run: + name: Upload coverage + command: | + task docker:run:bash -- "mkdir -p build/logs && php vendor/bin/php-coveralls -v -x tests/clover.xml" - # Run the Playwright tests. - # - # Zap groups set up by the UT; this can confuse Playwright tests. - - run: mysql --host="127.0.0.1" -u root -ps3cr3t -e "use restarters_db;SET foreign_key_checks=0;DELETE FROM \`groups\` WHERE location IS NULL;SET foreign_key_checks=1;" - - run: php artisan cache:clear - # Ignore the return code from the tinker; the user might exist from the phpunit tests. If it doesn't and - # the create fails, the tests will fail too. - - run: echo "App\User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);" | php artisan tinker || true - # Build the web app. - - run: export NODE_OPTIONS=--max-old-space-size=8192; npm rebuild node-sass; npm run prod - - run: npx playwright install - # Set up a real nginx/fpm server. This improves the speed of the tests enormously as artisan serve uses the - # single-threaded php built-in web server. - - run: sudo apt-get install nginx php8.1-fpm php8.1-mysql php8.1-pdo - - run: sudo cp /home/circleci/project/.circleci/nginx.conf /etc/nginx/sites-available/default - - run: sudo sed -i 's/www-data/circleci/g' /etc/php/8.1/fpm/pool.d/www.conf - - run: sudo /etc/init.d/php8.1-fpm start - - run: sudo sed -i 's/user .*;/user circleci;/g' /etc/nginx/nginx.conf - - run: sudo /etc/init.d/nginx start - # We're running against localhost. - - run: sudo sed -i 's/APP_URL=.*$/APP_URL=http:\/\/localhost/g' /home/circleci/project/.env - # Fix up Google key from CircleCI config. - - run: cp .env /tmp/.env - - run: echo "" >> /tmp/.env - - run: echo GOOGLE_API_CONSOLE_KEY=$GOOGLE_API_CONSOLE_KEY >> /tmp/.env - - run: echo MAPBOX_TOKEN=$MAPBOX_TOKEN >> /tmp/.env - - run: sudo cp /tmp/.env /home/circleci/project/.env - # Comment out throttle:api in App/Http/Kernel.php otherwise it kicks in during Playwright tests. - - run: sudo sed -i 's/.throttle:api.,//g' /home/circleci/project/app/Http/Kernel.php + # Run Jest tests + - run: + name: Run Jest tests + command: | + task docker:run:bash -- "npm run jest" - # Determine which port to use for Playwright tests + # Prepare for Playwright tests - run: - name: Check if port 8000 is available + name: Prepare for Playwright tests command: | - if nc -z localhost 8000; then - echo "export PLAYWRIGHT_BASE_URL=http://localhost:8000" >> $BASH_ENV - echo "Port 8000 is open, using localhost:8000" - else - echo "export PLAYWRIGHT_BASE_URL=http://localhost" >> $BASH_ENV - echo "Port 8000 not available, using localhost" - fi - - # Now run the tests. + # Clean up test data that might interfere + task docker:run:bash -- "mysql -h restarters_db -u root -ps3cr3t -e \"use restarters_db_test;SET foreign_key_checks=0;DELETE FROM \\\`groups\\\` WHERE location IS NULL;SET foreign_key_checks=1;\"" + task docker:run:artisan -- "cache:clear" + + # Create test user + task docker:run:bash -- "echo \"App\\\\User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);\" | php artisan tinker" || true + + # Build assets + task docker:run:bash -- "export NODE_OPTIONS=--max-old-space-size=8192; npm rebuild node-sass; npm run prod" + + # Disable API throttling for tests + task docker:run:bash -- "sed -i 's/.throttle:api.,//g' /var/www/app/Http/Kernel.php" + + # Run Playwright tests - run: - name: Playwright Tests - no_output_timeout: 10m + name: Run Playwright tests command: | - source $BASH_ENV - # Enable debug logging for Playwright tests in CI - export PLAYWRIGHT_DEBUG=true - export DEBUG=playwright - npx playwright test --reporter=list - - # Store test artifacts (screenshots, videos, traces, test reports) + # Run tests inside container with debug logging + task docker:run:bash -- "export PLAYWRIGHT_DEBUG=true; export DEBUG=playwright; export PLAYWRIGHT_BASE_URL=http://localhost:8001; npx playwright test --reporter=list" + no_output_timeout: 10m + + # Store artifacts - store_artifacts: path: /tmp/test-results destination: playwright-test-results - # Store test results for CircleCI UI - store_test_results: path: /tmp/test-results - + # Cleanup + - run: + name: Cleanup + command: | + task docker:down-all + when: always \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index fb7754c566..bf1165f6f5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -8,9 +8,19 @@ dotenv: env: UID: - sh: id -u + sh: | + if command -v id >/dev/null 2>&1; then + id -u + else + echo "1000" + fi GID: - sh: id -g + sh: | + if command -v id >/dev/null 2>&1; then + id -g + else + echo "1000" + fi vars: DOCKER_CMD: @@ -159,4 +169,95 @@ tasks: task docker:run:artisan -- migrate cmds: - - docker exec -it restarters php artisan "{{ .CLI_ARGS }}" \ No newline at end of file + - docker exec -it restarters php artisan "{{ .CLI_ARGS }}" + + docker:wait-for-services-*: + desc: Wait for Docker services to be ready and responding for a given profile (Usage - task docker:wait-for-services-[core|debug|discourse|all]) + summary: | + Wait for Docker services to be ready by checking their health endpoints. + This task will check that services are listening on their ports and returning + plausible responses before proceeding, but only for the services in the specified profile. + + For just the core services, use: + task docker:wait-for-services-core + + To include debug tools (phpMyAdmin, Mailhog), use: + task docker:wait-for-services-debug + + To include Discourse services, use: + task docker:wait-for-services-discourse + + To wait for all services, use: + task docker:wait-for-services-all + + The task checks: + - Core profile: MySQL database, Restarters web app + - Debug profile: Core + phpMyAdmin, Mailhog + - Discourse profile: Core + Discourse, PostgreSQL, Redis, Sidekiq + - All profile: All services + + requires: *PROFILE_REQUIRES + + vars: *PROFILE_VARS + + cmds: + - | + # Cross-platform sleep function + cross_platform_sleep() { + if command -v sleep >/dev/null 2>&1; then + sleep "$1" + elif command -v powershell >/dev/null 2>&1; then + powershell -Command "Start-Sleep -Seconds $1" + else + # Fallback using ping (works on most systems) + ping -n $(($1 + 1)) 127.0.0.1 >/dev/null 2>&1 || ping -c $1 127.0.0.1 >/dev/null 2>&1 + fi + } + + # Generic wait function that takes: service_name, check_command, max_attempts, sleep_interval + wait_for_service() { + local service_name="$1" + local check_command="$2" + local max_attempts="$3" + local sleep_interval="$4" + + echo "Waiting for $service_name..." + local attempt=0 + while [ $attempt -lt $max_attempts ]; do + if eval "$check_command" >/dev/null 2>&1; then + echo "✓ $service_name is ready" + return 0 + fi + echo " $service_name not ready, waiting... (attempt $((attempt + 1))/$max_attempts)" + cross_platform_sleep "$sleep_interval" + attempt=$((attempt + 1)) + done + echo "❌ $service_name failed to start after $max_attempts attempts" + exit 1 + } + + echo "Waiting for services in profile: {{.PROFILE}}" + echo "" + + # Wait for core services (always needed) + wait_for_service "MySQL database" "docker exec restarters_db mysqladmin ping -h localhost -u root -ps3cr3t --silent" 60 5 + wait_for_service "Restarters web application" "curl -f -s http://localhost:8001" 60 5 + + # Wait for debug services (if in debug or all profile) + {{- if or (eq .PROFILE "debug") (eq .PROFILE "all") }} + wait_for_service "phpMyAdmin" "curl -f -s http://localhost:8002" 60 5 + wait_for_service "Mailhog" "curl -f -s http://localhost:8025" 60 5 + {{- else }} + echo "✓ phpMyAdmin not in profile {{.PROFILE}}, skipping" + echo "✓ Mailhog not in profile {{.PROFILE}}, skipping" + {{- end }} + + # Wait for discourse services (if in discourse or all profile) + {{- if or (eq .PROFILE "discourse") (eq .PROFILE "all") }} + wait_for_service "PostgreSQL" "docker exec postgresql pg_isready -U postgres" 60 5 + wait_for_service "Discourse" "curl -f -s http://localhost:8003" 120 10 + {{- else }} + echo "✓ PostgreSQL not in profile {{.PROFILE}}, skipping" + echo "✓ Discourse not in profile {{.PROFILE}}, skipping" + {{- end }} + - echo "🎉 All services in profile {{.PROFILE}} are ready!" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b6da74a10a..5c9abbb9f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -70,8 +70,6 @@ # TODO This is stock Discourse - no theme. Would be nice to have the theme, but that doesn't matter so far as # testing the integration. -version: '3' - services: # Core services - always enabled restarters: diff --git a/docs/local-development.md b/docs/local-development.md index bc3072dc0c..c25f20e48c 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -96,6 +96,31 @@ task docker:up-discourse task docker:up-all ``` +**Waiting for Services to be Ready** + +After starting services, you can wait for them to be fully ready and responding: + +```bash +# Wait for core services to be ready +task docker:wait-for-services-core + +# Wait for debug services to be ready +task docker:wait-for-services-debug + +# Wait for Discourse services to be ready +task docker:wait-for-services-discourse + +# Wait for all services to be ready +task docker:wait-for-services-all +``` + +The wait commands will: +- Check that services are listening on their expected ports +- Verify services return proper responses (not just port availability) +- Show progress with attempt counters +- Fail fast if services don't start within reasonable timeouts +- Only check services that match the specified profile + ### 4. Initial Setup The core application container will automatically: @@ -143,6 +168,19 @@ task docker:run:bash -- [command] task docker:run:artisan -- [command] ``` +### Checking Service Health + +```bash +# Check if services are ready (useful for debugging startup issues) +task docker:wait-for-services-core + +# Check all services including optional ones +task docker:wait-for-services-all + +# View container logs if services aren't starting properly +task docker:logs +``` + ### Stopping the Environment ```bash From fc723938fe4bd3235587ff8c198b9b4afdf439be Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 10:10:31 +0100 Subject: [PATCH 002/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 24 +++++++++++++++++++----- Taskfile.yml | 10 +++++----- docs/local-development.md | 13 +------------ 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f5a481de51..dd6a093628 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 jobs: build: machine: - image: ubuntu-2204:2023.07.1 + image: circleci/cci-demo-docker-primary environment: - TZ: "UTC" @@ -97,7 +97,12 @@ jobs: - run: name: Run PHPUnit tests command: | - task docker:run:bash -- "export XDEBUG_MODE=coverage; ./vendor/bin/phpunit -d memory_limit=1024M --bootstrap vendor/autoload.php --coverage-clover tests/clover.xml --configuration ./phpunit.xml" + # Create test results directory on host + mkdir -p /tmp/test-results/phpunit + # Run PHPUnit with JUnit XML output + task docker:run:bash -- "export XDEBUG_MODE=coverage; ./vendor/bin/phpunit -d memory_limit=1024M --bootstrap vendor/autoload.php --coverage-clover tests/clover.xml --log-junit /tmp/phpunit-results.xml --configuration ./phpunit.xml" + # Copy test results to host + docker cp restarters:/tmp/phpunit-results.xml /tmp/test-results/phpunit/results.xml no_output_timeout: 45m # Upload coverage @@ -110,7 +115,12 @@ jobs: - run: name: Run Jest tests command: | - task docker:run:bash -- "npm run jest" + # Create test results directory for Jest + mkdir -p /tmp/test-results/jest + # Run Jest with JUnit output + task docker:run:bash -- "npm run jest -- --outputFile=/tmp/jest-results.xml --testResultsProcessor=jest-junit" + # Copy test results to host if they exist + docker cp restarters:/tmp/jest-results.xml /tmp/test-results/jest/results.xml || echo "Jest results not found, skipping" # Prepare for Playwright tests - run: @@ -133,8 +143,12 @@ jobs: - run: name: Run Playwright tests command: | - # Run tests inside container with debug logging - task docker:run:bash -- "export PLAYWRIGHT_DEBUG=true; export DEBUG=playwright; export PLAYWRIGHT_BASE_URL=http://localhost:8001; npx playwright test --reporter=list" + # Create test results directory for Playwright + mkdir -p /tmp/test-results/playwright + # Run Playwright tests with proper output directory + task docker:run:bash -- "export PLAYWRIGHT_DEBUG=true; export DEBUG=playwright; export PLAYWRIGHT_BASE_URL=http://localhost:8001; npx playwright test --reporter=junit --output-dir=/tmp/playwright-results" + # Copy test results and artifacts to host + docker cp restarters:/tmp/playwright-results /tmp/test-results/playwright/ || echo "Playwright results not found, skipping" no_output_timeout: 10m # Store artifacts diff --git a/Taskfile.yml b/Taskfile.yml index bf1165f6f5..8631a450f5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -65,7 +65,7 @@ tasks: PROFILE: "{{index .MATCH 0}}" cmds: - - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' + - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' docker:down-*: desc: Stop Docker containers for a given profile (Usage - task docker:down-[core|debug|discourse|all]) @@ -88,7 +88,7 @@ tasks: vars: *PROFILE_VARS cmds: - - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} down' + - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} down' docker:rebuild-*: desc: Rebuild Docker containers for a given profile (Usage - task docker:rebuild-[core|debug|discourse|all]) @@ -111,8 +111,8 @@ tasks: vars: *PROFILE_VARS cmds: - - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} down -v --rmi all' - - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' + - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} down -v --rmi all' + - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' docker:restart-*: desc: Restart Docker containers for a given profile (Usage - task docker:restart-[core|debug|discourse|all]) @@ -135,7 +135,7 @@ tasks: vars: *PROFILE_VARS cmds: - - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} restart' + - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} restart' docker:logs: diff --git a/docs/local-development.md b/docs/local-development.md index c25f20e48c..b654958a70 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -114,12 +114,7 @@ task docker:wait-for-services-discourse task docker:wait-for-services-all ``` -The wait commands will: -- Check that services are listening on their expected ports -- Verify services return proper responses (not just port availability) -- Show progress with attempt counters -- Fail fast if services don't start within reasonable timeouts -- Only check services that match the specified profile +The wait commands will check that services are listening on their expected ports and return proper responses. ### 4. Initial Setup @@ -171,12 +166,6 @@ task docker:run:artisan -- [command] ### Checking Service Health ```bash -# Check if services are ready (useful for debugging startup issues) -task docker:wait-for-services-core - -# Check all services including optional ones -task docker:wait-for-services-all - # View container logs if services aren't starting properly task docker:logs ``` From 45e3b7d05092a1fdbdf6f3686238467c975f6c52 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 10:21:38 +0100 Subject: [PATCH 003/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd6a093628..956e6b3162 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,8 @@ version: 2.1 jobs: build: machine: - image: circleci/cci-demo-docker-primary + image: ubuntu-2204:current + resource_class: large environment: - TZ: "UTC" From 650691a6b36228e75b39ae323f9bcd18c01f959f Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 10:32:45 +0100 Subject: [PATCH 004/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 956e6b3162..64d2c60fdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,12 +65,13 @@ jobs: - run: name: Setup application command: | - # Grant timezone access - task docker:run:bash -- "mysql -h restarters_db -u root -ps3cr3t -e \"GRANT SELECT ON mysql.time_zone_name TO 'restarters'@'%';\"" + # Grant timezone access - run directly on MySQL container + docker exec restarters_db mysql -u root -ps3cr3t -e "GRANT SELECT ON mysql.time_zone_name TO 'restarters'@'%';" # Setup Laravel (some commands are already handled by docker setup) task docker:run:artisan -- "key:generate" - task docker:run:bash -- "mysql -h restarters_db -u root -ps3cr3t -e \"SET PERSIST log_bin_trust_function_creators = 1;\"" + # Set MySQL function creators - run directly on MySQL container + docker exec restarters_db mysql -u root -ps3cr3t -e "SET PERSIST log_bin_trust_function_creators = 1;" task docker:run:artisan -- "migrate" task docker:run:artisan -- "l5-swagger:generate" @@ -88,8 +89,8 @@ jobs: - run: name: Setup Discourse command: | - # Add API key to Discourse - task docker:run:bash -- "docker exec postgresql psql -U postgres -c \"INSERT INTO api_keys (id, user_id, created_by_id, created_at, updated_at, allowed_ips, hidden, last_used_at, revoked_at, description, key_hash, truncated_key) VALUES (1, NULL, 1, '2021-10-25 13:56:20.033338', '2021-10-25 13:56:20.033338', NULL, false, NULL, NULL, 'Restarters', 'd89e9dfacfb611fbaf004807648187ce7ed474df44dcb0ada230fab5c8dd6a5b', '9fd7');\" bitnami_discourse" + # Add API key to Discourse - run directly on PostgreSQL container + docker exec postgresql psql -U postgres -c "INSERT INTO api_keys (id, user_id, created_by_id, created_at, updated_at, allowed_ips, hidden, last_used_at, revoked_at, description, key_hash, truncated_key) VALUES (1, NULL, 1, '2021-10-25 13:56:20.033338', '2021-10-25 13:56:20.033338', NULL, false, NULL, NULL, 'Restarters', 'd89e9dfacfb611fbaf004807648187ce7ed474df44dcb0ada230fab5c8dd6a5b', '9fd7');" bitnami_discourse # Configure Discourse settings task docker:run:artisan -- "discourse:setting personal_message_enabled_groups 10" From d5b4cbcad2e5b086cec8beebab8d34ac47b2f2b1 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 10:44:21 +0100 Subject: [PATCH 005/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64d2c60fdb..02d4cd6903 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,8 +70,6 @@ jobs: # Setup Laravel (some commands are already handled by docker setup) task docker:run:artisan -- "key:generate" - # Set MySQL function creators - run directly on MySQL container - docker exec restarters_db mysql -u root -ps3cr3t -e "SET PERSIST log_bin_trust_function_creators = 1;" task docker:run:artisan -- "migrate" task docker:run:artisan -- "l5-swagger:generate" @@ -128,8 +126,8 @@ jobs: - run: name: Prepare for Playwright tests command: | - # Clean up test data that might interfere - task docker:run:bash -- "mysql -h restarters_db -u root -ps3cr3t -e \"use restarters_db_test;SET foreign_key_checks=0;DELETE FROM \\\`groups\\\` WHERE location IS NULL;SET foreign_key_checks=1;\"" + # Clean up test data that might interfere - run directly on MySQL container + docker exec restarters_db mysql -u root -ps3cr3t -e "use restarters_db_test;SET foreign_key_checks=0;DELETE FROM \`groups\` WHERE location IS NULL;SET foreign_key_checks=1;" task docker:run:artisan -- "cache:clear" # Create test user From 62b44044943d3dbb12ef3f497f181931bf633566 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 10:55:11 +0100 Subject: [PATCH 006/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02d4cd6903..dcf20493fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,6 +55,27 @@ jobs: task docker:up-all no_output_timeout: 10m + # Wait for initial application build to complete + - run: + name: Wait for application build + command: | + echo "Waiting for initial application build to complete..." + # Wait for build completion by checking for expected build artifacts + max_attempts=60 # 10 minutes total + attempt=0 + while [ $attempt -lt $max_attempts ]; do + if docker exec restarters bash -c "[ -f public/mix-manifest.json ] || [ -f public/css/app.css ]"; then + echo "✓ Application build complete - build artifacts found" + break + fi + echo " Build not complete, waiting... (attempt $((attempt + 1))/$max_attempts)" + sleep 10 + attempt=$((attempt + 1)) + done + if [ $attempt -eq $max_attempts ]; then + echo "⚠️ Build artifacts not found after $max_attempts attempts, proceeding anyway" + fi + # Wait for services to be ready - run: name: Wait for services @@ -68,14 +89,14 @@ jobs: # Grant timezone access - run directly on MySQL container docker exec restarters_db mysql -u root -ps3cr3t -e "GRANT SELECT ON mysql.time_zone_name TO 'restarters'@'%';" - # Setup Laravel (some commands are already handled by docker setup) - task docker:run:artisan -- "key:generate" - task docker:run:artisan -- "migrate" + # Setup additional configuration needed for CI (most setup already done by docker_run.sh) + # Set MySQL function creators using session variable (compatible with MySQL 5.7) + docker exec restarters_db mysql -u root -ps3cr3t -e "SET GLOBAL log_bin_trust_function_creators = 1;" + + # Generate additional Laravel artifacts for testing task docker:run:artisan -- "l5-swagger:generate" - # Install test dependencies - task docker:run:bash -- "npm install" - task docker:run:artisan -- "lang:js --no-lib resources/js/translations.js" + # Install test-specific dependencies (npm install and basic setup already done by docker_run.sh) task docker:run:bash -- "npx playwright install" task docker:run:bash -- "npx playwright install-deps" task docker:run:bash -- "npm install -D @playwright/test" @@ -158,10 +179,3 @@ jobs: - store_test_results: path: /tmp/test-results - - # Cleanup - - run: - name: Cleanup - command: | - task docker:down-all - when: always \ No newline at end of file From a35e09f3c08ce95464071768333ee87b6384e26a Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 11:01:47 +0100 Subject: [PATCH 007/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 8 -------- docker_run.sh | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dcf20493fa..a6024d41ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,14 +95,6 @@ jobs: # Generate additional Laravel artifacts for testing task docker:run:artisan -- "l5-swagger:generate" - - # Install test-specific dependencies (npm install and basic setup already done by docker_run.sh) - task docker:run:bash -- "npx playwright install" - task docker:run:bash -- "npx playwright install-deps" - task docker:run:bash -- "npm install -D @playwright/test" - - # Create uploads directories - task docker:run:bash -- "mkdir -p uploads public/uploads" # Setup Discourse API - run: diff --git a/docker_run.sh b/docker_run.sh index 66ad6babda..486c844c3f 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -53,6 +53,11 @@ npm install --legacy-peer-deps npm rebuild node-sass php artisan lang:js --no-lib resources/js/translations.js +# Install Playwright for testing +npm install -D @playwright/test +npx playwright install +npx playwright install-deps + npm run watch-poll& php artisan key:generate php artisan cache:clear From f3629b8ce2719199f8031e9db82dee5e2fa849a4 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 11:14:58 +0100 Subject: [PATCH 008/189] WIP Change CircleCI to use Docker Compose. --- Dockerfile | 6 ++++++ docker_run.sh | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 886d43baa8..2b10fc3e94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,12 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +# Install Playwright system dependencies +# We need to install @playwright/test first to get the install-deps command +RUN npm install -g @playwright/test && \ + npx playwright install-deps && \ + npm uninstall -g @playwright/test + ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.7.31/install-php-extensions /usr/local/bin/ RUN install-php-extensions \ diff --git a/docker_run.sh b/docker_run.sh index 486c844c3f..a7ad4fe485 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -53,10 +53,9 @@ npm install --legacy-peer-deps npm rebuild node-sass php artisan lang:js --no-lib resources/js/translations.js -# Install Playwright for testing +# Install Playwright for testing (system deps already in Dockerfile) npm install -D @playwright/test npx playwright install -npx playwright install-deps npm run watch-poll& php artisan key:generate From baa2b14d4a22431b4c58fb4239aa4b6073f22fb5 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 11:23:36 +0100 Subject: [PATCH 009/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6024d41ae..a71ccb1274 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,7 +94,7 @@ jobs: docker exec restarters_db mysql -u root -ps3cr3t -e "SET GLOBAL log_bin_trust_function_creators = 1;" # Generate additional Laravel artifacts for testing - task docker:run:artisan -- "l5-swagger:generate" + docker exec restarters php artisan l5-swagger:generate # Setup Discourse API - run: @@ -104,7 +104,7 @@ jobs: docker exec postgresql psql -U postgres -c "INSERT INTO api_keys (id, user_id, created_by_id, created_at, updated_at, allowed_ips, hidden, last_used_at, revoked_at, description, key_hash, truncated_key) VALUES (1, NULL, 1, '2021-10-25 13:56:20.033338', '2021-10-25 13:56:20.033338', NULL, false, NULL, NULL, 'Restarters', 'd89e9dfacfb611fbaf004807648187ce7ed474df44dcb0ada230fab5c8dd6a5b', '9fd7');" bitnami_discourse # Configure Discourse settings - task docker:run:artisan -- "discourse:setting personal_message_enabled_groups 10" + docker exec restarters php artisan discourse:setting personal_message_enabled_groups 10 # Run PHPUnit tests - run: @@ -141,7 +141,7 @@ jobs: command: | # Clean up test data that might interfere - run directly on MySQL container docker exec restarters_db mysql -u root -ps3cr3t -e "use restarters_db_test;SET foreign_key_checks=0;DELETE FROM \`groups\` WHERE location IS NULL;SET foreign_key_checks=1;" - task docker:run:artisan -- "cache:clear" + docker exec restarters php artisan cache:clear # Create test user task docker:run:bash -- "echo \"App\\\\User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);\" | php artisan tinker" || true From 5818a4020784b466748994401a531acd0de70eeb Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 11:39:34 +0100 Subject: [PATCH 010/189] WIP Change CircleCI to use Docker Compose. --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a71ccb1274..bf348c60eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -112,8 +112,8 @@ jobs: command: | # Create test results directory on host mkdir -p /tmp/test-results/phpunit - # Run PHPUnit with JUnit XML output - task docker:run:bash -- "export XDEBUG_MODE=coverage; ./vendor/bin/phpunit -d memory_limit=1024M --bootstrap vendor/autoload.php --coverage-clover tests/clover.xml --log-junit /tmp/phpunit-results.xml --configuration ./phpunit.xml" + # Run PHPUnit with JUnit XML output - using direct docker exec to avoid quote issues + docker exec restarters bash -c "export XDEBUG_MODE=coverage; ./vendor/bin/phpunit -d memory_limit=1024M --bootstrap vendor/autoload.php --coverage-clover tests/clover.xml --log-junit /tmp/phpunit-results.xml --configuration ./phpunit.xml" # Copy test results to host docker cp restarters:/tmp/phpunit-results.xml /tmp/test-results/phpunit/results.xml no_output_timeout: 45m @@ -122,7 +122,7 @@ jobs: - run: name: Upload coverage command: | - task docker:run:bash -- "mkdir -p build/logs && php vendor/bin/php-coveralls -v -x tests/clover.xml" + docker exec restarters bash -c "mkdir -p build/logs && php vendor/bin/php-coveralls -v -x tests/clover.xml" # Run Jest tests - run: @@ -131,7 +131,7 @@ jobs: # Create test results directory for Jest mkdir -p /tmp/test-results/jest # Run Jest with JUnit output - task docker:run:bash -- "npm run jest -- --outputFile=/tmp/jest-results.xml --testResultsProcessor=jest-junit" + docker exec restarters bash -c "npm run jest -- --outputFile=/tmp/jest-results.xml --testResultsProcessor=jest-junit" # Copy test results to host if they exist docker cp restarters:/tmp/jest-results.xml /tmp/test-results/jest/results.xml || echo "Jest results not found, skipping" @@ -144,13 +144,13 @@ jobs: docker exec restarters php artisan cache:clear # Create test user - task docker:run:bash -- "echo \"App\\\\User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);\" | php artisan tinker" || true + docker exec restarters bash -c "echo \"App\\\\User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);\" | php artisan tinker" || true # Build assets - task docker:run:bash -- "export NODE_OPTIONS=--max-old-space-size=8192; npm rebuild node-sass; npm run prod" + docker exec restarters bash -c "export NODE_OPTIONS=--max-old-space-size=8192; npm rebuild node-sass; npm run prod" # Disable API throttling for tests - task docker:run:bash -- "sed -i 's/.throttle:api.,//g' /var/www/app/Http/Kernel.php" + docker exec restarters bash -c "sed -i 's/.throttle:api.,//g' /var/www/app/Http/Kernel.php" # Run Playwright tests - run: @@ -159,7 +159,7 @@ jobs: # Create test results directory for Playwright mkdir -p /tmp/test-results/playwright # Run Playwright tests with proper output directory - task docker:run:bash -- "export PLAYWRIGHT_DEBUG=true; export DEBUG=playwright; export PLAYWRIGHT_BASE_URL=http://localhost:8001; npx playwright test --reporter=junit --output-dir=/tmp/playwright-results" + docker exec restarters bash -c "export PLAYWRIGHT_DEBUG=true; export DEBUG=playwright; export PLAYWRIGHT_BASE_URL=http://localhost:8001; npx playwright test --reporter=junit --output-dir=/tmp/playwright-results" # Copy test results and artifacts to host docker cp restarters:/tmp/playwright-results /tmp/test-results/playwright/ || echo "Playwright results not found, skipping" no_output_timeout: 10m From e1dcf203fdca2cfc29d225da8c8efbc19cff755f Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Mon, 23 Jun 2025 12:13:57 +0100 Subject: [PATCH 011/189] WIP Change CircleCI to use Docker Compose. --- phpunit.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index acd1214587..760533435b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -26,7 +26,8 @@ - + + From b3ced0179cd587ff1340fa1eb72991609ab88888 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 14:34:22 +0100 Subject: [PATCH 012/189] We are using MySQL 8, so up the Docker Compose version. Also update playwright packages. --- docker-compose.yml | 2 +- package-lock.json | 555 +++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 3 files changed, 517 insertions(+), 42 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5c9abbb9f3..27f9e17ba7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -117,7 +117,7 @@ services: restarters_db: profiles: ["core", "debug", "discourse"] - image: mysql:5.7.33 + image: mysql:8.0 container_name: restarters_db restart: unless-stopped tty: true diff --git a/package-lock.json b/package-lock.json index 5b4aa07174..863030dcdd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "devDependencies": { "@babel/core": "^7.22.8", "@babel/preset-env": "^7.22.7", - "@playwright/test": "^1.14.1", + "@playwright/test": "^1.53.2", "@vue/test-utils": "^1.3.6", "@vue/vue2-jest": "^28.1.0", "axios": "^0.28", @@ -102,6 +102,27 @@ "node": ">=6.0.0" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "peer": true, + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "peer": true + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -1930,6 +1951,121 @@ "node": ">=0.1.90" } }, + "node_modules/@csstools/color-helpers": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", + "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "peer": true, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.10.tgz", + "integrity": "sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "peer": true, + "dependencies": { + "@csstools/color-helpers": "^5.0.2", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "peer": true, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "peer": true, + "engines": { + "node": ">=18" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -3132,31 +3268,28 @@ } }, "node_modules/@playwright/test": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.23.0.tgz", - "integrity": "sha512-RPWI8AHBVBiDyfTuxi1BhOaY3yaVy3S5ZsGKkSGGeWpZtSgN4SerInCYvgh9+EunIAK4RJQo+bzupbAn5pVqHQ==", + "version": "1.53.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.2.tgz", + "integrity": "sha512-tEB2U5z74ebBeyfGNZ3Jfg29AnW+5HlWhvHtb/Mqco9pFdZU1ZLNdVb2UtB5CvmiilNr2ZfVH/qMmAROG/XTzw==", "dev": true, "dependencies": { - "@types/node": "*", - "playwright-core": "1.23.0" + "playwright": "1.53.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=18" } }, - "node_modules/@playwright/test/node_modules/playwright-core": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.23.0.tgz", - "integrity": "sha512-Zzhyr5RZGoJ1ek2sgfJCt2076kdOg8hnNwFBqAYeLySiutXyxSQk93vZ5gbnFiWV1sHvueCcwla9n35acUTxtA==", - "dev": true, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" } }, "node_modules/@sentry/browser": { @@ -3445,6 +3578,12 @@ "@types/range-parser": "*" } }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "peer": true + }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -3560,6 +3699,15 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, + "node_modules/@types/leaflet": { + "version": "1.9.19", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.19.tgz", + "integrity": "sha512-pB+n2daHcZPF2FDaWa+6B0a0mSDf4dPU35y5iTXsx7x/PzzshiX5atYiS1jlBn43X7XvM8AP+AB26lnSk0J4GA==", + "peer": true, + "dependencies": { + "@types/geojson": "*" + } + }, "node_modules/@types/mime": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", @@ -6642,9 +6790,9 @@ } }, "node_modules/decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", "dev": true }, "node_modules/dedent": { @@ -12267,8 +12415,7 @@ "node_modules/jquery": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", - "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==", - "dev": true + "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" }, "node_modules/jquery-bootgrid": { "version": "1.3.1", @@ -12360,6 +12507,46 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "peer": true, + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, "node_modules/jsdom-global": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/jsdom-global/-/jsdom-global-3.0.2.tgz", @@ -12369,6 +12556,203 @@ "jsdom": ">=10.0.0" } }, + "node_modules/jsdom/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/jsdom/node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "peer": true, + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "peer": true, + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "peer": true, + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "peer": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/jsdom/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "peer": true, + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/jsdom/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "peer": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "peer": true, + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/jsdom/node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "peer": true, + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/jsdom/node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "peer": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "peer": true, + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + } + }, "node_modules/jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", @@ -16128,9 +16512,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "version": "2.2.20", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.20.tgz", + "integrity": "sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==", "dev": true }, "node_modules/nyc": { @@ -16606,6 +16990,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "peer": true, + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -16770,31 +17180,33 @@ } }, "node_modules/playwright": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.23.0.tgz", - "integrity": "sha512-rfZfuLueBPGV3UdEqPQxS8Uw7TgVMATWSPb3O0oV8SZBmVAhOndkOU9MPP8dxJoQI68r94yevuObPr14PhW9Xg==", + "version": "1.53.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.2.tgz", + "integrity": "sha512-6K/qQxVFuVQhRQhFsVZ9fGeatxirtrpPgxzBYWyZLEXJzqYwuL4fuNmfOfD5et1tJE4GScKyPNeLhZeRwuTU3A==", "dev": true, - "hasInstallScript": true, "dependencies": { - "playwright-core": "1.23.0" + "playwright-core": "1.53.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, - "node_modules/playwright/node_modules/playwright-core": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.23.0.tgz", - "integrity": "sha512-Zzhyr5RZGoJ1ek2sgfJCt2076kdOg8hnNwFBqAYeLySiutXyxSQk93vZ5gbnFiWV1sHvueCcwla9n35acUTxtA==", + "node_modules/playwright-core": { + "version": "1.53.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.2.tgz", + "integrity": "sha512-ox/OytMy+2w1jcYEYlOo1Hhp8hZkLCximMTUTMBXjGUA1KoFfiSZ+DU+3a739jsPY0yoKH2TFy9S2fsJas8yAw==", "dev": true, "bin": { - "playwright": "cli.js" + "playwright-core": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/popper.js": { @@ -17527,9 +17939,9 @@ "dev": true }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "engines": { "node": ">=6" } @@ -18010,6 +18422,13 @@ "inherits": "^2.0.1" } }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "peer": true + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -18137,6 +18556,19 @@ "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==", "dev": true }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "peer": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, "node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -19338,6 +19770,26 @@ "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "peer": true, + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "peer": true + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -19966,6 +20418,29 @@ "browser-process-hrtime": "^1.0.0" } }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "peer": true, + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/w3c-xmlserializer/node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + } + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", diff --git a/package.json b/package.json index 45285b2161..14717c8e0e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "devDependencies": { "@babel/core": "^7.22.8", "@babel/preset-env": "^7.22.7", - "@playwright/test": "^1.14.1", + "@playwright/test": "^1.53.2", "@vue/test-utils": "^1.3.6", "@vue/vue2-jest": "^28.1.0", "axios": "^0.28", From 6b40f1fca129fc43b117b6d1f8eea73e5348ca6a Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 15:21:47 +0100 Subject: [PATCH 013/189] Fail Docker startup on error. --- docker_run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker_run.sh b/docker_run.sh index a7ad4fe485..c39fb1ca0b 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -3,6 +3,9 @@ # # We install composer dependencies in here rather than during the build step so that if we switch branches # and restart the container, it works. +# +# Fail on error. +set -e USER_ID=${UID:-1000} GROUP_ID=${GID:-1000} From a3b646239dd884895f46d0cde93f329a41f4d7b8 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 15:22:15 +0100 Subject: [PATCH 014/189] Migration creates TRIGGERs which are no longer used and require permissions we don't have in Docker Compose environment. --- ..._27_101759_repair_status_to_string_data.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php index f3833f5a98..7be22cd075 100644 --- a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php +++ b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php @@ -33,24 +33,6 @@ public function up() DB::table('devices') ->where('repair_status', 0) ->update(['repair_status_str' => 'Unknown']); - DB::unprepared("CREATE TRIGGER `repair_status_str_up` -BEFORE UPDATE ON `devices` FOR EACH ROW -SET NEW.repair_status_str = CASE - WHEN NEW.repair_status = 1 THEN 'Fixed' - WHEN NEW.repair_status = 2 THEN 'Repairable' - WHEN NEW.repair_status = 3 THEN 'End of life' - ELSE 'Unknown' -END; -"); - DB::unprepared("CREATE TRIGGER `repair_status_str_in` -BEFORE INSERT ON `devices` FOR EACH ROW -SET NEW.repair_status_str = CASE - WHEN NEW.repair_status = 1 THEN 'Fixed' - WHEN NEW.repair_status = 2 THEN 'Repairable' - WHEN NEW.repair_status = 3 THEN 'End of life' - ELSE 'Unknown' -END; -"); } /** From 34f58f4ca2e3b4651d055c7a2ac06793c4bcb4bd Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 16:34:11 +0100 Subject: [PATCH 015/189] Phpunit tests failing. --- Dockerfile | 1 + ...27_101759_repair_status_to_string_data.php | 2 -- ..._08_000001_drop_repair_status_triggers.php | 28 +++++++++++++++++++ docker_run.sh | 20 +++++++------ phpunit.xml | 2 +- tests/Feature/Devices/EditTest.php | 1 + 6 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 database/migrations/2025_01_08_000001_drop_repair_status_triggers.php diff --git a/Dockerfile b/Dockerfile index 2b10fc3e94..3fcc16bf7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ RUN install-php-extensions \ xmlrpc \ xdebug \ intl \ + exif \ gd # Install composer. Don't run composer install yet - see docker_run.sh diff --git a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php index 7be22cd075..c3721a8f0c 100644 --- a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php +++ b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php @@ -42,8 +42,6 @@ public function up() */ public function down() { - DB::unprepared('DROP TRIGGER IF EXISTS `repair_status_str_in`'); - DB::unprepared('DROP TRIGGER IF EXISTS `repair_status_str_up`'); if (Schema::hasColumn('devices', 'repair_status_str')) { Schema::table('devices', function (Blueprint $table) { $table->dropColumn('repair_status_str'); diff --git a/database/migrations/2025_01_08_000001_drop_repair_status_triggers.php b/database/migrations/2025_01_08_000001_drop_repair_status_triggers.php new file mode 100644 index 0000000000..3edf06a2e0 --- /dev/null +++ b/database/migrations/2025_01_08_000001_drop_repair_status_triggers.php @@ -0,0 +1,28 @@ +/dev/null || true - fi -done - # Ensure storage directories exist and have correct permissions mkdir -p storage/framework/cache/data mkdir -p storage/framework/sessions mkdir -p storage/framework/views mkdir -p storage/logs mkdir -p bootstrap/cache +mkdir -p uploads +mkdir -p public/uploads + +# Only change ownership of directories that need it, excluding .git and other system files +# This prevents permission errors on files owned by the host system +echo "Fixing file permissions with ${USER_ID}:${GROUP_ID}" +for dir in storage bootstrap/cache vendor node_modules uploads public/uploads; do + if [ -d "$dir" ]; then + chown -R ${USER_ID}:${GROUP_ID} "$dir" 2>/dev/null || true + fi +done php artisan migrate npm install --legacy-peer-deps diff --git a/phpunit.xml b/phpunit.xml index 760533435b..5ae0acf275 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + ./app diff --git a/tests/Feature/Devices/EditTest.php b/tests/Feature/Devices/EditTest.php index be3d7b11fb..7af0f6d122 100644 --- a/tests/Feature/Devices/EditTest.php +++ b/tests/Feature/Devices/EditTest.php @@ -116,6 +116,7 @@ public function testDeviceEditAddImage() { $params = []; $response = $this->json('POST', '/device/image-upload/' . $iddevices, $params); + $response->assertSuccessful(); $ret = json_decode($response->getContent(), TRUE); self::assertEquals(true, $ret['success']); self::assertEquals($iddevices, $ret['iddevices']); From 5b76d7b53edd70a99b245df6d82d33bdfdc5fa43 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 17:02:17 +0100 Subject: [PATCH 016/189] pcntl_signal not found. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 3fcc16bf7c..f609299032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,7 @@ RUN install-php-extensions \ xdebug \ intl \ exif \ + pcntl \ gd # Install composer. Don't run composer install yet - see docker_run.sh From 6df44bfc4bff22d35c0f1086d8427a3daa144985 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 17:22:13 +0100 Subject: [PATCH 017/189] Handle test user already existing. --- .circleci/config.yml | 2 +- docker_run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bf348c60eb..479b8bf4dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -144,7 +144,7 @@ jobs: docker exec restarters php artisan cache:clear # Create test user - docker exec restarters bash -c "echo \"App\\\\User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);\" | php artisan tinker" || true + docker exec restarters bash -c "echo \"App\\\\User::firstOrCreate(['email'=>'jane@bloggs.net'], ['name'=>'Jane Bloggs','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);\" | php artisan tinker" || true # Build assets docker exec restarters bash -c "export NODE_OPTIONS=--max-old-space-size=8192; npm rebuild node-sass; npm run prod" diff --git a/docker_run.sh b/docker_run.sh index 3867fda7fe..7d9978ef76 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -68,7 +68,7 @@ php artisan cache:clear php artisan config:clear # Ensure we have the admin user -echo "User::create(['name'=>'Jane Bloggs','email'=>'jane@bloggs.net','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);" | php artisan tinker +echo "User::firstOrCreate(['email'=>'jane@bloggs.net'], ['name'=>'Jane Bloggs','password'=>Hash::make('passw0rd'),'role'=>2,'consent_past_data'=>'2021-01-01','consent_future_data'=>'2021-01-01','consent_gdpr'=>'2021-01-01']);" | php artisan tinker php-fpm From 1cf62fc606ea0be59cbbc66b4d6b0e679f2a614a Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 17:31:04 +0100 Subject: [PATCH 018/189] Phpunit tests failing. --- docker_run.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker_run.sh b/docker_run.sh index 7d9978ef76..1efc8165a8 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -3,10 +3,6 @@ # # We install composer dependencies in here rather than during the build step so that if we switch branches # and restart the container, it works. -# -# Fail on error. -set -e - USER_ID=${UID:-1000} GROUP_ID=${GID:-1000} From 313662286e7802aad80eb32ec120a838c277acd5 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 17:49:52 +0100 Subject: [PATCH 019/189] Phpunit tests failing. --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 8631a450f5..2d50042a14 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -241,7 +241,7 @@ tasks: # Wait for core services (always needed) wait_for_service "MySQL database" "docker exec restarters_db mysqladmin ping -h localhost -u root -ps3cr3t --silent" 60 5 - wait_for_service "Restarters web application" "curl -f -s http://localhost:8001" 60 5 + wait_for_service "Restarters web application" "curl -f -s http://localhost:8001" 120 5 # Wait for debug services (if in debug or all profile) {{- if or (eq .PROFILE "debug") (eq .PROFILE "all") }} From 0e49551de3131cc1c5ace2ecc3b1fc3b097f89cb Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 19:12:58 +0100 Subject: [PATCH 020/189] Make docker_run wait for DB to be available before proceeding. --- docker_run.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docker_run.sh b/docker_run.sh index 1efc8165a8..3dc74403d4 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -31,6 +31,40 @@ sed -i 's/DISCOURSE_SECRET=.*$/DISCOURSE_SECRET=mustbetencharacters/g' .env sed -i 's/SESSION_DOMAIN=.*$/SESSION_DOMAIN=/g' phpunit.xml sed -i 's/DB_TEST_HOST=.*$/DB_TEST_HOST=restarters_db/g' phpunit.xml +# Cross-platform sleep function +cross_platform_sleep() { + if command -v sleep >/dev/null 2>&1; then + sleep "$1" + elif command -v powershell >/dev/null 2>&1; then + powershell -Command "Start-Sleep -Seconds $1" + else + # Fallback using ping (works on most systems) + ping -n $(($1 + 1)) 127.0.0.1 >/dev/null 2>&1 || ping -c $1 127.0.0.1 >/dev/null 2>&1 + fi +} + +# Generic wait function that takes: service_name, check_command, max_attempts, sleep_interval +wait_for_service() { + local service_name="$1" + local check_command="$2" + local max_attempts="$3" + local sleep_interval="$4" + + echo "Waiting for $service_name..." + local attempt=0 + while [ $attempt -lt $max_attempts ]; do + if eval "$check_command" >/dev/null 2>&1; then + echo "✓ $service_name is ready" + return 0 + fi + echo " $service_name not ready, waiting... (attempt $((attempt + 1))/$max_attempts)" + cross_platform_sleep "$sleep_interval" + attempt=$((attempt + 1)) + done + echo "❌ $service_name failed to start after $max_attempts attempts" + exit 1 +} + # Ensure storage directories exist and have correct permissions mkdir -p storage/framework/cache/data mkdir -p storage/framework/sessions @@ -49,6 +83,9 @@ for dir in storage bootstrap/cache vendor node_modules uploads public/uploads; d fi done +# Wait for MySQL database to be ready before running migrations +wait_for_service "MySQL database" "docker exec restarters_db mysqladmin ping -h localhost -u root -ps3cr3t --silent" 60 5 + php artisan migrate npm install --legacy-peer-deps npm rebuild node-sass From 0277f5e9ed31596abc6d7bb97cd48413b687c76a Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 19:26:08 +0100 Subject: [PATCH 021/189] Make docker_run wait for DB to be available before proceeding. --- docker_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_run.sh b/docker_run.sh index 3dc74403d4..e705e0cfda 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -84,7 +84,7 @@ for dir in storage bootstrap/cache vendor node_modules uploads public/uploads; d done # Wait for MySQL database to be ready before running migrations -wait_for_service "MySQL database" "docker exec restarters_db mysqladmin ping -h localhost -u root -ps3cr3t --silent" 60 5 +wait_for_service "MySQL database" "docker exec restarters_db mysqladmin ping -h restarters_db -u root -ps3cr3t --silent" 60 5 php artisan migrate npm install --legacy-peer-deps From bcad74f62edcd3ce1c5c78186bd4f57cec7648a3 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 19:38:29 +0100 Subject: [PATCH 022/189] Make docker_run wait for DB to be available before proceeding. --- Dockerfile | 1 + docker_run.sh | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index f609299032..37825481c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update && \ npm \ vim \ default-mysql-client \ + mysql-client-core-8.0 \ postgresql-client && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/docker_run.sh b/docker_run.sh index e705e0cfda..382e55bb86 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -31,18 +31,6 @@ sed -i 's/DISCOURSE_SECRET=.*$/DISCOURSE_SECRET=mustbetencharacters/g' .env sed -i 's/SESSION_DOMAIN=.*$/SESSION_DOMAIN=/g' phpunit.xml sed -i 's/DB_TEST_HOST=.*$/DB_TEST_HOST=restarters_db/g' phpunit.xml -# Cross-platform sleep function -cross_platform_sleep() { - if command -v sleep >/dev/null 2>&1; then - sleep "$1" - elif command -v powershell >/dev/null 2>&1; then - powershell -Command "Start-Sleep -Seconds $1" - else - # Fallback using ping (works on most systems) - ping -n $(($1 + 1)) 127.0.0.1 >/dev/null 2>&1 || ping -c $1 127.0.0.1 >/dev/null 2>&1 - fi -} - # Generic wait function that takes: service_name, check_command, max_attempts, sleep_interval wait_for_service() { local service_name="$1" @@ -58,7 +46,7 @@ wait_for_service() { return 0 fi echo " $service_name not ready, waiting... (attempt $((attempt + 1))/$max_attempts)" - cross_platform_sleep "$sleep_interval" + sleep "$sleep_interval" attempt=$((attempt + 1)) done echo "❌ $service_name failed to start after $max_attempts attempts" @@ -84,7 +72,7 @@ for dir in storage bootstrap/cache vendor node_modules uploads public/uploads; d done # Wait for MySQL database to be ready before running migrations -wait_for_service "MySQL database" "docker exec restarters_db mysqladmin ping -h restarters_db -u root -ps3cr3t --silent" 60 5 +wait_for_service "MySQL database" "mysqladmin ping -h restarters_db -u root -ps3cr3t --silent" 60 5 php artisan migrate npm install --legacy-peer-deps From 865054f7fd08e63af7f6d57bbd583ded570bf221 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 19:43:23 +0100 Subject: [PATCH 023/189] Make docker_run wait for DB to be available before proceeding. --- Dockerfile | 1 - docker_run.sh | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 37825481c9..f609299032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ RUN apt-get update && \ npm \ vim \ default-mysql-client \ - mysql-client-core-8.0 \ postgresql-client && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/docker_run.sh b/docker_run.sh index 382e55bb86..189e0bb471 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -72,9 +72,12 @@ for dir in storage bootstrap/cache vendor node_modules uploads public/uploads; d done # Wait for MySQL database to be ready before running migrations -wait_for_service "MySQL database" "mysqladmin ping -h restarters_db -u root -ps3cr3t --silent" 60 5 +wait_for_service "MySQL database" "nc -z restarters_db 3306" 60 5 php artisan migrate + +# Ensure test database exists and migrations are run +php artisan migrate --database=testmysql npm install --legacy-peer-deps npm rebuild node-sass php artisan lang:js --no-lib resources/js/translations.js From 7e8e1c4034197807f03c0c9fa3e4be658a859caa Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 20:06:24 +0100 Subject: [PATCH 024/189] Make docker_run wait for DB to be available before proceeding. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f609299032..35a1412fc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && \ unzip \ npm \ vim \ + netcat \ default-mysql-client \ postgresql-client && \ apt-get clean && \ From 4ed280329f8375f5d87bf7cf326e14d29a1d6c84 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 20:07:56 +0100 Subject: [PATCH 025/189] Make docker_run wait for DB to be available before proceeding. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 35a1412fc5..761fa636ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ unzip \ npm \ vim \ - netcat \ + netcat-openbsd \ default-mysql-client \ postgresql-client && \ apt-get clean && \ From 07b8d4631faa2409b788f43d14a86d24efbf0507 Mon Sep 17 00:00:00 2001 From: Edward Hibbert Date: Tue, 8 Jul 2025 20:33:30 +0100 Subject: [PATCH 026/189] PHPUnit test fails. --- Taskfile.yml | 10 +++++----- docker_run.sh | 3 --- phpunit.xml | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 2d50042a14..71141eaa4e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -65,7 +65,7 @@ tasks: PROFILE: "{{index .MATCH 0}}" cmds: - - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' + - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' docker:down-*: desc: Stop Docker containers for a given profile (Usage - task docker:down-[core|debug|discourse|all]) @@ -88,7 +88,7 @@ tasks: vars: *PROFILE_VARS cmds: - - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} down' + - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} down' docker:rebuild-*: desc: Rebuild Docker containers for a given profile (Usage - task docker:rebuild-[core|debug|discourse|all]) @@ -111,8 +111,8 @@ tasks: vars: *PROFILE_VARS cmds: - - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} down -v --rmi all' - - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' + - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} down -v --rmi all' + - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} up -d' docker:restart-*: desc: Restart Docker containers for a given profile (Usage - task docker:restart-[core|debug|discourse|all]) @@ -135,7 +135,7 @@ tasks: vars: *PROFILE_VARS cmds: - - '{{.DOCKER_CMD}} --project-name restarters-ci --profile {{ index .COMPOSE_PROFILES .PROFILE }} restart' + - '{{.DOCKER_CMD}} --profile {{ index .COMPOSE_PROFILES .PROFILE }} restart' docker:logs: diff --git a/docker_run.sh b/docker_run.sh index 189e0bb471..f5f0562a8f 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -75,9 +75,6 @@ done wait_for_service "MySQL database" "nc -z restarters_db 3306" 60 5 php artisan migrate - -# Ensure test database exists and migrations are run -php artisan migrate --database=testmysql npm install --legacy-peer-deps npm rebuild node-sass php artisan lang:js --no-lib resources/js/translations.js diff --git a/phpunit.xml b/phpunit.xml index 5ae0acf275..760533435b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + ./app From 9595dd0428f52885eb673185ac1b70c56560688b Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:20 +0000 Subject: [PATCH 027/189] Adopt short array syntax Since PHP 5.4 the short array syntax `[]` may be used instead of `array()`. --- app/Http/Controllers/API/EventController.php | 4 ++-- app/Http/Controllers/API/GroupController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/API/EventController.php b/app/Http/Controllers/API/EventController.php index 38859a52d4..18646434db 100644 --- a/app/Http/Controllers/API/EventController.php +++ b/app/Http/Controllers/API/EventController.php @@ -740,7 +740,7 @@ function ($attribute, $value, $fail) use ($request) { $longitude = $geocoded['longitude']; } - return array( + return [ $groupid, $start, $end, @@ -753,6 +753,6 @@ function ($attribute, $value, $fail) use ($request) { $online, $link, $network_data - ); + ]; } } diff --git a/app/Http/Controllers/API/GroupController.php b/app/Http/Controllers/API/GroupController.php index 25076f9334..bd120ec97e 100644 --- a/app/Http/Controllers/API/GroupController.php +++ b/app/Http/Controllers/API/GroupController.php @@ -1053,7 +1053,7 @@ private function validateGroupParams(Request $request, $create): array { $country_code = $geocoded['country_code']; } - return array( + return [ $name, $area, $postcode, @@ -1068,6 +1068,6 @@ private function validateGroupParams(Request $request, $create): array { $network_data, $email, $archived_at - ); + ]; } } From de56b3da11070f35b6d47b1350aab56b8b15454c Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:22 +0000 Subject: [PATCH 028/189] Slim `lang` files --- lang/en/auth.php | 2 +- lang/en/pagination.php | 6 -- lang/en/passwords.php | 6 +- lang/en/validation.php | 174 ----------------------------------------- 4 files changed, 4 insertions(+), 184 deletions(-) delete mode 100644 lang/en/pagination.php delete mode 100644 lang/en/validation.php diff --git a/lang/en/auth.php b/lang/en/auth.php index 1b03c1090d..212f0c0d5e 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -5,7 +5,7 @@ 'login' => 'Login', 'delete_account' => 'Delete account', 'failed' => 'Either this email address isn\'t registered on the system or the password is incorrect.', - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + 'email_address' => 'Email address', 'sign_in' => 'I remembered. Let me sign in', 'forgotten_pw' => 'Forgotten your password?', diff --git a/lang/en/pagination.php b/lang/en/pagination.php deleted file mode 100644 index 556ffb5df7..0000000000 --- a/lang/en/pagination.php +++ /dev/null @@ -1,6 +0,0 @@ - '« Previous', - 'next' => 'Next »', -]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php index 347b32df5c..58fc6ca863 100644 --- a/lang/en/passwords.php +++ b/lang/en/passwords.php @@ -1,11 +1,11 @@ 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', - 'token' => 'This password reset token is invalid.', + 'user' => 'We can\'t find a user with that e-mail address.', - 'throttled' => 'Please wait before retrying.', + 'invalid' => 'Please input a valid email.', 'recover_title' => 'Account Recovery', 'match' => 'The passwords do not match', diff --git a/lang/en/validation.php b/lang/en/validation.php deleted file mode 100644 index 5ea01fa77d..0000000000 --- a/lang/en/validation.php +++ /dev/null @@ -1,174 +0,0 @@ - 'The :attribute must be accepted.', - 'accepted_if' => 'The :attribute must be accepted when :other is :value.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute must only contain letters.', - 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute must only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ - 'array' => 'The :attribute must have between :min and :max items.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'numeric' => 'The :attribute must be between :min and :max.', - 'string' => 'The :attribute must be between :min and :max characters.', - ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'current_password' => 'The password is incorrect.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'declined' => 'The :attribute must be declined.', - 'declined_if' => 'The :attribute must be declined when :other is :value.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.', - 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'enum' => 'The selected :attribute is invalid.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ - 'array' => 'The :attribute must have more than :value items.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'numeric' => 'The :attribute must be greater than :value.', - 'string' => 'The :attribute must be greater than :value characters.', - ], - 'gte' => [ - 'array' => 'The :attribute must have :value items or more.', - 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be greater than or equal to :value.', - 'string' => 'The :attribute must be greater than or equal to :value characters.', - ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lt' => [ - 'array' => 'The :attribute must have less than :value items.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'numeric' => 'The :attribute must be less than :value.', - 'string' => 'The :attribute must be less than :value characters.', - ], - 'lte' => [ - 'array' => 'The :attribute must not have more than :value items.', - 'file' => 'The :attribute must be less than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be less than or equal to :value.', - 'string' => 'The :attribute must be less than or equal to :value characters.', - ], - 'mac_address' => 'The :attribute must be a valid MAC address.', - 'max' => [ - 'array' => 'The :attribute must not have more than :max items.', - 'file' => 'The :attribute must not be greater than :max kilobytes.', - 'numeric' => 'The :attribute must not be greater than :max.', - 'string' => 'The :attribute must not be greater than :max characters.', - ], - 'max_digits' => 'The :attribute must not have more than :max digits.', - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ - 'array' => 'The :attribute must have at least :min items.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'numeric' => 'The :attribute must be at least :min.', - 'string' => 'The :attribute must be at least :min characters.', - ], - 'min_digits' => 'The :attribute must have at least :min digits.', - 'multiple_of' => 'The :attribute must be a multiple of :value.', - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => [ - 'letters' => 'The :attribute must contain at least one letter.', - 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', - 'numbers' => 'The :attribute must contain at least one number.', - 'symbols' => 'The :attribute must contain at least one symbol.', - 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', - ], - 'present' => 'The :attribute field must be present.', - 'prohibited' => 'The :attribute field is prohibited.', - 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', - 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', - 'prohibits' => 'The :attribute field prohibits :other from being present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_array_keys' => 'The :attribute field must contain entries for: :values.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_if_accepted' => 'The :attribute field is required when :other is accepted.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ - 'array' => 'The :attribute must contain :size items.', - 'file' => 'The :attribute must be :size kilobytes.', - 'numeric' => 'The :attribute must be :size.', - 'string' => 'The :attribute must be :size characters.', - ], - 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid timezone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute must be a valid URL.', - 'uuid' => 'The :attribute must be a valid UUID.', - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => [ - 'attribute-name' => [ - 'rule-name' => 'custom-message', - ], - ], - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap our attribute placeholder - | with something more reader friendly such as "E-Mail Address" instead - | of "email". This simply helps us make our message more expressive. - | - */ - - 'attributes' => [], - -]; From 5c14480f663eb0112754c2892a5a139258b06e64 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:23 +0000 Subject: [PATCH 029/189] Remove explicit call to register policies --- app/Providers/AuthServiceProvider.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index db44fadf7d..a98068cfb1 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -29,8 +29,6 @@ class AuthServiceProvider extends ServiceProvider */ public function boot() { - $this->registerPolicies(); - // } } From e3e1a77791f278f39c8f36023309cdbde8ec88a9 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:24 +0000 Subject: [PATCH 030/189] Shift core files --- app/Exceptions/Handler.php | 9 --------- app/Http/Controllers/Controller.php | 3 +-- app/Http/Kernel.php | 9 +++++---- app/Http/Middleware/Authenticate.php | 10 +++------- app/Http/Middleware/RedirectIfAuthenticated.php | 8 +++----- app/Http/Middleware/TrustHosts.php | 2 +- app/Providers/BroadcastServiceProvider.php | 4 +--- app/Providers/RouteServiceProvider.php | 16 +++------------- database/factories/UserFactory.php | 5 ++++- phpunit.xml | 3 ++- tests/CreatesApplication.php | 5 ++--- 11 files changed, 25 insertions(+), 49 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 576c74f831..f29ece7e74 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -8,15 +8,6 @@ class Handler extends ExceptionHandler { - /** - * A list of the exception types that are not reported. - * - * @var array - */ - protected $dontReport = [ - - ]; - /** * A list of the inputs that are never flashed for validation exceptions. * diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 6c28bcb782..4c97f6f73e 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -3,12 +3,11 @@ namespace App\Http\Controllers; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; use Party; class Controller extends BaseController { - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; + use AuthorizesRequests, ValidatesRequests; } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 7c1a359ba1..dcf15edb83 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -45,25 +45,26 @@ class Kernel extends HttpKernel \App\Http\Middleware\VerifyTranslationAccess::class, ], 'api' => [ - 'throttle:api', + \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; /** - * The application's route middleware. + * The application's middleware aliases. * - * These middleware may be assigned to groups or used individually. + * Aliases may be used to conveniently assign middleware to routes and groups. * * @var array */ - protected $routeMiddleware = [ + protected $middlewareAliases = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verifyUserConsent' => \App\Http\Middleware\VerifyUserConsent::class, diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a4be5c587e..d4ef6447a9 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -3,19 +3,15 @@ namespace App\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; +use Illuminate\Http\Request; class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. - * - * @param \Illuminate\Http\Request $request - * @return string */ - protected function redirectTo($request) + protected function redirectTo(Request $request): ?string { - if (! $request->expectsJson()) { - return route('login'); - } + return $request->expectsJson() ? null : route('login'); } } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index a2813a0648..afc78c4e53 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -6,18 +6,16 @@ use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Symfony\Component\HttpFoundation\Response; class RedirectIfAuthenticated { /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next - * @param string|null ...$guards - * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse + * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ - public function handle(Request $request, Closure $next, ...$guards) + public function handle(Request $request, Closure $next, string ...$guards): Response { $guards = empty($guards) ? [null] : $guards; diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 7186414c65..c9c58bddce 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -11,7 +11,7 @@ class TrustHosts extends Middleware * * @return array */ - public function hosts() + public function hosts(): array { return [ $this->allSubdomainsOfApplicationUrl(), diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 395c518bc4..2be04f5d9d 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -9,10 +9,8 @@ class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ - public function boot() + public function boot(): void { Broadcast::routes(); diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index adb0175cd4..9cbebde2ca 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -53,23 +53,13 @@ protected function mapApiRoutes() */ public function boot() { - $this->configureRateLimiting(); + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(300)->by($request->user()?->id ?: $request->ip()); + }); $this->routes(function () { $this->mapApiRoutes(); $this->mapWebRoutes(); }); } - - /** - * Configure the rate limiters for the application. - * - * @return void - */ - protected function configureRateLimiting() - { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(300)->by($request->user()?->id ?: $request->ip()); - }); - } } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index c151ae195e..d4be28169b 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories; +use Illuminate\Support\Facades\Hash; use Illuminate\Database\Eloquent\Factories\Factory; use App\Role; use App\User; @@ -25,13 +26,15 @@ class UserFactory extends Factory * * @return array */ + protected static ?string $password; + public function definition() { return [ 'name' => $this->faker->name(), 'email' => $this->faker->unique()->safeEmail(), 'username' => $this->faker->userName(), - 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret + 'password' => static::$password ??= Hash::make('secret'), 'remember_token' => Str::random(10), 'consent_past_data' => new \DateTime(), 'consent_future_data' => new \DateTime(), diff --git a/phpunit.xml b/phpunit.xml index acd1214587..a1120c07b6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,7 +23,8 @@ - + + diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 547152f6a9..cc68301129 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -3,15 +3,14 @@ namespace Tests; use Illuminate\Contracts\Console\Kernel; +use Illuminate\Foundation\Application; trait CreatesApplication { /** * Creates the application. - * - * @return \Illuminate\Foundation\Application */ - public function createApplication() + public function createApplication(): Application { $app = require __DIR__.'/../bootstrap/app.php'; From 9e0b1c2188e460ecc93e39ec86cece2632415aee Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:25 +0000 Subject: [PATCH 031/189] Shift config files --- config/broadcasting.php | 3 ++- config/cache.php | 1 + config/hashing.php | 4 +++- config/mail.php | 28 ++++++++++++++++++++++------ config/session.php | 13 +++++++++++++ 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/config/broadcasting.php b/config/broadcasting.php index 1688242447..2410485384 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -36,7 +36,8 @@ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/config/cache.php b/config/cache.php index 33bb29546e..d4171e2212 100644 --- a/config/cache.php +++ b/config/cache.php @@ -52,6 +52,7 @@ 'file' => [ 'driver' => 'file', 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), ], 'memcached' => [ diff --git a/config/hashing.php b/config/hashing.php index bcd3be4c28..0e8a0bb3ff 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -29,7 +29,8 @@ */ 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), + 'rounds' => env('BCRYPT_ROUNDS', 12), + 'verify' => true, ], /* @@ -47,6 +48,7 @@ 'memory' => 65536, 'threads' => 1, 'time' => 4, + 'verify' => true, ], ]; diff --git a/config/mail.php b/config/mail.php index 534395a369..e894b2e5f8 100644 --- a/config/mail.php +++ b/config/mail.php @@ -28,14 +28,15 @@ | sending an e-mail. You will specify which one you are using for your | mailers below. You are free to add additional mailers as required. | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array", "failover" + | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", + | "postmark", "log", "array", "failover", "roundrobin" | */ 'mailers' => [ 'smtp' => [ 'transport' => 'smtp', + 'url' => env('MAIL_URL'), 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), @@ -49,12 +50,19 @@ 'transport' => 'ses', ], - 'mailgun' => [ - 'transport' => 'mailgun', - ], - 'postmark' => [ 'transport' => 'postmark', + // 'message_stream_id' => null, + // 'client' => [ + // 'timeout' => 5, + // ], + ], + + 'mailgun' => [ + 'transport' => 'mailgun', + // 'client' => [ + // 'timeout' => 5, + // ], ], 'sendmail' => [ @@ -78,6 +86,14 @@ 'log', ], ], + + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + ], ], /* diff --git a/config/session.php b/config/session.php index fa3a0d33d4..1e490f78f7 100644 --- a/config/session.php +++ b/config/session.php @@ -198,4 +198,17 @@ 'same_site' => 'lax', + /* + |-------------------------------------------------------------------------- + | Partitioned Cookies + |-------------------------------------------------------------------------- + | + | Setting this value to true will tie the cookie to the top-level site for + | a cross-site context. Partitioned cookies are accepted by the browser + | when flagged "secure" and the Same-Site attribute is set to "none". + | + */ + + 'partitioned' => false, + ]; From b54617ee4926b39e5e24965e3c6f5e44c61da05b Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:26 +0000 Subject: [PATCH 032/189] Default config files In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used. --- config/app.php | 32 +++----------------------------- config/auth.php | 6 +++++- config/database.php | 10 ++++++---- config/logging.php | 9 +++++++++ 4 files changed, 23 insertions(+), 34 deletions(-) diff --git a/config/app.php b/config/app.php index b5d3ef9103..42e770538b 100644 --- a/config/app.php +++ b/config/app.php @@ -1,5 +1,6 @@ [ - - /* - * Laravel Framework Service Providers... - */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, - + 'providers' => ServiceProvider::defaultProviders()->merge([ /* * Package Service Providers... */ @@ -194,7 +168,7 @@ App\Providers\ScheduleServiceProvider::class, Sentry\Laravel\ServiceProvider::class, App\Providers\OurSentryLogging::class, - ], + ])->toArray(), /* |-------------------------------------------------------------------------- diff --git a/config/auth.php b/config/auth.php index 2231b26732..6080ddb2e3 100644 --- a/config/auth.php +++ b/config/auth.php @@ -86,10 +86,14 @@ | than one user table or model in the application and you want to have | separate password reset settings based on the specific user types. | - | The expire time is the number of minutes that each reset token will be + | The expiry time is the number of minutes that each reset token will be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | */ 'passwords' => [ diff --git a/config/database.php b/config/database.php index a09ab0f1cf..edbf228861 100644 --- a/config/database.php +++ b/config/database.php @@ -56,8 +56,6 @@ 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, - // We need strict = 'false' because we have some complex queries which fall foul of Laravel's requirements - // for use of GROUP BY. Note that Laravel Shift will try to set this back TRUE, but don't let it. 'strict' => false, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ @@ -111,6 +109,8 @@ 'charset' => 'utf8', 'prefix' => '', 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), ], ], @@ -151,7 +151,8 @@ 'default' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], @@ -159,7 +160,8 @@ 'cache' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], diff --git a/config/logging.php b/config/logging.php index 51f308d943..5a5b2ad53f 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,5 +1,6 @@ 'single', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, ], 'daily' => [ @@ -68,6 +70,7 @@ 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, + 'replace_placeholders' => true, ], 'discourse' => [ @@ -83,6 +86,7 @@ 'username' => 'Laravel Log', 'emoji' => ':boom:', 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, ], 'papertrail' => [ @@ -94,6 +98,7 @@ 'port' => env('PAPERTRAIL_PORT'), 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), ], + 'processors' => [PsrLogMessageProcessor::class], ], 'stderr' => [ @@ -104,16 +109,20 @@ 'with' => [ 'stream' => 'php://stderr', ], + 'processors' => [PsrLogMessageProcessor::class], ], 'syslog' => [ 'driver' => 'syslog', 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => LOG_USER, + 'replace_placeholders' => true, ], 'errorlog' => [ 'driver' => 'errorlog', 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, ], 'null' => [ From 1063d6a0253c6d31b251f5363f8ab279535e60c7 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:26 +0000 Subject: [PATCH 033/189] Bump Composer dependencies --- composer.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index 5167f983bd..9dc6b82b1a 100644 --- a/composer.json +++ b/composer.json @@ -8,15 +8,15 @@ "license": "MIT", "type": "project", "require": { - "php": "^8.0", - "addwiki/mediawiki-api": "~0.7.0", + "php": "^8.1", + "addwiki/mediawiki-api": "^2.8", "addwiki/mediawiki-api-base": "~2.0", "barryvdh/laravel-translation-manager": "^0.6.2", "bkwld/croppa": "^6.0.1", "caseyamcl/guzzle_retry_middleware": "^2.6", "cweagans/composer-patches": "^1.7", - "darkaonline/l5-swagger": "^8.0", - "doctrine/dbal": "^2.13", + "darkaonline/l5-swagger": "^8.3", + "doctrine/dbal": "^3.5", "egulias/email-validator": "^3.0.0", "filp/whoops": "^2.14", "geocoder-php/mapbox-provider": "^1.4", @@ -24,41 +24,41 @@ "hieu-le/wordpress-xmlrpc-client": "~2.0", "intervention/image": "^2.7", "jenssegers/agent": "^2.6", - "laravel/framework": "^9.42", - "laravel/tinker": "^2.7", - "laravel/ui": "^3.3", - "laravelcollective/html": "^6.3", + "laravel/framework": "^10.48", + "laravel/tinker": "^2.8", + "laravel/ui": "^4.2", + "laravelcollective/html": "^6.4", "league/csv": "^9.7", "league/flysystem-aws-s3-v3": "^3.0", - "mariuzzo/laravel-js-localization": "^1.9", + "mariuzzo/laravel-js-localization": "^1.10", "mcamara/laravel-localization": "^1.7", - "msurguy/honeypot": "^1.1", - "owen-it/laravel-auditing": "^12.1", - "rennokki/laravel-eloquent-query-cache": "^3.3", - "sentry/sentry-laravel": "^2.11", + "msurguy/honeypot": "^1.2", + "owen-it/laravel-auditing": "^13.1", + "rennokki/laravel-eloquent-query-cache": "^3.4", + "sentry/sentry-laravel": "^3.2", "soundasleep/html2text": "^1.1", "spatie/calendar-links": "^1.6", "spatie/laravel-validation-rules": "^3.4", - "spinen/laravel-discourse-sso": "^2.6", + "spinen/laravel-discourse-sso": "^2.8", "symfony/http-client": "^6.2", - "symfony/http-foundation": "^6.0", + "symfony/http-foundation": "^6.2", "symfony/mailgun-mailer": "^6.2", "toin0u/geocoder-laravel": "^4.6", "twbs/bootstrap": "4.1.0", "wouternl/laravel-drip": "^1.2.4" }, "require-dev": { - "barryvdh/laravel-debugbar": "^3.6", + "barryvdh/laravel-debugbar": "^3.8", "fakerphp/faker": "^1.20.0", - "laravel/dusk": "^6.21", + "laravel/dusk": "^7.4", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.3", "osteel/openapi-httpfoundation-testing": "^0.8.0", - "php-coveralls/php-coveralls": "^2.4", + "php-coveralls/php-coveralls": "^2.5", "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ignition": "^1.4", + "spatie/laravel-ignition": "^2.0", "squizlabs/php_codesniffer": "^3.6", - "symfony/dom-crawler": "^6.0" + "symfony/dom-crawler": "^6.2" }, "autoload": { "files": [ @@ -105,6 +105,6 @@ "cweagans/composer-patches": true } }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true } From 1846cab668c85c28a16553542e404403f75d01c0 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:26 +0000 Subject: [PATCH 034/189] Bump NPM dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45285b2161..45ce6b134b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@playwright/test": "^1.14.1", "@vue/test-utils": "^1.3.6", "@vue/vue2-jest": "^28.1.0", - "axios": "^0.28", + "axios": "^1.6.4", "babel-jest": "^28.1.0", "bootstrap": "^4.6.1", "browser-sync": "^2.27.11", From 2138636ba21d263040f5134e8367fa606e668150 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:27 +0000 Subject: [PATCH 035/189] Adopt anonymous migrations --- database/migrations/2022_11_07_152558_record_approval.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2022_11_07_152558_record_approval.php b/database/migrations/2022_11_07_152558_record_approval.php index 7464b73a10..b397f3ccfc 100644 --- a/database/migrations/2022_11_07_152558_record_approval.php +++ b/database/migrations/2022_11_07_152558_record_approval.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class RecordApproval extends Migration +return new class extends Migration { /** * Run the migrations. @@ -42,4 +42,4 @@ public function down() $table->dropColumn('approved'); }); } -} +}; From 9c801af84e636b33c0695e2486a241009eccc3b4 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Apr 2025 00:05:27 +0000 Subject: [PATCH 036/189] Rename `password_resets` table --- config/auth.php | 2 +- ...19_000000_rename_password_resets_table.php | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2025_04_19_000000_rename_password_resets_table.php diff --git a/config/auth.php b/config/auth.php index 6080ddb2e3..0628b65087 100644 --- a/config/auth.php +++ b/config/auth.php @@ -99,7 +99,7 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', + 'table' => 'password_reset_tokens', 'expire' => 60, 'throttle' => 60, ], diff --git a/database/migrations/2025_04_19_000000_rename_password_resets_table.php b/database/migrations/2025_04_19_000000_rename_password_resets_table.php new file mode 100644 index 0000000000..7ea51cef63 --- /dev/null +++ b/database/migrations/2025_04_19_000000_rename_password_resets_table.php @@ -0,0 +1,28 @@ + Date: Sat, 19 Apr 2025 00:05:33 +0000 Subject: [PATCH 037/189] Add type hints for Laravel 10 --- app/Barrier.php | 3 +- app/Cluster.php | 3 +- app/Console/Commands/AlertCreate.php | 2 +- .../Commands/AnonymiseUsersForTest.php | 2 +- app/Console/Commands/CheckGroupLocations.php | 2 +- app/Console/Commands/CheckTranslations.php | 2 +- .../Commands/CreateDiscourseGroups.php | 2 +- .../Commands/CrystalliseEventTimezone.php | 2 +- .../Commands/DiscourseAnonymiseUser.php | 2 +- .../Commands/DiscourseChangeSetting.php | 2 +- .../Commands/DiscourseCreateThread.php | 2 +- app/Console/Commands/FixViews.php | 2 +- app/Console/Commands/FixVolunteerCount.php | 2 +- app/Console/Commands/GroupCountryField.php | 2 +- app/Console/Commands/ImportGroups.php | 2 +- app/Console/Commands/ImportMRES.php | 2 +- app/Console/Commands/LanguageSync.php | 2 +- app/Console/Commands/MigrateWikiPasswords.php | 2 +- app/Console/Commands/NetworkCoordinator.php | 2 +- app/Console/Commands/NetworkCreate.php | 2 +- app/Console/Commands/NetworkGroup.php | 2 +- .../PopulateUniqueCodeToEventsAndGroups.php | 2 +- app/Console/Commands/SetPlaceNetworkData.php | 2 +- .../Commands/SetRepairTogetherPasswords.php | 2 +- app/Console/Commands/SyncDiscourseGroups.php | 2 +- .../Commands/SyncDiscourseUsernames.php | 2 +- app/Console/Commands/SyncEvents.php | 2 +- app/Console/Commands/SyncGroups.php | 2 +- .../SyncNetworkUsersToDiscourseGroup.php | 2 +- app/Console/Commands/UserCreate.php | 2 +- app/Console/Commands/UserMakeHost.php | 2 +- app/Console/Commands/WordpressCreateEvent.php | 2 +- .../Commands/WordpressCreateEventFailed.php | 2 +- .../Commands/WordpressCreateEventMissing.php | 2 +- app/Console/Commands/WordpressCreateGroup.php | 2 +- app/Console/Kernel.php | 4 +- app/Device.php | 8 +- app/Events/EventDeleted.php | 2 +- app/Events/UserEmailUpdated.php | 2 +- app/Events/UserLanguageUpdated.php | 2 +- app/Events/UserRegistered.php | 2 +- app/EventsUsers.php | 7 +- app/Group.php | 17 +- app/GroupTags.php | 6 +- app/GrouptagsGroups.php | 3 +- app/Http/Middleware/APISetLocale.php | 4 +- app/Http/Middleware/AcceptUserInvites.php | 4 +- app/Http/Middleware/CheckForRepairNetwork.php | 4 +- app/Http/Middleware/EnsureAPIToken.php | 4 +- app/Http/Middleware/HttpsProtocol.php | 4 +- app/Http/Middleware/LanguageSwitcher.php | 4 +- app/Http/Middleware/LogHTTPErrorsToSentry.php | 4 +- .../Middleware/VerifyTranslationAccess.php | 4 +- app/Http/Middleware/VerifyUserConsent.php | 4 +- app/Http/Resources/Alert.php | 2 +- app/Http/Resources/AlertCollection.php | 2 +- app/Http/Resources/Category.php | 2 +- app/Http/Resources/Device.php | 2 +- app/Http/Resources/Group.php | 2 +- app/Http/Resources/GroupCollection.php | 2 +- app/Http/Resources/GroupLocation.php | 2 +- app/Http/Resources/GroupSummary.php | 2 +- app/Http/Resources/Image.php | 2 +- app/Http/Resources/Item.php | 2 +- app/Http/Resources/ItemCollection.php | 2 +- app/Http/Resources/Network.php | 2 +- app/Http/Resources/NetworkSummary.php | 2 +- .../Resources/NetworkSummaryCollection.php | 2 +- app/Http/Resources/Party.php | 2 +- app/Http/Resources/PartySummary.php | 2 +- app/Http/Resources/Skill.php | 2 +- app/Http/Resources/SkillCollection.php | 2 +- app/Http/Resources/Tag.php | 2 +- app/Http/Resources/TagCollection.php | 2 +- app/Http/Resources/Volunteer.php | 2 +- app/Http/Resources/VolunteerCollection.php | 2 +- app/Invite.php | 5 +- app/Listeners/AddUserToDiscourseGroup.php | 2 +- .../AddUserToDiscourseThreadForEvent.php | 2 +- app/Listeners/AnonymiseSoftDeletedUser.php | 2 +- app/Listeners/ChangeWikiPassword.php | 2 +- .../CreateDiscourseGroupForGroup.php | 2 +- .../CreateDiscourseThreadForEvent.php | 2 +- app/Listeners/CreateWordpressPostForEvent.php | 2 +- app/Listeners/CreateWordpressPostForGroup.php | 2 +- app/Listeners/DeleteEventFromWordPress.php | 2 +- app/Listeners/DeviceUpdatedAt.php | 2 +- app/Listeners/EditWordpressPostForEvent.php | 2 +- app/Listeners/EditWordpressPostForGroup.php | 2 +- app/Listeners/LogInToWiki.php | 2 +- app/Listeners/LogOutOfWiki.php | 2 +- app/Listeners/LogSuccessfulLogin.php | 2 +- app/Listeners/NotifyApprovedEvent.php | 2 +- .../RemoveSoftDeletedUserFromAllGroups.php | 2 +- .../RemoveUserFromDiscourseThreadForEvent.php | 2 +- ...ndAdminModerateEventPhotosNotification.php | 2 +- .../SendAdminUserDeletedNotification.php | 2 +- app/Listeners/SyncUserProperties.php | 2 +- app/Network.php | 5 +- app/Notifications/AdminAbnormalDevices.php | 4 +- app/Notifications/AdminModerationEvent.php | 4 +- .../AdminModerationEventPhotos.php | 4 +- app/Notifications/AdminModerationGroup.php | 4 +- app/Notifications/AdminNewUser.php | 4 +- app/Notifications/AdminUserDeleted.php | 4 +- .../AdminWordPressCreateEventFailure.php | 4 +- .../AdminWordPressCreateGroupFailure.php | 4 +- .../AdminWordPressEditEventFailure.php | 4 +- .../AdminWordPressEditGroupFailure.php | 4 +- app/Notifications/BaseNotification.php | 2 +- .../DeleteEventFromWordpressFailed.php | 4 +- app/Notifications/EventConfirmed.php | 6 +- app/Notifications/EventDevices.php | 6 +- app/Notifications/EventRepairs.php | 4 +- app/Notifications/GroupConfirmed.php | 6 +- app/Notifications/JoinEvent.php | 6 +- app/Notifications/JoinGroup.php | 6 +- app/Notifications/NewDiscourseMember.php | 4 +- app/Notifications/NewGroupMember.php | 4 +- app/Notifications/NewGroupWithinRadius.php | 4 +- app/Notifications/NotifyAdminNoDevices.php | 4 +- .../NotifyRestartersOfNewEvent.php | 4 +- app/Notifications/RSVPEvent.php | 4 +- app/Notifications/ResetPassword.php | 6 +- app/Observers/EventsUsersObserver.php | 4 +- app/Party.php | 15 +- app/Policies/NetworkPolicy.php | 12 +- app/Providers/AgentServiceProvider.php | 4 +- app/Providers/AppServiceProvider.php | 4 +- app/Providers/AuthServiceProvider.php | 2 +- app/Providers/DiscourseServiceProvider.php | 2 +- app/Providers/EventServiceProvider.php | 4 +- app/Providers/MediawikiServiceProvider.php | 4 +- app/Providers/OurSentryLogging.php | 4 +- app/Providers/RouteServiceProvider.php | 2 +- app/Providers/ScheduleServiceProvider.php | 4 +- app/Providers/WordpressServiceProvider.php | 4 +- app/Services/CheckAuthService.php | 2 +- app/User.php | 21 +- app/UserGroups.php | 8 +- app/UsersSkills.php | 3 +- app/Xref.php | 3 +- database/factories/CategoryFactory.php | 2 +- database/factories/DeviceFactory.php | 2 +- database/factories/FaultcatFactory.php | 2 +- database/factories/GroupFactory.php | 2 +- database/factories/GroupTagsFactory.php | 2 +- database/factories/MisccatFactory.php | 2 +- database/factories/NetworkFactory.php | 2 +- database/factories/PartyFactory.php | 2 +- database/factories/UserFactory.php | 2 +- ...04_02_193005_create_translations_table.php | 4 +- ...12_100000_create_password_resets_table.php | 4 +- ...8_04_19_102108_initialise_fixometer_db.php | 4 +- .../2018_04_19_135338_password_recovery.php | 4 +- .../2018_04_19_135433_device_list_view.php | 4 +- .../2018_04_19_135527_device_age.php | 4 +- .../2018_04_19_135647_event_venue.php | 4 +- .../2018_04_19_135728_lang_pref.php | 4 +- .../migrations/2018_04_19_135801_website.php | 4 +- .../2018_04_19_145002_users_auth.php | 4 +- ...04_20_100516_users_location_age_gender.php | 4 +- .../2018_05_10_085751_rename_modified_at.php | 4 +- ...05_16_121333_rename_modified_at_images.php | 4 +- .../2018_06_01_142316_Create_Group_Tags.php | 4 +- .../2018_06_01_145539_Create_Brands.php | 4 +- .../2018_06_01_152511_Create_Skills.php | 4 +- .../2018_06_06_160236_Create_Skills_Pivot.php | 4 +- ...8_06_06_160549_Create_Group_Tags_Pivot.php | 4 +- ...2018_06_07_144018_Add_New_Fields_Users.php | 4 +- ...2018_06_14_140315_Add_Number_Of_Logins.php | 4 +- ..._19_091052_Add_Status_Role_User_Events.php | 4 +- ...00057_update_users_brands_registration.php | 4 +- ...018_06_28_204857_create_sessions_table.php | 4 +- ...2018_07_01_201744_create_invites_table.php | 4 +- ..._01_221529_Add_Status_Role_User_Groups.php | 4 +- .../2018_07_03_104638_user_table_updates.php | 4 +- .../2018_07_04_082822_invite_type_column.php | 4 +- .../2018_07_04_215949_device_wiki_column.php | 4 +- .../2018_07_06_221304_change_bio_length.php | 4 +- ...06_222838_make_group_tag_desc_nullable.php | 4 +- ..._07_12_110255_default_volunteers_value.php | 4 +- ...018_07_17_221336_volunteer_event_users.php | 4 +- .../2018_07_26_172108_media_wiki.php | 4 +- .../2018_07_31_213315_media_wiki_username.php | 4 +- .../2018_09_03_091813_create_audits_table.php | 4 +- ..._09_04_110332_create_preferences_table.php | 4 +- .../2018_09_13_114022_soft_delete_event.php | 4 +- ..._101249_create_drop_permissions_tables.php | 4 +- ...8_09_20_120947_soft_delete_permissions.php | 4 +- ..._02_162335_add_user_id_to_events_table.php | 4 +- ...0_04_095031_create_notifications_table.php | 4 +- .../2018_10_31_145415_add_preferences.php | 4 +- .../2018_11_05_190951_group_country_field.php | 4 +- ..._11_12_135805_additional_device_fields.php | 4 +- ..._212544_increase_username_field_length.php | 4 +- .../2018_12_10_114941_create_jobs_table.php | 4 +- ..._12_11_112533_create_failed_jobs_table.php | 4 +- ...08_add_last_login_field_to_users_table.php | 4 +- ...5_add_access_key_column_to_users_table.php | 4 +- ...019_03_22_105152_repair_network_update.php | 4 +- ...ue_shareable_code_to_events_and_groups.php | 4 +- ..._143811_fix_event_name_in_devices_view.php | 4 +- ...users_groups_default_role_to_restarter.php | 4 +- ..._add_drip_subscriber_id_to_users_table.php | 4 +- ...02_add_wiki_sync_status_to_users_table.php | 4 +- ...12609_add_calendar_hash_to_users_table.php | 4 +- ...5318_add_admin_user_deleted_preference.php | 4 +- ...admin_moderate_event_photos_preference.php | 4 +- ..._11_11_151415_rename_access_key_column.php | 4 +- ...12_01_191304_users_groups_soft_deletes.php | 4 +- ...ed_at_to_devices_faults_opinions_table.php | 4 +- ...untry_to_devices_faults_opinions_table.php | 4 +- ...35_create_microtask_demographics_table.php | 4 +- ..._02_10_182430_add_network_id_to_groups.php | 4 +- ...02_10_184130_add_external_id_to_groups.php | 4 +- ...10_200747_add_facebook_field_to_groups.php | 4 +- .../2020_02_17_100100_faultcat_refactor.php | 4 +- ...020_02_24_140951_create_misccat_tables.php | 4 +- ...020_03_11_164903_create_networks_table.php | 4 +- ...3_11_175639_create_group_network_table.php | 4 +- ...3_add_wordpress_push_to_networks_table.php | 4 +- ...dd_include_in_zapier_to_networks_table.php | 4 +- ...220513_add_shortname_to_networks_table.php | 4 +- ..._add_networkcoordinator_to_roles_table.php | 4 +- ...04_19_102144_create_user_network_table.php | 4 +- ...20_04_27_175552_create_default_network.php | 4 +- ...94252_add_drip_push_column_to_networks.php | 4 +- ...05_21_173538_add_online_flag_to_events.php | 4 +- ..._26_130318_allow_null_location_details.php | 4 +- ...093140_add_discourse_group_to_networks.php | 4 +- .../2020_06_30_100100_mobifix_setup.php | 4 +- ...event_deletion_notification_preference.php | 4 +- .../2020_08_01_110400_mobifix_ora_setup.php | 4 +- ...130008_latitude_longitude_three_digits.php | 4 +- ...08_26_110001_support_non_powered_items.php | 4 +- ...2020_10_21_121813_alter_table_charsets.php | 4 +- ...27_101759_repair_status_to_string_data.php | 4 +- .../2021_01_11_161917_cancellations.php | 4 +- .../2021_03_22_092800_tabicat_ora_setup.php | 4 +- .../2021_04_06_113426_printcat_ora_setup.php | 4 +- ...2021_04_16_095410_aggregate_categories.php | 4 +- .../2021_04_26_115247_add_postcode.php | 4 +- .../2021_05_05_151211_audit_issue.php | 4 +- ..._05_11_130314_create_microtask_surveys.php | 4 +- .../2021_05_14_105028_devices_updated_at.php | 4 +- .../2021_05_14_173108_repairdir_role.php | 4 +- .../2021_05_21_130659_discourse_thread.php | 4 +- .../2021_06_09_164834_no_null_problems.php | 4 +- .../2021_06_21_105938_battcat_ora_setup.php | 4 +- .../2021_07_14_125845_battcat_ora_changes.php | 4 +- ..._234516_drop_view_waste_emission_ratio.php | 4 +- ...000439_update_lca_unpowered_categories.php | 4 +- .../2021_08_16_133342_event_link.php | 4 +- .../2021_09_10_093142_autoapprove_events.php | 4 +- .../2021_10_04_124708_fix_category_names.php | 4 +- ...021_10_27_093744_group_discourse_group.php | 4 +- .../2021_12_08_100326_longer_language.php | 4 +- ...2022_01_04_123128_group_discourse_logo.php | 4 +- .../2022_01_24_101405_timezones.php | 4 +- ...022_02_04_132146_category_descriptions.php | 4 +- ..._02_04_140651_refactor_estimate_column.php | 4 +- .../2022_02_16_085124_refactor_age_column.php | 4 +- .../2022_03_02_102531_dustup_ora_setup.php | 4 +- .../2022_07_19_093250_add_brand_indexes.php | 4 +- ...2022_08_10_091731_unique_network_names.php | 4 +- .../2022_09_19_135345_add_group_phone.php | 4 +- .../2022_10_06_162442_network_logo.php | 4 +- .../2022_11_07_152558_record_approval.php | 4 +- ...0_000000_add_uuid_to_failed_jobs_table.php | 4 +- .../2023_04_19_153453_network_data.php | 4 +- .../2023_05_09_132601_useful_urls.php | 4 +- .../2023_06_07_130653_new_zealand.php | 4 +- .../2023_06_12_153317_country_codes.php | 4 +- .../2023_08_02_183803_item_type_collation.php | 4 +- .../2023_08_14_112539_group_email.php | 4 +- ...2023_12_19_161808_customisable_banners.php | 4 +- .../2024_08_27_123452_group_archive.php | 4 +- .../2024_09_16_093650_inactive_groups.php | 4 +- .../2025_03_06_110500_retire_workbench.php | 4 +- ...19_000000_rename_password_resets_table.php | 4 +- database/seeders/BrandList.php | 2 +- database/seeders/DatabaseSeeder.php | 2 +- database/seeders/DefaultSkills.php | 2 +- database/seeders/NetworksTableSeeder.php | 2 +- public/js/components/StatsShare.vue | 625 ++++++++++++++++++ public/js/translations.js | 1 + .../Users/UserDeletedNotificationTest.php | 2 +- tests/Feature/Admin/Users/ViewUsersTest.php | 10 +- tests/Feature/Admin/Users/WikiLoginTests.php | 8 +- tests/Feature/Alerts/AlertsTest.php | 6 +- tests/Feature/Brands/BrandsTest.php | 4 +- tests/Feature/Calendar/CalendarTest.php | 18 +- tests/Feature/Category/CategoryTest.php | 4 +- tests/Feature/Commands/DiscourseTest.php | 4 +- tests/Feature/Dashboard/BasicTest.php | 4 +- tests/Feature/Dashboard/CookiePolicyTest.php | 2 +- .../Dashboard/LanguageSwitcherTest.php | 6 +- tests/Feature/Devices/APIv2DeviceTest.php | 4 +- tests/Feature/Devices/CategoryTest.php | 4 +- tests/Feature/Devices/EditTest.php | 12 +- tests/Feature/Devices/NullAgeProblemTest.php | 4 +- .../Devices/NullEstimateProblemTest.php | 4 +- tests/Feature/Devices/NullProblemTest.php | 2 +- tests/Feature/Devices/SparePartsTest.php | 10 +- tests/Feature/Devices/TooManyMiscTest.php | 2 +- tests/Feature/Events/APIv2EventTest.php | 18 +- .../Feature/Events/AddRemoveVolunteerTest.php | 4 +- tests/Feature/Events/AttendanceTest.php | 4 +- tests/Feature/Events/DeleteEventTest.php | 12 +- .../Events/EventRequestReviewEmailTest.php | 2 +- tests/Feature/Events/ExportTest.php | 2 +- tests/Feature/Events/InviteEventTest.php | 16 +- tests/Feature/Events/JoinEventTest.php | 4 +- .../Events/ModerationEventEmailTest.php | 2 +- .../ModerationEventPhotosNotificationTest.php | 2 +- tests/Feature/Events/OnlineEventsTest.php | 2 +- .../Feature/Events/WordpressEventPushTest.php | 12 +- tests/Feature/Events/t/CreateEventTest.php | 28 +- tests/Feature/Fixometer/BasicTest.php | 4 +- tests/Feature/Groups/APIv2GroupTest.php | 28 +- tests/Feature/Groups/BasicTest.php | 2 +- tests/Feature/Groups/GroupCommandsTest.php | 2 +- tests/Feature/Groups/GroupCountryTest.php | 2 +- tests/Feature/Groups/GroupCreateTest.php | 10 +- tests/Feature/Groups/GroupDeleteTest.php | 8 +- tests/Feature/Groups/GroupEditTest.php | 14 +- tests/Feature/Groups/GroupHostTest.php | 6 +- tests/Feature/Groups/GroupJoinTest.php | 2 +- .../Feature/Groups/GroupNetworkCreateTest.php | 2 +- tests/Feature/Groups/GroupTagsTest.php | 10 +- tests/Feature/Groups/GroupViewTest.php | 10 +- tests/Feature/Groups/InviteGroupTest.php | 6 +- .../Feature/Groups/WordpressGroupPushTest.php | 4 +- tests/Feature/Home/HomeTest.php | 4 +- tests/Feature/Networks/APIv2NetworkTest.php | 8 +- .../Feature/Networks/NetworkCommandsTest.php | 6 +- tests/Feature/Networks/NetworkTest.php | 22 +- tests/Feature/Notifications/BasicTest.php | 2 +- tests/Feature/Role/RoleTest.php | 6 +- tests/Feature/Stats/DeviceStatsTest.php | 30 +- tests/Feature/Stats/EventStatsTest.php | 6 +- tests/Feature/Stats/GroupStatsTest.php | 10 +- tests/Feature/Stats/LcaStatsTest.php | 10 +- tests/Feature/Style/BasicTest.php | 4 +- tests/Feature/Swagger/SwaggerGenerateTest.php | 2 +- tests/Feature/Translations/CheckTest.php | 2 +- .../Users/EditLanguageSettingsTest.php | 4 +- tests/Feature/Users/EditProfileTest.php | 12 +- tests/Feature/Users/GroupsNearbyTest.php | 14 +- tests/Feature/Users/MenusTest.php | 4 +- tests/Feature/Users/PasswordResetTest.php | 6 +- tests/Feature/Users/ProfileTest.php | 18 +- tests/Feature/Users/RecoverTest.php | 2 +- .../Registration/AccountCreationTest.php | 18 +- .../DiscourseAccountCreationTest.php | 8 +- .../DiscourseAccountDeletionTest.php | 2 +- .../Feature/Users/Registration/LoginTest.php | 2 +- tests/Feature/Users/SkillsTest.php | 8 +- tests/Feature/Users/UserAdminTest.php | 4 +- tests/Feature/Users/UserCommandsTest.php | 4 +- tests/Feature/Zapier/ZapierNetworkTests.php | 12 +- tests/Unit/CharsetTest.php | 2 +- tests/Unit/Device/DeviceItemTypesTest.php | 2 +- tests/Unit/DripEventTest.php | 2 +- tests/Unit/Events/CoordinatorTest.php | 4 +- tests/Unit/Events/CountsTest.php | 2 +- tests/Unit/Events/EventPermissionsTest.php | 6 +- tests/Unit/Events/EventStateTest.php | 10 +- tests/Unit/Events/TimezoneTest.php | 16 +- tests/Unit/ExampleTest.php | 2 +- tests/Unit/GeocoderTest.php | 2 +- tests/Unit/GroupTest.php | 16 +- tests/Unit/NetworkTest.php | 2 +- tests/Unit/NotificationsTest.php | 4 +- tests/Unit/UserRolesTest.php | 6 +- tests/Unit/UsernameGeneratorTest.php | 14 +- 377 files changed, 1478 insertions(+), 811 deletions(-) create mode 100644 public/js/components/StatsShare.vue create mode 100644 public/js/translations.js diff --git a/app/Barrier.php b/app/Barrier.php index 0e1d5a9f97..d90829c677 100644 --- a/app/Barrier.php +++ b/app/Barrier.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; class Barrier extends Model @@ -11,7 +12,7 @@ class Barrier extends Model protected $hidden = []; public $timestamps = false; - public function barriers() + public function barriers(): BelongsToMany { return $this->belongsToMany(\App\Device::class, 'devices_barriers', 'barrier_id', 'device_id'); } diff --git a/app/Cluster.php b/app/Cluster.php index 5c1fcae448..b599d07182 100644 --- a/app/Cluster.php +++ b/app/Cluster.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Model; class Cluster extends Model @@ -23,7 +24,7 @@ class Cluster extends Model */ protected $hidden = []; - public function categories() + public function categories(): HasMany { return $this->hasMany(\App\Category::class, 'cluster', 'idclusters'); } diff --git a/app/Console/Commands/AlertCreate.php b/app/Console/Commands/AlertCreate.php index 8d56290f68..3ab355e878 100644 --- a/app/Console/Commands/AlertCreate.php +++ b/app/Console/Commands/AlertCreate.php @@ -40,7 +40,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $title = trim($this->argument('title')); $html = trim($this->argument('html')); diff --git a/app/Console/Commands/AnonymiseUsersForTest.php b/app/Console/Commands/AnonymiseUsersForTest.php index cedd287be5..cffb60be3d 100644 --- a/app/Console/Commands/AnonymiseUsersForTest.php +++ b/app/Console/Commands/AnonymiseUsersForTest.php @@ -27,7 +27,7 @@ class AnonymiseUsersForTest extends Command * * @return mixed */ - public function handle() + public function handle(): void { if (env('APP_ENV') !== 'local') { $this->error('This command is only designed to be run during local development.'); diff --git a/app/Console/Commands/CheckGroupLocations.php b/app/Console/Commands/CheckGroupLocations.php index 7a44642e22..cf9c382354 100644 --- a/app/Console/Commands/CheckGroupLocations.php +++ b/app/Console/Commands/CheckGroupLocations.php @@ -36,7 +36,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::where('approved', true)->get(); $geocoder = new \App\Helpers\Geocoder(); diff --git a/app/Console/Commands/CheckTranslations.php b/app/Console/Commands/CheckTranslations.php index 7c1418294a..49c51b504e 100644 --- a/app/Console/Commands/CheckTranslations.php +++ b/app/Console/Commands/CheckTranslations.php @@ -35,7 +35,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): int { // We want to scan all English translations. $files = scandir(base_path() . '/lang/en'); diff --git a/app/Console/Commands/CreateDiscourseGroups.php b/app/Console/Commands/CreateDiscourseGroups.php index 2c284d6dd5..6e21a1e1f5 100644 --- a/app/Console/Commands/CreateDiscourseGroups.php +++ b/app/Console/Commands/CreateDiscourseGroups.php @@ -36,7 +36,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::where('approved', true)->whereNull('discourse_group')->get(); diff --git a/app/Console/Commands/CrystalliseEventTimezone.php b/app/Console/Commands/CrystalliseEventTimezone.php index 02082a9366..e0265f0ece 100644 --- a/app/Console/Commands/CrystalliseEventTimezone.php +++ b/app/Console/Commands/CrystalliseEventTimezone.php @@ -39,7 +39,7 @@ public function __construct(DiscourseService $discourseService) * * @return mixed */ - public function handle() + public function handle(): void { $events = Party::past()->where('timezone', null)->get(); diff --git a/app/Console/Commands/DiscourseAnonymiseUser.php b/app/Console/Commands/DiscourseAnonymiseUser.php index 68a094d795..78bbaa0d18 100644 --- a/app/Console/Commands/DiscourseAnonymiseUser.php +++ b/app/Console/Commands/DiscourseAnonymiseUser.php @@ -60,7 +60,7 @@ public function __construct(DiscourseService $discourseService) * * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $id = $this->argument('id'); $user = User::findOrFail($id); diff --git a/app/Console/Commands/DiscourseChangeSetting.php b/app/Console/Commands/DiscourseChangeSetting.php index 066163e0d1..cb5651bb3e 100644 --- a/app/Console/Commands/DiscourseChangeSetting.php +++ b/app/Console/Commands/DiscourseChangeSetting.php @@ -59,7 +59,7 @@ public function __construct(DiscourseService $discourseService) * * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $setting = $this->argument('setting'); $value = $this->argument('value'); diff --git a/app/Console/Commands/DiscourseCreateThread.php b/app/Console/Commands/DiscourseCreateThread.php index f99251ef81..5667af1755 100644 --- a/app/Console/Commands/DiscourseCreateThread.php +++ b/app/Console/Commands/DiscourseCreateThread.php @@ -42,7 +42,7 @@ public function __construct(DiscourseService $discourseService) * * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $id = $this->argument('partyid'); diff --git a/app/Console/Commands/FixViews.php b/app/Console/Commands/FixViews.php index 1e76c43d3f..04f942c2f2 100644 --- a/app/Console/Commands/FixViews.php +++ b/app/Console/Commands/FixViews.php @@ -26,7 +26,7 @@ class FixViews extends Command * * @return mixed */ - public function handle() + public function handle(): void { if (env('APP_ENV') !== 'local') { $this->error('This command is only designed to be run during local development.'); diff --git a/app/Console/Commands/FixVolunteerCount.php b/app/Console/Commands/FixVolunteerCount.php index 1ff50f3e3b..f293cdbdd0 100644 --- a/app/Console/Commands/FixVolunteerCount.php +++ b/app/Console/Commands/FixVolunteerCount.php @@ -27,7 +27,7 @@ class FixVolunteerCount extends Command * * @return mixed */ - public function handle() + public function handle(): void { $events = Party::all(); diff --git a/app/Console/Commands/GroupCountryField.php b/app/Console/Commands/GroupCountryField.php index fe5f8c8883..fa05bdc100 100644 --- a/app/Console/Commands/GroupCountryField.php +++ b/app/Console/Commands/GroupCountryField.php @@ -27,7 +27,7 @@ class GroupCountryField extends Command * * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::all(); diff --git a/app/Console/Commands/ImportGroups.php b/app/Console/Commands/ImportGroups.php index bf4aa49532..38efda1504 100644 --- a/app/Console/Commands/ImportGroups.php +++ b/app/Console/Commands/ImportGroups.php @@ -38,7 +38,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $input = $this->argument('input'); $inputFile = fopen($input, 'r'); diff --git a/app/Console/Commands/ImportMRES.php b/app/Console/Commands/ImportMRES.php index 193ca3c284..3c68134a04 100644 --- a/app/Console/Commands/ImportMRES.php +++ b/app/Console/Commands/ImportMRES.php @@ -40,7 +40,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $input = $this->argument('input'); diff --git a/app/Console/Commands/LanguageSync.php b/app/Console/Commands/LanguageSync.php index a99a6a0aa0..b03476718e 100644 --- a/app/Console/Commands/LanguageSync.php +++ b/app/Console/Commands/LanguageSync.php @@ -36,7 +36,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { // We want to sync the language preference from restarters to mediawiki. // diff --git a/app/Console/Commands/MigrateWikiPasswords.php b/app/Console/Commands/MigrateWikiPasswords.php index c21f38b3ec..89cc43b913 100644 --- a/app/Console/Commands/MigrateWikiPasswords.php +++ b/app/Console/Commands/MigrateWikiPasswords.php @@ -36,7 +36,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $users = User::whereNotNull('mediawiki')->whereNull('deleted_at')->get(); diff --git a/app/Console/Commands/NetworkCoordinator.php b/app/Console/Commands/NetworkCoordinator.php index d37bdef7a4..ab546c8f1a 100644 --- a/app/Console/Commands/NetworkCoordinator.php +++ b/app/Console/Commands/NetworkCoordinator.php @@ -38,7 +38,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $networkname = $this->argument('networkname'); diff --git a/app/Console/Commands/NetworkCreate.php b/app/Console/Commands/NetworkCreate.php index 48f5a1b757..7e3114371b 100644 --- a/app/Console/Commands/NetworkCreate.php +++ b/app/Console/Commands/NetworkCreate.php @@ -37,7 +37,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $name = $this->argument('name'); $shortname = $this->argument('shortname'); diff --git a/app/Console/Commands/NetworkGroup.php b/app/Console/Commands/NetworkGroup.php index 4df46a4a51..b399b977cd 100644 --- a/app/Console/Commands/NetworkGroup.php +++ b/app/Console/Commands/NetworkGroup.php @@ -38,7 +38,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $networkname = $this->argument('networkname'); $groupname = $this->argument('groupname'); diff --git a/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php b/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php index 8bf63d5a57..a78c2858fb 100644 --- a/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php +++ b/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php @@ -28,7 +28,7 @@ class PopulateUniqueCodeToEventsAndGroups extends Command * * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::whereNull('shareable_code') ->get(); diff --git a/app/Console/Commands/SetPlaceNetworkData.php b/app/Console/Commands/SetPlaceNetworkData.php index 23194d97d2..b3bf460dc8 100644 --- a/app/Console/Commands/SetPlaceNetworkData.php +++ b/app/Console/Commands/SetPlaceNetworkData.php @@ -40,7 +40,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $networkname = $this->argument('networkname'); diff --git a/app/Console/Commands/SetRepairTogetherPasswords.php b/app/Console/Commands/SetRepairTogetherPasswords.php index 74cd3acd3f..7a550858e9 100644 --- a/app/Console/Commands/SetRepairTogetherPasswords.php +++ b/app/Console/Commands/SetRepairTogetherPasswords.php @@ -29,7 +29,7 @@ class SetRepairTogetherPasswords extends Command * * @return mixed */ - public function handle() + public function handle(): void { $users = User::where('repair_network', 3) ->where('password', '') diff --git a/app/Console/Commands/SyncDiscourseGroups.php b/app/Console/Commands/SyncDiscourseGroups.php index 19d09683d0..23c3a7e5ac 100644 --- a/app/Console/Commands/SyncDiscourseGroups.php +++ b/app/Console/Commands/SyncDiscourseGroups.php @@ -38,7 +38,7 @@ public function __construct(DiscourseService $discourseService) * * @return mixed */ - public function handle() + public function handle(): void { $this->discourseService->syncGroups(); } diff --git a/app/Console/Commands/SyncDiscourseUsernames.php b/app/Console/Commands/SyncDiscourseUsernames.php index 67a550e8ae..209dc9c105 100644 --- a/app/Console/Commands/SyncDiscourseUsernames.php +++ b/app/Console/Commands/SyncDiscourseUsernames.php @@ -58,7 +58,7 @@ public function __construct(DiscourseService $discourseService) * * @return mixed */ - public function handle() + public function handle(): void { $usersFoundInRestarters = 0; $updatedUsers = 0; diff --git a/app/Console/Commands/SyncEvents.php b/app/Console/Commands/SyncEvents.php index 9e6d3600a8..854b282799 100644 --- a/app/Console/Commands/SyncEvents.php +++ b/app/Console/Commands/SyncEvents.php @@ -49,7 +49,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $eventsQuery = Party::whereNotNull('wordpress_post_id')->where('approved', true); if (! is_null($this->option('datefrom'))) { diff --git a/app/Console/Commands/SyncGroups.php b/app/Console/Commands/SyncGroups.php index 051f7b4f9c..af23e55ff5 100644 --- a/app/Console/Commands/SyncGroups.php +++ b/app/Console/Commands/SyncGroups.php @@ -47,7 +47,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::where('approved', true)->whereNotNull('wordpress_post_id')->get(); diff --git a/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php b/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php index a02ab4aa2e..b9fb08591a 100644 --- a/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php +++ b/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php @@ -45,7 +45,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Console/Commands/UserCreate.php b/app/Console/Commands/UserCreate.php index 4e2c5897b4..d22e72bdb6 100644 --- a/app/Console/Commands/UserCreate.php +++ b/app/Console/Commands/UserCreate.php @@ -42,7 +42,7 @@ public function __construct() * * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $name = $this->argument('name'); $email = $this->argument('email'); diff --git a/app/Console/Commands/UserMakeHost.php b/app/Console/Commands/UserMakeHost.php index eadf82d771..8fc2fe5a31 100644 --- a/app/Console/Commands/UserMakeHost.php +++ b/app/Console/Commands/UserMakeHost.php @@ -41,7 +41,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $email = $this->argument('email'); $groupname = $this->argument('groupname'); diff --git a/app/Console/Commands/WordpressCreateEvent.php b/app/Console/Commands/WordpressCreateEvent.php index da4fba53ee..a6dae4f14e 100644 --- a/app/Console/Commands/WordpressCreateEvent.php +++ b/app/Console/Commands/WordpressCreateEvent.php @@ -37,7 +37,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $id = $this->argument('id'); $event = Party::findOrFail($id); diff --git a/app/Console/Commands/WordpressCreateEventFailed.php b/app/Console/Commands/WordpressCreateEventFailed.php index 584c2973f0..43be0f5086 100644 --- a/app/Console/Commands/WordpressCreateEventFailed.php +++ b/app/Console/Commands/WordpressCreateEventFailed.php @@ -38,7 +38,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $wordpressClient = new \HieuLe\WordpressXmlrpcClient\WordpressClient(); $wordpressClient->setCredentials(env('WP_XMLRPC_ENDPOINT'), env('WP_XMLRPC_USER'), env('WP_XMLRPC_PSWD')); diff --git a/app/Console/Commands/WordpressCreateEventMissing.php b/app/Console/Commands/WordpressCreateEventMissing.php index f8bac85185..b6cdd42170 100644 --- a/app/Console/Commands/WordpressCreateEventMissing.php +++ b/app/Console/Commands/WordpressCreateEventMissing.php @@ -37,7 +37,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $events = Party::future()->where('approved', true)->where('wordpress_post_id', null)->get(); diff --git a/app/Console/Commands/WordpressCreateGroup.php b/app/Console/Commands/WordpressCreateGroup.php index 1bb2ccb81a..fe6e1eb9c6 100644 --- a/app/Console/Commands/WordpressCreateGroup.php +++ b/app/Console/Commands/WordpressCreateGroup.php @@ -37,7 +37,7 @@ public function __construct() * * @return mixed */ - public function handle() + public function handle(): void { $id = $this->argument('id'); $group = Group::findOrFail($id); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index af6e170b0c..d23b3b8f33 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ - protected function schedule(Schedule $schedule) + protected function schedule(Schedule $schedule): void { $schedule->call(function () { $parties = Party::doesnthave('devices') @@ -54,7 +54,7 @@ protected function schedule(Schedule $schedule) * * @return void */ - protected function commands() + protected function commands(): void { $this->load(__DIR__.'/Commands'); diff --git a/app/Device.php b/app/Device.php index 8d71743555..6be30690cf 100644 --- a/app/Device.php +++ b/app/Device.php @@ -2,6 +2,8 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Events\DeviceCreatedOrUpdated; use DB; @@ -243,17 +245,17 @@ public function findMostSeen($status = null, $cluster = null, $group = null) } } - public function deviceCategory() + public function deviceCategory(): HasOne { return $this->hasOne(\App\Category::class, 'idcategories', 'category'); } - public function deviceEvent() + public function deviceEvent(): HasOne { return $this->hasOne(\App\Party::class, 'idevents', 'event'); } - public function barriers() + public function barriers(): BelongsToMany { return $this->belongsToMany(\App\Barrier::class, 'devices_barriers', 'device_id', 'barrier_id'); } diff --git a/app/Events/EventDeleted.php b/app/Events/EventDeleted.php index c119ea2d51..4b771d8fb6 100644 --- a/app/Events/EventDeleted.php +++ b/app/Events/EventDeleted.php @@ -32,7 +32,7 @@ public function __construct(Party $repairEvent) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { return new PrivateChannel('channel-name'); } diff --git a/app/Events/UserEmailUpdated.php b/app/Events/UserEmailUpdated.php index f711cb700a..864fbb22bc 100644 --- a/app/Events/UserEmailUpdated.php +++ b/app/Events/UserEmailUpdated.php @@ -33,7 +33,7 @@ public function __construct(User $user) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { return new PrivateChannel('channel-name'); } diff --git a/app/Events/UserLanguageUpdated.php b/app/Events/UserLanguageUpdated.php index d8b03064ea..d3cc0cc387 100644 --- a/app/Events/UserLanguageUpdated.php +++ b/app/Events/UserLanguageUpdated.php @@ -33,7 +33,7 @@ public function __construct(User $user) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { return new PrivateChannel('channel-name'); } diff --git a/app/Events/UserRegistered.php b/app/Events/UserRegistered.php index 029b602afc..e425d4a488 100644 --- a/app/Events/UserRegistered.php +++ b/app/Events/UserRegistered.php @@ -33,7 +33,7 @@ public function __construct(User $user) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { return new PrivateChannel('channel-name'); } diff --git a/app/EventsUsers.php b/app/EventsUsers.php index 23546bc0bd..0a094b6cd7 100644 --- a/app/EventsUsers.php +++ b/app/EventsUsers.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use DB; use Illuminate\Database\Eloquent\Model; @@ -27,18 +28,18 @@ class EventsUsers extends Model public $timestamps = false; //Table Relations - public function role() + public function role(): HasOne { return $this->hasOne(\App\Role::class, 'role', 'role'); } //Table Relations - public function volunteer() + public function volunteer(): HasOne { return $this->hasOne(\App\User::class, 'id', 'user'); } - public function event() + public function event(): HasOne { return $this->hasOne(\App\Party::class, 'id', 'event'); } diff --git a/app/Group.php b/app/Group.php index a00865ca1b..ffbaf6dcb6 100644 --- a/app/Group.php +++ b/app/Group.php @@ -2,6 +2,9 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use DB; use Illuminate\Database\Eloquent\Model; @@ -95,7 +98,7 @@ public function addTag($tag) // NGM: when tests in place, this method name should be changed to just `tags`. // It's on a group, the group_ prefix is superfluous. - public function group_tags() + public function group_tags(): BelongsToMany { return $this->belongsToMany(\App\GroupTags::class, 'grouptags_groups', 'group', 'group_tag'); } @@ -176,22 +179,22 @@ public function ofThisUser($id) ORDER BY `g`.`name` ASC'), ['id' => $id]); } - public function groupImage() + public function groupImage(): HasOne { return $this->hasOne(\App\Xref::class, 'reference', 'idgroups')->where('reference_type', env('TBL_GROUPS'))->where('object_type', 5); } - public function allHosts() + public function allHosts(): HasMany { return $this->hasMany(\App\UserGroups::class, 'group', 'idgroups')->where('role', Role::HOST); } - public function allRestarters() + public function allRestarters(): HasMany { return $this->hasMany(\App\UserGroups::class, 'group', 'idgroups')->where('role', Role::RESTARTER); } - public function allVolunteers() + public function allVolunteers(): HasMany { return $this->hasMany(\App\UserGroups::class, 'group', 'idgroups')->orderBy('role', 'ASC'); } @@ -322,7 +325,7 @@ public function isVolunteer($user_id = null) return $this->allConfirmedVolunteers()->where($attributes)->exists(); } - public function parties() + public function parties(): HasMany { return $this->hasMany(Party::class, 'group', 'idgroups'); } @@ -379,7 +382,7 @@ public function getNextUpcomingEvent() return $event->first(); } - public function networks() + public function networks(): BelongsToMany { return $this->belongsToMany(Network::class, 'group_network', 'group_id', 'network_id'); } diff --git a/app/GroupTags.php b/app/GroupTags.php index 4c7a91e3ce..57bbddeb09 100644 --- a/app/GroupTags.php +++ b/app/GroupTags.php @@ -2,6 +2,8 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -27,13 +29,13 @@ class GroupTags extends Model protected $hidden = []; //Table Relations - public function group_tags() + public function group_tags(): BelongsToMany { return $this->belongsToMany(\App\GrouptagsGroups::class); } //Table Relations - public function groupTagGroups() + public function groupTagGroups(): HasMany { return $this->hasMany(GrouptagsGroups::class, 'group_tag', 'id'); } diff --git a/app/GrouptagsGroups.php b/app/GrouptagsGroups.php index 84e0fb3302..6603cc97f6 100644 --- a/app/GrouptagsGroups.php +++ b/app/GrouptagsGroups.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Model; class GrouptagsGroups extends Model @@ -33,7 +34,7 @@ class GrouptagsGroups extends Model * @version 1.0.0 * @return [type] */ - public function theGroup() + public function theGroup(): HasOne { return $this->hasOne(Group::class, 'idgroups', 'group'); } diff --git a/app/Http/Middleware/APISetLocale.php b/app/Http/Middleware/APISetLocale.php index ef3277c2e7..6a069587f9 100644 --- a/app/Http/Middleware/APISetLocale.php +++ b/app/Http/Middleware/APISetLocale.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; use Illuminate\Auth\Middleware\Authenticate; @@ -11,7 +13,7 @@ */ class APISetLocale extends Authenticate { - public function handle($request, Closure $next, ...$guards) + public function handle(Request $request, Closure $next, ...$guards): Response { if ($request->has('locale')) { $locale = $request->input('locale'); diff --git a/app/Http/Middleware/AcceptUserInvites.php b/app/Http/Middleware/AcceptUserInvites.php index 9747f527d5..8cee955107 100644 --- a/app/Http/Middleware/AcceptUserInvites.php +++ b/app/Http/Middleware/AcceptUserInvites.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\EventsUsers; use App\Invite; use App\UserGroups; @@ -17,7 +19,7 @@ class AcceptUserInvites * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { // Check if there are existing Groups/Events Shareable Invites for the // Current User diff --git a/app/Http/Middleware/CheckForRepairNetwork.php b/app/Http/Middleware/CheckForRepairNetwork.php index d14cd62ac9..df5aa3eed7 100644 --- a/app/Http/Middleware/CheckForRepairNetwork.php +++ b/app/Http/Middleware/CheckForRepairNetwork.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App; use App\Network; use Auth; @@ -20,7 +22,7 @@ class CheckForRepairNetwork * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $host = $request->getHost(); $update_user = []; diff --git a/app/Http/Middleware/EnsureAPIToken.php b/app/Http/Middleware/EnsureAPIToken.php index 69924758a7..128ce43aca 100644 --- a/app/Http/Middleware/EnsureAPIToken.php +++ b/app/Http/Middleware/EnsureAPIToken.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\User; use Auth; use Closure; @@ -15,7 +17,7 @@ class EnsureAPIToken * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { if (Auth::check() && Auth::user()) { // We want to ensure that every user has an API token. This is because the Vue client's use of the API diff --git a/app/Http/Middleware/HttpsProtocol.php b/app/Http/Middleware/HttpsProtocol.php index b7c100ebfc..fd58ef0838 100644 --- a/app/Http/Middleware/HttpsProtocol.php +++ b/app/Http/Middleware/HttpsProtocol.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; class HttpsProtocol @@ -13,7 +15,7 @@ class HttpsProtocol * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { if (! $request->secure() && (env('APP_ENV') === 'development' || env('APP_ENV') === 'production')) { return redirect()->secure($request->getRequestUri(), 301); diff --git a/app/Http/Middleware/LanguageSwitcher.php b/app/Http/Middleware/LanguageSwitcher.php index a8c6fe8400..c006e8eb32 100644 --- a/app/Http/Middleware/LanguageSwitcher.php +++ b/app/Http/Middleware/LanguageSwitcher.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App; use Auth; use Closure; @@ -18,7 +20,7 @@ class LanguageSwitcher * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { // A query string parameter of locale overrides all other places to attempt to determine the locale. if ($request->exists('locale')) { diff --git a/app/Http/Middleware/LogHTTPErrorsToSentry.php b/app/Http/Middleware/LogHTTPErrorsToSentry.php index 49834b97df..0acb7edc6f 100644 --- a/app/Http/Middleware/LogHTTPErrorsToSentry.php +++ b/app/Http/Middleware/LogHTTPErrorsToSentry.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; class LogHTTPErrorsToSentry { @@ -12,7 +14,7 @@ class LogHTTPErrorsToSentry { * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $response = $next($request); diff --git a/app/Http/Middleware/VerifyTranslationAccess.php b/app/Http/Middleware/VerifyTranslationAccess.php index 1b1fe65e2c..1f7c11908b 100644 --- a/app/Http/Middleware/VerifyTranslationAccess.php +++ b/app/Http/Middleware/VerifyTranslationAccess.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\Helpers\Fixometer; use App\User; use Auth; @@ -16,7 +18,7 @@ class VerifyTranslationAccess * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $has_permission = User::join('users_permissions', 'users_permissions.user_id', '=', 'users.id') ->join('permissions', 'permissions.idpermissions', '=', 'users_permissions.permission_id') diff --git a/app/Http/Middleware/VerifyUserConsent.php b/app/Http/Middleware/VerifyUserConsent.php index a652e0f1a5..f8be064772 100644 --- a/app/Http/Middleware/VerifyUserConsent.php +++ b/app/Http/Middleware/VerifyUserConsent.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\User; use Auth; use Closure; @@ -15,7 +17,7 @@ class VerifyUserConsent * @param \Closure $next * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { if (Auth::check() && Auth::user()->hasUserGivenConsent()) { return $next($request); diff --git a/app/Http/Resources/Alert.php b/app/Http/Resources/Alert.php index f5268aab58..80bc8e48c9 100644 --- a/app/Http/Resources/Alert.php +++ b/app/Http/Resources/Alert.php @@ -76,7 +76,7 @@ class Alert extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { $ret = [ 'id' => $this->id, diff --git a/app/Http/Resources/AlertCollection.php b/app/Http/Resources/AlertCollection.php index f850ac63d3..ee0f328ce2 100644 --- a/app/Http/Resources/AlertCollection.php +++ b/app/Http/Resources/AlertCollection.php @@ -24,7 +24,7 @@ class AlertCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Category.php b/app/Http/Resources/Category.php index fcd8d1ac13..fae7f1f304 100644 --- a/app/Http/Resources/Category.php +++ b/app/Http/Resources/Category.php @@ -41,7 +41,7 @@ class Category extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->idcategories, diff --git a/app/Http/Resources/Device.php b/app/Http/Resources/Device.php index d41a316cd7..09e7f36ae4 100644 --- a/app/Http/Resources/Device.php +++ b/app/Http/Resources/Device.php @@ -185,7 +185,7 @@ class Device extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { $event = \App\Party::find($this->event); $group = $event ? \App\Group::find($event->group) : NULL; diff --git a/app/Http/Resources/Group.php b/app/Http/Resources/Group.php index 211a9088fd..bf5b1c5a9c 100644 --- a/app/Http/Resources/Group.php +++ b/app/Http/Resources/Group.php @@ -272,7 +272,7 @@ class Group extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { $stats = $this->resource->getGroupStats(); $stats['events'] = $stats['parties']; diff --git a/app/Http/Resources/GroupCollection.php b/app/Http/Resources/GroupCollection.php index 23008f02ea..71d7b14af8 100644 --- a/app/Http/Resources/GroupCollection.php +++ b/app/Http/Resources/GroupCollection.php @@ -24,7 +24,7 @@ class GroupCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/GroupLocation.php b/app/Http/Resources/GroupLocation.php index ec4f75d22d..cff039b60c 100644 --- a/app/Http/Resources/GroupLocation.php +++ b/app/Http/Resources/GroupLocation.php @@ -66,7 +66,7 @@ class GroupLocation extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { $ret = [ 'location' => $this->location, diff --git a/app/Http/Resources/GroupSummary.php b/app/Http/Resources/GroupSummary.php index 2d8a493d9f..c57617ced5 100644 --- a/app/Http/Resources/GroupSummary.php +++ b/app/Http/Resources/GroupSummary.php @@ -85,7 +85,7 @@ class GroupSummary extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { $ret = [ 'id' => $this->idgroups, diff --git a/app/Http/Resources/Image.php b/app/Http/Resources/Image.php index 436b508a52..6dfdc4807a 100644 --- a/app/Http/Resources/Image.php +++ b/app/Http/Resources/Image.php @@ -34,7 +34,7 @@ class Image extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->idimages, diff --git a/app/Http/Resources/Item.php b/app/Http/Resources/Item.php index fd9a870d2b..f92aec9e31 100644 --- a/app/Http/Resources/Item.php +++ b/app/Http/Resources/Item.php @@ -48,7 +48,7 @@ class Item extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'type' => $this->item_type, diff --git a/app/Http/Resources/ItemCollection.php b/app/Http/Resources/ItemCollection.php index e89c2619b6..2fc79c3bb2 100644 --- a/app/Http/Resources/ItemCollection.php +++ b/app/Http/Resources/ItemCollection.php @@ -24,7 +24,7 @@ class ItemCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Network.php b/app/Http/Resources/Network.php index db727b23b7..3857cf7cba 100644 --- a/app/Http/Resources/Network.php +++ b/app/Http/Resources/Network.php @@ -210,7 +210,7 @@ class Network extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/NetworkSummary.php b/app/Http/Resources/NetworkSummary.php index 2be5f0b2bb..16260bb572 100644 --- a/app/Http/Resources/NetworkSummary.php +++ b/app/Http/Resources/NetworkSummary.php @@ -49,7 +49,7 @@ class NetworkSummary extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/NetworkSummaryCollection.php b/app/Http/Resources/NetworkSummaryCollection.php index 605a03a8d4..0815ad6661 100644 --- a/app/Http/Resources/NetworkSummaryCollection.php +++ b/app/Http/Resources/NetworkSummaryCollection.php @@ -24,7 +24,7 @@ class NetworkSummaryCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Party.php b/app/Http/Resources/Party.php index e0e78b56fb..8a6da94a8b 100644 --- a/app/Http/Resources/Party.php +++ b/app/Http/Resources/Party.php @@ -242,7 +242,7 @@ class Party extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { // We return information which can be public, and we rename fields to look more consistent. $networkData = gettype($this->network_data) == 'string' ? json_decode($this->network_data, true) : $this->network_data; diff --git a/app/Http/Resources/PartySummary.php b/app/Http/Resources/PartySummary.php index 86855eb8fc..bbc43c872b 100644 --- a/app/Http/Resources/PartySummary.php +++ b/app/Http/Resources/PartySummary.php @@ -111,7 +111,7 @@ class PartySummary extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { // We return information which can be public, and we rename fields to look more consistent. // diff --git a/app/Http/Resources/Skill.php b/app/Http/Resources/Skill.php index 137cc36436..4d22ef2493 100644 --- a/app/Http/Resources/Skill.php +++ b/app/Http/Resources/Skill.php @@ -48,7 +48,7 @@ class Skill extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/SkillCollection.php b/app/Http/Resources/SkillCollection.php index 03ac5b12fd..630b591b27 100644 --- a/app/Http/Resources/SkillCollection.php +++ b/app/Http/Resources/SkillCollection.php @@ -24,7 +24,7 @@ class SkillCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Tag.php b/app/Http/Resources/Tag.php index 55edeeb13f..4e88706e98 100644 --- a/app/Http/Resources/Tag.php +++ b/app/Http/Resources/Tag.php @@ -41,7 +41,7 @@ class Tag extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/TagCollection.php b/app/Http/Resources/TagCollection.php index 886cd77d14..feb0cc302d 100644 --- a/app/Http/Resources/TagCollection.php +++ b/app/Http/Resources/TagCollection.php @@ -24,7 +24,7 @@ class TagCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Volunteer.php b/app/Http/Resources/Volunteer.php index 801f7f4c75..08bfd32ea8 100644 --- a/app/Http/Resources/Volunteer.php +++ b/app/Http/Resources/Volunteer.php @@ -68,7 +68,7 @@ class Volunteer extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { if (\Cache::has('all_skills')) { $allSkills = \Cache::get('all_skills'); diff --git a/app/Http/Resources/VolunteerCollection.php b/app/Http/Resources/VolunteerCollection.php index a5ed8e82a9..5c40db856a 100644 --- a/app/Http/Resources/VolunteerCollection.php +++ b/app/Http/Resources/VolunteerCollection.php @@ -24,7 +24,7 @@ class VolunteerCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return parent::toArray($request); } diff --git a/app/Invite.php b/app/Invite.php index cd79974c8f..8acc00d8e2 100644 --- a/app/Invite.php +++ b/app/Invite.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; use Illuminate\Notifications\Notifiable; @@ -18,14 +19,14 @@ class Invite extends Model 'email', 'record_id', 'hash', 'type', ]; - public function group() + public function group(): BelongsTo { if ($this->type == 'group') { return $this->belongsTo(Group::class, 'record_id', 'idgroups'); } } - public function event() + public function event(): BelongsTo { if ($this->type == 'event') { return $this->belongsTo(Party::class, 'record_id', 'idevents'); diff --git a/app/Listeners/AddUserToDiscourseGroup.php b/app/Listeners/AddUserToDiscourseGroup.php index afd44a0482..2c89a1d58a 100644 --- a/app/Listeners/AddUserToDiscourseGroup.php +++ b/app/Listeners/AddUserToDiscourseGroup.php @@ -25,7 +25,7 @@ public function __construct() * @param UserFollowedGroup $event * @return void */ - public function handle(UserFollowedGroup $event) + public function handle(UserFollowedGroup $event): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Listeners/AddUserToDiscourseThreadForEvent.php b/app/Listeners/AddUserToDiscourseThreadForEvent.php index 4868768806..f07369c4ce 100644 --- a/app/Listeners/AddUserToDiscourseThreadForEvent.php +++ b/app/Listeners/AddUserToDiscourseThreadForEvent.php @@ -29,7 +29,7 @@ private function getHost($idevents) { return $hosts->count() ? $hosts[0] : null; } - public function handle(UserConfirmedEvent $e) { + public function handle(UserConfirmedEvent $e): void { // This call can block for a long time - add our own timeout so that we can fail it rather than block // the whole queue. pcntl_signal(SIGALRM, function () { diff --git a/app/Listeners/AnonymiseSoftDeletedUser.php b/app/Listeners/AnonymiseSoftDeletedUser.php index 73091b12d1..9d3c383b13 100644 --- a/app/Listeners/AnonymiseSoftDeletedUser.php +++ b/app/Listeners/AnonymiseSoftDeletedUser.php @@ -9,7 +9,7 @@ class AnonymiseSoftDeletedUser extends BaseEvent /** * @param UserDeleted $event */ - public function handle(UserDeleted $event) + public function handle(UserDeleted $event): void { $event->user->anonymise()->save(); } diff --git a/app/Listeners/ChangeWikiPassword.php b/app/Listeners/ChangeWikiPassword.php index d99230c16d..3fcd5eed43 100644 --- a/app/Listeners/ChangeWikiPassword.php +++ b/app/Listeners/ChangeWikiPassword.php @@ -28,7 +28,7 @@ public function __construct(Request $request) * @param PasswordChanged $event * @return void */ - public function handle(PasswordChanged $event) + public function handle(PasswordChanged $event): void { $user = $event->user; $oldpw = $event->oldPassword; diff --git a/app/Listeners/CreateDiscourseGroupForGroup.php b/app/Listeners/CreateDiscourseGroupForGroup.php index 40fcb652a7..aaa6b03cde 100644 --- a/app/Listeners/CreateDiscourseGroupForGroup.php +++ b/app/Listeners/CreateDiscourseGroupForGroup.php @@ -28,7 +28,7 @@ public function __construct() * @param ApproveGroup $event * @return void */ - public function handle(ApproveGroup $event) + public function handle(ApproveGroup $event): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Listeners/CreateDiscourseThreadForEvent.php b/app/Listeners/CreateDiscourseThreadForEvent.php index 4ca7920a98..17b0438cab 100644 --- a/app/Listeners/CreateDiscourseThreadForEvent.php +++ b/app/Listeners/CreateDiscourseThreadForEvent.php @@ -26,7 +26,7 @@ public function __construct() * @param ApproveEvent $event * @return void */ - public function handle(ApproveEvent $event) + public function handle(ApproveEvent $event): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Listeners/CreateWordpressPostForEvent.php b/app/Listeners/CreateWordpressPostForEvent.php index 4f8af507f4..261368028f 100644 --- a/app/Listeners/CreateWordpressPostForEvent.php +++ b/app/Listeners/CreateWordpressPostForEvent.php @@ -31,7 +31,7 @@ public function __construct(WordpressClient $wpClient) * @param ApproveEvent $event * @return void */ - public function handle(ApproveEvent $event) + public function handle(ApproveEvent $event): void { $partyId = $event->party->idevents; diff --git a/app/Listeners/CreateWordpressPostForGroup.php b/app/Listeners/CreateWordpressPostForGroup.php index 61ffed8bc5..03a6f671e2 100644 --- a/app/Listeners/CreateWordpressPostForGroup.php +++ b/app/Listeners/CreateWordpressPostForGroup.php @@ -28,7 +28,7 @@ public function __construct(WordpressClient $wpClient) * @param ApproveGroup $event * @return void */ - public function handle(ApproveGroup $event) + public function handle(ApproveGroup $event): void { $id = $event->group->idgroups; $data = $event->data; diff --git a/app/Listeners/DeleteEventFromWordPress.php b/app/Listeners/DeleteEventFromWordPress.php index d1e452dae2..3badfafc40 100644 --- a/app/Listeners/DeleteEventFromWordPress.php +++ b/app/Listeners/DeleteEventFromWordPress.php @@ -29,7 +29,7 @@ public function __construct(WordpressClient $wpClient) * @param EventDeleted $event * @return void */ - public function handle(EventDeleted $event) + public function handle(EventDeleted $event): void { // Slightly confusing name clash - usually we refer to community repair events as 'events' in the system. Here explicitly calling it repairEvent. diff --git a/app/Listeners/DeviceUpdatedAt.php b/app/Listeners/DeviceUpdatedAt.php index 2c24543642..4325d141c6 100644 --- a/app/Listeners/DeviceUpdatedAt.php +++ b/app/Listeners/DeviceUpdatedAt.php @@ -15,7 +15,7 @@ class DeviceUpdatedAt extends BaseEvent * @param DeviceCreatedOrUpdated $event * @return void */ - public function handle(DeviceCreatedOrUpdated $event) + public function handle(DeviceCreatedOrUpdated $event): void { // We've been passed a device id, and we want to record in the event and group that the devices have been // updated. diff --git a/app/Listeners/EditWordpressPostForEvent.php b/app/Listeners/EditWordpressPostForEvent.php index c0aff9d9d0..1a0efd5c00 100644 --- a/app/Listeners/EditWordpressPostForEvent.php +++ b/app/Listeners/EditWordpressPostForEvent.php @@ -31,7 +31,7 @@ public function __construct(WordpressClient $wpClient) * @param EditEvent $event * @return void */ - public function handle(EditEvent $event) + public function handle(EditEvent $event): void { $id = $event->party->idevents; $data = $event->data; diff --git a/app/Listeners/EditWordpressPostForGroup.php b/app/Listeners/EditWordpressPostForGroup.php index e10527db1d..b180f78b18 100644 --- a/app/Listeners/EditWordpressPostForGroup.php +++ b/app/Listeners/EditWordpressPostForGroup.php @@ -28,7 +28,7 @@ public function __construct(WordpressClient $wpClient) * @param EditGroup $event * @return void */ - public function handle(EditGroup $event) + public function handle(EditGroup $event): void { $id = $event->group->idgroups; $data = $event->data; diff --git a/app/Listeners/LogInToWiki.php b/app/Listeners/LogInToWiki.php index 193d30d80b..6be604baaa 100644 --- a/app/Listeners/LogInToWiki.php +++ b/app/Listeners/LogInToWiki.php @@ -37,7 +37,7 @@ public function __construct(Request $request, UserCreator $mediawikiUserCreator) * @param Login $event * @return void */ - public function handle(Login $event) + public function handle(Login $event): void { $user = $event->user; diff --git a/app/Listeners/LogOutOfWiki.php b/app/Listeners/LogOutOfWiki.php index f82617ec33..0ffa39503e 100644 --- a/app/Listeners/LogOutOfWiki.php +++ b/app/Listeners/LogOutOfWiki.php @@ -26,7 +26,7 @@ public function __construct(Request $request) * @param Logout $event * @return void */ - public function handle(Logout $event) + public function handle(Logout $event): void { $user = $event->user; diff --git a/app/Listeners/LogSuccessfulLogin.php b/app/Listeners/LogSuccessfulLogin.php index 5e2ec09d66..45e5de1b6f 100644 --- a/app/Listeners/LogSuccessfulLogin.php +++ b/app/Listeners/LogSuccessfulLogin.php @@ -26,7 +26,7 @@ public function __construct(Request $request) * @param Login $event * @return void */ - public function handle(Login $event) + public function handle(Login $event): void { $user = $event->user; diff --git a/app/Listeners/NotifyApprovedEvent.php b/app/Listeners/NotifyApprovedEvent.php index 3e712d6e45..e38d32205c 100644 --- a/app/Listeners/NotifyApprovedEvent.php +++ b/app/Listeners/NotifyApprovedEvent.php @@ -21,7 +21,7 @@ class NotifyApprovedEvent extends BaseEvent * @param ApproveEvent $event * @return void */ - public function handle(ApproveEvent $event) + public function handle(ApproveEvent $event): void { $partyId = $event->party->idevents; diff --git a/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php b/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php index faf90d6f4d..dc608dc4d1 100644 --- a/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php +++ b/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php @@ -10,7 +10,7 @@ class RemoveSoftDeletedUserFromAllGroups extends BaseEvent /** * @param UserDeleted $event */ - public function handle(UserDeleted $event) + public function handle(UserDeleted $event): void { UserGroups::where('user', $event->user->id)->delete(); } diff --git a/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php b/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php index 2c1f085dcf..61f21d68c5 100644 --- a/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php +++ b/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php @@ -27,7 +27,7 @@ private function getHost($idevents) { return $hosts->count() ? $hosts[0] : null; } - public function handle(UserLeftEvent $e) { + public function handle(UserLeftEvent $e): void { if ($e->iduser) { $event = Party::find($e->idevents); $user = User::find($e->iduser); diff --git a/app/Listeners/SendAdminModerateEventPhotosNotification.php b/app/Listeners/SendAdminModerateEventPhotosNotification.php index 2e69775a97..45b70f8edd 100644 --- a/app/Listeners/SendAdminModerateEventPhotosNotification.php +++ b/app/Listeners/SendAdminModerateEventPhotosNotification.php @@ -36,7 +36,7 @@ class SendAdminModerateEventPhotosNotification extends BaseEvent /** * @param EventImagesUploaded $event */ - public function handle(EventImagesUploaded $event) + public function handle(EventImagesUploaded $event): void { $this->event = $event; $this->party = $event->party; diff --git a/app/Listeners/SendAdminUserDeletedNotification.php b/app/Listeners/SendAdminUserDeletedNotification.php index 9982751aa1..d169e75458 100644 --- a/app/Listeners/SendAdminUserDeletedNotification.php +++ b/app/Listeners/SendAdminUserDeletedNotification.php @@ -12,7 +12,7 @@ class SendAdminUserDeletedNotification extends BaseEvent /** * @param UserDeleted $event */ - public function handle(UserDeleted $event) + public function handle(UserDeleted $event): void { $notify_users = Fixometer::usersWhoHavePreference('admin-user-deleted'); diff --git a/app/Listeners/SyncUserProperties.php b/app/Listeners/SyncUserProperties.php index b7b1cad9ca..42c0cc7004 100644 --- a/app/Listeners/SyncUserProperties.php +++ b/app/Listeners/SyncUserProperties.php @@ -26,7 +26,7 @@ public function __construct() * @param UserUpdated $event * @return void */ - public function handle(UserUpdated $event) + public function handle(UserUpdated $event): void { if ($event->user->isDirty('email')) { event(new UserEmailUpdated($event->user)); diff --git a/app/Network.php b/app/Network.php index acc2376d46..0f61ccf35b 100644 --- a/app/Network.php +++ b/app/Network.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Group; use Illuminate\Database\Eloquent\Model; @@ -10,7 +11,7 @@ class Network extends Model { use HasFactory; - public function groups() + public function groups(): BelongsToMany { return $this->belongsToMany(Group::class, 'group_network', 'network_id', 'group_id'); } @@ -25,7 +26,7 @@ public function containsGroup($group) return $this->groups->contains($group); } - public function coordinators() + public function coordinators(): BelongsToMany { return $this->belongsToMany(User::class, 'user_network', 'network_id', 'user_id'); } diff --git a/app/Notifications/AdminAbnormalDevices.php b/app/Notifications/AdminAbnormalDevices.php index 7fdc86277e..2adaad32f8 100644 --- a/app/Notifications/AdminAbnormalDevices.php +++ b/app/Notifications/AdminAbnormalDevices.php @@ -12,7 +12,7 @@ class AdminAbnormalDevices extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject(__('notifications.abnormal_devices_subject', [], $notifiable->language)) @@ -36,7 +36,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.abnormal_devices_title', [], $notifiable->language), diff --git a/app/Notifications/AdminModerationEvent.php b/app/Notifications/AdminModerationEvent.php index 316929722c..f555380235 100644 --- a/app/Notifications/AdminModerationEvent.php +++ b/app/Notifications/AdminModerationEvent.php @@ -12,7 +12,7 @@ class AdminModerationEvent extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject( @@ -41,7 +41,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.moderation_event_subject', [ diff --git a/app/Notifications/AdminModerationEventPhotos.php b/app/Notifications/AdminModerationEventPhotos.php index 817e6dd99a..bf8b1890ed 100644 --- a/app/Notifications/AdminModerationEventPhotos.php +++ b/app/Notifications/AdminModerationEventPhotos.php @@ -12,7 +12,7 @@ class AdminModerationEventPhotos extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -46,7 +46,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminModerationGroup.php b/app/Notifications/AdminModerationGroup.php index 43c7fbcc16..18a39e1ff0 100644 --- a/app/Notifications/AdminModerationGroup.php +++ b/app/Notifications/AdminModerationGroup.php @@ -12,7 +12,7 @@ class AdminModerationGroup extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -42,7 +42,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminNewUser.php b/app/Notifications/AdminNewUser.php index 83eca44b84..80d857efc3 100644 --- a/app/Notifications/AdminNewUser.php +++ b/app/Notifications/AdminNewUser.php @@ -12,7 +12,7 @@ class AdminNewUser extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminUserDeleted.php b/app/Notifications/AdminUserDeleted.php index 9d7b1ea56d..e4efe2d2cf 100644 --- a/app/Notifications/AdminUserDeleted.php +++ b/app/Notifications/AdminUserDeleted.php @@ -12,7 +12,7 @@ class AdminUserDeleted extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressCreateEventFailure.php b/app/Notifications/AdminWordPressCreateEventFailure.php index e1eda41661..12f3bbb6e1 100644 --- a/app/Notifications/AdminWordPressCreateEventFailure.php +++ b/app/Notifications/AdminWordPressCreateEventFailure.php @@ -12,7 +12,7 @@ class AdminWordPressCreateEventFailure extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressCreateGroupFailure.php b/app/Notifications/AdminWordPressCreateGroupFailure.php index 43a5afe220..a859a360a6 100644 --- a/app/Notifications/AdminWordPressCreateGroupFailure.php +++ b/app/Notifications/AdminWordPressCreateGroupFailure.php @@ -12,7 +12,7 @@ class AdminWordPressCreateGroupFailure extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressEditEventFailure.php b/app/Notifications/AdminWordPressEditEventFailure.php index 630fb55a08..e9f4abccdf 100644 --- a/app/Notifications/AdminWordPressEditEventFailure.php +++ b/app/Notifications/AdminWordPressEditEventFailure.php @@ -12,7 +12,7 @@ class AdminWordPressEditEventFailure extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressEditGroupFailure.php b/app/Notifications/AdminWordPressEditGroupFailure.php index 88fdaaeca2..0eb07250b1 100644 --- a/app/Notifications/AdminWordPressEditGroupFailure.php +++ b/app/Notifications/AdminWordPressEditGroupFailure.php @@ -12,7 +12,7 @@ class AdminWordPressEditGroupFailure extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/BaseNotification.php b/app/Notifications/BaseNotification.php index 0a3aeaec3f..9d4c2bf0e9 100644 --- a/app/Notifications/BaseNotification.php +++ b/app/Notifications/BaseNotification.php @@ -25,7 +25,7 @@ public function __construct($arr, $user = null) * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { // If user being notified has opted in to receive emails. if ($notifiable->invites == 1) diff --git a/app/Notifications/DeleteEventFromWordpressFailed.php b/app/Notifications/DeleteEventFromWordpressFailed.php index 96c6dc0fcd..6621c34ce2 100644 --- a/app/Notifications/DeleteEventFromWordpressFailed.php +++ b/app/Notifications/DeleteEventFromWordpressFailed.php @@ -12,7 +12,7 @@ class DeleteEventFromWordpressFailed extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -44,7 +44,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/EventConfirmed.php b/app/Notifications/EventConfirmed.php index 3b875d76c7..499afe2cf4 100644 --- a/app/Notifications/EventConfirmed.php +++ b/app/Notifications/EventConfirmed.php @@ -25,7 +25,7 @@ public function __construct(Party $party) * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -36,7 +36,7 @@ public function via($notifiable) * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; $url = url('/party/view/' . $this->party->idevents); @@ -66,7 +66,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; $url = url('/party/view/' . $this->party->idevents); diff --git a/app/Notifications/EventDevices.php b/app/Notifications/EventDevices.php index 1115445e49..f158ea97ef 100644 --- a/app/Notifications/EventDevices.php +++ b/app/Notifications/EventDevices.php @@ -12,7 +12,7 @@ class EventDevices extends BaseNotification * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -23,7 +23,7 @@ public function via($notifiable) * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { if ($notifiable !== null && $notifiable->invites == 1) { @@ -51,7 +51,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/EventRepairs.php b/app/Notifications/EventRepairs.php index cc65b1c3bd..a5d3b3275e 100644 --- a/app/Notifications/EventRepairs.php +++ b/app/Notifications/EventRepairs.php @@ -12,7 +12,7 @@ class EventRepairs extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -42,7 +42,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; diff --git a/app/Notifications/GroupConfirmed.php b/app/Notifications/GroupConfirmed.php index 09604c0f80..c06c2254b3 100644 --- a/app/Notifications/GroupConfirmed.php +++ b/app/Notifications/GroupConfirmed.php @@ -24,7 +24,7 @@ public function __construct($group) * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -35,7 +35,7 @@ public function via($notifiable) * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -61,7 +61,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'name' => $this->group->name, diff --git a/app/Notifications/JoinEvent.php b/app/Notifications/JoinEvent.php index f07ced7e9c..e6677c6358 100644 --- a/app/Notifications/JoinEvent.php +++ b/app/Notifications/JoinEvent.php @@ -12,7 +12,7 @@ class JoinEvent extends BaseNotification * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { if ($notifiable == null) { @@ -43,7 +43,7 @@ public function via($notifiable) * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; $subject = __('notifications.join_event_subject', [ @@ -131,7 +131,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.join_event_title', [], $notifiable->locale), diff --git a/app/Notifications/JoinGroup.php b/app/Notifications/JoinGroup.php index 79b02bbb20..a98d78df41 100644 --- a/app/Notifications/JoinGroup.php +++ b/app/Notifications/JoinGroup.php @@ -12,7 +12,7 @@ class JoinGroup extends BaseNotification * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -23,7 +23,7 @@ public function via($notifiable) * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; $subject = __('notifications.join_group_title', [ @@ -106,7 +106,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ diff --git a/app/Notifications/NewDiscourseMember.php b/app/Notifications/NewDiscourseMember.php index 696a7e26ce..6f6eafc8d9 100644 --- a/app/Notifications/NewDiscourseMember.php +++ b/app/Notifications/NewDiscourseMember.php @@ -12,7 +12,7 @@ class NewDiscourseMember extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject( @@ -39,7 +39,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('groups.talk_group_add_title', [ diff --git a/app/Notifications/NewGroupMember.php b/app/Notifications/NewGroupMember.php index a2d2ec3cbe..b8502354aa 100644 --- a/app/Notifications/NewGroupMember.php +++ b/app/Notifications/NewGroupMember.php @@ -12,7 +12,7 @@ class NewGroupMember extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -43,7 +43,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.new_member_title', [ diff --git a/app/Notifications/NewGroupWithinRadius.php b/app/Notifications/NewGroupWithinRadius.php index 7262b93c4c..6bcacad1c7 100644 --- a/app/Notifications/NewGroupWithinRadius.php +++ b/app/Notifications/NewGroupWithinRadius.php @@ -12,7 +12,7 @@ class NewGroupWithinRadius extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -42,7 +42,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.new_group_title', [], $notifiable->language), diff --git a/app/Notifications/NotifyAdminNoDevices.php b/app/Notifications/NotifyAdminNoDevices.php index 98c66978d6..f5e533aa9e 100644 --- a/app/Notifications/NotifyAdminNoDevices.php +++ b/app/Notifications/NotifyAdminNoDevices.php @@ -12,7 +12,7 @@ class NotifyAdminNoDevices extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -37,7 +37,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/NotifyRestartersOfNewEvent.php b/app/Notifications/NotifyRestartersOfNewEvent.php index f7388e484f..38328cf4a8 100644 --- a/app/Notifications/NotifyRestartersOfNewEvent.php +++ b/app/Notifications/NotifyRestartersOfNewEvent.php @@ -12,7 +12,7 @@ class NotifyRestartersOfNewEvent extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -43,7 +43,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.new_event_title', [ diff --git a/app/Notifications/RSVPEvent.php b/app/Notifications/RSVPEvent.php index 198c8b809c..eb7b048f0d 100644 --- a/app/Notifications/RSVPEvent.php +++ b/app/Notifications/RSVPEvent.php @@ -12,7 +12,7 @@ class RSVPEvent extends BaseNotification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -43,7 +43,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.rsvp_title', [ diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php index 032e6030ab..7f08389fae 100644 --- a/app/Notifications/ResetPassword.php +++ b/app/Notifications/ResetPassword.php @@ -12,7 +12,7 @@ class ResetPassword extends BaseNotification * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -23,7 +23,7 @@ public function via($notifiable) * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -41,7 +41,7 @@ public function toMail($notifiable) * @param mixed $notifiable * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ diff --git a/app/Observers/EventsUsersObserver.php b/app/Observers/EventsUsersObserver.php index cff09f19b2..073f57de9c 100644 --- a/app/Observers/EventsUsersObserver.php +++ b/app/Observers/EventsUsersObserver.php @@ -30,7 +30,7 @@ public function __construct(DiscourseService $discourseService) * @param \App\EventsUsers $eu * @return void */ - public function created(EventsUsers $eu) + public function created(EventsUsers $eu): void { $idevents = $eu->event; $event = \App\Party::find($idevents); @@ -78,7 +78,7 @@ public function updating(EventsUsers $eu) { * @param \App\EventsUsers $eu * @return void */ - public function deleted(EventsUsers $eu) + public function deleted(EventsUsers $eu): void { $idevents = $eu->event; $event = \App\Party::find($idevents); diff --git a/app/Party.php b/app/Party.php index cfa9c0d035..59d450649c 100644 --- a/app/Party.php +++ b/app/Party.php @@ -2,6 +2,9 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Events\ApproveEvent; use Auth; @@ -349,17 +352,17 @@ public function scopeUpcomingEventsInUserArea($query, $user) ->orderBy('distance', 'ASC'); } - public function allDevices() + public function allDevices(): HasMany { return $this->hasMany(\App\Device::class, 'event', 'idevents')->join('categories', 'categories.idcategories', '=', 'devices.category'); } - public function allInvited() + public function allInvited(): HasMany { return $this->hasMany(\App\EventsUsers::class, 'event', 'idevents')->where('status', '!=', 1); } - public function allConfirmedVolunteers() + public function allConfirmedVolunteers(): HasMany { return $this->hasMany(EventsUsers::class, 'event', 'idevents') ->where(function ($query) { @@ -369,7 +372,7 @@ public function allConfirmedVolunteers() } // Doesn't work if called 'group' - I guess because a reserved SQL keyword. - public function theGroup() + public function theGroup(): HasOne { return $this->hasOne(\App\Group::class, 'idgroups', 'group'); } @@ -574,7 +577,7 @@ public function getEventStats($eEmissionRatio = null, $uEmissionratio = null, $i return $result; } - public function devices() + public function devices(): HasMany { return $this->hasMany(\App\Device::class, 'event', 'idevents'); } @@ -650,7 +653,7 @@ public function isBeingAttendedBy($userId) * @version 1.0.0 * @return [type] */ - public function owner() + public function owner(): BelongsTo { return $this->belongsTo(User::class, 'user_id', 'id'); } diff --git a/app/Policies/NetworkPolicy.php b/app/Policies/NetworkPolicy.php index 0c7163f316..3419edd68b 100644 --- a/app/Policies/NetworkPolicy.php +++ b/app/Policies/NetworkPolicy.php @@ -17,7 +17,7 @@ class NetworkPolicy * @param \App\Network $network * @return mixed */ - public function view(User $user, Network $network) + public function view(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -36,7 +36,7 @@ public function view(User $user, Network $network) * @param \App\User $user * @return mixed */ - public function create(User $user) + public function create(User $user): bool { if ($user->hasRole('Administrator')) { return true; @@ -50,7 +50,7 @@ public function create(User $user) * @param \App\Network $network * @return mixed */ - public function update(User $user, Network $network) + public function update(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -89,7 +89,7 @@ public function associateGroups(User $user, Network $network) * @param \App\Network $network * @return mixed */ - public function delete(User $user, Network $network) + public function delete(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -103,7 +103,7 @@ public function delete(User $user, Network $network) * @param \App\Network $network * @return mixed */ - public function restore(User $user, Network $network) + public function restore(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -117,7 +117,7 @@ public function restore(User $user, Network $network) * @param \App\Network $network * @return mixed */ - public function forceDelete(User $user, Network $network) + public function forceDelete(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; diff --git a/app/Providers/AgentServiceProvider.php b/app/Providers/AgentServiceProvider.php index 8e34f8c705..3c1dbfb659 100644 --- a/app/Providers/AgentServiceProvider.php +++ b/app/Providers/AgentServiceProvider.php @@ -8,14 +8,14 @@ class AgentServiceProvider extends ServiceProvider { - public function boot() + public function boot(): void { $agent = new Agent(); View::share('agent', $agent); } - public function register() + public function register(): void { // } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2c73288359..237e49608f 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -20,7 +20,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // The admin area is unusable without this if (app()->isLocal()) { @@ -47,7 +47,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { $this->app->singleton(Geocoder::class, function () { return new Geocoder(); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index a98068cfb1..03996cf4c4 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -27,7 +27,7 @@ class AuthServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // } diff --git a/app/Providers/DiscourseServiceProvider.php b/app/Providers/DiscourseServiceProvider.php index 8bec9af118..69817074a8 100644 --- a/app/Providers/DiscourseServiceProvider.php +++ b/app/Providers/DiscourseServiceProvider.php @@ -22,7 +22,7 @@ class DiscourseServiceProvider extends ServiceProvider private $logger = null; - public function register() + public function register(): void { // We need to register the service whether or not the feature is turned on, so that we can mock it in testing. diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index b510773386..f21f706b4a 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -116,7 +116,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { if (env('FEATURE__WIKI_INTEGRATION') === true) { @@ -129,7 +129,7 @@ public function boot() * * @return bool */ - public function shouldDiscoverEvents() + public function shouldDiscoverEvents(): bool { return false; } diff --git a/app/Providers/MediawikiServiceProvider.php b/app/Providers/MediawikiServiceProvider.php index 697f9de089..5158ae03c5 100644 --- a/app/Providers/MediawikiServiceProvider.php +++ b/app/Providers/MediawikiServiceProvider.php @@ -16,7 +16,7 @@ class MediawikiServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // } @@ -26,7 +26,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { if (env('FEATURE__WIKI_INTEGRATION') === false) { return; diff --git a/app/Providers/OurSentryLogging.php b/app/Providers/OurSentryLogging.php index 3ef4ebfad0..af13c01e78 100644 --- a/app/Providers/OurSentryLogging.php +++ b/app/Providers/OurSentryLogging.php @@ -13,7 +13,7 @@ class OurSentryLogging extends ServiceProvider * * @return void */ - public function register() + public function register(): void { } @@ -22,7 +22,7 @@ public function register() * * @return void */ - public function boot() + public function boot(): void { Event::listen(MessageLogged::class, function (MessageLogged $e) { if ($e->level == 'error') { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 9cbebde2ca..d3a3ada846 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -51,7 +51,7 @@ protected function mapApiRoutes() * * @return void */ - public function boot() + public function boot(): void { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(300)->by($request->user()?->id ?: $request->ip()); diff --git a/app/Providers/ScheduleServiceProvider.php b/app/Providers/ScheduleServiceProvider.php index 6055e0d057..963b380fbb 100644 --- a/app/Providers/ScheduleServiceProvider.php +++ b/app/Providers/ScheduleServiceProvider.php @@ -7,7 +7,7 @@ class ScheduleServiceProvider extends ServiceProvider { - public function boot() + public function boot(): void { $this->app->booted(function () { $schedule = $this->app->make(Schedule::class); @@ -16,7 +16,7 @@ public function boot() }); } - public function register() + public function register(): void { } } diff --git a/app/Providers/WordpressServiceProvider.php b/app/Providers/WordpressServiceProvider.php index fc864276cb..0b6e3246ee 100644 --- a/app/Providers/WordpressServiceProvider.php +++ b/app/Providers/WordpressServiceProvider.php @@ -13,7 +13,7 @@ class WordpressServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // } @@ -23,7 +23,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { $this->app->singleton(WordpressClient::class, function () { try { diff --git a/app/Services/CheckAuthService.php b/app/Services/CheckAuthService.php index 395341ad8b..5ca9353abc 100644 --- a/app/Services/CheckAuthService.php +++ b/app/Services/CheckAuthService.php @@ -89,7 +89,7 @@ private function handle($email) * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'authenticated' => $this->authenticated, diff --git a/app/User.php b/app/User.php index 24e3096bc8..d0a907add0 100644 --- a/app/User.php +++ b/app/User.php @@ -2,6 +2,9 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Events\UserDeleted; use App\Events\UserUpdated; @@ -70,7 +73,7 @@ class User extends Authenticatable implements Auditable, HasLocalePreference 'deleted' => UserDeleted::class, ]; - public function role() + public function role(): HasOne { return $this->hasOne(\App\Role::class, 'idroles', 'role'); } @@ -81,19 +84,19 @@ public function repairdir_role() return $this->repairdir_role ? $this->repairdir_role : Role::REPAIR_DIRECTORY_NONE; } - public function userSkills() + public function userSkills(): HasMany { return $this->hasMany(\App\UsersSkills::class, 'user', 'id'); } - public function skills() + public function skills(): BelongsToMany { return $this->belongsToMany(\App\Skills::class, 'users_skills', 'user', 'skill'); } // This is an incorrect relationship, but leaving it here for now as it is used in a strange way in two legacy places and apparently working in those instances somehow. // Use skills() for correct belongsToMany relationship. - public function skillsold() + public function skillsold(): BelongsToMany { return $this->belongsToMany(\App\UsersSkills::class, 'users_skills', 'user', 'skill'); } @@ -110,7 +113,7 @@ public function assignSkill($skill) } } - public function groups() + public function groups(): BelongsToMany { return $this->belongsToMany(\App\Group::class, 'users_groups', 'user', 'group'); } @@ -165,12 +168,12 @@ public function groupsNearby($numberOfGroups = 10, $createdSince = null, $nearby return $groupsNearby; } - public function preferences() + public function preferences(): BelongsToMany { return $this->belongsToMany(self::class, 'users_preferences', 'user_id', 'preference_id'); } - public function permissions() + public function permissions(): BelongsToMany { return $this->belongsToMany(self::class, 'users_permissions', 'user_id', 'permission_id'); } @@ -402,7 +405,7 @@ public function convertToHost() } } - public function groupTag() + public function groupTag(): HasOne { return $this->hasOne(GroupTags::class, 'id', 'access_group_tag_id'); } @@ -512,7 +515,7 @@ public function isCoordinatorOf($network) return $this->networks->contains($network); } - public function networks() + public function networks(): BelongsToMany { return $this->belongsToMany(Network::class, 'user_network', 'user_id', 'network_id'); } diff --git a/app/UserGroups.php b/app/UserGroups.php index 6d3f8b6bae..b0dea22211 100644 --- a/app/UserGroups.php +++ b/app/UserGroups.php @@ -2,6 +2,8 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use DB; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -89,7 +91,7 @@ public function deleteUsersGroups($iduser) } //Table Relations - public function volunteer() + public function volunteer(): HasOne { return $this->hasOne(\App\User::class, 'id', 'user'); } @@ -113,11 +115,11 @@ public function getFullName() return 'N/A'; } - public function user() { + public function user(): BelongsTo { return $this->belongsTo(\App\User::class, 'user', 'id'); } - public function group() { + public function group(): BelongsTo { return $this->belongsTo(\App\Groups::class, 'group', 'idgroups'); } } diff --git a/app/UsersSkills.php b/app/UsersSkills.php index 82079a7c60..603540bb2f 100644 --- a/app/UsersSkills.php +++ b/app/UsersSkills.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use DB; use Illuminate\Database\Eloquent\Model; @@ -25,7 +26,7 @@ class UsersSkills extends Model public $timestamps = false; //Table Relations - public function skillName() + public function skillName(): HasOne { return $this->hasOne(\App\Skills::class, 'id', 'skill'); } diff --git a/app/Xref.php b/app/Xref.php index 2145acb475..01fdb98a50 100644 --- a/app/Xref.php +++ b/app/Xref.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use DB; use Illuminate\Database\Eloquent\Model; @@ -70,7 +71,7 @@ public function deleteObjectXref() } } - public function image() + public function image(): HasOne { return $this->hasOne(\App\Images::class, 'idimages', 'object'); } diff --git a/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php index c8721c30c1..3b2b98b2f7 100644 --- a/database/factories/CategoryFactory.php +++ b/database/factories/CategoryFactory.php @@ -11,7 +11,7 @@ class CategoryFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return []; } diff --git a/database/factories/DeviceFactory.php b/database/factories/DeviceFactory.php index bedcf4823d..849148b8d8 100644 --- a/database/factories/DeviceFactory.php +++ b/database/factories/DeviceFactory.php @@ -13,7 +13,7 @@ class DeviceFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'event' => Party::factory()->create()->idevents, diff --git a/database/factories/FaultcatFactory.php b/database/factories/FaultcatFactory.php index 374f4ea436..c77acdafdf 100644 --- a/database/factories/FaultcatFactory.php +++ b/database/factories/FaultcatFactory.php @@ -11,7 +11,7 @@ class FaultcatFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return []; } diff --git a/database/factories/GroupFactory.php b/database/factories/GroupFactory.php index 0160f7e5f5..b34f7064f8 100644 --- a/database/factories/GroupFactory.php +++ b/database/factories/GroupFactory.php @@ -11,7 +11,7 @@ class GroupFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->unique()->company(), diff --git a/database/factories/GroupTagsFactory.php b/database/factories/GroupTagsFactory.php index 54eee54ab5..0fe72e16a8 100644 --- a/database/factories/GroupTagsFactory.php +++ b/database/factories/GroupTagsFactory.php @@ -11,7 +11,7 @@ class GroupTagsFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'tag_name' => $this->faker->word(), diff --git a/database/factories/MisccatFactory.php b/database/factories/MisccatFactory.php index 948d6b594d..4af9be3543 100644 --- a/database/factories/MisccatFactory.php +++ b/database/factories/MisccatFactory.php @@ -11,7 +11,7 @@ class MisccatFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return []; } diff --git a/database/factories/NetworkFactory.php b/database/factories/NetworkFactory.php index f4a7cf277b..b9b3d63c97 100644 --- a/database/factories/NetworkFactory.php +++ b/database/factories/NetworkFactory.php @@ -11,7 +11,7 @@ class NetworkFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->unique()->company(), diff --git a/database/factories/PartyFactory.php b/database/factories/PartyFactory.php index 9adcbcccb0..07fe62f247 100644 --- a/database/factories/PartyFactory.php +++ b/database/factories/PartyFactory.php @@ -53,7 +53,7 @@ public function configure() * * @return array */ - public function definition() + public function definition(): array { return [ // Need to force the location otherwise the random one may not be geocodable and therefore the event may not diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index d4be28169b..d523e3eaba 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -28,7 +28,7 @@ class UserFactory extends Factory */ protected static ?string $password; - public function definition() + public function definition(): array { return [ 'name' => $this->faker->name(), diff --git a/database/migrations/2014_04_02_193005_create_translations_table.php b/database/migrations/2014_04_02_193005_create_translations_table.php index 034d183ca1..a3b6a1d269 100644 --- a/database/migrations/2014_04_02_193005_create_translations_table.php +++ b/database/migrations/2014_04_02_193005_create_translations_table.php @@ -10,7 +10,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('ltm_translations', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::drop('ltm_translations'); } diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index fcacb80b3e..b4d45de200 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->index(); @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('password_resets'); } diff --git a/database/migrations/2018_04_19_102108_initialise_fixometer_db.php b/database/migrations/2018_04_19_102108_initialise_fixometer_db.php index e756425551..4fadcd7ac9 100644 --- a/database/migrations/2018_04_19_102108_initialise_fixometer_db.php +++ b/database/migrations/2018_04_19_102108_initialise_fixometer_db.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { //Settings @@ -540,7 +540,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135338_password_recovery.php b/database/migrations/2018_04_19_135338_password_recovery.php index c60fa80e62..ef249c22f8 100644 --- a/database/migrations/2018_04_19_135338_password_recovery.php +++ b/database/migrations/2018_04_19_135338_password_recovery.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `users` ADD COLUMN `recovery` VARCHAR(45) NULL AFTER `role`, @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135433_device_list_view.php b/database/migrations/2018_04_19_135433_device_list_view.php index 9c94da9125..783b4e1cf9 100644 --- a/database/migrations/2018_04_19_135433_device_list_view.php +++ b/database/migrations/2018_04_19_135433_device_list_view.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { // DB::statement('CREATE OR REPLACE VIEW `view_devices_list` AS // SELECT @@ -44,7 +44,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135527_device_age.php b/database/migrations/2018_04_19_135527_device_age.php index 3192a7abf7..127025786e 100644 --- a/database/migrations/2018_04_19_135527_device_age.php +++ b/database/migrations/2018_04_19_135527_device_age.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `devices` ADD COLUMN `age` VARCHAR(255) NULL COMMENT "// kept as free text to capture data type after research" AFTER `model`;' @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135647_event_venue.php b/database/migrations/2018_04_19_135647_event_venue.php index 06e39fbe54..23cf985f7b 100644 --- a/database/migrations/2018_04_19_135647_event_venue.php +++ b/database/migrations/2018_04_19_135647_event_venue.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `events` ADD COLUMN `venue` VARCHAR(255) NULL AFTER `end`;' @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135728_lang_pref.php b/database/migrations/2018_04_19_135728_lang_pref.php index 0eb570a73b..f401e6b05f 100644 --- a/database/migrations/2018_04_19_135728_lang_pref.php +++ b/database/migrations/2018_04_19_135728_lang_pref.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `users` ADD COLUMN `language` VARCHAR(2) NOT NULL DEFAULT "en" AFTER `recovery_expires`;' @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135801_website.php b/database/migrations/2018_04_19_135801_website.php index 39419fa152..f9d40cae03 100644 --- a/database/migrations/2018_04_19_135801_website.php +++ b/database/migrations/2018_04_19_135801_website.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `groups` ADD COLUMN `website` TEXT NULL DEFAULT NULL AFTER `free_text`;' @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_145002_users_auth.php b/database/migrations/2018_04_19_145002_users_auth.php index 0007ed0144..ed6669fef3 100644 --- a/database/migrations/2018_04_19_145002_users_auth.php +++ b/database/migrations/2018_04_19_145002_users_auth.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->rememberToken(); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('remember_token'); diff --git a/database/migrations/2018_04_20_100516_users_location_age_gender.php b/database/migrations/2018_04_20_100516_users_location_age_gender.php index fca09e3952..5ebbc751e1 100644 --- a/database/migrations/2018_04_20_100516_users_location_age_gender.php +++ b/database/migrations/2018_04_20_100516_users_location_age_gender.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('location')->nullable(); @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('location'); diff --git a/database/migrations/2018_05_10_085751_rename_modified_at.php b/database/migrations/2018_05_10_085751_rename_modified_at.php index b7ba918de3..3ad3267dee 100644 --- a/database/migrations/2018_05_10_085751_rename_modified_at.php +++ b/database/migrations/2018_05_10_085751_rename_modified_at.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->renameColumn('modified_at', 'updated_at'); @@ -32,7 +32,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->renameColumn('updated_at', 'modified_at'); diff --git a/database/migrations/2018_05_16_121333_rename_modified_at_images.php b/database/migrations/2018_05_16_121333_rename_modified_at_images.php index ffd9fad789..b2f7b6ed1c 100644 --- a/database/migrations/2018_05_16_121333_rename_modified_at_images.php +++ b/database/migrations/2018_05_16_121333_rename_modified_at_images.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('images', function (Blueprint $table) { $table->renameColumn('modified_at', 'updated_at'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('images', function (Blueprint $table) { $table->renameColumn('updated_at', 'modified_at'); diff --git a/database/migrations/2018_06_01_142316_Create_Group_Tags.php b/database/migrations/2018_06_01_142316_Create_Group_Tags.php index 9a4e9f8b36..1ba9129415 100644 --- a/database/migrations/2018_06_01_142316_Create_Group_Tags.php +++ b/database/migrations/2018_06_01_142316_Create_Group_Tags.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('group_tags', function (Blueprint $table) { $table->increments('id'); @@ -29,7 +29,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('group_tags'); Schema::table('groups', function (Blueprint $table) { diff --git a/database/migrations/2018_06_01_145539_Create_Brands.php b/database/migrations/2018_06_01_145539_Create_Brands.php index 711b4c9680..a21666349a 100644 --- a/database/migrations/2018_06_01_145539_Create_Brands.php +++ b/database/migrations/2018_06_01_145539_Create_Brands.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('brands', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('brands'); Schema::table('devices', function (Blueprint $table) { diff --git a/database/migrations/2018_06_01_152511_Create_Skills.php b/database/migrations/2018_06_01_152511_Create_Skills.php index b7e57793f5..1317931657 100644 --- a/database/migrations/2018_06_01_152511_Create_Skills.php +++ b/database/migrations/2018_06_01_152511_Create_Skills.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('skills', function (Blueprint $table) { $table->increments('id'); @@ -29,7 +29,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('skills'); Schema::table('users', function (Blueprint $table) { diff --git a/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php b/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php index 6f3507b809..b0a4f2ac86 100644 --- a/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php +++ b/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('users_skills', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users_skills'); Schema::table('users', function (Blueprint $table) { diff --git a/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php b/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php index e9a7b7845e..2ad33bbb45 100644 --- a/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php +++ b/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('grouptags_groups', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('grouptags_groups'); Schema::table('groups', function (Blueprint $table) { diff --git a/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php b/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php index c613aa6624..11b0a945dd 100644 --- a/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php +++ b/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('country')->nullable(); @@ -29,7 +29,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('country'); diff --git a/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php b/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php index 9dd8c895ca..452fc665c4 100644 --- a/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php +++ b/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->integer('number_of_logins')->default(0); @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('number_of_logins'); diff --git a/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php b/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php index 8d792cbb11..5e685a5a28 100644 --- a/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php +++ b/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events_users', function (Blueprint $table) { $table->string('status', 50)->nullable(); @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events_users', function (Blueprint $table) { $table->dropColumn('status'); diff --git a/database/migrations/2018_06_27_000057_update_users_brands_registration.php b/database/migrations/2018_06_27_000057_update_users_brands_registration.php index 8f23146183..e8d7bad443 100644 --- a/database/migrations/2018_06_27_000057_update_users_brands_registration.php +++ b/database/migrations/2018_06_27_000057_update_users_brands_registration.php @@ -12,7 +12,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->timestamp('consent_past_data')->nullable(); @@ -44,7 +44,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('consent_gdpr'); diff --git a/database/migrations/2018_06_28_204857_create_sessions_table.php b/database/migrations/2018_06_28_204857_create_sessions_table.php index e36514b9e6..ae1d001faf 100644 --- a/database/migrations/2018_06_28_204857_create_sessions_table.php +++ b/database/migrations/2018_06_28_204857_create_sessions_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::rename('sessions', 'sessions_old'); @@ -30,7 +30,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::rename('sessions_old', 'sessions'); diff --git a/database/migrations/2018_07_01_201744_create_invites_table.php b/database/migrations/2018_07_01_201744_create_invites_table.php index 1d867dbc62..e4cd4284b3 100644 --- a/database/migrations/2018_07_01_201744_create_invites_table.php +++ b/database/migrations/2018_07_01_201744_create_invites_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('invites', function (Blueprint $table) { $table->increments('id'); @@ -27,7 +27,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('invites'); } diff --git a/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php b/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php index 932f1c3b97..cae4c90a62 100644 --- a/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php +++ b/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users_groups', function (Blueprint $table) { $table->string('status', 50)->nullable(); @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users_groups', function (Blueprint $table) { $table->dropColumn('status'); diff --git a/database/migrations/2018_07_03_104638_user_table_updates.php b/database/migrations/2018_07_03_104638_user_table_updates.php index 689fa02454..5a7642abbc 100644 --- a/database/migrations/2018_07_03_104638_user_table_updates.php +++ b/database/migrations/2018_07_03_104638_user_table_updates.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('gender')->nullable()->default(null)->change(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('gender')->nullable(false)->default('N/A')->change(); diff --git a/database/migrations/2018_07_04_082822_invite_type_column.php b/database/migrations/2018_07_04_082822_invite_type_column.php index 3daabd7480..816ebf58f0 100644 --- a/database/migrations/2018_07_04_082822_invite_type_column.php +++ b/database/migrations/2018_07_04_082822_invite_type_column.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('invites', function (Blueprint $table) { $table->string('type')->nullable(); @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('invites', function (Blueprint $table) { $table->dropColumn('type'); diff --git a/database/migrations/2018_07_04_215949_device_wiki_column.php b/database/migrations/2018_07_04_215949_device_wiki_column.php index 1c1925b9a9..7a17b26cde 100644 --- a/database/migrations/2018_07_04_215949_device_wiki_column.php +++ b/database/migrations/2018_07_04_215949_device_wiki_column.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('devices', function (Blueprint $table) { $table->integer('wiki')->after('repaired_by')->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('devices', function (Blueprint $table) { $table->dropColumn('wiki'); diff --git a/database/migrations/2018_07_06_221304_change_bio_length.php b/database/migrations/2018_07_06_221304_change_bio_length.php index 735718707b..50a69d849f 100644 --- a/database/migrations/2018_07_06_221304_change_bio_length.php +++ b/database/migrations/2018_07_06_221304_change_bio_length.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->text('biography')->change(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('biography')->change(); diff --git a/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php b/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php index 2810ca7f2d..efe56d5e90 100644 --- a/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php +++ b/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('group_tags', function (Blueprint $table) { $table->text('description')->nullable()->change(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('group_tags', function (Blueprint $table) { $table->string('description')->nullable(false)->change(); diff --git a/database/migrations/2018_07_12_110255_default_volunteers_value.php b/database/migrations/2018_07_12_110255_default_volunteers_value.php index dd032ce597..2ee186d9e3 100644 --- a/database/migrations/2018_07_12_110255_default_volunteers_value.php +++ b/database/migrations/2018_07_12_110255_default_volunteers_value.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->integer('volunteers')->nullable(false)->default(0)->change(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->integer('volunteers')->nullable()->change(); diff --git a/database/migrations/2018_07_17_221336_volunteer_event_users.php b/database/migrations/2018_07_17_221336_volunteer_event_users.php index 58ee6d518f..d1abba3ecc 100644 --- a/database/migrations/2018_07_17_221336_volunteer_event_users.php +++ b/database/migrations/2018_07_17_221336_volunteer_event_users.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events_users', function (Blueprint $table) { $table->string('full_name')->nullable(); @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events_users', function (Blueprint $table) { $table->dropColumn('full_name'); diff --git a/database/migrations/2018_07_26_172108_media_wiki.php b/database/migrations/2018_07_26_172108_media_wiki.php index db18776609..fd38d2302c 100644 --- a/database/migrations/2018_07_26_172108_media_wiki.php +++ b/database/migrations/2018_07_26_172108_media_wiki.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->tinyInteger('mediawiki')->default(0); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('mediawiki'); diff --git a/database/migrations/2018_07_31_213315_media_wiki_username.php b/database/migrations/2018_07_31_213315_media_wiki_username.php index 900853237e..c060e966f9 100644 --- a/database/migrations/2018_07_31_213315_media_wiki_username.php +++ b/database/migrations/2018_07_31_213315_media_wiki_username.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('mediawiki')->default(null)->nullable()->change(); @@ -27,7 +27,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->integer('mediawiki')->default(0)->change(); diff --git a/database/migrations/2018_09_03_091813_create_audits_table.php b/database/migrations/2018_09_03_091813_create_audits_table.php index dc7c72a80c..ab3a594e4d 100644 --- a/database/migrations/2018_09_03_091813_create_audits_table.php +++ b/database/migrations/2018_09_03_091813_create_audits_table.php @@ -23,7 +23,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('audits', function (Blueprint $table) { $table->increments('id'); @@ -48,7 +48,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::drop('audits'); } diff --git a/database/migrations/2018_09_04_110332_create_preferences_table.php b/database/migrations/2018_09_04_110332_create_preferences_table.php index cf53dece72..657b78459e 100644 --- a/database/migrations/2018_09_04_110332_create_preferences_table.php +++ b/database/migrations/2018_09_04_110332_create_preferences_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('preferences', function (Blueprint $table) { $table->increments('id'); @@ -39,7 +39,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users_preferences'); Schema::dropIfExists('preferences'); diff --git a/database/migrations/2018_09_13_114022_soft_delete_event.php b/database/migrations/2018_09_13_114022_soft_delete_event.php index f7a161b1d1..39a20c943d 100644 --- a/database/migrations/2018_09_13_114022_soft_delete_event.php +++ b/database/migrations/2018_09_13_114022_soft_delete_event.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->softDeletes(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('deleted_at'); diff --git a/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php b/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php index 516f82a47d..7b826befda 100644 --- a/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php +++ b/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::table('users_preferences')->delete(); DB::table('preferences')->delete(); @@ -51,7 +51,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users_permissions'); } diff --git a/database/migrations/2018_09_20_120947_soft_delete_permissions.php b/database/migrations/2018_09_20_120947_soft_delete_permissions.php index 64e7bd83cb..a4441e45f8 100644 --- a/database/migrations/2018_09_20_120947_soft_delete_permissions.php +++ b/database/migrations/2018_09_20_120947_soft_delete_permissions.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('permissions', function (Blueprint $table) { $table->softDeletes(); @@ -27,7 +27,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('permissions', function (Blueprint $table) { $table->dropColumn('deleted_at'); diff --git a/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php b/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php index 714d3c7d04..d6a632d573 100644 --- a/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php +++ b/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->integer('user_id')->unsigned()->nullable()->after('volunteers'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('user_id'); diff --git a/database/migrations/2018_10_04_095031_create_notifications_table.php b/database/migrations/2018_10_04_095031_create_notifications_table.php index 4357c9efa5..6d7e70333c 100644 --- a/database/migrations/2018_10_04_095031_create_notifications_table.php +++ b/database/migrations/2018_10_04_095031_create_notifications_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('notifications', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('notifications'); } diff --git a/database/migrations/2018_10_31_145415_add_preferences.php b/database/migrations/2018_10_31_145415_add_preferences.php index 8b42ccc1eb..dd66b01d6b 100644 --- a/database/migrations/2018_10_31_145415_add_preferences.php +++ b/database/migrations/2018_10_31_145415_add_preferences.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { // Additional preferences DB::table('preferences')->insert([ @@ -73,7 +73,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::table('users_preferences')->delete(); DB::table('preferences')->truncate(); diff --git a/database/migrations/2018_11_05_190951_group_country_field.php b/database/migrations/2018_11_05_190951_group_country_field.php index ecf4b7a590..a624593554 100644 --- a/database/migrations/2018_11_05_190951_group_country_field.php +++ b/database/migrations/2018_11_05_190951_group_country_field.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('country')->after('area')->nullable(); @@ -41,7 +41,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('country'); diff --git a/database/migrations/2018_11_12_135805_additional_device_fields.php b/database/migrations/2018_11_12_135805_additional_device_fields.php index c3a9d411ea..33e0b91f70 100644 --- a/database/migrations/2018_11_12_135805_additional_device_fields.php +++ b/database/migrations/2018_11_12_135805_additional_device_fields.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('barriers', function (Blueprint $table) { $table->increments('id'); @@ -58,7 +58,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('barriers'); Schema::dropIfExists('devices_urls'); diff --git a/database/migrations/2018_12_04_212544_increase_username_field_length.php b/database/migrations/2018_12_04_212544_increase_username_field_length.php index a3014d9234..a473cdea2d 100644 --- a/database/migrations/2018_12_04_212544_increase_username_field_length.php +++ b/database/migrations/2018_12_04_212544_increase_username_field_length.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('username', 50)->change(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('username', 20)->change(); diff --git a/database/migrations/2018_12_10_114941_create_jobs_table.php b/database/migrations/2018_12_10_114941_create_jobs_table.php index a786a89100..560ae54bcd 100644 --- a/database/migrations/2018_12_10_114941_create_jobs_table.php +++ b/database/migrations/2018_12_10_114941_create_jobs_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); @@ -29,7 +29,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('jobs'); } diff --git a/database/migrations/2018_12_11_112533_create_failed_jobs_table.php b/database/migrations/2018_12_11_112533_create_failed_jobs_table.php index 23a0faa341..3bafc3bf3e 100644 --- a/database/migrations/2018_12_11_112533_create_failed_jobs_table.php +++ b/database/migrations/2018_12_11_112533_create_failed_jobs_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { $table->bigIncrements('id'); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('failed_jobs'); } diff --git a/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php b/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php index e2e35c3751..69df1de2c0 100644 --- a/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php +++ b/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php @@ -12,7 +12,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->datetime('last_login_at')->nullable(); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('last_login_at'); diff --git a/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php b/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php index 647de7470d..06d5785e91 100644 --- a/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php +++ b/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('access_key')->nullable()->unique(); @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('access_key'); diff --git a/database/migrations/2019_03_22_105152_repair_network_update.php b/database/migrations/2019_03_22_105152_repair_network_update.php index b3a51ba670..2da1fd59d7 100644 --- a/database/migrations/2019_03_22_105152_repair_network_update.php +++ b/database/migrations/2019_03_22_105152_repair_network_update.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->tinyInteger('repair_network')->default(1)->after('language'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('repair_network'); diff --git a/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php b/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php index f6fae67a7e..339888b6c5 100644 --- a/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php +++ b/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('shareable_code')->after('free_text')->nullable(); @@ -27,7 +27,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('shareable_code'); diff --git a/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php b/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php index 47e5450e5b..950b54f9b8 100644 --- a/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php +++ b/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('DROP VIEW IF EXISTS view_devices_list'); DB::statement('CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `view_devices_list` AS select `devices`.`iddevices` AS `id`,`categories`.`name` AS `category_name`,`categories`.`idcategories` AS `idcategory`,`devices`.`brand` AS `brand`,`devices`.`model` AS `model`,`devices`.`problem` AS `problem`,`groups`.`idgroups` AS `idgroup`,`groups`.`name` AS `group_name`,COALESCE(`events`.`venue`,`events`.`location`) AS event_name, `events`.`location` AS `event_location`,`events`.`latitude` AS `event_latitude`,`events`.`longitude` AS `event_longitude`,unix_timestamp(`events`.`event_date`) AS `event_date`,`users`.`name` AS `restarter`,`devices`.`repair_status` AS `repair_status`,`devices`.`created_at` AS `sorter` from ((((`devices` join `categories` on((`categories`.`idcategories` = `devices`.`category`))) join `events` on((`events`.`idevents` = `devices`.`event`))) join `groups` on((`groups`.`idgroups` = `events`.`group`))) join `users` on((`users`.`id` = `devices`.`repaired_by`)));'); @@ -22,7 +22,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement('DROP VIEW IF EXISTS view_devices_list'); DB::statement('CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `view_devices_list` AS select `devices`.`iddevices` AS `id`,`categories`.`name` AS `category_name`,`categories`.`idcategories` AS `idcategory`,`devices`.`brand` AS `brand`,`devices`.`model` AS `model`,`devices`.`problem` AS `problem`,`groups`.`idgroups` AS `idgroup`,`groups`.`name` AS `group_name`,`events`.`location` AS `event_location`,`events`.`latitude` AS `event_latitude`,`events`.`longitude` AS `event_longitude`,unix_timestamp(`events`.`event_date`) AS `event_date`,`users`.`name` AS `restarter`,`devices`.`repair_status` AS `repair_status`,`devices`.`created_at` AS `sorter` from ((((`devices` join `categories` on((`categories`.`idcategories` = `devices`.`category`))) join `events` on((`events`.`idevents` = `devices`.`event`))) join `groups` on((`groups`.`idgroups` = `events`.`group`))) join `users` on((`users`.`id` = `devices`.`repaired_by`)));'); diff --git a/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php b/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php index 2b536d4b77..e798add6c8 100644 --- a/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php +++ b/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { // Using raw SQL as tinyint columns can't be altered. // See https://laravel.com/docs/5.6/migrations#modifying-columns @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement("ALTER TABLE `users_groups` CHANGE `role` `role` TINYINT(4) NOT NULL DEFAULT '3'"); } diff --git a/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php b/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php index 319d0f9bec..24b899b048 100644 --- a/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php +++ b/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('drip_subscriber_id')->nullable()->after('newsletter')->unique(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('drip_subscriber_id'); diff --git a/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php b/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php index d5b0e6624b..c45c657c3a 100644 --- a/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php +++ b/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->boolean('wiki_sync_status')->default(false); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('wiki_sync_status'); diff --git a/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php b/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php index ed303be157..c4bfb56edc 100644 --- a/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php +++ b/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php @@ -12,7 +12,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('calendar_hash')->after('drip_subscriber_id')->unique()->nullable(); @@ -36,7 +36,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('calendar_hash'); diff --git a/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php b/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php index 20fd526822..fee3d1670c 100644 --- a/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php +++ b/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::table('preferences')->insert([ 'name' => 'Admin User Deleted', @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { $id = DB::table('preferences')->where('slug', 'admin-user-deleted')->pluck('id'); DB::table('users_preferences')->where('preference_id', $id)->delete(); diff --git a/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php b/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php index 6cfc04853d..1ec9b9db55 100644 --- a/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php +++ b/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::table('preferences')->insert([ 'name' => 'Admin Moderate Event Photos', @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { $id = DB::table('preferences')->where('slug', 'admin-moderate-event-photos')->pluck('id'); DB::table('users_preferences')->where('preference_id', $id)->delete(); diff --git a/database/migrations/2019_11_11_151415_rename_access_key_column.php b/database/migrations/2019_11_11_151415_rename_access_key_column.php index 658b047382..0bf65c9bdb 100644 --- a/database/migrations/2019_11_11_151415_rename_access_key_column.php +++ b/database/migrations/2019_11_11_151415_rename_access_key_column.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->renameColumn('access_key', 'api_token'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->renameColumn('api_token', 'access_key'); diff --git a/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php b/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php index 28b5c953b0..8df3273d5e 100644 --- a/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php +++ b/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users_groups', function (Blueprint $table) { $table->softDeletes(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { $table->dropSoftDeletes(); } diff --git a/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php b/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php index 8003c0344e..8bd133f4f6 100644 --- a/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php +++ b/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (Schema::hasTable('devices_faults_opinions')) { if (! Schema::hasColumn('devices_faults_opinions', 'updated_at')) { @@ -39,7 +39,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('devices_faults_opinions', function (Blueprint $table) { $table->dropColumn('updated_at'); diff --git a/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php b/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php index d002a67f9c..91f7381c12 100644 --- a/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php +++ b/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (Schema::hasTable('devices_faults_opinions')) { if (! Schema::hasColumn('devices_faults_opinions', 'age')) { @@ -44,7 +44,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('devices_faults_opinions', function (Blueprint $table) { $table->dropColumn('age'); diff --git a/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php b/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php index ba1650d040..af3b8c23c1 100644 --- a/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php +++ b/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('microtask_demographics', function (Blueprint $table) { $table->increments('id'); @@ -33,7 +33,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('microtask_demographics'); } diff --git a/database/migrations/2020_02_10_182430_add_network_id_to_groups.php b/database/migrations/2020_02_10_182430_add_network_id_to_groups.php index f87259ddd3..2a23d18e23 100644 --- a/database/migrations/2020_02_10_182430_add_network_id_to_groups.php +++ b/database/migrations/2020_02_10_182430_add_network_id_to_groups.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->smallInteger('network_id') @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('network_id'); diff --git a/database/migrations/2020_02_10_184130_add_external_id_to_groups.php b/database/migrations/2020_02_10_184130_add_external_id_to_groups.php index 78ba2a3cb2..48558bea62 100644 --- a/database/migrations/2020_02_10_184130_add_external_id_to_groups.php +++ b/database/migrations/2020_02_10_184130_add_external_id_to_groups.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->smallInteger('external_id') @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('external_id'); diff --git a/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php b/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php index 5e7b17e3e8..2eff6ee85e 100644 --- a/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php +++ b/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->text('facebook')->after('website'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('facebook'); diff --git a/database/migrations/2020_02_17_100100_faultcat_refactor.php b/database/migrations/2020_02_17_100100_faultcat_refactor.php index 3f190f903b..31890fcacc 100644 --- a/database/migrations/2020_02_17_100100_faultcat_refactor.php +++ b/database/migrations/2020_02_17_100100_faultcat_refactor.php @@ -14,7 +14,7 @@ * * @return void */ - public function up() + public function up(): void { if (Schema::hasTable('devices_faults')) { Schema::rename('devices_faults', 'devices_faults_events'); @@ -84,7 +84,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_adjudicated'); diff --git a/database/migrations/2020_02_24_140951_create_misccat_tables.php b/database/migrations/2020_02_24_140951_create_misccat_tables.php index 3be0691f45..6b47ba4c0a 100644 --- a/database/migrations/2020_02_24_140951_create_misccat_tables.php +++ b/database/migrations/2020_02_24_140951_create_misccat_tables.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('devices_misc_opinions', function (Blueprint $table) { $table->increments('id'); @@ -42,7 +42,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_misc_opinions'); Schema::dropIfExists('devices_misc_adjudicated'); diff --git a/database/migrations/2020_03_11_164903_create_networks_table.php b/database/migrations/2020_03_11_164903_create_networks_table.php index b995781d83..8604498062 100644 --- a/database/migrations/2020_03_11_164903_create_networks_table.php +++ b/database/migrations/2020_03_11_164903_create_networks_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('networks', function (Blueprint $table) { $table->increments('id'); @@ -29,7 +29,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('networks'); } diff --git a/database/migrations/2020_03_11_175639_create_group_network_table.php b/database/migrations/2020_03_11_175639_create_group_network_table.php index ff409f6852..6b4ac5cfc9 100644 --- a/database/migrations/2020_03_11_175639_create_group_network_table.php +++ b/database/migrations/2020_03_11_175639_create_group_network_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('group_network', function (Blueprint $table) { $table->primary(['group_id', 'network_id']); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('group_network'); } diff --git a/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php b/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php index b511de95a4..217f6237fb 100644 --- a/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php +++ b/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('events_push_to_wordpress')->notNullable()->default(false); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('events_push_to_wordpress'); diff --git a/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php b/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php index eeb6d27df9..b9dd56fb97 100644 --- a/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php +++ b/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('include_in_zapier')->nullable(false)->default(false); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('include_in_zapier'); diff --git a/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php b/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php index 7d2b86e601..f7c55cbff1 100644 --- a/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php +++ b/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->string('shortname', 255)->nullable(false); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('shortname'); diff --git a/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php b/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php index d1c223fd9a..d4a70733fc 100644 --- a/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php +++ b/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::table('roles')->insert([ 'role' => 'NetworkCoordinator', @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::delete("delete from roles where role = 'NetworkCoordinator'"); } diff --git a/database/migrations/2020_04_19_102144_create_user_network_table.php b/database/migrations/2020_04_19_102144_create_user_network_table.php index f0f1e3e4d8..547f416d74 100644 --- a/database/migrations/2020_04_19_102144_create_user_network_table.php +++ b/database/migrations/2020_04_19_102144_create_user_network_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('user_network', function (Blueprint $table) { $table->primary(['user_id', 'network_id']); @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('user_network'); } diff --git a/database/migrations/2020_04_27_175552_create_default_network.php b/database/migrations/2020_04_27_175552_create_default_network.php index 6198c3bb26..fdab92f447 100644 --- a/database/migrations/2020_04_27_175552_create_default_network.php +++ b/database/migrations/2020_04_27_175552_create_default_network.php @@ -13,7 +13,7 @@ * * @return void */ - public function up() + public function up(): void { // This is the default 'Restarters' network - that which // groups will be a member of by default, if not part of @@ -37,7 +37,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::table('networks')->where('id', 1)->delete(); } diff --git a/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php b/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php index 67db46aedf..8acc477131 100644 --- a/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php +++ b/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php @@ -12,7 +12,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('users_push_to_drip')->nullable(false)->default(false) @@ -27,7 +27,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('users_push_to_drip'); diff --git a/database/migrations/2020_05_21_173538_add_online_flag_to_events.php b/database/migrations/2020_05_21_173538_add_online_flag_to_events.php index 6258fb212c..22b0231df2 100644 --- a/database/migrations/2020_05_21_173538_add_online_flag_to_events.php +++ b/database/migrations/2020_05_21_173538_add_online_flag_to_events.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->boolean('online') @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('online'); diff --git a/database/migrations/2020_05_26_130318_allow_null_location_details.php b/database/migrations/2020_05_26_130318_allow_null_location_details.php index aad571291a..d8da65fe89 100644 --- a/database/migrations/2020_05_26_130318_allow_null_location_details.php +++ b/database/migrations/2020_05_26_130318_allow_null_location_details.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('location', 255)->nullable()->change(); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->string('location', 255)->nullable(false)->change(); diff --git a/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php b/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php index 7a992c1a44..80f4b3800e 100644 --- a/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php +++ b/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->string('discourse_group', 255)->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('discourse_group'); diff --git a/database/migrations/2020_06_30_100100_mobifix_setup.php b/database/migrations/2020_06_30_100100_mobifix_setup.php index 86e5fa7c63..7e97e2f58f 100644 --- a/database/migrations/2020_06_30_100100_mobifix_setup.php +++ b/database/migrations/2020_06_30_100100_mobifix_setup.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('devices_faults_mobiles_opinions', function (Blueprint $table) { $table->increments('id'); @@ -40,7 +40,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_mobiles_adjudicated'); Schema::dropIfExists('devices_faults_mobiles_opinions'); diff --git a/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php b/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php index df09c2ad26..b322716371 100644 --- a/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php +++ b/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::table('preferences')->insert([ 'name' => 'Event deletion notification', @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { $id = DB::table('preferences')->where('slug', 'delete-event-notification')->pluck('id'); DB::table('users_preferences')->where('preference_id', $id)->delete(); diff --git a/database/migrations/2020_08_01_110400_mobifix_ora_setup.php b/database/migrations/2020_08_01_110400_mobifix_ora_setup.php index 62bc4264d8..5be813ed79 100644 --- a/database/migrations/2020_08_01_110400_mobifix_ora_setup.php +++ b/database/migrations/2020_08_01_110400_mobifix_ora_setup.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('devices_faults_mobiles_ora_opinions', function (Blueprint $table) { $table->increments('id'); @@ -241,7 +241,7 @@ protected function _FaultTypes() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_mobiles_ora_adjudicated'); Schema::dropIfExists('devices_faults_mobiles_ora_opinions'); diff --git a/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php b/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php index 560e0fe4cc..9f7ad0c402 100644 --- a/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php +++ b/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `users` CHANGE `longitude` `longitude` DECIMAL(10,7), CHANGE `latitude` `latitude` DECIMAL(10,7) NULL DEFAULT NULL;'); } @@ -21,7 +21,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `users` CHANGE `longitude` `longitude` DECIMAL(10,8), CHANGE `latitude` `latitude` DECIMAL(10,8) NULL DEFAULT NULL;'); } diff --git a/database/migrations/2020_08_26_110001_support_non_powered_items.php b/database/migrations/2020_08_26_110001_support_non_powered_items.php index 48d89e7a8e..cb2cee25fc 100644 --- a/database/migrations/2020_08_26_110001_support_non_powered_items.php +++ b/database/migrations/2020_08_26_110001_support_non_powered_items.php @@ -12,7 +12,7 @@ * * @return void */ - public function up() + public function up(): void { // New cluster for non-powered categories. DB::table('clusters')->insert([ @@ -63,7 +63,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('devices', function (Blueprint $table) { $table->dropColumn('item_type'); diff --git a/database/migrations/2020_10_21_121813_alter_table_charsets.php b/database/migrations/2020_10_21_121813_alter_table_charsets.php index 8151e3d35c..b2d475dd8d 100644 --- a/database/migrations/2020_10_21_121813_alter_table_charsets.php +++ b/database/migrations/2020_10_21_121813_alter_table_charsets.php @@ -14,7 +14,7 @@ * * @return void */ - public function up() + public function up(): void { Log::info('START MIGRATE AlterTableCharsets'); @@ -35,7 +35,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { $tables = $this->_tableCharsets(); foreach ($tables as $table) { diff --git a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php index f3833f5a98..88bd4a07b9 100644 --- a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php +++ b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (! Schema::hasColumn('devices', 'repair_status_str')) { Schema::table('devices', function (Blueprint $table) { @@ -58,7 +58,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::unprepared('DROP TRIGGER IF EXISTS `repair_status_str_in`'); DB::unprepared('DROP TRIGGER IF EXISTS `repair_status_str_up`'); diff --git a/database/migrations/2021_01_11_161917_cancellations.php b/database/migrations/2021_01_11_161917_cancellations.php index 5779b8c0e3..96fe0a751b 100644 --- a/database/migrations/2021_01_11_161917_cancellations.php +++ b/database/migrations/2021_01_11_161917_cancellations.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->boolean('cancelled')->after('deleted_at')->default(false); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('cancelled'); diff --git a/database/migrations/2021_03_22_092800_tabicat_ora_setup.php b/database/migrations/2021_03_22_092800_tabicat_ora_setup.php index fc90afe418..a3753d49e3 100755 --- a/database/migrations/2021_03_22_092800_tabicat_ora_setup.php +++ b/database/migrations/2021_03_22_092800_tabicat_ora_setup.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (! Schema::hasTable('devices_faults_tablets_ora_opinions')) { Schema::create('devices_faults_tablets_ora_opinions', function (Blueprint $table) { @@ -240,7 +240,7 @@ protected function _FaultTypes() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_tablets_ora_adjudicated'); Schema::dropIfExists('devices_faults_tablets_ora_opinions'); diff --git a/database/migrations/2021_04_06_113426_printcat_ora_setup.php b/database/migrations/2021_04_06_113426_printcat_ora_setup.php index 85aebaaff2..68ffd16c7d 100644 --- a/database/migrations/2021_04_06_113426_printcat_ora_setup.php +++ b/database/migrations/2021_04_06_113426_printcat_ora_setup.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (! Schema::hasTable('devices_faults_printers_ora_opinions')) { Schema::create('devices_faults_printers_ora_opinions', function (Blueprint $table) { @@ -225,7 +225,7 @@ protected function _FaultTypes() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_printers_ora_adjudicated'); Schema::dropIfExists('devices_faults_printers_ora_opinions'); diff --git a/database/migrations/2021_04_16_095410_aggregate_categories.php b/database/migrations/2021_04_16_095410_aggregate_categories.php index d73882b367..8d0d6ba98c 100644 --- a/database/migrations/2021_04_16_095410_aggregate_categories.php +++ b/database/migrations/2021_04_16_095410_aggregate_categories.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('categories', function (Blueprint $table) { $table->boolean('aggregate'); @@ -40,7 +40,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('categories', function (Blueprint $table) { $table->dropColumn('aggregate'); diff --git a/database/migrations/2021_04_26_115247_add_postcode.php b/database/migrations/2021_04_26_115247_add_postcode.php index a5c51e307e..f8b7dadb7e 100644 --- a/database/migrations/2021_04_26_115247_add_postcode.php +++ b/database/migrations/2021_04_26_115247_add_postcode.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('postcode', 32); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('postcode'); diff --git a/database/migrations/2021_05_05_151211_audit_issue.php b/database/migrations/2021_05_05_151211_audit_issue.php index 9a9697863d..143f1269c7 100644 --- a/database/migrations/2021_05_05_151211_audit_issue.php +++ b/database/migrations/2021_05_05_151211_audit_issue.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('audits', function (Blueprint $table) { $table->string('old_values', '4294967295')->change(); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('audits', function (Blueprint $table) { $table->string('old_values', '16777215')->change(); diff --git a/database/migrations/2021_05_11_130314_create_microtask_surveys.php b/database/migrations/2021_05_11_130314_create_microtask_surveys.php index c7720d1ff6..7de8d77ccf 100644 --- a/database/migrations/2021_05_11_130314_create_microtask_surveys.php +++ b/database/migrations/2021_05_11_130314_create_microtask_surveys.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (! Schema::hasTable('microtask_surveys')) { Schema::create( @@ -36,7 +36,7 @@ function (Blueprint $table) { * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('microtask_surveys'); } diff --git a/database/migrations/2021_05_14_105028_devices_updated_at.php b/database/migrations/2021_05_14_105028_devices_updated_at.php index 6ffdde3d6b..03aacefd46 100644 --- a/database/migrations/2021_05_14_105028_devices_updated_at.php +++ b/database/migrations/2021_05_14_105028_devices_updated_at.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->datetime('devices_updated_at')->nullable(); @@ -27,7 +27,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('devices_updated_at'); diff --git a/database/migrations/2021_05_14_173108_repairdir_role.php b/database/migrations/2021_05_14_173108_repairdir_role.php index ace6d03d97..72c88da4c8 100644 --- a/database/migrations/2021_05_14_173108_repairdir_role.php +++ b/database/migrations/2021_05_14_173108_repairdir_role.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (! Schema::hasColumn('users', 'repairdir_role')) { Schema::table('users', function (Blueprint $table) { @@ -25,7 +25,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2021_05_21_130659_discourse_thread.php b/database/migrations/2021_05_21_130659_discourse_thread.php index fcc485b701..0f00291c32 100644 --- a/database/migrations/2021_05_21_130659_discourse_thread.php +++ b/database/migrations/2021_05_21_130659_discourse_thread.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('discourse_thread', 255)->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('discourse_thread'); diff --git a/database/migrations/2021_06_09_164834_no_null_problems.php b/database/migrations/2021_06_09_164834_no_null_problems.php index 713bd5a197..816cf27dd4 100644 --- a/database/migrations/2021_06_09_164834_no_null_problems.php +++ b/database/migrations/2021_06_09_164834_no_null_problems.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { // See https://github.com/doctrine/dbal/issues/3161. DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); diff --git a/database/migrations/2021_06_21_105938_battcat_ora_setup.php b/database/migrations/2021_06_21_105938_battcat_ora_setup.php index 229c1e69c2..9a33ad582b 100644 --- a/database/migrations/2021_06_21_105938_battcat_ora_setup.php +++ b/database/migrations/2021_06_21_105938_battcat_ora_setup.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('devices_faults_batteries_ora_opinions', function (Blueprint $table) { $table->increments('id'); @@ -141,7 +141,7 @@ protected function _FaultTypes() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_batteries_ora_adjudicated'); Schema::dropIfExists('devices_faults_batteries_ora_opinions'); diff --git a/database/migrations/2021_07_14_125845_battcat_ora_changes.php b/database/migrations/2021_07_14_125845_battcat_ora_changes.php index a786fe4330..97cf2ad8a5 100644 --- a/database/migrations/2021_07_14_125845_battcat_ora_changes.php +++ b/database/migrations/2021_07_14_125845_battcat_ora_changes.php @@ -9,7 +9,7 @@ * * @return void */ - public function up() + public function up(): void { DB::table('fault_types_batteries')->where('id', '=', 14)->update([ 'title' => 'Unrepairable corrosion or leakage', @@ -71,7 +71,7 @@ protected function _FaultTypes() * * @return void */ - public function down() + public function down(): void { } }; diff --git a/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php b/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php index b12335e55f..afe1bc3f6f 100644 --- a/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php +++ b/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('DROP VIEW IF EXISTS `view_waste_emission_ratio`;'); } @@ -21,7 +21,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php b/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php index 65ba5580b2..638c750c79 100644 --- a/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php +++ b/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php @@ -29,7 +29,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('SET foreign_key_checks=0'); DB::table('categories')->insert([ @@ -157,7 +157,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement('SET foreign_key_checks=0'); DB::table('categories')->where('idcategories', 6)->delete(); diff --git a/database/migrations/2021_08_16_133342_event_link.php b/database/migrations/2021_08_16_133342_event_link.php index 79fbe55384..dfa50cbd77 100644 --- a/database/migrations/2021_08_16_133342_event_link.php +++ b/database/migrations/2021_08_16_133342_event_link.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('link')->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('link'); diff --git a/database/migrations/2021_09_10_093142_autoapprove_events.php b/database/migrations/2021_09_10_093142_autoapprove_events.php index 3946288e4f..ece304b3ec 100644 --- a/database/migrations/2021_09_10_093142_autoapprove_events.php +++ b/database/migrations/2021_09_10_093142_autoapprove_events.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('auto_approve_events')->default(false); @@ -30,7 +30,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('auto_approve_events'); diff --git a/database/migrations/2021_10_04_124708_fix_category_names.php b/database/migrations/2021_10_04_124708_fix_category_names.php index b12ba07d98..5237421f44 100644 --- a/database/migrations/2021_10_04_124708_fix_category_names.php +++ b/database/migrations/2021_10_04_124708_fix_category_names.php @@ -9,7 +9,7 @@ * * @return void */ - public function up() + public function up(): void { $cats = [ 19 => 'PC accessory', @@ -30,7 +30,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { $cats = [ 19 => 'PC Accessory', diff --git a/database/migrations/2021_10_27_093744_group_discourse_group.php b/database/migrations/2021_10_27_093744_group_discourse_group.php index 9ff618c9eb..b2a190835b 100644 --- a/database/migrations/2021_10_27_093744_group_discourse_group.php +++ b/database/migrations/2021_10_27_093744_group_discourse_group.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('discourse_group', 255)->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('discourse_group'); diff --git a/database/migrations/2021_12_08_100326_longer_language.php b/database/migrations/2021_12_08_100326_longer_language.php index 651655a874..019da88864 100644 --- a/database/migrations/2021_12_08_100326_longer_language.php +++ b/database/migrations/2021_12_08_100326_longer_language.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('language', 5)->change(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('language', 2)->change(); diff --git a/database/migrations/2022_01_04_123128_group_discourse_logo.php b/database/migrations/2022_01_04_123128_group_discourse_logo.php index 863d5267a8..20368959c0 100644 --- a/database/migrations/2022_01_04_123128_group_discourse_logo.php +++ b/database/migrations/2022_01_04_123128_group_discourse_logo.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->integer('discourse_logo')->default(null)->nullable()->comment('ID of last Laraval Group image applied to Discourse Group'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('discourse_group'); diff --git a/database/migrations/2022_01_24_101405_timezones.php b/database/migrations/2022_01_24_101405_timezones.php index 83d01cb831..e396695163 100644 --- a/database/migrations/2022_01_24_101405_timezones.php +++ b/database/migrations/2022_01_24_101405_timezones.php @@ -13,7 +13,7 @@ * * @return void */ - public function up() + public function up(): void { # Timezones for groups and events. Schema::table('groups', function (Blueprint $table) { @@ -76,7 +76,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { # Restore the event_date/state/end fields. Schema::table('events', function (Blueprint $table) { diff --git a/database/migrations/2022_02_04_132146_category_descriptions.php b/database/migrations/2022_02_04_132146_category_descriptions.php index 87b60affd8..c23ac46b29 100644 --- a/database/migrations/2022_02_04_132146_category_descriptions.php +++ b/database/migrations/2022_02_04_132146_category_descriptions.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('categories', function (Blueprint $table) { $table->string('description_short', 255); @@ -80,7 +80,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('categories', function (Blueprint $table) { $table->dropColumn('description_short'); diff --git a/database/migrations/2022_02_04_140651_refactor_estimate_column.php b/database/migrations/2022_02_04_140651_refactor_estimate_column.php index 63a2ed28af..527d59a6ee 100644 --- a/database/migrations/2022_02_04_140651_refactor_estimate_column.php +++ b/database/migrations/2022_02_04_140651_refactor_estimate_column.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `devices` ADD `estimate_old` VARCHAR(10) AFTER `estimate`'); DB::statement('UPDATE devices SET `estimate_old` = `estimate`'); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `devices` DROP `estimate`'); DB::statement('ALTER TABLE `devices` CHANGE `estimate_old` `estimate` VARCHAR(10)'); diff --git a/database/migrations/2022_02_16_085124_refactor_age_column.php b/database/migrations/2022_02_16_085124_refactor_age_column.php index dccf7999d8..d203e9c922 100644 --- a/database/migrations/2022_02_16_085124_refactor_age_column.php +++ b/database/migrations/2022_02_16_085124_refactor_age_column.php @@ -9,7 +9,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `devices` ADD `age_old` VARCHAR(10) AFTER `age`'); DB::statement('UPDATE devices SET `age_old` = `age`'); @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `devices` DROP `age`'); DB::statement('ALTER TABLE `devices` CHANGE `age_old` `age` VARCHAR(10)'); diff --git a/database/migrations/2022_03_02_102531_dustup_ora_setup.php b/database/migrations/2022_03_02_102531_dustup_ora_setup.php index 31bb91809d..04d7214f09 100644 --- a/database/migrations/2022_03_02_102531_dustup_ora_setup.php +++ b/database/migrations/2022_03_02_102531_dustup_ora_setup.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { if (!Schema::hasTable('devices_faults_vacuums_ora_opinions')) { Schema::create('devices_faults_vacuums_ora_opinions', function (Blueprint $table) { @@ -214,7 +214,7 @@ protected function _FaultTypes() * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_vacuums_ora_adjudicated'); Schema::dropIfExists('devices_faults_vacuums_ora_opinions'); diff --git a/database/migrations/2022_07_19_093250_add_brand_indexes.php b/database/migrations/2022_07_19_093250_add_brand_indexes.php index 151ea004cd..ef727557ca 100644 --- a/database/migrations/2022_07_19_093250_add_brand_indexes.php +++ b/database/migrations/2022_07_19_093250_add_brand_indexes.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('brands', function (Blueprint $table) { $table->index('brand_name'); @@ -26,7 +26,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('devices', function (Blueprint $table) { $table->dropIndex('devices_brand_index'); diff --git a/database/migrations/2022_08_10_091731_unique_network_names.php b/database/migrations/2022_08_10_091731_unique_network_names.php index 71fd433587..332defedc1 100644 --- a/database/migrations/2022_08_10_091731_unique_network_names.php +++ b/database/migrations/2022_08_10_091731_unique_network_names.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { // Make networks table unique on name Schema::table('networks', function (Blueprint $table) { @@ -24,7 +24,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // Restore networks table to be non-unique Schema::table('networks', function (Blueprint $table) { diff --git a/database/migrations/2022_09_19_135345_add_group_phone.php b/database/migrations/2022_09_19_135345_add_group_phone.php index 7b570125cc..2385f9234f 100644 --- a/database/migrations/2022_09_19_135345_add_group_phone.php +++ b/database/migrations/2022_09_19_135345_add_group_phone.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('phone', 40)->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('phone'); diff --git a/database/migrations/2022_10_06_162442_network_logo.php b/database/migrations/2022_10_06_162442_network_logo.php index f0ed57f2c9..2edbae923b 100644 --- a/database/migrations/2022_10_06_162442_network_logo.php +++ b/database/migrations/2022_10_06_162442_network_logo.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->string('logo', 255)->nullable(); @@ -39,7 +39,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('logo'); diff --git a/database/migrations/2022_11_07_152558_record_approval.php b/database/migrations/2022_11_07_152558_record_approval.php index b397f3ccfc..b3e6bbb00c 100644 --- a/database/migrations/2022_11_07_152558_record_approval.php +++ b/database/migrations/2022_11_07_152558_record_approval.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->boolean('approved')->default(false); @@ -32,7 +32,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('approved'); diff --git a/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php b/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php index f6048bb3a9..5778c8907f 100644 --- a/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php +++ b/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php @@ -13,7 +13,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('failed_jobs', function (Blueprint $table) { $table->string('uuid')->after('id')->nullable()->unique(); @@ -31,7 +31,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('failed_jobs', function (Blueprint $table) { $table->dropColumn('uuid'); diff --git a/database/migrations/2023_04_19_153453_network_data.php b/database/migrations/2023_04_19_153453_network_data.php index 3a7c7db8fc..3950adab1d 100644 --- a/database/migrations/2023_04_19_153453_network_data.php +++ b/database/migrations/2023_04_19_153453_network_data.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { // Add JSON columns. In older versions of MySQL these will be LONGTEXT rather than JSON, so // if we ever want to do extraction/query/indexing on them we might need to migrate them at that point. @@ -28,7 +28,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('network_data'); diff --git a/database/migrations/2023_05_09_132601_useful_urls.php b/database/migrations/2023_05_09_132601_useful_urls.php index 9e944fe8f2..3db1e50e3f 100644 --- a/database/migrations/2023_05_09_132601_useful_urls.php +++ b/database/migrations/2023_05_09_132601_useful_urls.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::drop('devices_urls'); } @@ -21,7 +21,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::create('devices_urls', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2023_06_07_130653_new_zealand.php b/database/migrations/2023_06_07_130653_new_zealand.php index e2d196a888..03d68b475b 100644 --- a/database/migrations/2023_06_07_130653_new_zealand.php +++ b/database/migrations/2023_06_07_130653_new_zealand.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement(DB::raw("update `groups` set country = 'Aotearoa New Zealand' where country = 'New Zealand';")); } @@ -21,7 +21,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement(DB::raw("update `groups` set country = 'New Zealand' where country = 'Aotearoa New Zealand';")); } diff --git a/database/migrations/2023_06_12_153317_country_codes.php b/database/migrations/2023_06_12_153317_country_codes.php index 789b2a855c..1e03b1216a 100644 --- a/database/migrations/2023_06_12_153317_country_codes.php +++ b/database/migrations/2023_06_12_153317_country_codes.php @@ -12,7 +12,7 @@ * * @return void */ - public function up() + public function up(): void { $countries = array_flip(App\Helpers\Fixometer::getAllCountries('en')); @@ -49,7 +49,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('country_code'); diff --git a/database/migrations/2023_08_02_183803_item_type_collation.php b/database/migrations/2023_08_02_183803_item_type_collation.php index fa7003b823..b586671b1b 100644 --- a/database/migrations/2023_08_02_183803_item_type_collation.php +++ b/database/migrations/2023_08_02_183803_item_type_collation.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { DB::statement(DB::raw("ALTER TABLE `devices` CHANGE `item_type` `item_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL;")); } @@ -21,7 +21,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { DB::statement(DB::raw("ALTER TABLE `devices` CHANGE `item_type` `item_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;")); } diff --git a/database/migrations/2023_08_14_112539_group_email.php b/database/migrations/2023_08_14_112539_group_email.php index 8fed6d9480..6cd1b35bd9 100644 --- a/database/migrations/2023_08_14_112539_group_email.php +++ b/database/migrations/2023_08_14_112539_group_email.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('email', 255)->nullable(); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('email'); diff --git a/database/migrations/2023_12_19_161808_customisable_banners.php b/database/migrations/2023_12_19_161808_customisable_banners.php index 26b039c36a..aea886ba5e 100644 --- a/database/migrations/2023_12_19_161808_customisable_banners.php +++ b/database/migrations/2023_12_19_161808_customisable_banners.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::create('alerts', function (Blueprint $table) { $table->increments('id'); @@ -31,7 +31,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::drop('alerts'); } diff --git a/database/migrations/2024_08_27_123452_group_archive.php b/database/migrations/2024_08_27_123452_group_archive.php index 573e813a95..a3a5c98aef 100644 --- a/database/migrations/2024_08_27_123452_group_archive.php +++ b/database/migrations/2024_08_27_123452_group_archive.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->date('archived_at')->default(null)->nullable()->comment('Date the group was archived'); @@ -23,7 +23,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('archived_at'); diff --git a/database/migrations/2024_09_16_093650_inactive_groups.php b/database/migrations/2024_09_16_093650_inactive_groups.php index 37db481257..dc420a3c69 100644 --- a/database/migrations/2024_09_16_093650_inactive_groups.php +++ b/database/migrations/2024_09_16_093650_inactive_groups.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { $groups = \App\Group::join('grouptags_groups', 'groups.idgroups', '=', 'grouptags_groups.group') ->join('group_tags', 'grouptags_groups.group_tag', '=', 'group_tags.id') @@ -33,7 +33,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // Add [INACTIVE] into all groups with archived_at. $groups = \App\Group::whereNotNull('archived_at')->get(); diff --git a/database/migrations/2025_03_06_110500_retire_workbench.php b/database/migrations/2025_03_06_110500_retire_workbench.php index 788d462252..26e3fb46fb 100644 --- a/database/migrations/2025_03_06_110500_retire_workbench.php +++ b/database/migrations/2025_03_06_110500_retire_workbench.php @@ -45,7 +45,7 @@ 'microtask_surveys', ]; - public function up() + public function up(): void { // For each table, rename to 'archived__' + table name. // Using two underscores triggers phpMyAdmin table grouping. @@ -64,7 +64,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { // For each table, rename back to original name foreach ($this->tables as $table) { diff --git a/database/migrations/2025_04_19_000000_rename_password_resets_table.php b/database/migrations/2025_04_19_000000_rename_password_resets_table.php index 7ea51cef63..ab300e6e9c 100644 --- a/database/migrations/2025_04_19_000000_rename_password_resets_table.php +++ b/database/migrations/2025_04_19_000000_rename_password_resets_table.php @@ -11,7 +11,7 @@ * * @return void */ - public function up() + public function up(): void { Schema::rename('password_resets', 'password_reset_tokens'); } @@ -21,7 +21,7 @@ public function up() * * @return void */ - public function down() + public function down(): void { Schema::rename('password_reset_tokens', 'password_resets'); } diff --git a/database/seeders/BrandList.php b/database/seeders/BrandList.php index 718965d5d1..b56a9af80a 100644 --- a/database/seeders/BrandList.php +++ b/database/seeders/BrandList.php @@ -12,7 +12,7 @@ class BrandList extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('brands')->truncate(); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 625878c49a..e8d3c52bc7 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -11,7 +11,7 @@ class DatabaseSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { $this->call(DefaultSkills::class); $this->call(BrandList::class); diff --git a/database/seeders/DefaultSkills.php b/database/seeders/DefaultSkills.php index 5198f39d6b..69533668cd 100644 --- a/database/seeders/DefaultSkills.php +++ b/database/seeders/DefaultSkills.php @@ -12,7 +12,7 @@ class DefaultSkills extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('skills')->truncate(); diff --git a/database/seeders/NetworksTableSeeder.php b/database/seeders/NetworksTableSeeder.php index ae5650bf73..aa8bcf2ac0 100644 --- a/database/seeders/NetworksTableSeeder.php +++ b/database/seeders/NetworksTableSeeder.php @@ -13,7 +13,7 @@ class NetworksTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { // Restarters network is REQUIRED, so is created as part of the database // migrations with id = 1. diff --git a/public/js/components/StatsShare.vue b/public/js/components/StatsShare.vue new file mode 100644 index 0000000000..b65ec18f23 --- /dev/null +++ b/public/js/components/StatsShare.vue @@ -0,0 +1,625 @@ + + + \ No newline at end of file diff --git a/public/js/translations.js b/public/js/translations.js new file mode 100644 index 0000000000..cd4da6b38c --- /dev/null +++ b/public/js/translations.js @@ -0,0 +1 @@ +module.exports = {"de.admin":{"brand":"Brand","brand-name":"Brand name","brand_modal_title":"Add new brand","categories":"Categories","category_cluster":"Category Cluster","category_name":"Category name","co2_footprint":"CO2<\/sub> Footprint (kg)","create-new-brand":"Create new brand","create-new-category":"Create new category","create-new-skill":"Create new skill","create-new-tag":"Create new tag","delete-skill":"Delete skill","delete-tag":"Delete tag","description":"Description","description_optional":"Description (optional)","edit-brand":"Edit brand","edit-brand-content":"","edit-category":"Edit category","edit-category-content":"","edit-skill":"Edit skill","edit-skill-content":"","group-tags":"Group tags","name":"Name","reliability":"Reliability","reliability-1":"Very poor","reliability-2":"Poor","reliability-3":"Fair","reliability-4":"Good","reliability-5":"Very good","reliability-6":"N\/A","save-brand":"Save brand","save-category":"Save category","save-skill":"Save skill","save-tag":"Save tag","skill_name":"Skill name","skills":"Skills","skills_modal_title":"Add new skill","tag-name":"Tag name","tags_modal_title":"Add new tag","weight":"Weight (kg)"},"de.auth":{"assigned_groups":"Assigned to groups","change_password":"Change password","change_password_text":"Keep your account safe and regularly change your password.","create_account":"Create an account","current_password":"Current password","delete_account":"Delete account","delete_account_text":"I understand that deleting my account will remove all of my personal data and\nthis is a permanent action.","email_address":"Email address","email_address_validation":"An account with this email address already exists. Have you tried logging in?","forgot_password":"Forgot password","forgotten_pw":"Forgotten your password?","forgotten_pw_text":"It happens to all of us. Simply enter your email to receive a password reset message.","login":"Login","new_password":"New password","new_repeat_password":"Repeat new password","password":"Password","profile_admin":"Admin only","profile_admin_text":"Here admins have the ability to change a user's role or their associated groups","repeat_password":"Repeat password","repeat_password_validation":"Passwords do not match or are fewer than six characters","reset":"Reset","reset_password":"Reset password","save_preferences":"Save preferences","save_user":"Save user","set_preferences":"Click here to set your email preferences for our discussion platform","sign_in":"I remembered. Let me sign in","throttle":"Too many login attempts. Please try again in :seconds seconds.","user_role":"User role"},"de.battcatora":{"about":"Mehr Informationen","branding":{"powered_by":"Unter Verwendung von Daten aus:"},"info":{"body-s1-header":"Was ist BattCat?","body-s1-p1":"Wir wollen verstehen, wie Batterien und Akkus dazu beitragen, dass Ger\u00e4te versagen. Damit m\u00f6chten wir der Politik sagen, wie zuk\u00fcnftige Modelle leichter reparierbar gemacht werden k\u00f6nnen. Reparatur vermeidet Abfall und schont die Ressourcen unseres Planeten.","body-s1-p2":"Mit BattCat k\u00f6nnen Sie sich an unserer Untersuchung beteiligen. Wir haben Informationen zu \u00fcber 1000 defekten Ger\u00e4ten gesammelt und brauchen Ihre Hilfe, um diese zu kategorisieren.","body-s2-header":"Was muss ich tun?","body-s2-p1":"Lesen Sie einfach die Informationen \u00fcber das defekte Ger\u00e4t und w\u00e4hlen Sie die Problembeschreibung oder Handlungsempfehlung aus der Liste darunter. Wenn Sie sich nicht sicher sind, w\u00e4hlen Sie unten einfach \"Ich wei\u00df nicht\". Sobald Sie eine Option ausgew\u00e4hlt haben, zeigen wir Ihnen ein anderes Ger\u00e4t. Je mehr Ger\u00e4tefehler Sie kategorisieren k\u00f6nnen, desto mehr lernen wir! BattCat zeigt jedes Ger\u00e4t drei Personen, die helfen, die richtige Kategorie zu best\u00e4tigen.","body-s3-header":"Woher bekommt BattCat Daten \u00fcber defekte Ger\u00e4te?","body-s3-p1":"BattCat verwendet Informationen von der Open Repair Alliance<\/a>, die Daten \u00fcber kaputte Ger\u00e4te sammelt, die echte Menschen auf der ganzen Welt bei Reparaturveranstaltungen wie Repair Caf\u00e9s und Restart Partys zu reparieren versucht haben.","body-s4-header":"Noch Fragen?","body-s4-p1":"Erfahren Sie mehr, stellen Sie Fragen und geben Sie uns Ihr Feedback, in der BattCat-Diskussion<\/a>.","title":"Danke, dass Sie BattCat ausprobiert haben"},"status":{"brand":"Marke","items_0_opinions":"mit 0 Meinungen","items_1_opinion":"mit 1 Meinung","items_2_opinions":"mit 2 Meinungen","items_3_opinions":"mit 3 Meinungen","items_majority_opinions":"Artikel mit Mehrheitsmeinungen","items_opinions":"Artikel \/ meinungen","items_split_opinions":"Artikel mit geteilten Meinungen","number_of_records":"Anzahl der Eintr\u00e4ge","opinions":"Meinungen","problem":"Problem","progress":"vollst\u00e4ndig","status":"Status","task_completed":"Du hast alle Eintr\u00e4ge gesehen, danke","total":"Gesamt","winning_opinion":"Gewinnende meinung"},"survey":{"a1":"Starke Ablehnung","a2":"Ablehnung","a3":"Neutral","a4":"Zustimmung","a5":"Starke Zustimmung","footer":"Wenn Sie eine der beiden Tasten dr\u00fccken, gelangen Sie zur\u00fcck zu BattCat","header1":"Vielen Dank!","header2":"Wir planen bereits weitere zuk\u00fcnftige Quests wie diese. Um die n\u00e4chsten noch besser zu machen, haben wir ein paar kurze Fragen f\u00fcr Sie.","invalid":"Bitte w\u00e4hlen Sie aus jeder der Fragen","q1":"BattCat hat mein Interesse am Reparieren gesteigert","q2":"BattCat hat mich dazu gebracht, mehr \u00fcber Elektroschrott nachzudenken","q3":"BattCat hat mein Denken \u00fcber den Kauf von Elektronik ver\u00e4ndert","q4":"BattCat hat meine Ansicht \u00fcber die Wichtigkeit von Reparaturen ver\u00e4ndert","send":"Senden","skip":"\u00fcberspringen"}},"de.dashboard":{"devices_logged":"devices logged","discussion_header":"Discussion Forum","getting_started_header":"Getting Started","join_group":"Join a group","visit_wiki":"Visit the wiki"},"de.device-audits":{"unavailable_audits":"No changes have been made to this device!","updated":{"metadata":"On :audit_created_at, :user_name updated record :audit_url<\/strong>","modified":{"age":"Age<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","brand":"Brand<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","category":"Category<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","category_creation":"Category Creation<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","do_it_yourself":"Do it yourself<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","estimate":"Estimate<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","event":"Event<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","model":"Model<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","more_time_needed":"More time needed<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","problem":"Problem<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","professional_help":"Professional Help<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","repair_status":"Repair Status<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","repaired_by":"Reparied by<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","spare_parts":"Spare Parts<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","wiki":"Wiki<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\""}}},"de.devices":{"age":"Age","age_approx":"years - approximate, if known","brand":"Brand","by_date":"By date","by_taxonomy":"By taxonomy","category":"Category","delete_device":"Delete device","devices":"Devices","devices_description":"Description of problem\/solution","event_info":"Event info","export_device_data":"Export device data","fixed":"Fixed","from_date":"From date","from_manufacturer":"From manufacturer","from_third_party":"From third party","graphic-camera":"Camera","graphic-comment":"Comment","group":"Group","model":"Model","repair":"Repair date","repair_details":"Next steps","repair_source":"Source of repair information","repair_status":"Repair status","repairable":"Repairable","required_impact":"kg - required for environmental impact calculation","to_date":"To date","useful_repair_urls":"URL of useful repair information used","useful_repair_urls_explanation":"Useful repair URL","useful_repair_urls_helper":"Enter URL here","weight":"Weight"},"de.dustupora":{"about":"Mehr Informationen","branding":{"powered_by":"Unter Verwendung von Daten aus:"},"info":{"body-s1-header":"Was ist DustUp?","body-s1-p1":"Wir wollen verstehen, wie Batterien und Akkus dazu beitragen, dass Ger\u00e4te versagen. Damit m\u00f6chten wir der Politik sagen, wie zuk\u00fcnftige Modelle leichter reparierbar gemacht werden k\u00f6nnen. Reparatur vermeidet Abfall und schont die Ressourcen unseres Planeten.","body-s1-p2":"Mit DustUp k\u00f6nnen Sie sich an unserer Untersuchung beteiligen. Wir haben Informationen zu \u00fcber 1000 defekten Ger\u00e4ten gesammelt und brauchen Ihre Hilfe, um diese zu kategorisieren.","body-s2-header":"Was muss ich tun?","body-s2-p1":"Lesen Sie einfach die Informationen \u00fcber das defekte Ger\u00e4t und w\u00e4hlen Sie die Problembeschreibung oder Handlungsempfehlung aus der Liste darunter. Wenn Sie sich nicht sicher sind, w\u00e4hlen Sie unten einfach \"Ich wei\u00df nicht\". Sobald Sie eine Option ausgew\u00e4hlt haben, zeigen wir Ihnen ein anderes Ger\u00e4t. Je mehr Ger\u00e4tefehler Sie kategorisieren k\u00f6nnen, desto mehr lernen wir! DustUp zeigt jedes Ger\u00e4t drei Personen, die helfen, die richtige Kategorie zu best\u00e4tigen.","body-s3-header":"Woher bekommt DustUp Daten \u00fcber defekte Ger\u00e4te?","body-s3-p1":"DustUp verwendet Informationen von der Open Repair Alliance<\/a>, die Daten \u00fcber kaputte Ger\u00e4te sammelt, die echte Menschen auf der ganzen Welt bei Reparaturveranstaltungen wie Repair Caf\u00e9s und Restart Partys zu reparieren versucht haben.","body-s4-header":"Noch Fragen?","body-s4-p1":"Erfahren Sie mehr, stellen Sie Fragen und geben Sie uns Ihr Feedback, in der DustUp-Diskussion<\/a>.","title":"Danke, dass Sie DustUp ausprobiert haben"},"status":{"brand":"Marke","items_0_opinions":"mit 0 Meinungen","items_1_opinion":"mit 1 Meinung","items_2_opinions":"mit 2 Meinungen","items_3_opinions":"mit 3 Meinungen","items_majority_opinions":"Artikel mit Mehrheitsmeinungen","items_opinions":"Artikel \/ meinungen","items_split_opinions":"Artikel mit geteilten Meinungen","number_of_records":"Anzahl der Eintr\u00e4ge","opinions":"Meinungen","problem":"Problem","progress":"vollst\u00e4ndig","status":"Status","task_completed":"Du hast alle Eintr\u00e4ge gesehen, danke","total":"Gesamt","winning_opinion":"Gewinnende meinung"},"survey":{"a1":"Starke Ablehnung","a2":"Ablehnung","a3":"Neutral","a4":"Zustimmung","a5":"Starke Zustimmung","footer":"Wenn Sie eine der beiden Tasten dr\u00fccken, gelangen Sie zur\u00fcck zu DustUp","header1":"Vielen Dank!","header2":"Wir planen bereits weitere zuk\u00fcnftige Quests wie diese. Um die n\u00e4chsten noch besser zu machen, haben wir ein paar kurze Fragen f\u00fcr Sie.","invalid":"Bitte w\u00e4hlen Sie aus jeder der Fragen","q1":"DustUp hat mein Interesse am Reparieren gesteigert","q2":"DustUp hat mich dazu gebracht, mehr \u00fcber Elektroschrott nachzudenken","q3":"DustUp hat mein Denken \u00fcber den Kauf von Elektronik ver\u00e4ndert","q4":"DustUp hat meine Ansicht \u00fcber die Wichtigkeit von Reparaturen ver\u00e4ndert","send":"Senden","skip":"\u00fcberspringen"},"task":{"brand":"Brand","did_you_know":"Wussten Sie schon?","fetch_another":"Ich wei\u00df es nicht, zeig eine andere Reparatur","go_with":"Geh mit","learn_more":"Mehr Informationen","problem":"Beschreibung des Problems","progress_subtitle":"Der Prozentsatz der Ger\u00e4te, die wir bisher klassifiziert haben","progress_title":"Unser Fortschritt","signpost_1":"Vacuum cleaners can be pretty pricey. If they break, they can be surprisingly hard to fix and end up as e-waste. If brands did more to make their vacuum cleaners easier to repair, we could save a lot of unnecessary waste.","signpost_2":"The European Union is planning to introduce new rules for vacuum cleaners that could require them to be easier to repair. Rules decided by the EU could also be used to influence laws in other places, including the UK.","signpost_3":"We want to tell policymakers why vacuum cleaners break and how they could be made easier to fix. Community repair groups around the world have been recording this information, and by trying DustUp, you are helping us analyse it. Thank you!","signpost_4":"Vielen Dank f\u00fcr Ihre Hilfe! Jeder Fehler, den Sie kategorisieren, macht diese Daten noch n\u00fctzlicher. Werden Sie doch auch Mitglied unserer Community<\/a>.","source":"Quelle","status":"Status","step1":"Lesen Sie die Informationen \u00fcber das defekte Ger\u00e4t.","step1-extra":"Ein Freiwilliger hat versucht, dieses Ger\u00e4t bei einer Reparaturveranstaltung zu reparieren und diese Beschreibung verfasst.","step2":"What caused this vacuum cleaner to fail?","step2-extra":"W\u00e4hlen Sie die Option, die am besten zu dem oben beschriebenen Problem passt.","strapline":"Lesen Sie einfach die Informationen \u00fcber das defekte Ger\u00e4t und w\u00e4hlen Sie die Art des beschriebenen Fehlers aus der Liste darunter aus.","subtitle":"Ein Freiwilliger hat versucht, dieses Ger\u00e4t bei einer Reparaturveranstaltung zu reparieren und diese Beschreibung verfasst.","suggestions":"Vorschl\u00e4ge","thankyou_guest":"Vielen Dank f\u00fcr Ihre Hilfe! Jeder Fehler, den Sie kategorisieren, macht diese Daten noch n\u00fctzlicher. Werden Sie doch auch Mitglied unserer Community<\/a>.","thankyou_user":"Vielen Dank an Sie! Bitte nehmen Sie an unserer Umfrage teil<\/a>","title":"DustUp: Akkuprobleme kategorisieren","translation":"\u00dcbersetzung"}},"de.event-audits":{"created":{"metadata":"On :audit_created_at, :user_name created record :audit_url<\/strong>","modified":{"end":"Event End Time<\/strong> set as \":new<\/strong>\"","event_date":"Event Date<\/strong> set as \":new<\/strong>\"","free_text":"Free Text<\/strong> set as \":new<\/strong>\"","group":"Event Group ID<\/strong> set as \":new<\/strong>\"","hours":"Event Hours<\/strong> set as \":new<\/strong>\"","idevents":"Event ID<\/strong> set as \":new<\/strong>\"","latitude":"Event Latitude<\/strong> set as \":new<\/strong>\"","location":"Event Location<\/strong> set as \":new<\/strong>\"","longitude":"Event Longitude<\/strong> set as \":new<\/strong>\"","pax":"pax<\/strong> set as \":new<\/strong>\"","start":"Event Start Time<\/strong> set as \":new<\/strong>\"","venue":"Event Name<\/strong> set as \":new<\/strong>\"","volunteers":"Quantity of Volunteers<\/strong> set as \":new<\/strong>\""}},"unavailable_audits":"No changes have been made to this event!","updated":{"metadata":"On :audit_created_at, :user_name updated record :audit_url<\/strong>","modified":{"end":"Event End Time<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","event_date":"Event Date<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","free_text":"Free Text<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","group":"Event Group ID<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","hours":"Event Hours<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","latitude":"Event Latitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","location":"Event Location<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","longitude":"Event Longitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","pax":"pax<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","start":"Event Start Time<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","venue":"Event Name<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","volunteers":"Quantity of Volunteers<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\""}}},"de.events":{"about_event_name_header":"About :event","add_event":"Add event","add_volunteer_modal_heading":"Add volunteer","all_invited_restarters_modal_description":"An overview of the Restarters invited to your event and their skills.","all_invited_restarters_modal_heading":"All invited Restarters","all_restarters_attended_modal_description":"An overview of who attended your event and their skills.","all_restarters_attended_modal_heading":"All Restarters attended","approve_event":"Approve Event","before_submit_text":"Once confirmed by our community lead, your event will be made public on The Restart Project homepage.","by_event":"By event","by_group":"By group","co2_equivalence_visualisation_dropdown":"CO2<\/sub> equivalence visualisation","create_event":"Create event","create_new_event":"Create new event","download-results":"Download Results (CSV)","edit_event":"Edit event","edit_event_content":"Go ahead and change or improve your event information.","embed_code_header":"Embed code","event":"Event","event_date":"Date","event_name":"Event","event_time":"Time","events":"Events","events_title_admin":"Events to moderate","field_add_image":"Add images","field_event_city":"City","field_event_country":"Country","field_event_county":"County\/State","field_event_date":"Date of event","field_event_desc":"Description","field_event_group":"Event group","field_event_images":"Add event images here","field_event_images_2":"Choose an image for your event","field_event_name":"Name of event","field_event_name_helper":"Please enter a neighbourhood or the name of the venue - please no 'Restart Party' or 'Repair Cafe'.","field_event_route":"Route","field_event_street_address":"Street address","field_event_time":"Start\/end time","field_event_venue":"Venue address","field_event_zip":"Post\/Zip code","field_venue_helper":"I.e. the place where the fixing happens!","full_name":"Full name","full_name_helper":"Leave field blank if anonymous","group_member":"Group member","headline_stats_dropdown":"Headline stats","headline_stats_message":"This widget shows the headline stats for your event e.g. the number of participants at your parties; the hours volunteered","infographic_message":"An infographic of an easy-to-understand equivalent of the CO2<\/sub> emissions that your group has prevented, such as equivalent number of cars manufactured","invite_restarters_modal_heading":"Invite volunteers to the event","manual_invite_box":"Send invites to","message_to_restarters":"Invitation message","message_volunteer_email_address":"This field will invite the volunteer to join the group","option_default":"-- Select --","option_not_registered":"Not registered on Fixometer","pending_rsvp_button":"I am attending","pending_rsvp_message":"You have an invite pending for this event","reporting":"Reporting","rsvp_button":"Sorry, I can no longer attend","rsvp_message":"Excellent! You are joining us at this event","sample_text_message_to_restarters":"","save_event":"Save Event","send_invite_button":"Send invites","send_invites_to_restarters_tickbox":"Add invites for group members. Members marked with a \u26a0 will be invited but won't be sent an email due to their notification settings.","share_stats_header":"Share your stats","share_stats_message":"Well done! On the :date at :event_name we were able to repair :number_devices devices<\/strong>. Help us spread the message by sharing your environmental impact on your website.","stat-0":"Participants","stat-2":"Restarters","stat-3":"Repairable devices","stat-4":"End-of-life devices","stat-5":"Fixed devices","stat-6":"CO2 emissions prevented","stat-7":"Waste prevented","table_restarter_column":"Restarter","table_skills_column":"Skills","type_email_addresses_message":"Note: you can also manually type in the email address of anyone else you would like to invite to this event. Press the tab, enter or comma key after each email address that you enter.","volunteer_attended_button":"Volunteer attended","volunteer_email_address":"Volunteer's email address (optional)","warning_volunteers_message":"Please note that the number of volunteers does not match the attendance record. Do you need to add or remove volunteers?"},"de.general":{"alert_uptodate":"Thanks! You are up to date","alert_uptodate_text":"You have nothing to action now. When you do, we'll let you know.","calendar_feed_help_url":"\/t\/fixometer-how-to-subscribe-to-a-calendar","email_alerts":"Emails & alerts","email_alerts_pref1":"I would like to receive The Restart Project monthly newsletter","email_alerts_pref2":"I would like to receive email notifications about events or groups near me","email_alerts_text":"Please choose what kind of email updates you would like to receive. You can change these at any time. Our Privacy Policy is available here<\/a>","faq_url":"https:\/\/therestartproject.org\/faq","filter-results":"Filter results","general":"General","help_feedback_url":"https:\/\/talk.restarters.net\/c\/help","introduction_message":"We are a global community of people who help others fix their electronics in community events. Join us!","login":"Login","logout":"Logout","menu_discourse":"Discussion","menu_faq":"FAQs","menu_help_feedback":"Help & Feedback","menu_other":"Other Links","menu_tools":"Community Tools","menu_wiki":"Wiki","new_group":"Create a new group","other_profile":"profile","party_reporting":"Event reporting","please_select":"Please select","profile":"Your profile","profile_content":"Please share some information about yourself, so you can connect with other organisers and fixers, and so we can understand the community better","repair_skills":"Skills","repair_skills_content":"This is optional but helps us improve your experience - which skills do you have and would like to share with others?","reporting":"Reporting","restartproject_url":"https:\/\/therestartproject.org","save_repair_skills":"Save skills","signmeup":"Sign me up!","therestartproject":"The Restart Project","time_reporting":"Volunteer hours","your_name":"Your name","your_name_validation":"Please enter your name","your_repair_skills":"Your skills"},"de.group-audits":{"unavailable_audits":"No changes have been made to this group!","updated":{"metadata":"On :audit_created_at, :user_name updated record :audit_url<\/strong>","modified":{"area":"Area<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","free_text":"Free Text<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","latitude":"Latitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","location":"Location<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","longitude":"Longitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","name":"Name<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","website":"Website<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\""}}},"de.groups":{"about_group_name_header":"About :group","add_groups":"Add a group","add_groups_content":"Tell us more about your group, so we can create a page for you and help you publicise to potential volunteers and participants.","all_groups":"All groups","all_volunteers_group_name_header":"All volunteers of :group","all_volunteers_group_name_message":"Here's a list of all of the volunteers affiliated with your group and their skills.","approve_group":"Approve group","co2_equivalence_visualisation_dropdown":"CO2<\/sub> equivalence visualisation","create_group":"Create group","create_groups":"Create new group","edit_group":"Edit group","edit_group_save_changes":"Save changes","edit_group_text":"Go ahead and change or improve your group's profile.","email_addresses_field":"Email addresses","embed_code_header":"Embed code","group":"Group","group_admin_only":"Admin only","group_image":"Group image","group_tag":"Tag","group_tag2":"Group tag","group_tags":"Group tags","groups":"Groups","groups_about_group":"Tell us about your group","groups_approval_text":"Group submissions need to be approved by an administrator","groups_group_small":"A couple of examples include 'Restarters Torino' or 'Nottingham Fixers'","groups_location":"Location","groups_location_small":"I.e the place where the fixing happens!","groups_modal-button":"Yes, lets get started!","groups_modal_content":"We can help you get started, scheduling and announcing events, logging data and getting reports on their impact.","groups_modal_title":"Would you like to start a community repair group?","groups_name":"Name","groups_name_of":"Name of group","groups_title1":"Your groups","groups_title2":"Groups nearest to you","groups_website":"Your website","groups_website_small":"Don't have a website? Feel free to add a Facebook group or similar","headline_stats_dropdown":"Headline stats","headline_stats_message":"This widget shows the headline stats for your group e.g. the number of participants at your parties; the hours volunteered","infographic_message":"An infographic of an easy-to-understand equivalent of the CO2<\/sub> emissions that your group has prevented, such as equivalent number of cars manufactured.","join_group_button":"Join group","location":"Group location","message_example_text":"","message_header":"Invitation message","restarter_column_table":"Restarter","search_name":"Search name","send_invite_button":"Send invites","share_stats_header":"Share your stats","share_stats_message":":group have made a real impact fixing electronics and preventing waste. Help share this on your website and get other people involved:","skills_column_table":"Skills","tag-1":"Tag 1","tag-2":"Tag 2","tag-3":"Tag 3","tag-4":"Tag 4","tag-5":"Tag 5","tag-6":"Tag 6","tag-7":"Tag 7","tag-8":"Tag 8","type_email_addresses_message":"Type in the email addresses of the people you would like to invite to this group. Press the tab or comma key after each email address."},"de.login":{"login_title":"Sign in","more":"Find out more","stat_1":"Devices fixed","stat_2":"CO2<\/sub> emissions prevented","stat_3":"Waste prevented","stat_4":"Events held","whatis":"German Welcome to the Restarters community","whatis_content":"

This is a place to grow the community electronics repair movement. The world needs more fixing and more fixing skills to be shared.<\/p>

Join in if you would like to:<\/p>