diff --git a/ChangeLog b/ChangeLog index 0d05ea7..e683497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,14 @@ -1.8.2 - Thursday 20 February 2026 +1.8.2 - Thursday 04 March 2026 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- Fixed: PHP 8.5 deprecation of using 'null' as an array key, switch to ''. +- Fixed: PHP 8.5 deprecation of SplObjectStorage::contains(), detach(), and attach(). - Fixed: PHP 8.4 deprecation of implicit nullable parameter types in ezcPersistentSaveHandler::saveInternal(). - Fixed: PHP 8.4 deprecation of implicit nullable parameter types in ezcPersistentObjectIdProperty::__construct(). - Fixed: PHP 8.4 deprecation of implicit nullable parameter types in ezcPersistentObjectDefinition::__construct(). - Fixed: PHP 8.4 deprecation of implicit nullable parameter types in ezcPersistentSessionIdentityDecorator::__construct(). - Fixed: PHP 8.4 deprecation of implicit nullable parameter types in ezcPersistentIdentity::__construct(). +- Fixed: PHP 8.3 deprecation of dynamic property creation. - Fixed: PHP 8.1 deprecation of non-covariant return types in ezcPersistentFindIterator::rewind(), current(), key(), next() and valid(). - Fixed: PHP 8.1 deprecation of non-covariant return types in ezcPersistentIdentityFindIterator::next(). - Fixed: PHP 8.1 deprecation of non-covariant return types in ezcPersistentRelationCollection::offsetSet(), exchangeArray(), setFlags() and append(). diff --git a/src/identity_maps/basic.php b/src/identity_maps/basic.php index a2c3b6f..25d3bcb 100644 --- a/src/identity_maps/basic.php +++ b/src/identity_maps/basic.php @@ -466,7 +466,7 @@ public function addRelatedObject( $sourceObject, $relatedObject, $relationName = $relStore[$relId] = $relatedObject; // Store new reference - $this->identities[$relClass][$relId]->references->attach( + $this->identities[$relClass][$relId]->references->offsetSet( $relStore ); @@ -530,7 +530,7 @@ public function removeRelatedObject( $sourceObject, $relatedObject, $relationNam if ( isset( $srcIdentity->relatedObjects[$relationStoreName] ) ) { unset( $srcIdentity->relatedObjects[$relationStoreName][$relId] ); - $relIdentity->references->detach( $srcIdentity->relatedObjects[$relationStoreName] ); + $relIdentity->references->offsetUnset( $srcIdentity->relatedObjects[$relationStoreName] ); } foreach ( $srcIdentity->namedRelatedObjectSets as $setName => $rels ) @@ -538,7 +538,7 @@ public function removeRelatedObject( $sourceObject, $relatedObject, $relationNam if ( isset( $rels[$relId] ) && $rels[$relId] instanceof $relClass ) { unset( $srcIdentity->namedRelatedObjectSets[$setName][$relId] ); - $relIdentity->references->detach( + $relIdentity->references->offsetUnset( $srcIdentity->namedRelatedObjectSets[$setName] ); } @@ -693,10 +693,10 @@ protected function removeReferences( ArrayObject $set ) $def = $this->definitionManager->fetchDefinition( $class ); $state = $obj->getState(); $id = $state[$def->idProperty->propertyName]; - - if ( $this->identities[$class][$id]->references->contains( $set ) ) + + if ( $this->identities[$class][$id]->references->offsetExists( $set ) ) { - $this->identities[$class][$id]->references->detach( $set ); + $this->identities[$class][$id]->references->offsetUnset( $set ); } } } diff --git a/src/persistent_session_instance.php b/src/persistent_session_instance.php index 3e0cac8..a8a8374 100644 --- a/src/persistent_session_instance.php +++ b/src/persistent_session_instance.php @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -54,7 +54,7 @@ class ezcPersistentSessionInstance * @see ezcPersistentSessionInstance::get() * @var string */ - static private $defaultInstanceIdentifier = null; + static private $defaultInstanceIdentifier = ''; /** * Holds the session instances. @@ -79,9 +79,9 @@ class ezcPersistentSessionInstance * @param string $identifier * @return ezcPersistentSession */ - public static function get( $identifier = null ) + public static function get( $identifier = '' ) { - if ( $identifier === null && self::$defaultInstanceIdentifier ) + if ( $identifier === '' && self::$defaultInstanceIdentifier ) { $identifier = self::$defaultInstanceIdentifier; } @@ -115,9 +115,9 @@ public static function get( $identifier = null ) * @param string $identifier the identifier of the database handler * @return void */ - public static function set( ezcPersistentSessionFoundation $session, $identifier = null ) + public static function set( ezcPersistentSessionFoundation $session, $identifier = '' ) { - if ( $identifier === null ) + if ( $identifier === '' ) { $identifier = self::$defaultInstanceIdentifier; } @@ -157,7 +157,7 @@ public static function resetDefault() */ public static function reset() { - self::$defaultInstanceIdentifier = null; + self::$defaultInstanceIdentifier = ''; self::$instances = array(); } }