Skip to content

Commit 112112a

Browse files
committed
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.
1 parent ff47262 commit 112112a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/validate.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,20 @@ jobs:
172172
uses: ludeeus/action-shellcheck@2.0.0
173173
with:
174174
format: gcc
175+
176+
find-token-properties:
177+
# The properties in the Tokens class have been deprecated.
178+
# The code in this repository should always use the constants instead.
179+
name: 'Find use of Tokens properties'
180+
runs-on: windows-latest
181+
182+
steps:
183+
- name: Checkout code
184+
uses: actions/checkout@v4
185+
186+
- name: Find uses
187+
id: findprops
188+
shell: cmd
189+
run: |
190+
findstr /S /N /C:"Tokens::$" *.php
191+
IF %ERRORLEVEL% NEQ 1 (Echo Please use the Tokens constants instead of the properties &Exit /b 1)

0 commit comments

Comments
 (0)