From b491d7c0dbe1e9e1c2d922b82600ef52e430087b Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 22 Jun 2026 20:27:22 -0400 Subject: [PATCH 1/4] bump tooling --- .github/workflows/pull-requests.yml | 2 +- Jenkinsfile | 9 +++++---- README.md | 3 --- composer.json | 20 +++++++------------- package.json | 8 ++++---- pnpm-lock.yaml | 10 +++++----- 6 files changed, 22 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 54ab047..ce50d9e 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -52,6 +52,6 @@ jobs: - name: Run tests timeout-minutes: 5 run: | - pnpm prettier composer run phpcs:ci + pnpm format composer run phpstan:ci diff --git a/Jenkinsfile b/Jenkinsfile index b1bb15a..08cf7b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,16 +24,17 @@ pipeline { } } - stage('Check PHP Static Analysis') { + stage('Check Formatting') { steps { - sh 'composer run phpstan:ci' + sh 'n -d exec engine pnpm format' } } - stage('Check Formatting') { + stage('Check PHP Static Analysis') { steps { - sh 'n -d exec engine pnpm prettier' + sh 'composer run phpstan:ci' } } + } } diff --git a/README.md b/README.md index 5a16908..f831500 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,6 @@ block types found in `Building/views`. ## Installation -Make sure the silverorange composer repository is added to the `composer.json` -for the project and then run: - ```sh composer require silverorange/building ``` diff --git a/composer.json b/composer.json index 78260ee..db8d9c5 100644 --- a/composer.json +++ b/composer.json @@ -13,15 +13,6 @@ "email": "mike@silverorange.com" } ], - "repositories": [ - { - "type": "composer", - "url": "https://composer.silverorange.com", - "only": [ - "silverorange/*" - ] - } - ], "require": { "php": ">=8.2", "ext-mbstring": "*", @@ -30,16 +21,19 @@ "silverorange/swat": "^7.9.2" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.64.0", - "phpstan/phpstan": "^1.12" + "friendsofphp/php-cs-fixer": "3.88.2", + "phpstan/phpstan": "^2.2", + "rector/rector": "^2.4" }, "scripts": { "phpcs": "./vendor/bin/php-cs-fixer check -v", "phpcs:ci": "./vendor/bin/php-cs-fixer check --config=.php-cs-fixer.php --no-interaction --show-progress=none --diff --using-cache=no -vvv", - "phpcs:write": "./vendor/bin/php-cs-fixer fix -v", + "phpcs:fix": "./vendor/bin/php-cs-fixer fix -v", "phpstan": "./vendor/bin/phpstan analyze", "phpstan:ci": "./vendor/bin/phpstan analyze -vvv --no-progress --memory-limit 2G", - "phpstan:baseline": "./vendor/bin/phpstan analyze --generate-baseline" + "phpstan:baseline": "./vendor/bin/phpstan analyze --generate-baseline", + "rector": "./vendor/bin/rector --dry-run", + "rector:fix": "./vendor/bin/rector" }, "autoload": { "classmap": [ diff --git a/package.json b/package.json index 0063d97..fb35e37 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ }, "type": "module", "scripts": { - "prettier": "prettier --check .", - "prettier:write": "prettier --write ." + "format": "prettier --check .", + "format:fix": "prettier --write ." }, "devDependencies": { - "prettier": "^3.5.3" + "prettier": "^3.8.4" }, - "packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228" + "packageManager": "pnpm@11.8.0+sha512.c1f5e7c4cb241c8f174b743851d82f42b802324afc8b0f116b96adb15aa06664948dde36960a3ba1079ba5b4b29dd0140135b94b5b5f5263592249d68e555f26" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d848d49..79b1882 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,16 +9,16 @@ importers: .: devDependencies: prettier: - specifier: ^3.5.3 - version: 3.6.2 + specifier: ^3.8.4 + version: 3.8.4 packages: - prettier@3.6.2: - resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + prettier@3.8.4: + resolution: {integrity: sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==} engines: {node: '>=14'} hasBin: true snapshots: - prettier@3.6.2: {} + prettier@3.8.4: {} From 0e874a7ed7b9a68c6fe300be4b17bb157f0d79f8 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 22 Jun 2026 20:28:10 -0400 Subject: [PATCH 2/4] phpcs:fix --- .php-cs-fixer.php | 2 +- Building/admin/components/Block/AttachmentEdit.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index cad3946..2f38f99 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -11,7 +11,7 @@ ->setParallelConfig(ParallelConfigFactory::detect(null, null, 2**18-1)) ->setRules([ '@PhpCsFixer' => true, - '@PHP82Migration' => true, + '@PHP8x2Migration' => true, 'indentation_type' => true, // Overrides for (opinionated) @PhpCsFixer and @Symfony rules: diff --git a/Building/admin/components/Block/AttachmentEdit.php b/Building/admin/components/Block/AttachmentEdit.php index cf02e41..f273710 100644 --- a/Building/admin/components/Block/AttachmentEdit.php +++ b/Building/admin/components/Block/AttachmentEdit.php @@ -25,8 +25,8 @@ protected function getAttachmentSet() { if (!$this->attachment_set instanceof SiteAttachmentSet) { if ($this->getObject()->attachment instanceof SiteAttachment) { - $this->attachment_set = - $this->getObject()->attachment->attachment_set; + $this->attachment_set + = $this->getObject()->attachment->attachment_set; } else { $this->attachment_set = SwatDBClassMap::new(SiteAttachmentSet::class); $this->attachment_set->setDatabase($this->app->db); From ba91a972738d936361376a583e0a2fd278df8620 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 22 Jun 2026 20:30:26 -0400 Subject: [PATCH 3/4] phpstan updates --- phpcs.xml | 13 ------------- phpstan-baseline.neon | 0 phpstan.dist.neon | 4 +--- 3 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 phpcs.xml delete mode 100644 phpstan-baseline.neon diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 5a5374f..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - ./Building - - - diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index e69de29..0000000 diff --git a/phpstan.dist.neon b/phpstan.dist.neon index d58536a..379320b 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,6 +1,3 @@ -includes: - - phpstan-baseline.neon - parameters: phpVersion: 80200 level: 1 @@ -8,3 +5,4 @@ parameters: - Building editorUrl: '%%file%%:%%line%%' editorUrlTitle: '%%file%%:%%line%%' + errorFormat: table From 3106da611c19b197efe142b1418965277ffe1bc2 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 22 Jun 2026 20:32:26 -0400 Subject: [PATCH 4/4] add phpstan baseline to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dc4e043..6ca593f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ composer.lock # overrides for local tooling /phpstan.neon +/phpstan-baseline.neon