Refactor namespaces

- Remove unused use statements
- Add required use statements
- Escape global classes
This commit is contained in:
Hypolite Petovan 2019-01-06 16:28:14 -05:00
parent 070aa016e0
commit cb3f09ae4f
48 changed files with 7 additions and 81 deletions

View file

@ -8,7 +8,6 @@ use Detection\MobileDetect;
use DOMDocument;
use DOMXPath;
use Exception;
use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Psr\Log\LoggerInterface;

View file

@ -6,7 +6,6 @@
namespace Friendica\Content;
use Friendica\Core\Protocol;
use Friendica\Content\Feature;
use Friendica\Content\Text\HTML;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;

View file

@ -9,7 +9,6 @@ namespace Friendica\Content\Text;
use Friendica\BaseObject;
use Friendica\Model\Contact;
use Michelf\MarkdownExtra;
use Friendica\Content\Text\HTML;
/**
* Friendica-specific usage of Markdown

View file

@ -4,8 +4,6 @@
*/
namespace Friendica\Content;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;

View file

@ -11,7 +11,6 @@ use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Util\Security;
/**
* TagCloud widget

View file

@ -6,7 +6,6 @@ use Friendica\Core\Cache;
use Friendica\Core\Logger;
use Exception;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Memcached;
/**

View file

@ -10,7 +10,6 @@ namespace Friendica\Core;
use Friendica\App;
use Friendica\BaseObject;
use Friendica\Core\Config;
/**
* @brief Arbitrary system configuration storage

View file

@ -2,7 +2,6 @@
namespace Friendica\Core\Console;
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Database\DBA;
use Friendica\Util\Strings;

View file

@ -7,8 +7,6 @@ use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\Installer;
use Friendica\Core\Theme;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use RuntimeException;
class AutomaticInstallation extends Console

View file

@ -6,7 +6,6 @@ namespace Friendica\Core;
use DOMDocument;
use Exception;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\Object\Image;

View file

@ -1,13 +1,12 @@
<?php
namespace Friendica\Core;
/**
* @file src/Core/Lock.php
* @brief Functions for preventing parallel execution of functions
*/
use Friendica\Core\Logger;
namespace Friendica\Core;
use Friendica\Core\Cache\CacheDriverFactory;
use Friendica\Core\Cache\IMemoryCacheDriver;

View file

@ -9,8 +9,6 @@ namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Item;

View file

@ -7,7 +7,6 @@ namespace Friendica\Core;
use Exception;
use Friendica\BaseObject;
use Friendica\Core\System;
use Friendica\Render\FriendicaSmarty;
/**

View file

@ -3,9 +3,6 @@
namespace Friendica\Core;
use Friendica\Database\DBA;
use Friendica\Core\Config;
use Friendica\Core\Logger;
/**

View file

@ -5,8 +5,6 @@
namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Util\XML;

View file

@ -7,10 +7,10 @@
namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Model\Profile;
require_once 'boot.php';
/**
* Some functions to handle themes
*/

View file

@ -5,9 +5,6 @@
namespace Friendica\Core;
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
use Friendica\Object\Image;

View file

@ -11,7 +11,6 @@ use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\ItemURI;
use Friendica\Model\PermissionSet;
use Friendica\Database\DBA;
/**
* Post update functions

View file

@ -27,7 +27,7 @@ class LegacyModule extends BaseModule
public static function setModuleFile($file_path)
{
if (!is_readable($file_path)) {
throw new Exception(Core\L10n::t('Legacy module file not found: %s', $file_path));
throw new \Exception(Core\L10n::t('Legacy module file not found: %s', $file_path));
}
self::$moduleName = basename($file_path, '.php');

View file

@ -8,7 +8,6 @@ namespace Friendica\Model;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBA;
use Friendica\Model\Item;
/**
* @brief This class handles FileTag related functions

View file

@ -10,7 +10,6 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Util\Security;
/**
* @brief functions for interacting with the group database table

View file

@ -20,15 +20,6 @@ use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Event;
use Friendica\Model\FileTag;
use Friendica\Model\PermissionSet;
use Friendica\Model\Term;
use Friendica\Model\ItemURI;
use Friendica\Model\Photo;
use Friendica\Model\Attach;
use Friendica\Object\Image;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\OStatus;
use Friendica\Util\DateTimeFormat;

View file

@ -10,7 +10,6 @@ use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;

View file

@ -220,7 +220,7 @@ class Photo extends BaseObject
$fields = self::getFields();
$values = array_fill(0, count($fields), "");
$photo = array_combine($fields, $values);
$photo["backend-class"] = \Friendica\Model\Storage\SystemResource::class;
$photo["backend-class"] = Storage\SystemResource::class;
$photo["backend-ref"] = $filename;
$photo["type"] = $mimetype;
$photo["cacheable"] = false;

View file

@ -20,7 +20,6 @@ use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;

View file

@ -8,7 +8,6 @@ namespace Friendica\Model\Storage;
use Friendica\Core\Logger;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBA;
/**

View file

@ -16,7 +16,6 @@ use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
use Friendica\Object\Image;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;

View file

@ -18,7 +18,6 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model;
use Friendica\Module\Login;
use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;

View file

@ -9,7 +9,6 @@ use Friendica\Protocol\ActivityPub;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Util\HTTPSignature;
use Friendica\Core\Logger;
/**
* ActivityPub Inbox

View file

@ -4,8 +4,6 @@ namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\Core;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;

View file

@ -10,10 +10,6 @@ use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Model\Photo as MPhoto;
use Friendica\Object\Image;
use Friendica\Util\Security;
use Friendica\Network\HTTPException\NotFoundException;
use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Network\HTTPException\InternalServerErrorException;
/**
* @brief Photo Module

View file

@ -5,15 +5,11 @@
*/
namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;

View file

@ -12,7 +12,6 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Photo;
use Friendica\Util\Network;
use Exception;

View file

@ -16,7 +16,6 @@ use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Conversation;
use Friendica\Model\Item;
use Friendica\Model\Term;
use Friendica\Util\Crypto;

View file

@ -7,7 +7,6 @@ namespace Friendica\Object;
use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Object\Post;
use Friendica\Util\Security;
/**

View file

@ -4,6 +4,7 @@
*/
namespace Friendica\Protocol;
use Friendica\Util\JsonLD;
use Friendica\Util\Network;
use Friendica\Core\Protocol;
use Friendica\Model\APContact;

View file

@ -9,7 +9,6 @@ use Friendica\Content\Text\HTML;
use Friendica\Core\Config;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Model\Conversation;
use Friendica\Model\Contact;
use Friendica\Model\APContact;
use Friendica\Model\Item;

View file

@ -21,7 +21,6 @@ use Friendica\Content\Text\BBCode;
use Friendica\Util\JsonLD;
use Friendica\Util\LDSignature;
use Friendica\Model\Profile;
use Friendica\Core\Config;
use Friendica\Object\Image;
use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Diaspora;

View file

@ -6,7 +6,6 @@ namespace Friendica\Protocol;
use Friendica\Core\Logger;
use Friendica\Content\Text\HTML;
use Friendica\Core\Protocol;
use Friendica\Model\Item;
/**

View file

@ -5,14 +5,10 @@
*/
namespace Friendica\Util;
use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\Model\User;
use Friendica\Model\APContact;
use Friendica\Protocol\ActivityPub;
use Friendica\Util\DateTimeFormat;
/**
* @brief Implements HTTP Signatures per draft-cavage-http-signatures-07.

View file

@ -3,9 +3,6 @@
namespace Friendica\Util;
use Friendica\Core\Logger;
use Friendica\Util\JsonLD;
use Friendica\Util\DateTimeFormat;
use Friendica\Protocol\ActivityPub;
use Friendica\Model\APContact;
/**

View file

@ -2,11 +2,9 @@
namespace Friendica\Util;
use Friendica\BaseModule;
use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Util\Strings;
/**
* @brief Proxy utilities class

View file

@ -9,9 +9,6 @@ use Friendica\BaseObject;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Core\L10n;
use Friendica\Model\PermissionSet;
use Friendica\Core\System;
/**
* Secures that User is allow to do requests

View file

@ -8,7 +8,6 @@ namespace Friendica\Util;
use DateTime;
use DateTimeZone;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;

View file

@ -9,7 +9,6 @@ use Friendica\Core\Logger;
use Friendica\Core\Worker;
use Friendica\Model\ItemDeliveryData;
use Friendica\Protocol\ActivityPub;
use Friendica\Model\Item;
use Friendica\Util\HTTPSignature;
class APDelivery extends BaseObject

View file

@ -5,7 +5,6 @@
*/
namespace Friendica\Worker;
use Friendica\Core\Config;
use Friendica\Core\Update;
class DBUpdate

View file

@ -5,7 +5,6 @@
namespace Friendica\Worker;
use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;

View file

@ -5,7 +5,6 @@
*/
namespace Friendica\Worker;
use Friendica\Core\Config;
use Friendica\Core\Logger;
use Friendica\Model\Item;