Skip to content
Open
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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI

on:
# Run on all pushes to master and on all pull requests.
push:
branches:
master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
uses: "zetacomponents/.github/.github/workflows/ci.yml@master"
14 changes: 14 additions & 0 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Coding Standard

on:
# Run on all pushes and on all pull requests.
push:
branches:
master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
uses: "zetacomponents/.github/.github/workflows/coding-standard.yml@master"
20 changes: 20 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
1.8.2 - Thursday 20 February 2026
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- 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.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().
- Fixed: PHP 8.1 deprecation of missing return types in ezcPersistentObjectRelations::offsetSet(), exchangeArray(), setFlags() and append().
- Fixed: PHP 8.1 deprecation of missing return types in ezcPersistentObjectProperties::offsetSet(), exchangeArray(), setFlags() and append().
- Fixed: PHP 8.1 deprecation of missing return types in ezcPersistentObjectColumns::offsetSet(), exchangeArray(), setFlags() and append().
- Fixed: PHP 8.1 deprecation of missing return types in PHPUnit setUp() and tearDown() methods across all test classes.
- Fixed: PHPUnit deprecation of getMock() replaced with getMockBuilder() in test classes.
- Fixed: PHPUnit deprecation of readAttribute() replaced with a custom readPrivateAttribute() helper using Reflection.
- Fixed: PHPUnit strict type assertion corrections (string to int) in ezcPersistentDatabaseTypeTest.


1.8.1 - Friday 26 March 2021
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
11 changes: 6 additions & 5 deletions src/find_iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct( PDOStatement $stmt, ezcPersistentObjectDefinition $
*
* @return void
*/
public function rewind()
public function rewind(): void
{
if ( $this->object === null )
{
Expand All @@ -116,7 +116,7 @@ public function rewind()
*
* @return object
*/
public function current()
public function current(): mixed
{
return $this->object;
}
Expand All @@ -129,7 +129,7 @@ public function current()
*
* @return null
*/
public function key()
public function key(): mixed
{
return null;
}
Expand All @@ -143,6 +143,7 @@ public function key()
*
* @return object
*/
#[\ReturnTypeWillChange]
public function next()
{
$row = false;
Expand All @@ -153,7 +154,7 @@ public function next()
catch ( PDOException $e ) // MySQL 5.0 throws this if the statement is not executed.
{
$this->object = null;
return;
return null;
}

// SQLite returns empty array on faulty statement!
Expand Down Expand Up @@ -193,7 +194,7 @@ private function checkDef()
*
* @return bool
*/
public function valid()
public function valid(): bool
{
return $this->object !== null ? true : false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/save_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function updateFromQuery( ezcQueryUpdate $query )
private function saveInternal(
$object,
$doPersistenceCheck = true,
ezcPersistentIdentifierGenerator $idGenerator = null
?ezcPersistentIdentifierGenerator $idGenerator = null
)
{
$class = get_class( $object );
Expand Down
18 changes: 9 additions & 9 deletions src/object/persistent_object_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct()
* @param ezcPersistentObjectProperty $value
* @return void
*/
public function offsetSet( $offset, $value )
public function offsetSet( $offset, $value ): void
{
if ( ( $value instanceof ezcPersistentObjectProperty ) === false && ( $value instanceof ezcPersistentObjectIdProperty ) === false )
{
Expand All @@ -78,9 +78,9 @@ public function offsetSet( $offset, $value )
* Performs additional value checks on the array.
*
* @param array(ezcPersistentObjectProperty) $array New relations array.
* @return void
* @return array the old array.
*/
public function exchangeArray( $array )
public function exchangeArray( $array ): array
{
foreach ( $array as $offset => $value )
{
Expand All @@ -93,7 +93,7 @@ public function exchangeArray( $array )
throw new ezcBaseValueException( 'offset', $offset, 'string, length > 0' );
}
}
parent::exchangeArray( $array );
return parent::exchangeArray( $array );
}

/**
Expand All @@ -103,7 +103,7 @@ public function exchangeArray( $array )
* @param int $flags Must be 0.
* @return void
*/
public function setFlags( $flags )
public function setFlags( $flags ): void
{
if ( $flags !== 0 )
{
Expand All @@ -112,12 +112,12 @@ public function setFlags( $flags )
}

/**
* Appending is not supported.
*
* @param mixed $value
* Appending is not supported.
*
* @param mixed $value
* @return void
*/
public function append( $value )
public function append( $value ): void
{
throw new Exception( 'Operation append is not supported by this object.' );
}
Expand Down
2 changes: 1 addition & 1 deletion src/object/persistent_object_definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct( $table = '',
$class = '',
array $properties = array(),
array $relations = array(),
ezcPersistentObjectIdProperty $idProperty = null )
?ezcPersistentObjectIdProperty $idProperty = null )
{
$this->table = $table;
$this->class = $class;
Expand Down
2 changes: 1 addition & 1 deletion src/object/persistent_object_id_property.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function __construct(
$columnName = null,
$propertyName = null,
$visibility = null,
ezcPersistentGeneratorDefinition $generator = null,
?ezcPersistentGeneratorDefinition $generator = null,
$propertyType = ezcPersistentObjectProperty::PHP_TYPE_INT,
$databaseType = PDO::PARAM_STR
)
Expand Down
18 changes: 9 additions & 9 deletions src/object/persistent_object_properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct()
* @param ezcPersistentObjectProperty $value
* @return void
*/
public function offsetSet( $offset, $value )
public function offsetSet( $offset, $value ): void
{
if ( ( $value instanceof ezcPersistentObjectProperty ) === false )
{
Expand All @@ -78,9 +78,9 @@ public function offsetSet( $offset, $value )
* Performs additional value checks on the array.
*
* @param array(ezcPersistentObjectProperty) $array New properties array.
* @return void
* @return array the old array.
*/
public function exchangeArray( $array )
public function exchangeArray( $array ): array
{
foreach ( $array as $offset => $value )
{
Expand All @@ -93,7 +93,7 @@ public function exchangeArray( $array )
throw new ezcBaseValueException( 'offset', $offset, 'string, length > 0' );
}
}
parent::exchangeArray( $array );
return parent::exchangeArray( $array );
}

/**
Expand All @@ -103,7 +103,7 @@ public function exchangeArray( $array )
* @param int $flags Must be 0.
* @return void
*/
public function setFlags( $flags )
public function setFlags( $flags ): void
{
if ( $flags !== 0 )
{
Expand All @@ -112,12 +112,12 @@ public function setFlags( $flags )
}

/**
* Appending is not supported.
*
* @param mixed $value
* Appending is not supported.
*
* @param mixed $value
* @return void
*/
public function append( $value )
public function append( $value ): void
{
throw new Exception( 'Operation append is not supported by this object.' );
}
Expand Down
18 changes: 9 additions & 9 deletions src/object/persistent_object_relations.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct()
* @param ezcPersistentRelation $value
* @return void
*/
public function offsetSet( $offset, $value )
public function offsetSet( $offset, $value ): void
{
if ( !( $value instanceof ezcPersistentRelation ) && !( $value instanceof ezcPersistentRelationCollection ) )
{
Expand All @@ -78,9 +78,9 @@ public function offsetSet( $offset, $value )
* Performs additional value checks on the array.
*
* @param array(ezcPersistentRelation) $array New relations array.
* @return void
* @return array the old array.
*/
public function exchangeArray( $array )
public function exchangeArray( $array ): array
{
foreach ( $array as $offset => $value )
{
Expand All @@ -93,7 +93,7 @@ public function exchangeArray( $array )
throw new ezcBaseValueException( 'offset', $offset, 'string, length > 0' );
}
}
parent::exchangeArray( $array );
return parent::exchangeArray( $array );
}

/**
Expand All @@ -103,7 +103,7 @@ public function exchangeArray( $array )
* @param int $flags Must be 0.
* @return void
*/
public function setFlags( $flags )
public function setFlags( $flags ): void
{
if ( $flags !== 0 )
{
Expand All @@ -112,12 +112,12 @@ public function setFlags( $flags )
}

/**
* Appending is not supported.
*
* @param mixed $value
* Appending is not supported.
*
* @param mixed $value
* @return void
*/
public function append( $value )
public function append( $value ): void
{
throw new Exception( 'Operation append is not supported by this object.' );
}
Expand Down
10 changes: 5 additions & 5 deletions src/object/relation_collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct()
* @param ezcPersistentRelation $value
* @return void
*/
public function offsetSet( $offset, $value )
public function offsetSet( $offset, $value ): void
{
if ( ( $value instanceof ezcPersistentRelation ) === false )
{
Expand All @@ -80,7 +80,7 @@ public function offsetSet( $offset, $value )
* @param array(ezcPersistentRelation) $array New relations array.
* @return void
*/
public function exchangeArray( $array )
public function exchangeArray( $array ): array
{
foreach ( $array as $offset => $value )
{
Expand All @@ -93,7 +93,7 @@ public function exchangeArray( $array )
throw new ezcBaseValueException( 'offset', $offset, 'string, length > 0' );
}
}
parent::exchangeArray( $array );
return parent::exchangeArray( $array );
}

/**
Expand All @@ -103,7 +103,7 @@ public function exchangeArray( $array )
* @param int $flags Must be 0.
* @return void
*/
public function setFlags( $flags )
public function setFlags( $flags ): void
{
if ( $flags !== 0 )
{
Expand All @@ -117,7 +117,7 @@ public function setFlags( $flags )
* @param mixed $value
* @return void
*/
public function append( $value )
public function append( $value ): void
{
throw new Exception( 'Operation append is not supported by this object.' );
}
Expand Down
2 changes: 1 addition & 1 deletion src/session_decorators/identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ezcPersistentSessionIdentityDecorator implements ezcPersistentSessionFound
* @param ezcPersistentIdentityMap $identityMap
* @param ezcPersistentSessionIdentityDecoratorOptions $options
*/
public function __construct( ezcPersistentSession $session, ezcPersistentIdentityMap $identityMap, ezcPersistentSessionIdentityDecoratorOptions $options = null )
public function __construct( ezcPersistentSession $session, ezcPersistentIdentityMap $identityMap, ?ezcPersistentSessionIdentityDecoratorOptions $options = null )
{
$this->session = $session;
$this->properties['identityMap'] = $identityMap;
Expand Down
1 change: 1 addition & 0 deletions src/session_decorators/identity/find_iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function __construct(
*
* @return object
*/
#[\ReturnTypeWillChange]
public function next()
{
$object = parent::next();
Expand Down
2 changes: 1 addition & 1 deletion src/structs/identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function __construct(
$object = null,
array $relatedObjects = array(),
array $namedRelatedObjectSets = array(),
SplObjectStorage $references = null
?SplObjectStorage $references = null
)
{
$this->object = $object;
Expand Down
4 changes: 2 additions & 2 deletions tests/basic_identity_map_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public static function suite()
return new \PHPUnit\Framework\TestSuite( __CLASS__ );
}

public function setUp()
public function setUp(): void
{
$this->definitionManager = new ezcPersistentCodeManager(
dirname( __FILE__ ) . '/data'
);
}

public function tearDown()
public function tearDown(): void
{
}

Expand Down
Loading