diff --git a/composer.lock b/composer.lock index af9186e8d..1555bc9be 100644 --- a/composer.lock +++ b/composer.lock @@ -720,11 +720,11 @@ }, { "name": "friendica/json-ld", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://git.friendi.ca/friendica/php-json-ld", - "reference": "5f6ea87b261d346e57f03457ae906e6835f0205f" + "reference": "8d1d421b1dfd493adc058a79541a257d4bfadb01" }, "require": { "ext-json": "*", @@ -760,7 +760,7 @@ "Semantic Web", "jsonld" ], - "time": "2023-02-20T21:56:16+00:00" + "time": "2023-05-23T05:58:06+00:00" }, { "name": "fxp/composer-asset-plugin", diff --git a/src/Collection/Api/Notifications.php b/src/Collection/Api/Notifications.php index c2ccf2cff..4bb1eaa56 100644 --- a/src/Collection/Api/Notifications.php +++ b/src/Collection/Api/Notifications.php @@ -29,6 +29,7 @@ class Notifications extends BaseCollection /** * @return Notification */ + #[\ReturnTypeWillChange] public function current() { return parent::current(); diff --git a/src/Object/Api/Twitter/User.php b/src/Object/Api/Twitter/User.php index 60a7f9818..3ad5c5461 100644 --- a/src/Object/Api/Twitter/User.php +++ b/src/Object/Api/Twitter/User.php @@ -24,8 +24,8 @@ namespace Friendica\Object\Api\Twitter; use Friendica\BaseDataTransferObject; use Friendica\Content\ContactSelector; use Friendica\Content\Text\BBCode; -use Friendica\Core\Protocol; use Friendica\Model\Contact; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Util\DateTimeFormat; use Friendica\Util\Proxy; @@ -82,6 +82,42 @@ class User extends BaseDataTransferObject protected $withheld_in_countries; /** @var string */ protected $withheld_scope; + /** @var string */ + protected $profile_image_url; + /** @var bool */ + protected $follow_request_sent; + /** @var string */ + protected $profile_image_url_large; + /** @var string */ + protected $profile_image_url_profile_size; + /** @var int */ + protected $utc_offset; + /** @var string */ + protected $time_zone; + /** @var bool */ + protected $geo_enabled; + /** @var null */ + protected $lang; + /** @var bool */ + protected $contributors_enabled; + /** @var bool */ + protected $is_translator; + /** @var bool */ + protected $is_translation_enabled; + /** @var bool */ + protected $following; + /** @var bool */ + protected $statusnet_blocking; + /** @var bool */ + protected $notifications; + /** @var int */ + protected $uid; + /** @var int */ + protected $pid; + /** @var int */ + protected $cid; + /** @var mixed */ + protected $statusnet_profile_url; /** * Missing fields: @@ -95,11 +131,12 @@ class User extends BaseDataTransferObject * @param array $publicContact Full contact table record with uid = 0 * @param array $apcontact Optional full apcontact table record * @param array $userContact Optional full contact table record with uid != 0 - * @param bool $skip_status Whether to remove the last status property, currently unused + * @param null $status * @param bool $include_user_entities Whether to add the entities property - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * + * @throws InternalServerErrorException */ - public function __construct(array $publicContact, array $apcontact = [], array $userContact = [], $status = null, $include_user_entities = true) + public function __construct(array $publicContact, array $apcontact = [], array $userContact = [], $status = null, bool $include_user_entities = true) { $uid = $userContact['uid'] ?? 0; diff --git a/src/Util/ACLFormatter.php b/src/Util/ACLFormatter.php index f7a0894e1..cd398fc28 100644 --- a/src/Util/ACLFormatter.php +++ b/src/Util/ACLFormatter.php @@ -35,7 +35,7 @@ final class ACLFormatter * * @return array The array based on the IDs (empty in case there is no list) */ - public function expand(string $acl_string = null) + public function expand(string $acl_string = null): array { // In case there is no ID list, return empty array (=> no ACL set) if (empty($acl_string)) { @@ -55,7 +55,7 @@ final class ACLFormatter * @param string|null $acl_string * @return string */ - public function sanitize(string $acl_string = null) + public function sanitize(string $acl_string = null): string { if (empty($acl_string)) { return ''; @@ -107,10 +107,13 @@ final class ACLFormatter * * @return string */ - function toString($permissions) { + function toString($permissions): string + { $return = ''; if (is_array($permissions)) { $item = $permissions; + } elseif (empty($permissions)) { + return ''; } else { $item = explode(',', $permissions); } diff --git a/src/Util/ReversedFileReader.php b/src/Util/ReversedFileReader.php index fdd15bec9..58fb2cb3f 100644 --- a/src/Util/ReversedFileReader.php +++ b/src/Util/ReversedFileReader.php @@ -89,7 +89,7 @@ class ReversedFileReader implements \Iterator * * @return string|null Depending on data being buffered */ - private function _readline() + private function _readline(): ?string { $buffer = & $this->buffer; while (true) { @@ -112,6 +112,7 @@ class ReversedFileReader implements \Iterator * @see Iterator::next() * @return void */ + #[\ReturnTypeWillChange] public function next() { ++$this->key; @@ -124,6 +125,7 @@ class ReversedFileReader implements \Iterator * @see Iterator::rewind() * @return void */ + #[\ReturnTypeWillChange] public function rewind() { if ($this->filesize > 0) { diff --git a/src/Util/XML.php b/src/Util/XML.php index e5fa4009f..c35f19b8a 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -118,7 +118,7 @@ class XML $namespace = null; } - $element->addAttribute($attr_key, $attr_value, $namespace); + $element->addAttribute($attr_key, $attr_value ?? '', $namespace); } continue; diff --git a/tests/Util/Database/StaticDatabase.php b/tests/Util/Database/StaticDatabase.php index be2ec99f0..3ae497e9a 100644 --- a/tests/Util/Database/StaticDatabase.php +++ b/tests/Util/Database/StaticDatabase.php @@ -60,7 +60,6 @@ class StaticDatabase extends Database $this->driver = 'pdo'; $this->connection = self::$staticConnection; $this->connected = true; - $this->emulate_prepares = false; return $this->connected; } diff --git a/tests/Util/Intercept.php b/tests/Util/Intercept.php index 27b558fc5..483d274fc 100644 --- a/tests/Util/Intercept.php +++ b/tests/Util/Intercept.php @@ -37,7 +37,7 @@ class Intercept extends php_user_filter public static $cache = ''; /** @noinspection PhpMissingParentCallCommonInspection */ - public function filter($in, $out, &$consumed, $closing) + public function filter($in, $out, &$consumed, $closing): int { while ($bucket = stream_bucket_make_writeable($in)) { self::$cache .= $bucket->data; diff --git a/tests/src/App/BaseURLTest.php b/tests/src/App/BaseURLTest.php index e45b30b20..fb79fd4d3 100644 --- a/tests/src/App/BaseURLTest.php +++ b/tests/src/App/BaseURLTest.php @@ -178,7 +178,7 @@ class BaseURLTest extends MockedTest public function testRedirectException() { self::expectException(InternalServerErrorException::class); - self::expectErrorMessage('https://friendica.other is not a relative path, please use System::externalRedirect'); + self::expectExceptionMessage('https://friendica.other is not a relative path, please use System::externalRedirect'); $config = new ReadOnlyFileConfig(new Cache([ 'system' => [ diff --git a/tests/src/Content/Text/BBCodeTest.php b/tests/src/Content/Text/BBCodeTest.php index 889b12caa..fc8fd4bff 100644 --- a/tests/src/Content/Text/BBCodeTest.php +++ b/tests/src/Content/Text/BBCodeTest.php @@ -28,6 +28,9 @@ use Friendica\Test\FixtureTest; class BBCodeTest extends FixtureTest { + /** @var \HTMLPurifier */ + public $HTMLPurifier; + protected function setUp(): void { parent::setUp(); diff --git a/tests/src/Database/DatabaseTest.php b/tests/src/Database/DatabaseTest.php index e90683461..c431a5294 100644 --- a/tests/src/Database/DatabaseTest.php +++ b/tests/src/Database/DatabaseTest.php @@ -30,6 +30,15 @@ class DatabaseTest extends FixtureTest { use CreateDatabaseTrait; + /** + * @var Cache + */ + protected $configCache; + /** + * @var ConfigFileManager + */ + protected $configFileManager; + protected function setUp(): void { $this->setUpVfsDir(); diff --git a/tests/src/Model/User/CookieTest.php b/tests/src/Model/User/CookieTest.php index 372645bf3..ebe78764b 100644 --- a/tests/src/Model/User/CookieTest.php +++ b/tests/src/Model/User/CookieTest.php @@ -231,11 +231,12 @@ class CookieTest extends MockedTest $data = json_decode(StaticCookie::$_COOKIE[Cookie::NAME]); - self::assertObjectHasAttribute('uid', $data); + self::assertIsObject($data); + self::assertTrue(property_exists($data, 'uid')); self::assertEquals($uid, $data->uid); - self::assertObjectHasAttribute('hash', $data); + self::assertTrue(property_exists($data, 'hash')); self::assertEquals($hash, $data->hash); - self::assertObjectHasAttribute('ip', $data); + self::assertTrue(property_exists($data, 'ip')); self::assertEquals($remoteIp, $data->ip); self::assertLessThanOrEqual(time() + Cookie::DEFAULT_EXPIRE * 24 * 60 * 60, StaticCookie::$_EXPIRE);