From fb5eb44b38d40540efd0a171403838010b5fb51a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Jul 2024 00:54:58 +0000 Subject: [PATCH] :package: ci: php-8.1 downgraded v0.1.0 --- .changeset/README.md | 8 -- .changeset/config.json | 11 --- .editorconfig | 20 ----- .gitattributes | 34 -------- .github/ISSUE_TEMPLATE/1_Bug_report.md | 35 --------- .github/ISSUE_TEMPLATE/2_Feature_request.md | 13 ---- .github/ISSUE_TEMPLATE/config.yml | 5 -- .github/PULL_REQUEST_TEMPLATE.md | 15 ---- .github/workflows/lint.yml | 28 ------- .github/workflows/publish.yml | 38 --------- .github/workflows/release.yml | 69 ----------------- .github/workflows/test.yml | 52 ------------- .gitignore | 25 ------ .husky/commit-msg | 4 - .husky/pre-commit | 4 - CHANGELOG.md | 7 -- CONTRIBUTING.md | 60 --------------- build/composer-php-81.json | 23 ------ build/rector-downgrade-php-81.php | 12 --- commitlint.config.js | 4 - composer.json | 77 +++++-------------- ecs.php | 29 ------- lint-staged.config.js | 11 --- package.json | 18 ----- phpstan.neon.dist | 64 --------------- phpunit.xml.dist | 8 -- rector.php | 36 --------- .../ContainerExceptionInterface.stub | 9 --- stubs/Psr/Container/ContainerInterface.stub | 7 -- .../Container/NotFoundExceptionInterface.stub | 7 -- .../SilverStripe/Core/Injector/Injector.stub | 44 ----------- .../php/Extension/SiteConfigExtensionTest.php | 29 ------- tests/php/View/TemplateProviderTest.php | 60 --------------- 33 files changed, 21 insertions(+), 845 deletions(-) delete mode 100644 .changeset/README.md delete mode 100644 .changeset/config.json delete mode 100644 .editorconfig delete mode 100644 .gitattributes delete mode 100644 .github/ISSUE_TEMPLATE/1_Bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/2_Feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .gitignore delete mode 100755 .husky/commit-msg delete mode 100755 .husky/pre-commit delete mode 100644 CHANGELOG.md delete mode 100644 CONTRIBUTING.md delete mode 100644 build/composer-php-81.json delete mode 100644 build/rector-downgrade-php-81.php delete mode 100644 commitlint.config.js delete mode 100644 ecs.php delete mode 100644 lint-staged.config.js delete mode 100644 package.json delete mode 100644 phpstan.neon.dist delete mode 100644 phpunit.xml.dist delete mode 100644 rector.php delete mode 100644 stubs/Psr/Container/ContainerExceptionInterface.stub delete mode 100644 stubs/Psr/Container/ContainerInterface.stub delete mode 100644 stubs/Psr/Container/NotFoundExceptionInterface.stub delete mode 100644 stubs/SilverStripe/Core/Injector/Injector.stub delete mode 100644 tests/php/Extension/SiteConfigExtensionTest.php delete mode 100644 tests/php/View/TemplateProviderTest.php diff --git a/.changeset/README.md b/.changeset/README.md deleted file mode 100644 index e5b6d8d..0000000 --- a/.changeset/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Changesets - -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets) - -We have a quick list of common questions to get you started engaging with this project in -[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json deleted file mode 100644 index 91b6a95..0000000 --- a/.changeset/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", - "changelog": "@changesets/cli/changelog", - "commit": false, - "fixed": [], - "linked": [], - "access": "restricted", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "ignore": [] -} diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 720cbaf..0000000 --- a/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# For more information about the properties used in this file, -# please see the EditorConfig documentation: -# https://editorconfig.org/ - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.{yml,js,json,css,scss}] -indent_size = 2 - -[composer.json] -indent_size = 4 diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1d85317..0000000 --- a/.gitattributes +++ /dev/null @@ -1,34 +0,0 @@ -# IDE -.editorconfig export-ignore - -# Git -.gitattributes export-ignore -.gitignore export-ignore -.github export-ignore - -# Quality tools -.changeset export-ignore -.husky export-ignore -commitlint.config.js export-ignore -lint-staged.config.js export-ignore - -# Tests -phpunit.xml.dist export-ignore -tests export-ignore - -# Coding standards -ecs.php export-ignore -phpstan.neon.dist export-ignore -rector.php export-ignore -stubs export-ignore - -# Documentation -CHANGELOG.md export -CONTRIBUTING.md export-ignore - -# Docker -compose.yml export-ignore -docker export-ignore - -# Extra -package.json export-ignore diff --git a/.github/ISSUE_TEMPLATE/1_Bug_report.md b/.github/ISSUE_TEMPLATE/1_Bug_report.md deleted file mode 100644 index 5f19783..0000000 --- a/.github/ISSUE_TEMPLATE/1_Bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: "Bug report \U0001F41B" -about: "If something isn't working as expected \U0001F914." -title: '' -labels: 'i: bug' -assignees: '' ---- - -## Bug report 🐛 - - - -| Subject | Details | -| :------------- | :--------------------------------------------------------------------------------| -| Version | e.g. v1.0.0 (invoke `composer show dnadesign/silverstripe-browser-update \| grep versions`) | - - - -### Minimal affected code 🚨 - - -```php -``` - -### Current behaviour 😢 - - -```php -``` - -### Expected behaviour 🙂 - - -```php -``` diff --git a/.github/ISSUE_TEMPLATE/2_Feature_request.md b/.github/ISSUE_TEMPLATE/2_Feature_request.md deleted file mode 100644 index 42496a1..0000000 --- a/.github/ISSUE_TEMPLATE/2_Feature_request.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: "Feature request \U00002728" -about: "I have a suggestion (and may want to implement it \U0001F642)!" -title: '' -labels: 'i: enhancement' -assignees: '' ---- - -## Feature request ✨ - - - - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index cd84579..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Support question 🙋 - url: https://github.com/dnadesign/silverstripe-browser-update/discussions/new - about: Please ask and answer questions here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 41b9222..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,15 +0,0 @@ -## Description ✍️ - - - -## Fixes 🐛 - -- Link to github issue(s) here. - -## DoD checklist ✅ - -- [ ] I have performed a self-review of my code -- [ ] My code adheres to the [coding standards](../CONTRIBUTING.md#coding-standards-️) -- [ ] My commit messages adhere to the [commit standards](../CONTRIBUTING.md#commit-standards-️). -- [ ] My code has been [tested](../CONTRIBUTING.md#testing-). -- [ ] I have added a [changeset](../CONTRIBUTING.md#making-a-pull-request-). diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index ac6ef2d..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Lint 👮 - -on: - pull_request: - branches: - - main - push: - branches: - - main - -env: - # see https://github.com/composer/composer/issues/9368#issuecomment-718112361 - COMPOSER_ROOT_VERSION: dev-main - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - coverage: none - - - uses: ramsey/composer-install@v2 - - - run: composer lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index ac0191c..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish 🔖 -on: - workflow_run: - workflows: - - lint - - test - branches: - - main - types: - - completed - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -permissions: - contents: write - pull-requests: write - -jobs: - publish: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - - run: yarn install - - - name: Create release pull request or publish - id: changesets - uses: changesets/action@v1 - with: - commit: ":memo: ci: update changelog" - title: ":memo: ci: update changelog" - publish: "echo 'versioned'" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index de079a5..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Release 🚀 - -# https://tomasvotruba.com/blog/how-to-release-php-81-and-72-package-in-the-same-repository/ -# https://github.com/TomasVotruba/cognitive-complexity/blob/main/.github/workflows/downgraded_release.yaml -# https://github.com/symplify/config-transformer/blob/main/.github/workflows/downgraded_release.yaml -# https://github.com/driftingly/rector-laravel/blob/main/.github/workflows/downgraded_release.yaml - -on: - push: - tags: - - "*" - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - coverage: none - - - uses: ramsey/composer-install@v2 - - # Downgrade to PHP 7.4 - - run: vendor/bin/rector process src --config build/rector-downgrade-php-81.php --ansi - - # Copy composer - - run: cp build/composer-php-81.json composer.json - - # Clear the dev files - - run: | - rm -rf \ - .editorconfig \ - .gitattributes \ - .gitignore \ - .github \ - .changeset \ - .husky \ - commitlint.config.js \ - lint-staged.config.js \ - phpunit.xml.dist \ - tests \ - ecs.php \ - phpstan.neon.dist \ - rector.php \ - build \ - stubs \ - package.json \ - CHANGELOG.md \ - CONTRIBUTING.md \ - docker \ - compose.yml \ - - # Setup git bot user - - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - - # Publish to the same repository with a new tag - - name: Tag downgraded code - run: | - git commit -a -m ":package: ci: php-8.1 downgraded ${GITHUB_REF#refs/tags/}" - - # Force push tag, so there is only a single version - git tag "${GITHUB_REF#refs/tags/}" --force - git push origin "${GITHUB_REF#refs/tags/}" --force diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index a397a47..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Test 🧑‍🔬 - -on: - pull_request: - branches: - - main - push: - branches: - - main - -env: - # see https://github.com/composer/composer/issues/9368#issuecomment-718112361 - COMPOSER_ROOT_VERSION: dev-main - -jobs: - test: - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:8.0 - env: - MYSQL_HOST: 127.0.0.1 - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: SS_mysite - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 - - steps: - - uses: actions/checkout@v3 - - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - coverage: none - - - uses: ramsey/composer-install@v2 - - - run: vendor/bin/sake dev/build flush=1 - env: - SS_DATABASE_SERVER: 127.0.0.1 - SS_DATABASE_NAME: SS_mysite - SS_DATABASE_USERNAME: root - SS_DATABASE_PASSWORD: root - - - run: vendor/bin/phpunit -d flush=1 - env: - SS_DATABASE_SERVER: 127.0.0.1 - SS_DATABASE_NAME: SS_mysite - SS_DATABASE_USERNAME: root - SS_DATABASE_PASSWORD: root diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0aea8a1..0000000 --- a/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# OS -.DS_Store - -# IDE -.idea -.vscode - -# Silverstripe -public/ -app/ - -# Dependencies -node_modules/ -vendor/ -composer.lock -yarn-error.log -yarn.lock - -# Tests -.phpunit.result.cache -coverage/ - -# Docker -docker -compose.yml diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index b567676..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx --no -- commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d24fdfc..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx lint-staged diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index f27dc80..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# silverstripe-browser-update - -## 0.1.0 - -### Minor Changes - -- Initial release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 15323f4..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,60 +0,0 @@ -# Contributing 🤩 - -Kia ora! Would you like to contribute? That's awesome, thank you so much for your interest in this project! - -Before you go committing your amazing contribution please read the following guidelines. - -## Getting started 🐤 - -Here are some things to know before you start coding. - -We use the following dependencies for development: - -- php 8.3 -- composer -- node >=18 - -We use a number of quality of life tools to streamline development, install them via the command line. - -```sh -composer install -yarn install -``` - -## Coding standards 👮‍♂️ - -To keep the codebase tidy, use the following script to clean each commit. - -```sh -composer lint -``` - -## Commit standards 👮‍♀️ - -This project uses the [gitmoji config for commitlint](https://www.npmjs.com/package/commitlint-config-gitmoji#structure). - -Each commit should adhere to the following structure. - -```sh -:gitmoji: type(scope?): subject -body? -footer? -``` - -## Testing 🧑‍🔬 - -Be sure to run the test suite regularly. New tests should be added for new features. - -```sh -vendor/bin/phpunit -``` - -## Making a pull request ✨ - -This project uses [changesets](https://github.com/changesets/changesets). This tool helps us to streamline our changelog. - -When making a pull request, be sure to add a changeset if there has been a change to the project. - -```sh -npx changeset -``` diff --git a/build/composer-php-81.json b/build/composer-php-81.json deleted file mode 100644 index 749666e..0000000 --- a/build/composer-php-81.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "dnadesign/silverstripe-browser-update", - "description": "Browser update for Silverstripe CMS.", - "license": "MIT", - "type": "silverstripe-vendormodule", - "keywords": [ - "silverstripe", - "browser-update" - ], - "require": { - "php": "^8.1", - "silverstripe/admin": "^1.0 || ^2.0", - "silverstripe/framework": "^4.0 || ^5.0", - "silverstripe/siteconfig": "^4.0 || ^5.0" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "DNADesign\\BrowserUpdate\\": "src" - } - } -} diff --git a/build/rector-downgrade-php-81.php b/build/rector-downgrade-php-81.php deleted file mode 100644 index af5953d..0000000 --- a/build/rector-downgrade-php-81.php +++ /dev/null @@ -1,12 +0,0 @@ -withImportNames(removeUnusedImports: true) - ->withSets([ - DowngradeLevelSetList::DOWN_TO_PHP_81, - ]); diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 2addcf2..0000000 --- a/commitlint.config.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {import('@commitlint/types').UserConfig}*/ -module.exports = { - extends: ["gitmoji"], -}; diff --git a/composer.json b/composer.json index f84091d..749666e 100644 --- a/composer.json +++ b/composer.json @@ -1,58 +1,23 @@ { - "name": "dnadesign/silverstripe-browser-update", - "description": "Browser update integration for Silverstripe CMS.", - "license": "MIT", - "type": "silverstripe-vendormodule", - "keywords": [ - "silverstripe", - "browser-update" - ], - "require": { - "php": "^8.3", - "silverstripe/admin": "^1.0 || ^2.0", - "silverstripe/framework": "^4.0 || ^5.0", - "silverstripe/siteconfig": "^4.0 || ^5.0" - }, - "require-dev": { - "cambis/silverstripe-rector": "^0.5.0", - "ergebnis/composer-normalize": "^2.42", - "php-parallel-lint/php-parallel-lint": "^1.4", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "^9.5", - "rector/rector": "^1.0", - "silverstripe/standards": "^1.0", - "slevomat/coding-standard": "^8.14", - "symplify/easy-coding-standard": "^12.0" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "DNADesign\\BrowserUpdate\\": "src", - "DNADesign\\BrowserUpdate\\Tests\\": "tests/php" - } - }, - "config": { - "allow-plugins": { - "composer/installers": true, - "dealerdirect/phpcodesniffer-composer-installer": true, - "ergebnis/composer-normalize": true, - "phpstan/extension-installer": true, - "silverstripe/vendor-plugin": true - }, - "sort-packages": true - }, - "scripts": { - "lint": [ - "vendor/bin/parallel-lint src tests --colors --blame", - "vendor/bin/ecs check --ansi", - "vendor/bin/phpstan analyse --ansi --memory-limit=-1" - ], - "lint:fix": [ - "vendor/bin/ecs check --fix --ansi" - ] - } + "name": "dnadesign/silverstripe-browser-update", + "description": "Browser update for Silverstripe CMS.", + "license": "MIT", + "type": "silverstripe-vendormodule", + "keywords": [ + "silverstripe", + "browser-update" + ], + "require": { + "php": "^8.1", + "silverstripe/admin": "^1.0 || ^2.0", + "silverstripe/framework": "^4.0 || ^5.0", + "silverstripe/siteconfig": "^4.0 || ^5.0" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "DNADesign\\BrowserUpdate\\": "src" + } + } } diff --git a/ecs.php b/ecs.php deleted file mode 100644 index 9630d63..0000000 --- a/ecs.php +++ /dev/null @@ -1,29 +0,0 @@ -withPaths([ - __DIR__ . '/_config.php', - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->withConfiguredRule( - ReferenceUsedNamesOnlySniff::class, - [ - 'allowFallbackGlobalFunctions' => false, - 'allowFallbackGlobalConstants' => false, - ] - ) - ->withSets([ - SetList::COMMON, - SetList::PSR_12, - ]) - ->withSkip([ - NotOperatorWithSuccessorSpaceFixer::class, - ]); diff --git a/lint-staged.config.js b/lint-staged.config.js deleted file mode 100644 index 2775a1b..0000000 --- a/lint-staged.config.js +++ /dev/null @@ -1,11 +0,0 @@ -/** @type {import('lint-staged').Config} */ -module.exports = { - '*.php': [ - 'php vendor/bin/parallel-lint src tests --colors --blame', - 'php vendor/bin/ecs check --fix', - 'php vendor/bin/phpstan analyse --ansi --memory-limit=-1', - ], - 'composer.json': [ - 'composer normalize --ansi' - ], -}; diff --git a/package.json b/package.json deleted file mode 100644 index 7284be5..0000000 --- a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "silverstripe-browser-update", - "version": "0.1.0", - "license": "MIT", - "devDependencies": { - "@commitlint/cli": "^19.3.0", - "@commitlint/types": "^19.0.3", - "commitlint-config-gitmoji": "^2.3.1", - "husky": "^9.0.11", - "lint-staged": "^15.2.2" - }, - "dependencies": { - "@changesets/cli": "^2.27.1" - }, - "scripts": { - "prepare": "husky" - } -} diff --git a/phpstan.neon.dist b/phpstan.neon.dist deleted file mode 100644 index 23b164e..0000000 --- a/phpstan.neon.dist +++ /dev/null @@ -1,64 +0,0 @@ -parameters: - level: 9 - paths: - - _config.php - - src - - tests - excludePaths: - - ecs.php - - rector.php - stubFiles: - - stubs/Psr/Container/ContainerExceptionInterface.stub - - stubs/Psr/Container/ContainerInterface.stub - - stubs/Psr/Container/NotFoundExceptionInterface.stub - - stubs/SilverStripe/Core/Injector/Injector.stub - universalObjectCratesClasses: - - SilverStripe\Core\Config\Config_ForClass - - SilverStripe\Forms\GridField\GridState_Data - - SilverStripe\ORM\DataObjectInterface - - SilverStripe\View\ArrayData - - SilverStripe\View\ViewableData - - Symbiote\QueuedJobs\Services\AbstractQueuedJob - ignoreErrors: - - - # Ignore configuration properties - message: '#Static property [a-zA-Z0-9\\$\\_\\\\:\\(\\)]+ is never read, only written#' - identifier: property.onlyWritten - reportUnmatched: false - - - # Prefer dynamic calls in PHPUnit - messages: - - '#Dynamic call to static method PHPUnit\\Framework\\#' - - '#Dynamic call to static method SilverStripe\\Dev\\FunctionalTest#' - - '#Dynamic call to static method SilverStripe\\Dev\\SapphireTest#' - identifier: staticMethod.dynamicCall - reportUnmatched: false - - - message: "#^Parameter \\#1 \\$member of static method SilverStripe\\\\Security\\\\Permission\\:\\:checkMember\\(\\) expects int\\|SilverStripe\\\\Security\\\\Member, SilverStripe\\\\Security\\\\Member\\|null given\\.$#" - count: 4 - path: src/Model/Announcement.php - - - - message: "#^Return type \\(bool\\|int\\) of method DNADesign\\\\BrowserUpdate\\\\Model\\\\Announcement\\:\\:canCreate\\(\\) should be covariant with return type \\(bool\\) of method SilverStripe\\\\ORM\\\\DataObject\\:\\:canCreate\\(\\)$#" - count: 1 - path: src/Model/Announcement.php - - - - message: "#^Return type \\(bool\\|int\\) of method DNADesign\\\\BrowserUpdate\\\\Model\\\\Announcement\\:\\:canDelete\\(\\) should be covariant with return type \\(bool\\) of method SilverStripe\\\\ORM\\\\DataObject\\:\\:canDelete\\(\\)$#" - count: 1 - path: src/Model/Announcement.php - - - - message: "#^Return type \\(bool\\|int\\) of method DNADesign\\\\BrowserUpdate\\\\Model\\\\Announcement\\:\\:canEdit\\(\\) should be covariant with return type \\(bool\\) of method SilverStripe\\\\ORM\\\\DataObject\\:\\:canEdit\\(\\)$#" - count: 1 - path: src/Model/Announcement.php - - - - message: "#^Return type \\(bool\\|int\\) of method DNADesign\\\\BrowserUpdate\\\\Model\\\\Announcement\\:\\:canView\\(\\) should be covariant with return type \\(bool\\) of method SilverStripe\\\\ORM\\\\DataObject\\:\\:canView\\(\\)$#" - count: 1 - path: src/Model/Announcement.php - - - - message: "#^Access to an undefined property DNADesign\\\\BrowserUpdate\\\\Extension\\\\SiteConfigExtension\\:\\:\\$BrowserAnnouncementID\\.$#" - count: 1 - path: tests/php/View/TemplateProviderTest.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 3801dc3..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - tests/php - - - diff --git a/rector.php b/rector.php deleted file mode 100644 index 41305f9..0000000 --- a/rector.php +++ /dev/null @@ -1,36 +0,0 @@ -withImportNames() - ->withPaths([ - __DIR__ . '/_config.php', - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->withSets([ - LevelSetList::UP_TO_PHP_83, - SetList::CODE_QUALITY, - SetList::CODING_STYLE, - SetList::DEAD_CODE, - SetList::EARLY_RETURN, - SetList::PRIVATIZATION, - PHPUnitSetList::PHPUNIT_90, - PHPUnitSetList::PHPUNIT_CODE_QUALITY, - SilverstripeLevelSetList::UP_TO_SILVERSTRIPE_52, - ])->withSkip([ - ClosureToArrowFunctionRector::class, - // These may cause a downgrade to fail - AddOverrideAttributeToOverriddenMethodsRector::class, - AddTypeToConstRector::class, - ]); diff --git a/stubs/Psr/Container/ContainerExceptionInterface.stub b/stubs/Psr/Container/ContainerExceptionInterface.stub deleted file mode 100644 index 0627734..0000000 --- a/stubs/Psr/Container/ContainerExceptionInterface.stub +++ /dev/null @@ -1,9 +0,0 @@ -|string $name The name of the service to retrieve. If not a registered - * service, then a class of the given name is instantiated - * @param bool $asSingleton If set to false a new instance will be returned. - * If true a singleton will be returned unless the spec is type=prototype' - * @param array $constructorArgs Args to pass in to the constructor. Note: Ignored for singletons - * @return T|mixed Instance of the specified object - * @phpstan-return ($name is class-string ? T : mixed) - */ - public function get($name, $asSingleton = true, $constructorArgs = []) - { - } - - /** - * @template T of object - * @param class-string|string $name - * @param mixed ...$argument arguments to pass to the constructor - * @return T|mixed A new instance of the specified object - * @phpstan-return ($name is class-string ? T : mixed) A new instance of the specified object - */ - public function create($name, $argument = null) - { - } - - /** - * @template T - * @param class-string|string $name Name of the class to create an object of - * @param array $constructorArgs Arguments to pass to the constructor - * @return T|mixed - * @phpstan-return ($name is class-string ? T : mixed) - */ - public function createWithArgs($name, $constructorArgs) - { - } -} diff --git a/tests/php/Extension/SiteConfigExtensionTest.php b/tests/php/Extension/SiteConfigExtensionTest.php deleted file mode 100644 index 058d18a..0000000 --- a/tests/php/Extension/SiteConfigExtensionTest.php +++ /dev/null @@ -1,29 +0,0 @@ - $fieldClass - */ - public function testUpdateCMSFields(string $fieldName, string $fieldClass): void - { - $fields = SiteConfig::current_site_config()->getCMSFields(); - $field = $fields->dataFieldByName($fieldName); - - $this->assertInstanceOf($fieldClass, $field); - } -} diff --git a/tests/php/View/TemplateProviderTest.php b/tests/php/View/TemplateProviderTest.php deleted file mode 100644 index 49eaf60..0000000 --- a/tests/php/View/TemplateProviderTest.php +++ /dev/null @@ -1,60 +0,0 @@ -assertArrayHasKey( - $key, - TemplateProvider::get_template_global_variables() - ); - } - - public function testBrowserUpdateNoAnnouncements(): void - { - $template = SSViewer::execute_string( - '{$BrowserUpdate}', - '' - ); - - $this->assertEmpty($template); - } - - public function testBrowserUpdate(): void - { - $announcement = Announcement::create(); - $announcement->write(); - - /** @var SiteConfigExtension $siteConfig */ - $siteConfig = SiteConfig::current_site_config(); - $siteConfig->BrowserAnnouncementID = $announcement->ID; - - $template = SSViewer::execute_string( - '{$BrowserUpdate}', - '' - ); - - $this->assertStringContainsString( - '{"reminder":24,"reminderClosed":150,"test":0,"newwindow":1,"url":null,"noclose":0,"no_permanent_hide":0,"api":"2024.07","insecure":1,"unsupported":1,"text":{"msg":"Your web browser ({brow_name}) is out of date.","msgmore":"Update your browser for more security, speed and the best experience on this site.","bupdate":"Update browser","bignore":"Ignore","remind":"You will be reminded in {days} days.","bnever":"Never show again"}}', - $template, - ); - } -}