Browse Source

Refactor namespaces

- Remove unused use statements
- Add required use statements
- Escape global classes
pull/6482/head
Hypolite Petovan 3 years ago
parent
commit
cb3f09ae4f
  1. 1
      src/App.php
  2. 1
      src/Content/ForumManager.php
  3. 1
      src/Content/Text/Markdown.php
  4. 2
      src/Content/Widget.php
  5. 1
      src/Content/Widget/TagCloud.php
  6. 1
      src/Core/Cache/MemcachedCacheDriver.php
  7. 1
      src/Core/Config.php
  8. 1
      src/Core/Console/ArchiveContact.php
  9. 2
      src/Core/Console/AutomaticInstallation.php
  10. 1
      src/Core/Installer.php
  11. 5
      src/Core/Lock.php
  12. 2
      src/Core/NotificationsManager.php
  13. 1
      src/Core/Renderer.php
  14. 3
      src/Core/StorageManager.php
  15. 2
      src/Core/System.php
  16. 4
      src/Core/Theme.php
  17. 3
      src/Core/UserImport.php
  18. 1
      src/Database/PostUpdate.php
  19. 2
      src/LegacyModule.php
  20. 1
      src/Model/FileTag.php
  21. 1
      src/Model/Group.php
  22. 9
      src/Model/Item.php
  23. 1
      src/Model/Mail.php
  24. 2
      src/Model/Photo.php
  25. 1
      src/Model/Profile.php
  26. 1
      src/Model/Storage/Database.php
  27. 1
      src/Model/User.php
  28. 1
      src/Module/Contact.php
  29. 1
      src/Module/Inbox.php
  30. 2
      src/Module/Install.php
  31. 4
      src/Module/Photo.php
  32. 4
      src/Module/Proxy.php
  33. 1
      src/Object/Image.php
  34. 1
      src/Object/Post.php
  35. 1
      src/Object/Thread.php
  36. 1
      src/Protocol/ActivityPub.php
  37. 1
      src/Protocol/ActivityPub/Processor.php
  38. 1
      src/Protocol/ActivityPub/Transmitter.php
  39. 1
      src/Protocol/Email.php
  40. 4
      src/Util/HTTPSignature.php
  41. 3
      src/Util/LDSignature.php
  42. 2
      src/Util/Proxy.php
  43. 3
      src/Util/Security.php
  44. 1
      src/Util/Temporal.php
  45. 1
      src/Worker/APDelivery.php
  46. 1
      src/Worker/DBUpdate.php
  47. 1
      src/Worker/PubSubPublish.php
  48. 1
      src/Worker/SpoolPost.php

1
src/App.php

@ -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;

1
src/Content/ForumManager.php

@ -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;

1
src/Content/Text/Markdown.php

@ -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

2
src/Content/Widget.php

@ -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;

1
src/Content/Widget/TagCloud.php

@ -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

1
src/Core/Cache/MemcachedCacheDriver.php

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

1
src/Core/Config.php

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

1
src/Core/Console/ArchiveContact.php

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

2
src/Core/Console/AutomaticInstallation.php

@ -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

1
src/Core/Installer.php

@ -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;

5
src/Core/Lock.php

@ -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;

2
src/Core/NotificationsManager.php

@ -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;

1
src/Core/Renderer.php

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

3
src/Core/StorageManager.php

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

2
src/Core/System.php

@ -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;

4
src/Core/Theme.php

@ -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
*/

3
src/Core/UserImport.php

@ -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;

1
src/Database/PostUpdate.php

@ -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

2
src/LegacyModule.php

@ -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');

1
src/Model/FileTag.php

@ -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

1
src/Model/Group.php

@ -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

9
src/Model/Item.php

@ -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;

1
src/Model/Mail.php

@ -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;

2
src/Model/Photo.php

@ -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;

1
src/Model/Profile.php

@ -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;

1
src/Model/Storage/Database.php

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

1
src/Model/User.php

@ -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;

1
src/Module/Contact.php

@ -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;

1
src/Module/Inbox.php

@ -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

2
src/Module/Install.php

@ -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;

4
src/Module/Photo.php

@ -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

4
src/Module/Proxy.php

@ -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;

1
src/Object/Image.php

@ -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;

1
src/Object/Post.php

@ -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;

1
src/Object/Thread.php

@ -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;
/**

1
src/Protocol/ActivityPub.php

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

1
src/Protocol/ActivityPub/Processor.php

@ -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;

1
src/Protocol/ActivityPub/Transmitter.php

@ -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;

1
src/Protocol/Email.php

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

4
src/Util/HTTPSignature.php

@ -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.

3
src/Util/LDSignature.php

@ -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;
/**

2
src/Util/Proxy.php

@ -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

3
src/Util/Security.php

@ -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

1
src/Util/Temporal.php

@ -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;

1
src/Worker/APDelivery.php

@ -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

1
src/Worker/DBUpdate.php

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

1
src/Worker/PubSubPublish.php

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

1
src/Worker/SpoolPost.php

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

Loading…
Cancel
Save