Skip to content

Commit

Permalink
Merge "Re-enable Phan and fix warnings for `data-model-serialization'"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Mar 3, 2025
2 parents bd2f9cf + 9db2aaa commit 5ee4370
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
$cfg['exclude_analysis_directory_list'] = array_merge(
$cfg['exclude_analysis_directory_list'],
[
'lib/packages/wikibase/data-model-serialization/src/',
'lib/packages/wikibase/data-model-services/src/',
'lib/packages/wikibase/internal-serialization/src/',
'../../extensions/Babel/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function needsDataTypeLookup( string $valueType ): bool {
array_keys( $this->dataTypeToValueTypeMap, $valueType, true )
);

return !empty( array_intersect( $possibleDataTypeKeys, array_keys( $this->deserializerBuilders ) ) );
return array_intersect( $possibleDataTypeKeys, array_keys( $this->deserializerBuilders ) ) !== [];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct( AliasGroupSerializer $aliasGroupSerializer, bool $u

/**
* @param AliasGroupList $object
* @return array|::stdClass
* @return array|\stdClass
*/
public function serialize( $object ) {
$this->assertIsSerializerFor( $object );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct( bool $useObjectsForEmptyMaps ) {
* @return array|\stdClass
*/
protected function serializeMap( array $serialization ) {
if ( $this->useObjectsForEmptyMaps && empty( $serialization ) ) {
if ( $this->useObjectsForEmptyMaps && $serialization === [] ) {
$serialization = (object)$serialization;
}

Expand Down

0 comments on commit 5ee4370

Please sign in to comment.