PHPStan: Fix missing requires/namespaces

This commit is contained in:
Hypolite Petovan 2017-12-17 15:24:57 -05:00
parent e40917b792
commit 10b72b0e9e
35 changed files with 89 additions and 37 deletions

View file

@ -17,8 +17,9 @@ use Friendica\Util\Lock;
use Friendica\Util\XML;
use dba;
use DOMDocument;
use DomXPath;
use DOMXPath;
require_once 'include/dba.php';
require_once 'include/threads.php';
require_once 'include/html2bbcode.php';
require_once 'include/bbcode.php';
@ -251,7 +252,7 @@ class OStatus
$doc = new DOMDocument();
@$doc->loadXML($xml);
$xpath = new DomXPath($doc);
$xpath = new DOMXPath($doc);
$xpath->registerNamespace('atom', NAMESPACE_ATOM1);
$xpath->registerNamespace('thr', NAMESPACE_THREAD);
$xpath->registerNamespace('georss', NAMESPACE_GEORSS);
@ -329,7 +330,7 @@ class OStatus
$doc = new DOMDocument();
@$doc->loadXML($xml);
$xpath = new DomXPath($doc);
$xpath = new DOMXPath($doc);
$xpath->registerNamespace('atom', NAMESPACE_ATOM1);
$xpath->registerNamespace('thr', NAMESPACE_THREAD);
$xpath->registerNamespace('georss', NAMESPACE_GEORSS);
@ -739,7 +740,7 @@ class OStatus
if (!@$doc->loadHTML($conversation_data['body'])) {
return;
}
$xpath = new DomXPath($doc);
$xpath = new DOMXPath($doc);
$links = $xpath->query('//link');
if ($links) {
@ -779,7 +780,7 @@ class OStatus
$doc = new DOMDocument();
@$doc->loadXML($xml);
$xpath = new DomXPath($doc);
$xpath = new DOMXPath($doc);
$xpath->registerNamespace('atom', NAMESPACE_ATOM1);
$xpath->registerNamespace('thr', NAMESPACE_THREAD);
$xpath->registerNamespace('ostatus', NAMESPACE_OSTATUS);
@ -929,7 +930,7 @@ class OStatus
if (!@$doc->loadHTML($related_data['body'])) {
return;
}
$xpath = new DomXPath($doc);
$xpath = new DOMXPath($doc);
$atom_file = '';