Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- Several `npm run` scripts were renamed for consistency: `analyse:server` → `check:server:phpstan`, `cs:server` → `check:server:cs`, `lint:server` → `check:server:lint`. ([#1494](https://github.com/fossar/selfoss/pull/1494))
- Front-end code was converted to TypeScript. ([#1457](https://github.com/fossar/selfoss/pull/1457))
- Last use of [F3 framework](https://fatfreeframework.com) was removed. So long… ([#1298](https://github.com/fossar/selfoss/pull/1298))
- All non-spout classes were moved to a single PSR-4 namespace: `Selfoss\`. ([#1532](https://github.com/fossar/selfoss/pull/1532))

### API changes

Expand Down
4 changes: 2 additions & 2 deletions cliupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

use helpers\UpdateVisitor;
use Psr\Container\ContainerInterface;
use Selfoss\helpers\UpdateVisitor;

chdir(__DIR__);
require __DIR__ . '/src/common.php';

/** @var ContainerInterface $container */
$loader = $container->get(helpers\ContentLoader::class);
$loader = $container->get(Selfoss\helpers\ContentLoader::class);
$updateVisitor = new class implements UpdateVisitor {
public function started(int $count): void {
}
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@
],
"autoload": {
"psr-4": {
"controllers\\": "src/controllers/",
"daos\\": "src/daos/",
"helpers\\": "src/helpers/",
"spouts\\": "src/spouts/",
"Selfoss\\": "src/",
"Tests\\": "tests/"
}
},
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);

use Psr\Container\ContainerInterface;
use Selfoss\controllers;

require __DIR__ . '/src/common.php';

Expand Down
16 changes: 9 additions & 7 deletions src/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

declare(strict_types=1);

use helpers\Configuration;
use helpers\DatabaseConnection;
use helpers\WebClient;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\ErrorLogHandler;
use Monolog\Handler\NullHandler;
Expand All @@ -13,6 +10,11 @@
use Psr\Container\ContainerInterface;
use Psr\Http\Client\ClientInterface;
use Psr\SimpleCache\CacheInterface;
use Selfoss\daos;
use Selfoss\helpers;
use Selfoss\helpers\Configuration;
use Selfoss\helpers\DatabaseConnection;
use Selfoss\helpers\WebClient;
use Slince\Di\Container;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;
Expand Down Expand Up @@ -97,19 +99,19 @@ function boot_error(string $message): never {

// Choose database implementation based on config
$container
->register(daos\DatabaseInterface::class, 'daos\\' . $configuration->dbType . '\\Database')
->register(daos\DatabaseInterface::class, 'Selfoss\daos\\' . $configuration->dbType . '\\Database')
->setShared(true)
;
$container
->register(daos\ItemsInterface::class, 'daos\\' . $configuration->dbType . '\\Items')
->register(daos\ItemsInterface::class, 'Selfoss\daos\\' . $configuration->dbType . '\\Items')
->setShared(true)
;
$container
->register(daos\SourcesInterface::class, 'daos\\' . $configuration->dbType . '\\Sources')
->register(daos\SourcesInterface::class, 'Selfoss\daos\\' . $configuration->dbType . '\\Sources')
->setShared(true)
;
$container
->register(daos\TagsInterface::class, 'daos\\' . $configuration->dbType . '\\Tags')
->register(daos\TagsInterface::class, 'Selfoss\daos\\' . $configuration->dbType . '\\Tags')
->setShared(true)
;

Expand Down
8 changes: 4 additions & 4 deletions src/controllers/About.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace controllers;
namespace Selfoss\controllers;

use helpers\Authentication;
use helpers\Configuration;
use helpers\View;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\Configuration;
use Selfoss\helpers\View;

/**
* Controller for instance information API
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace controllers;
namespace Selfoss\controllers;

use helpers\Authentication\AuthenticationService;
use helpers\View;
use Selfoss\helpers\Authentication\AuthenticationService;
use Selfoss\helpers\View;

/**
* Controller for user related tasks
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/Helpers/HashPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace controllers\Helpers;
namespace Selfoss\controllers\Helpers;

use helpers\Authentication;
use helpers\View;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\View;

/**
* Controller for user related tasks
Expand Down
19 changes: 10 additions & 9 deletions src/controllers/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

declare(strict_types=1);

namespace controllers;
namespace Selfoss\controllers;

use Bramus\Router\Router;
use daos\ItemOptions;
use helpers\Authentication;
use helpers\StringKeyedArray;
use helpers\View;
use helpers\ViewHelper;
use Selfoss\daos;
use Selfoss\daos\ItemOptions;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\StringKeyedArray;
use Selfoss\helpers\View;
use Selfoss\helpers\ViewHelper;

/**
* Controller for root
Expand All @@ -21,11 +22,11 @@
final readonly class Index {
public function __construct(
private Authentication $authentication,
private \daos\Items $itemsDao,
private daos\Items $itemsDao,
private Router $router,
private \daos\Sources $sourcesDao,
private daos\Sources $sourcesDao,
private Tags $tagsController,
private \daos\Tags $tagsDao,
private daos\Tags $tagsDao,
private View $view,
private ViewHelper $viewHelper
) {
Expand Down
14 changes: 7 additions & 7 deletions src/controllers/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace controllers;
namespace Selfoss\controllers;

use daos\ItemOptions;
use DateTimeInterface;
use helpers\Authentication;
use helpers\Misc;
use helpers\Request;
use helpers\View;
use InvalidArgumentException;
use Selfoss\daos\ItemOptions;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\Misc;
use Selfoss\helpers\Request;
use Selfoss\helpers\View;

/**
* Controller for item handling
Expand All @@ -22,7 +22,7 @@
final readonly class Items {
public function __construct(
private Authentication $authentication,
private \daos\Items $itemsDao,
private \Selfoss\daos\Items $itemsDao,
private Request $request,
private View $view
) {
Expand Down
13 changes: 7 additions & 6 deletions src/controllers/Items/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

declare(strict_types=1);

namespace controllers\Items;
namespace Selfoss\controllers\Items;

use helpers\Authentication;
use helpers\View;
use Selfoss\daos;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\View;

/**
* Controller for viewing item statistics
*/
final readonly class Stats {
public function __construct(
private Authentication $authentication,
private \daos\Items $itemsDao,
private \daos\Sources $sourcesDao,
private \daos\Tags $tagsDao,
private daos\Items $itemsDao,
private daos\Sources $sourcesDao,
private daos\Tags $tagsDao,
private View $view
) {
}
Expand Down
21 changes: 11 additions & 10 deletions src/controllers/Items/Sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

declare(strict_types=1);

namespace controllers\Items;
namespace Selfoss\controllers\Items;

use helpers\Authentication;
use helpers\Configuration;
use function helpers\json_response;
use helpers\View;
use helpers\ViewHelper;
use Selfoss\daos;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\Configuration;
use function Selfoss\helpers\json_response;
use Selfoss\helpers\View;
use Selfoss\helpers\ViewHelper;

/**
* Controller for synchronizing item statuses
Expand All @@ -17,10 +18,10 @@
public function __construct(
private Authentication $authentication,
private Configuration $configuration,
private \daos\Items $itemsDao,
private \daos\Sources $sourcesDao,
private \controllers\Tags $tagsController,
private \daos\Tags $tagsDao,
private daos\Items $itemsDao,
private daos\Sources $sourcesDao,
private \Selfoss\controllers\Tags $tagsController,
private daos\Tags $tagsDao,
private View $view,
private ViewHelper $viewHelper
) {
Expand Down
15 changes: 8 additions & 7 deletions src/controllers/Opml/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

declare(strict_types=1);

namespace controllers\Opml;
namespace Selfoss\controllers\Opml;

use helpers\Authentication;
use helpers\Configuration;
use helpers\SpoutLoader;
use helpers\StringKeyedArray;
use Monolog\Logger;
use Selfoss\daos;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\Configuration;
use Selfoss\helpers\SpoutLoader;
use Selfoss\helpers\StringKeyedArray;

/**
* OPML loading and exporting controller
Expand All @@ -23,9 +24,9 @@ public function __construct(
private Authentication $authentication,
private Configuration $configuration,
private Logger $logger,
private \daos\Sources $sourcesDao,
private daos\Sources $sourcesDao,
private SpoutLoader $spoutLoader,
private \daos\Tags $tagsDao,
private daos\Tags $tagsDao,
private \XMLWriter $writer
) {
}
Expand Down
11 changes: 6 additions & 5 deletions src/controllers/Opml/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

declare(strict_types=1);

namespace controllers\Opml;
namespace Selfoss\controllers\Opml;

use helpers\Authentication;
use helpers\View;
use Monolog\Logger;
use Selfoss\daos;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\View;
use SimpleXMLElement;

/**
Expand All @@ -25,8 +26,8 @@ final class Import {
public function __construct(
private readonly Authentication $authentication,
private readonly Logger $logger,
private readonly \daos\Sources $sourcesDao,
private readonly \daos\Tags $tagsDao,
private readonly daos\Sources $sourcesDao,
private readonly daos\Tags $tagsDao,
private readonly View $view
) {
}
Expand Down
15 changes: 8 additions & 7 deletions src/controllers/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

declare(strict_types=1);

namespace controllers;
namespace Selfoss\controllers;

use daos\ItemOptions;
use FeedWriter\RSS2;
use helpers\Authentication;
use helpers\Configuration;
use helpers\View;
use Selfoss\daos;
use Selfoss\daos\ItemOptions;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\Configuration;
use Selfoss\helpers\View;

/**
* Controller for rss access
Expand All @@ -22,8 +23,8 @@ public function __construct(
private Authentication $authentication,
private Configuration $configuration,
private RSS2 $feedWriter,
private \daos\Items $itemsDao,
private \daos\Sources $sourcesDao,
private daos\Items $itemsDao,
private daos\Sources $sourcesDao,
private View $view
) {
}
Expand Down
15 changes: 8 additions & 7 deletions src/controllers/Sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

declare(strict_types=1);

namespace controllers;
namespace Selfoss\controllers;

use helpers\Authentication;
use helpers\Misc;
use helpers\SpoutLoader;
use helpers\View;
use InvalidArgumentException;
use Selfoss\daos;
use Selfoss\helpers\Authentication;
use Selfoss\helpers\Misc;
use Selfoss\helpers\SpoutLoader;
use Selfoss\helpers\View;

/**
* Controller for sources handling
Expand All @@ -20,9 +21,9 @@
final readonly class Sources {
public function __construct(
private Authentication $authentication,
private \daos\Sources $sourcesDao,
private daos\Sources $sourcesDao,
private SpoutLoader $spoutLoader,
private \daos\Tags $tagsDao,
private daos\Tags $tagsDao,
private View $view
) {
}
Expand Down
Loading