We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With PHP 8.2 , dynamic properties are deprecated so your exact snippet is not working anymore :
$config = Fastly\Configuration::getDefaultConfiguration()->setApiToken('YOUR_API_TOKEN');
Resulting in my unit test
ErrorException: Creation of dynamic property Fastly\Configuration::$apiKeys is deprecated in /usr/src/app/vendor/fastly/fastly/lib/Configuration.php:193 Stack trace: #0 /usr/src/app/vendor/fastly/fastly/lib/Configuration.php(193): custom_error_handler() #1 /usr/src/app/app/common/services/v1/FastlyService.php(30): Fastly\Configuration->setApiToken() #2 /usr/src/app/app/common/library/Traits/Singleton.php(27): Services\v1\FastlyService->__construct() #3 /usr/src/app/app/common/library/Helper/Cache.php(186): Services\v1\FastlyService::getInstance() #4 /usr/src/app/app/common/library/PubSub/ArticleHandler.php(580): LeMonde\Helper\Cache::uncacheArticle() #5 /usr/src/app/app/common/library/PubSub/ArticleHandler.php(116): LeMonde\PubSub\ArticleHandler->deleteCache() #6 /usr/src/app/tests/php/common/library/PubSub/AbstractHandlerTester.php(47): LeMonde\PubSub\ArticleHandler->handleRaw() #7 /usr/src/app/vendor/phpunit/phpunit/src/Framework/TestCase.php(1234): LeMonde\PubSub\AbstractHandlerTester->testHandleRaw() #8 /usr/src/app/vendor/phpunit/phpunit/src/Framework/TestCase.php(515): PHPUnit\Framework\TestCase->runTest() #9 /usr/src/app/vendor/phpunit/phpunit/src/Framework/TestRunner/TestRunner.php(86): PHPUnit\Framework\TestCase->runBare() #10 /usr/src/app/vendor/phpunit/phpunit/src/Framework/TestCase.php(362): PHPUnit\Framework\TestRunner->run() #11 /usr/src/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(369): PHPUnit\Framework\TestCase->run() #12 /usr/src/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(369): PHPUnit\Framework\TestSuite->run() #13 /usr/src/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(64): PHPUnit\Framework\TestSuite->run() #14 /usr/src/app/vendor/phpunit/phpunit/src/TextUI/Application.php(210): PHPUnit\TextUI\TestRunner->run() #15 /usr/src/app/vendor/phpunit/phpunit/phpunit(104): PHPUnit\TextUI\Application->run() #16 /usr/src/app/vendor/bin/phpunit(122): include('...') #17 {main}
You have to either use #[\AllowDynamicProperties] on your class or declare the property private array $apiKeys = [];
#[\AllowDynamicProperties]
private array $apiKeys = [];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With PHP 8.2 , dynamic properties are deprecated so your exact snippet is not working anymore :
Resulting in my unit test
You have to either use
#[\AllowDynamicProperties]
on your class or declare the propertyprivate array $apiKeys = [];
The text was updated successfully, but these errors were encountered: