Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEP Limit PHP support for CMS 6 #598

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
with:
extra_jobs: |
- php: 8.1
- php: 8.3
endtoend: true
endtoend_suite: asset-admin
endtoend_config: vendor/silverstripe/asset-admin/behat.yml
- php: 8.1
- php: 8.3
endtoend: true
endtoend_suite: versioned-admin
endtoend_config: vendor/silverstripe/versioned-admin/behat.yml
- php: 8.1
- php: 8.3
endtoend: true
endtoend_suite: silverstripe-elemental
endtoend_config: vendor/dnadesign/silverstripe-elemental/behat.yml
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "silverstripe-vendormodule",
"license": "BSD-3-Clause",
"require": {
"php": "^8.1",
"php": "^8.3",
"silverstripe/framework": "^6",
"silverstripe/vendor-plugin": "^2",
"webonyx/graphql-php": "^15.0.1",
Expand Down
9 changes: 4 additions & 5 deletions tests/Schema/IntegrationTest.php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to this test needed to fix https://github.com/silverstripe/silverstripe-graphql/actions/runs/10447767783/job/28980872372?pr=598

Calling ReflectionProperty::setValue() with a single argument is deprecated

https://www.php.net/manual/en/reflectionproperty.setvalue.php says

Note: As of PHP 8.3.0, calling this method with a single argument is deprecated, use ReflectionClass::setStaticPropertyValue() instead.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
use GraphQL\Validator\Rules\QueryComplexity;
use GraphQL\Validator\Rules\QueryDepth;
use GraphQL\Validator\ValidationContext;
use ReflectionProperty;
use ReflectionClass;

class IntegrationTest extends SapphireTest
{
Expand Down Expand Up @@ -1688,11 +1688,10 @@ public function testGlobalRuleNotRemoved()

private function removeDocumentValidatorRule(string $ruleName): void
{
$reflectionRules = new ReflectionProperty(DocumentValidator::class, 'rules');
$reflectionRules->setAccessible(true);
$rules = $reflectionRules->getValue();
$reflectionValidator = new ReflectionClass(DocumentValidator::class);
$rules = $reflectionValidator->getStaticPropertyValue('rules');
unset($rules[$ruleName]);
$reflectionRules->setValue($rules);
$reflectionValidator->setStaticPropertyValue('rules', $rules);
}

private function createProviderForComplexityOrDepth(int $limit): array
Expand Down
Loading