Comments (13)
This is now finally fixed with v7.0.0 :) @Seppo-Konttinen-Solteq @NeilMasters @dbebawy-modus
from contentful.php.
Unfortunately, the mixed return type is only available starting with PHP 8: https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.mixed .
Using bool and void is possible, though.
from contentful.php.
Hey @dbebawy-modus ,
unfortunately, we can't add this attributes or the return type until we deprecate support of PHP7, which we can't do until at least extended support for it runs out. So there's no way to get rid of these warning for now.
from contentful.php.
The composer.json file only supports "php": "^7.2|^8.0",
.
Support for PHP return types was added in PHP 7.0 and the void
type was added in PHP 7.1.
For the first 3 items, we can resolve the notices by adding the appropriate return types (mixed, bool).
@@ -126,7 +126,7 @@ class Entry extends LocalizedResource implements EntryInterface, \ArrayAccess
/**
* {@inheritdoc}
*/
- public function offsetGet($name)
+ public function offsetGet($name): mixed
{
return $this->get($name);
}
@@ -134,7 +134,7 @@ class Entry extends LocalizedResource implements EntryInterface, \ArrayAccess
/**
* {@inheritdoc}
*/
- public function offsetExists($name)
+ public function offsetExists($name): bool
{
return $this->has($name);
}
@@ -50,7 +50,7 @@ abstract class BaseSystemProperties implements SystemPropertiesInterface
/**
* {@inheritdoc}
*/
- public function jsonSerialize()
+ public function jsonSerialize(): mixed
{
return [
'id' => $this->id,
The last 2 items can be resolved by adding the void
return type. This is supported in PHP >= 7.1.
@@ -142,7 +142,7 @@ class Entry extends LocalizedResource implements EntryInterface, \ArrayAccess
/**
* {@inheritdoc}
*/
- public function offsetSet($name, $value)
+ public function offsetSet($name, $value): void
{
throw new \LogicException('Entry class does not support setting fields.');
}
@@ -150,7 +150,7 @@ class Entry extends LocalizedResource implements EntryInterface, \ArrayAccess
/**
* {@inheritdoc}
*/
- public function offsetUnset($name)
+ public function offsetUnset($name): void
{
throw new \LogicException('Entry class does not support unsetting fields.');
}
from contentful.php.
Created PR #317 for your review/approval.
from contentful.php.
Hi @Sebb767
Is there anything that can be done with this? We are currently doing upgrade and are blocked with this. Current Magento version EOL is 28th of Nov so se cannot wait much more longer to be able to do upgrade and testing in time.
Thanks.
from contentful.php.
The composer.json file only supports "php": "^7.2|^8.0",.
Is there expected full support for php 8.1 coming anytime soon?
from contentful.php.
unfortunately, we can't add this attributes or the return type until we deprecate support of PHP7, which we can't do until at least extended support for it runs out. So there's no way to get rid of these warning for now.
This isn't true. Attributes start with a #
which also happens to be a comment. So any attributes you add to your code will simply be ignored pre-8.1. And even if it did, that's what versioning is for. Composer will just resolve the version you need based on your environment. Tagging the next release with PHP 8.1 will not cause any issues for people (STILL!) running PHP 7.x.
from contentful.php.
Can this be now released as the PHP7 support should be dropped?
from contentful.php.
@Seppo-Konttinen-Solteq There's unfortunately still a blocker in releasing the updated version for rich-text
. As soon as this is resolved, I'll immediately publish a new version.
from contentful.php.
Thanks for the info @Sebb767 ! :)
from contentful.php.
Awesome work @Sebb767
from contentful.php.
Legend.
from contentful.php.
Related Issues (20)
- Potential segfault? HOT 5
- BaseClient::messages memory exhaustion HOT 3
- Allow specifying timeouts for API requests
- Support for Tags HOT 3
- Support for HTML Serializing of Rich Text fields HOT 2
- Empty Paragraph Node HOT 2
- Filtering not working on preview API HOT 3
- Version 6.2.0 contains BC breaks HOT 6
- Library not compatible with Google Auth because of not supporting PSR Cache in version 2 HOT 3
- Nested assets not returned for $entry->all(); HOT 3
- Serializable interface deprecated in PHP 8.1 HOT 3
- Contentful Delivery $setLocale * not working as expected HOT 6
- Soft Line Returns Not Rendered to HTML HOT 3
- Client::getEntries() cache does not work properly with different locales HOT 2
- psr/log require mismatch with Magento 2.4.4-p2 HOT 5
- PHP 8.2 HOT 1
- Doesn't return content, links, images and fields when serializing HOT 1
- I have a problem when updating php 8 that is defining the return type with Contentful\Delivery\Resource\Entry
- Update support for php 8.2/8.3? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contentful.php.