Skip to content

Commit c69f7dc

Browse files
committed
updates
1 parent a62d084 commit c69f7dc

49 files changed

Lines changed: 2176 additions & 56 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@ jobs:
1919
latest:
2020
name: "Build & Verify"
2121
runs-on: 'ubuntu-latest'
22+
services:
23+
mysql: &mysql
24+
image: mysql:8.0
25+
env:
26+
MYSQL_DATABASE: silverstripe-blog-utils
27+
MYSQL_ROOT_PASSWORD: root
28+
ports:
29+
- 3306:3306
30+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2231
steps:
23-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v5
2433
- uses: php-actions/composer@v6
2534
with:
2635
command: update
27-
--with silverstripe/framework:^5.0
28-
php_version: 8.1
36+
--with silverstripe/framework:^6.0
37+
php_version: 8.3
2938
php_extensions: xdebug intl
3039
- name: Generate Code Coverage
3140
run: |
@@ -47,7 +56,7 @@ jobs:
4756
git diff --exit-code src || ( \
4857
git config user.name github-actions && \
4958
git config user.email github-actions@github.com && \
50-
git add src && \
59+
git add . && \
5160
git commit -m "tidy" && \
5261
git fetch --unshallow origin ${{ github.head_ref || github.ref_name }} && \
5362
git push origin HEAD:${{ github.head_ref || github.ref_name }} \
@@ -59,18 +68,17 @@ jobs:
5968
matrix:
6069
include:
6170
- operating-system: 'ubuntu-latest'
62-
silverstripe-version: '5.0'
63-
php-version: '8.1'
71+
silverstripe-version: '6.1.0'
72+
php-version: '8.3'
6473
- operating-system: 'ubuntu-latest'
65-
silverstripe-version: '4.0'
66-
php-version: '8.0'
67-
- operating-system: 'ubuntu-latest'
68-
silverstripe-version: '4.0'
69-
php-version: '7.4'
74+
silverstripe-version: '6.0.0'
75+
php-version: '8.3'
7076
name: "Matrix: SS ${{ matrix.silverstripe-version }}, PHP ${{ matrix.php-version }}"
7177
runs-on: ${{ matrix.operating-system }}
78+
services:
79+
mysql: *mysql
7280
steps:
73-
- uses: actions/checkout@v3
81+
- uses: actions/checkout@v5
7482
- uses: php-actions/composer@v6
7583
with:
7684
command: update
@@ -86,7 +94,7 @@ jobs:
8694
needs: [latest,matrix]
8795
runs-on: 'ubuntu-latest'
8896
steps:
89-
- uses: actions/checkout@v3
97+
- uses: actions/checkout@v5
9098
- run: |
9199
false || ( \
92100
git config user.name github-actions && \

.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
resources
2-
composer.lock
3-
vendor
1+
.phptidy-cache
2+
.phpunit.cache
3+
*.log
44
*~
5-
coverage.xml
6-
public/assets
7-
.phpunit.result.cache
85
app
6+
composer.lock
7+
coverage.xml
8+
DOCKER_ENV
9+
docker_tag
10+
resources
11+
vendor

composer.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@
1313
"email": "jflearn@logicbrush.com"
1414
}],
1515
"require": {
16-
"php": "^7.2||^8.0",
17-
"silverstripe/cms": "^4.0||^5.0",
16+
"silverstripe/cms": "^6.0||6.x-dev",
1817
"jonom/focuspoint": "*",
1918
"silverstripe/widgets": "*",
2019
"bummzack/sortablefile": "*"
2120
},
2221
"require-dev": {
23-
"phpunit/phpunit": "^9.5",
24-
"silverstripe/sqlite3": "*",
25-
"logicbrush/metrics": "*",
26-
"cmrcx/phptidy": "*",
27-
"rector/rector": "^1.2"
22+
"cambis/silverstripe-rector": "*",
23+
"phpunit/phpunit": "^11.0",
24+
"rector/rector": "^1.2",
25+
"logicbrush/metrics": "^1.0",
26+
"cmrcx/phptidy": "*"
2827
},
2928
"autoload": {
3029
"psr-4": {
@@ -38,10 +37,7 @@
3837
},
3938
"extra": {
4039
"expose": [
41-
"css",
42-
"images",
43-
"javascript",
44-
"thirdparty"
40+
"client/dist"
4541
]
4642
},
4743
"config": {

phpunit.xml.dist

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
1-
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage includeUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
7-
<exclude>
8-
<directory suffix=".php">tests/</directory>
9-
</exclude>
10-
<report>
11-
<clover outputFile="clover.xml"/>
12-
</report>
13-
</coverage>
14-
<testsuite name="Default">
15-
<directory>tests/</directory>
16-
</testsuite>
17-
<logging/>
18-
<php>
19-
<includePath>app/code</includePath>
20-
<env name="SS_DATABASE_CLASS" value="SQLite3Database"/>
21-
<env name="SS_SQLITE_DATABASE_PATH" value=":memory:"/>
22-
<env name="SS_DATABASE_NAME" value="testing"/>
23-
<env name="SS_DATABASE_USERNAME" value=""/>
24-
<env name="SS_DATABASE_PASSWORD" value=""/>
25-
</php>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/silverstripe/cms/tests/bootstrap.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
shortenArraysForExportThreshold="10"
8+
requireCoverageMetadata="false"
9+
beStrictAboutCoverageMetadata="true"
10+
beStrictAboutOutputDuringTests="true"
11+
displayDetailsOnPhpunitDeprecations="true"
12+
failOnPhpunitDeprecation="true"
13+
failOnRisky="true"
14+
failOnWarning="true">
15+
16+
<testsuites>
17+
<testsuite name="default">
18+
<directory>tests</directory>
19+
</testsuite>
20+
</testsuites>
21+
22+
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
23+
<include>
24+
<directory>src</directory>
25+
</include>
26+
</source>
27+
28+
<php>
29+
<includePath>app/code</includePath>
30+
<env name="SS_DATABASE_CLASS" value="MySQLDatabase"/>
31+
<env name="SS_DATABASE_SERVER" value="127.0.0.1"/>
32+
<env name="SS_DATABASE_NAME" value="silverstripe-imagegallery"/>
33+
<env name="SS_DATABASE_USERNAME" value="root"/>
34+
<env name="SS_DATABASE_PASSWORD" value="root"/>
35+
</php>
36+
2637
</phpunit>

public/_resources/client/dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../client/dist

rector.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,31 @@
33

44
declare( strict_types = 1 );
55

6+
use Cambis\SilverstripeRector\CodeQuality\Rector\Assign\ConfigurationPropertyFetchToMethodCallRector;
7+
use Cambis\SilverstripeRector\CodeQuality\Rector\StaticPropertyFetch\StaticPropertyFetchToConfigGetRector;
8+
use Cambis\SilverstripeRector\Set\ValueObject\SilverstripeLevelSetList;
9+
use Cambis\SilverstripeRector\Set\ValueObject\SilverstripeSetList;
610
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
711
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
812
use Rector\Config\RectorConfig;
913
use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector;
1014
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
15+
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
1116
use Rector\Set\ValueObject\LevelSetList;
1217
use Rector\Set\ValueObject\SetList;
1318

1419
return static function ( RectorConfig $rectorConfig ): void {
1520

1621
$rectorConfig->sets( [
17-
LevelSetList::UP_TO_PHP_74,
22+
SilverstripeLevelSetList::UP_TO_SILVERSTRIPE_60,
23+
SilverstripeSetList::CODE_QUALITY,
24+
LevelSetList::UP_TO_PHP_83,
1825
SetList::CODE_QUALITY,
1926
SetList::DEAD_CODE,
2027
] );
2128

2229
$rectorConfig->skip( [
30+
AddOverrideAttributeToOverriddenMethodsRector::class,
2331
CompleteDynamicPropertiesRector::class,
2432
ExplicitBoolCompareRector::class,
2533
RemoveParentCallWithoutParentRector::class,

widgets/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# For more information about the properties used in this file,
2+
# please see the EditorConfig documentation:
3+
# http://editorconfig.org
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[{*.yml,package.json}]
14+
indent_size = 2
15+
16+
# The indent size used in the package.json file cannot be changed:
17+
# https://github.com/npm/npm/pull/3180#issuecomment-16336516

widgets/.tx/config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[main]
2+
host = https://www.transifex.com
3+
4+
[silverstripe-widgets.master]
5+
file_filter = lang/<lang>.yml
6+
source_file = lang/en.yml
7+
source_lang = en
8+
type = YML

0 commit comments

Comments
 (0)