Skip to content

Commit f745b62

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 is intended to catch any accidental/force-of-habit usages of the `Tokens` properties.
1 parent 7f3e8f2 commit f745b62

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/[email protected]
173173
with:
174174
format: gcc
175+
176+
find-token-properties:
177+
# The properties in the Tokens class have been deprecated. The code in this repository should use the constants instead.
178+
name: 'Find use of Tokens properties'
179+
runs-on: ubuntu-latest
180+
181+
steps:
182+
- name: Checkout code
183+
uses: actions/checkout@v4
184+
185+
- name: Find uses
186+
uses: jacobtomlinson/gha-find-replace@v3
187+
with:
188+
include: "**/*.php"
189+
find: "\\bTokens::\\$"
190+
replace: ""
191+
regex: true

0 commit comments

Comments
 (0)