Browse Source

add missing namespaces/fix wrong class-names

pull/8134/head
nupplaPhil 4 weeks ago
parent
commit
174129af94
No account linked to committer's email address
13 changed files with 20 additions and 4 deletions
  1. +2
    -0
      doc/Addons.md
  2. +5
    -1
      doc/autoloader.md
  3. +1
    -0
      mod/fsuggest.php
  4. +1
    -0
      mod/wall_attach.php
  5. +1
    -0
      src/App/Router.php
  6. +1
    -0
      src/Core/Installer.php
  7. +1
    -0
      src/Database/DBStructure.php
  8. +1
    -1
      src/Model/Contact.php
  9. +1
    -0
      src/Module/Credits.php
  10. +1
    -0
      src/Module/Debug/Babel.php
  11. +1
    -0
      src/Module/Search/Acl.php
  12. +1
    -1
      src/Module/Settings/UserExport.php
  13. +3
    -1
      tests/Util/DbaCacheMockTrait.php

+ 2
- 0
doc/Addons.md View File

@@ -181,6 +181,8 @@ Put your tpl files in the *templates/* subfolder of your addon.
In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:

```php
use Friendica\Core\Renderer;

# load template file. first argument is the template name,
# second is the addon path relative to friendica top folder
$tpl = Renderer::getMarkupTemplate('mytemplate.tpl', __DIR__);

+ 5
- 1
doc/autoloader.md View File

@@ -47,8 +47,10 @@ The code will be something like:
// mod/network.php
<?php

use Friendica\App;

function network_content(App $a) {
$itemsmanager = new Friendica\ItemsManager();
$itemsmanager = new \Friendica\ItemsManager();
$items = $itemsmanager->getAll();

// pass $items to template
@@ -117,6 +119,8 @@ If your code is in same namespace as the class you need, you don't need to prepe

namespace Friendica;

use Friendica\Protocol\DFRN;

// this is the same content of current include/delivery.php,
// but has been declared to be in "Friendica" namespace


+ 1
- 0
mod/fsuggest.php View File

@@ -7,6 +7,7 @@ use Friendica\App;
use Friendica\Core\ACL;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use Friendica\Worker\Delivery;

+ 1
- 0
mod/wall_attach.php View File

@@ -7,6 +7,7 @@ use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Attach;
use Friendica\Model\User;
use Friendica\Util\Strings;

+ 1
- 0
src/App/Router.php View File

@@ -8,6 +8,7 @@ use FastRoute\Dispatcher;
use FastRoute\RouteCollector;
use FastRoute\RouteParser\Std;
use Friendica\Core\Hook;
use Friendica\DI;
use Friendica\Network\HTTPException;

/**

+ 1
- 0
src/Core/Installer.php View File

@@ -9,6 +9,7 @@ use Exception;
use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Database\Database;
use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Util\Images;
use Friendica\Util\Network;
use Friendica\Util\Strings;

+ 1
- 0
src/Database/DBStructure.php View File

@@ -9,6 +9,7 @@ use Exception;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;

require_once __DIR__ . '/../../include/dba.php';

+ 1
- 1
src/Model/Contact.php View File

@@ -342,7 +342,7 @@ class Contact
* @param integer $uid User ID
*
* @return integer|boolean Public contact id for given user id
* @throws Exception
* @throws \Exception
*/
public static function getPublicIdByUserId($uid)
{

+ 1
- 0
src/Module/Credits.php View File

@@ -4,6 +4,7 @@ namespace Friendica\Module;

use Friendica\BaseModule;
use Friendica\Core\Renderer;
use Friendica\DI;

/**
* Show a credits page for all the developers who helped with the project

+ 1
- 0
src/Module/Debug/Babel.php View File

@@ -5,6 +5,7 @@ namespace Friendica\Module\Debug;
use Friendica\BaseModule;
use Friendica\Content\Text;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Util\XML;


+ 1
- 0
src/Module/Search/Acl.php View File

@@ -9,6 +9,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Network\HTTPException;

+ 1
- 1
src/Module/Settings/UserExport.php View File

@@ -209,7 +209,7 @@ class UserExport extends BaseSettingsModule
* echoes account data and items as separated json, one per line
*
* @param App $a
* @throws Exception
* @throws \Exception
*/
private static function exportAll(App $a)
{

+ 3
- 1
tests/Util/DbaCacheMockTrait.php View File

@@ -2,6 +2,8 @@

namespace Friendica\Test\Util;

use Friendica\Core\Cache\Duration;

trait DbaCacheMockTrait
{
/**
@@ -30,7 +32,7 @@ trait DbaCacheMockTrait
$this->mockIsResult(['v' => $value], isset($return), $times);
}

protected function mockSet($key, $value, $ttl = Cache::FIVE_MINUTES, $time = null, $return = true, $times = null)
protected function mockSet($key, $value, $ttl = Duration::FIVE_MINUTES, $time = null, $return = true, $times = null)
{
if ($time === null) {
$time = time();

Loading…
Cancel
Save