]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/PortableContact.php
Update more PHPDoc, including in include/
[friendica.git] / src / Protocol / PortableContact.php
index f446461f669c6b065548283e97c56dae8cf0b3a8..da42a057edcc4b1951e9b49e8d4fa2c53198c77d 100644 (file)
@@ -44,7 +44,7 @@ class PortableContact
         * Once the global contact is stored add (if necessary) the contact linkage which associates
         * the given uid, cid to the global contact entry. There can be many uid/cid combinations
         * pointing to the same global contact id.
-        *
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function loadWorker($cid, $uid = 0, $zcid = 0, $url = null)
        {
@@ -59,11 +59,11 @@ class PortableContact
         * @param integer $uid  User ID
         * @param integer $zcid Global Contact ID
         * @param integer $url  POCO address that should be polled
-        *
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function load($cid, $uid, $zcid, $url)
        {
-               $a = get_app();
+               $a = \get_app();
 
                if ($cid) {
                        if (!$url || !$uid) {
@@ -334,7 +334,7 @@ class PortableContact
                        $server_url = Strings::normaliseLink(self::detectServer($profile));
                }
 
-               if (!in_array($gcontacts[0]["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::FEED, Protocol::OSTATUS, ""])) {
+               if (!in_array($gcontacts[0]["network"], [Protocol::DFRN, Protocol::DIASPORA, Protocol::FEED, Protocol::OSTATUS, ""])) {
                        Logger::log("Profile ".$profile.": Network type ".$gcontacts[0]["network"]." can't be checked", Logger::DEBUG);
                        return false;
                }
@@ -643,6 +643,7 @@ class PortableContact
         *
         * @param string $server_url address of the server
         * @return array Server data
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function fetchNodeinfo($server_url)
        {
@@ -696,6 +697,7 @@ class PortableContact
         *
         * @param string $nodeinfo_url address of the nodeinfo path
         * @return array Server data
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function parseNodeinfo1($nodeinfo_url)
        {
@@ -780,6 +782,7 @@ class PortableContact
         *
         * @param string $nodeinfo_url address of the nodeinfo path
         * @return array Server data
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function parseNodeinfo2($nodeinfo_url)
        {
@@ -1376,7 +1379,7 @@ class PortableContact
                                        $info = defaults($data, 'info', '');
                                        $register_policy = defaults($data, 'register_policy', REGISTER_CLOSED);
                                        if (in_array($register_policy, ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) {
-                                               $register_policy = constant($data['register_policy']);
+                                               $register_policy = constant($register_policy);
                                        } else {
                                                Logger::log("Register policy '$register_policy' from $server_url is invalid.");
                                                $register_policy = REGISTER_CLOSED; // set a default value
@@ -1444,6 +1447,7 @@ class PortableContact
         * @brief Fetch relay data from a given server url
         *
         * @param string $server_url address of the server
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function discoverRelay($server_url)
        {
@@ -1518,6 +1522,7 @@ class PortableContact
        /**
         * @brief Returns a list of all known servers
         * @return array List of server urls
+        * @throws Exception
         */
        public static function serverlist()
        {
@@ -1542,6 +1547,7 @@ class PortableContact
         * @brief Fetch server list from remote servers and adds them when they are new.
         *
         * @param string $poco URL to the POCO endpoint
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function fetchServerlist($poco)
        {