From 03162cb58fc24e926139cc8674e354226507649d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 15 Aug 2025 18:47:24 +0200 Subject: [PATCH] 4.0 | GH Actions: add automated check for usage of `Tokens::$...` properties In the 4.x branch, only the `Tokens::...` constants should be used. The use of the properties from the `Tokens` class is deprecated. This workflow job is intended to catch any accidental/force-of-habit usages of the `Tokens` properties. --- .github/workflows/validate.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 25bffcd027..e614c0a531 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -172,3 +172,21 @@ jobs: uses: ludeeus/action-shellcheck@2.0.0 with: format: gcc + + find-token-properties: + # The properties in the Tokens class have been deprecated. + # The code in this repository should always use the constants instead. + name: 'Find use of Tokens properties' + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Find uses + id: findprops + shell: cmd + run: | + findstr /S /N /C:"Tokens::$" *.php + IF %ERRORLEVEL% NEQ 1 (Echo Please use the Tokens constants instead of the properties &Exit /b 1) + IF %ERRORLEVEL% EQU 1 (Echo All good &Exit /b 0)