Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
entity
Commits
0f0bd50d
Commit
0f0bd50d
authored
3 years ago
by
tr
Committed by
Tim Rohaly
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue #3249556 by TR: PHP 8.1 changes
parent
b40cc125
No related branches found
Branches containing commit
Tags
7.x-1.10
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/entity.wrapper.inc
+20
-0
20 additions, 0 deletions
includes/entity.wrapper.inc
with
20 additions
and
0 deletions
includes/entity.wrapper.inc
+
20
−
0
View file @
0f0bd50d
...
@@ -553,6 +553,7 @@ class EntityStructureWrapper extends EntityMetadataWrapper implements IteratorAg
...
@@ -553,6 +553,7 @@ class EntityStructureWrapper extends EntityMetadataWrapper implements IteratorAg
return
isset
(
$this
->
propertyInfo
[
'properties'
][
$name
]);
return
isset
(
$this
->
propertyInfo
[
'properties'
][
$name
]);
}
}
#[\ReturnTypeWillChange]
public
function
getIterator
()
{
public
function
getIterator
()
{
$this
->
spotInfo
();
$this
->
spotInfo
();
return
new
EntityMetadataWrapperIterator
(
$this
,
array_keys
(
$this
->
propertyInfo
[
'properties'
]));
return
new
EntityMetadataWrapperIterator
(
$this
,
array_keys
(
$this
->
propertyInfo
[
'properties'
]));
...
@@ -1123,6 +1124,7 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
...
@@ -1123,6 +1124,7 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
/**
/**
* If we wrap a list, we return an iterator over the data list.
* If we wrap a list, we return an iterator over the data list.
*/
*/
#[\ReturnTypeWillChange]
public
function
getIterator
()
{
public
function
getIterator
()
{
// In case there is no data available, just iterate over the first item.
// In case there is no data available, just iterate over the first item.
return
new
EntityMetadataWrapperIterator
(
$this
,
(
$this
->
dataAvailable
()
&&
is_array
(
parent
::
value
()))
?
array_keys
(
parent
::
value
())
:
array
(
0
));
return
new
EntityMetadataWrapperIterator
(
$this
,
(
$this
->
dataAvailable
()
&&
is_array
(
parent
::
value
()))
?
array_keys
(
parent
::
value
())
:
array
(
0
));
...
@@ -1131,18 +1133,22 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
...
@@ -1131,18 +1133,22 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
/**
/**
* Implements the ArrayAccess interface.
* Implements the ArrayAccess interface.
*/
*/
#[\ReturnTypeWillChange]
public
function
offsetGet
(
$delta
)
{
public
function
offsetGet
(
$delta
)
{
return
$this
->
get
(
$delta
);
return
$this
->
get
(
$delta
);
}
}
#[\ReturnTypeWillChange]
public
function
offsetExists
(
$delta
)
{
public
function
offsetExists
(
$delta
)
{
return
$this
->
dataAvailable
()
&&
(
$data
=
$this
->
value
())
&&
array_key_exists
(
$delta
,
$data
);
return
$this
->
dataAvailable
()
&&
(
$data
=
$this
->
value
())
&&
array_key_exists
(
$delta
,
$data
);
}
}
#[\ReturnTypeWillChange]
public
function
offsetSet
(
$delta
,
$value
)
{
public
function
offsetSet
(
$delta
,
$value
)
{
$this
->
get
(
$delta
)
->
set
(
$value
);
$this
->
get
(
$delta
)
->
set
(
$value
);
}
}
#[\ReturnTypeWillChange]
public
function
offsetUnset
(
$delta
)
{
public
function
offsetUnset
(
$delta
)
{
if
(
$this
->
offsetExists
(
$delta
))
{
if
(
$this
->
offsetExists
(
$delta
))
{
unset
(
$this
->
data
[
$delta
]);
unset
(
$this
->
data
[
$delta
]);
...
@@ -1150,6 +1156,7 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
...
@@ -1150,6 +1156,7 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
}
}
}
}
#[\ReturnTypeWillChange]
public
function
count
()
{
public
function
count
()
{
return
$this
->
dataAvailable
()
?
count
(
$this
->
value
())
:
0
;
return
$this
->
dataAvailable
()
?
count
(
$this
->
value
())
:
0
;
}
}
...
@@ -1209,30 +1216,37 @@ class EntityMetadataWrapperIterator implements RecursiveIterator {
...
@@ -1209,30 +1216,37 @@ class EntityMetadataWrapperIterator implements RecursiveIterator {
$this
->
keys
=
$keys
;
$this
->
keys
=
$keys
;
}
}
#[\ReturnTypeWillChange]
public
function
rewind
()
{
public
function
rewind
()
{
$this
->
position
=
0
;
$this
->
position
=
0
;
}
}
#[\ReturnTypeWillChange]
public
function
current
()
{
public
function
current
()
{
return
$this
->
wrapper
->
get
(
$this
->
keys
[
$this
->
position
]);
return
$this
->
wrapper
->
get
(
$this
->
keys
[
$this
->
position
]);
}
}
#[\ReturnTypeWillChange]
public
function
key
()
{
public
function
key
()
{
return
$this
->
keys
[
$this
->
position
];
return
$this
->
keys
[
$this
->
position
];
}
}
#[\ReturnTypeWillChange]
public
function
next
()
{
public
function
next
()
{
$this
->
position
++
;
$this
->
position
++
;
}
}
#[\ReturnTypeWillChange]
public
function
valid
()
{
public
function
valid
()
{
return
isset
(
$this
->
keys
[
$this
->
position
]);
return
isset
(
$this
->
keys
[
$this
->
position
]);
}
}
#[\ReturnTypeWillChange]
public
function
hasChildren
()
{
public
function
hasChildren
()
{
return
$this
->
current
()
instanceof
IteratorAggregate
;
return
$this
->
current
()
instanceof
IteratorAggregate
;
}
}
#[\ReturnTypeWillChange]
public
function
getChildren
()
{
public
function
getChildren
()
{
return
$this
->
current
()
->
getIterator
();
return
$this
->
current
()
->
getIterator
();
}
}
...
@@ -1258,26 +1272,32 @@ class EntityMetadataArrayObject implements ArrayAccess, Countable, IteratorAggre
...
@@ -1258,26 +1272,32 @@ class EntityMetadataArrayObject implements ArrayAccess, Countable, IteratorAggre
/**
/**
* Implements the ArrayAccess interface.
* Implements the ArrayAccess interface.
*/
*/
#[\ReturnTypeWillChange]
public
function
offsetGet
(
$delta
)
{
public
function
offsetGet
(
$delta
)
{
return
$this
->
data
[
$delta
];
return
$this
->
data
[
$delta
];
}
}
#[\ReturnTypeWillChange]
public
function
offsetExists
(
$delta
)
{
public
function
offsetExists
(
$delta
)
{
return
array_key_exists
(
$delta
,
$this
->
data
);
return
array_key_exists
(
$delta
,
$this
->
data
);
}
}
#[\ReturnTypeWillChange]
public
function
offsetSet
(
$delta
,
$value
)
{
public
function
offsetSet
(
$delta
,
$value
)
{
$this
->
data
[
$delta
]
=
$value
;
$this
->
data
[
$delta
]
=
$value
;
}
}
#[\ReturnTypeWillChange]
public
function
offsetUnset
(
$delta
)
{
public
function
offsetUnset
(
$delta
)
{
unset
(
$this
->
data
[
$delta
]);
unset
(
$this
->
data
[
$delta
]);
}
}
#[\ReturnTypeWillChange]
public
function
count
()
{
public
function
count
()
{
return
count
(
$this
->
data
);
return
count
(
$this
->
data
);
}
}
#[\ReturnTypeWillChange]
public
function
getIterator
()
{
public
function
getIterator
()
{
return
new
ArrayIterator
(
$this
->
data
);
return
new
ArrayIterator
(
$this
->
data
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment