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 #320

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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.3",
"silverstripe/framework": "^6",
"silverstripe/cms": "^6",
"silverstripe/versioned": "^3"
Expand Down
9 changes: 4 additions & 5 deletions tests/php/Tasks/LinkFieldMigrationTaskTest.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 file are needed to fix https://github.com/silverstripe/silverstripe-linkfield/actions/runs/10447675451/job/28980857139?pr=320

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 @@ -3,8 +3,8 @@
namespace SilverStripe\LinkField\Tests\Tasks;

use LogicException;
use ReflectionClass;
use ReflectionMethod;
use ReflectionProperty;
use RuntimeException;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Environment;
Expand Down Expand Up @@ -1015,9 +1015,8 @@ public function testCheckForBrokenLinks(bool $hasBrokenLinks): void
public function testCheckForBrokenLinksWithHtmlOutput(bool $hasBrokenLinks): void
{
// Make sure we get HTML output
$reflectionCli = new ReflectionProperty(Environment::class, 'isCliOverride');
$reflectionCli->setAccessible(true);
$reflectionCli->setValue(false);
$reflectionEnvironment = new ReflectionClass(Environment::class);
$reflectionEnvironment->setStaticPropertyValue('isCliOverride', false);
try {
$brokenLinkFixtures = $this->getBrokenLinkFixtures($hasBrokenLinks);
$this->startCapturingOutput();
Expand Down Expand Up @@ -1062,7 +1061,7 @@ public function testCheckForBrokenLinksWithHtmlOutput(bool $hasBrokenLinks): voi
}
} finally {
// Make sure we unset the CLI override
$reflectionCli->setValue(null);
$reflectionEnvironment->setStaticPropertyValue('isCliOverride', null);
}
}

Expand Down
Loading