Skip to content

Commit aa1836e

Browse files
committed
Move non-spouts to Selfoss namespace
Simplifies PSR-4 definition.
1 parent 266d768 commit aa1836e

File tree

97 files changed

+269
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+269
-268
lines changed

cliupdate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
declare(strict_types=1);
44

5-
use helpers\UpdateVisitor;
65
use Psr\Container\ContainerInterface;
6+
use Selfoss\helpers\UpdateVisitor;
77

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

1111
/** @var ContainerInterface $container */
12-
$loader = $container->get(helpers\ContentLoader::class);
12+
$loader = $container->get(Selfoss\helpers\ContentLoader::class);
1313
$updateVisitor = new class implements UpdateVisitor {
1414
public function started(int $count): void {
1515
}

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
],
4646
"autoload": {
4747
"psr-4": {
48-
"controllers\\": "src/controllers/",
49-
"daos\\": "src/daos/",
50-
"helpers\\": "src/helpers/",
5148
"spouts\\": "src/spouts/",
49+
"Selfoss\\": "src/",
5250
"Tests\\": "tests/"
5351
}
5452
},

index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare(strict_types=1);
44

55
use Psr\Container\ContainerInterface;
6+
use Selfoss\controllers;
67

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

src/common.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
declare(strict_types=1);
44

5-
use helpers\Configuration;
6-
use helpers\DatabaseConnection;
7-
use helpers\WebClient;
85
use Monolog\Formatter\LineFormatter;
96
use Monolog\Handler\ErrorLogHandler;
107
use Monolog\Handler\NullHandler;
@@ -13,6 +10,11 @@
1310
use Psr\Container\ContainerInterface;
1411
use Psr\Http\Client\ClientInterface;
1512
use Psr\SimpleCache\CacheInterface;
13+
use Selfoss\daos;
14+
use Selfoss\helpers;
15+
use Selfoss\helpers\Configuration;
16+
use Selfoss\helpers\DatabaseConnection;
17+
use Selfoss\helpers\WebClient;
1618
use Slince\Di\Container;
1719
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1820
use Symfony\Component\Cache\Psr16Cache;

src/controllers/About.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace controllers;
5+
namespace Selfoss\controllers;
66

7-
use helpers\Authentication;
8-
use helpers\Configuration;
9-
use helpers\View;
7+
use Selfoss\helpers\Authentication;
8+
use Selfoss\helpers\Configuration;
9+
use Selfoss\helpers\View;
1010

1111
/**
1212
* Controller for instance information API

src/controllers/Authentication.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace controllers;
5+
namespace Selfoss\controllers;
66

7-
use helpers\Authentication\AuthenticationService;
8-
use helpers\View;
7+
use Selfoss\helpers\Authentication\AuthenticationService;
8+
use Selfoss\helpers\View;
99

1010
/**
1111
* Controller for user related tasks

src/controllers/Helpers/HashPassword.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace controllers\Helpers;
5+
namespace Selfoss\controllers\Helpers;
66

7-
use helpers\Authentication;
8-
use helpers\View;
7+
use Selfoss\helpers\Authentication;
8+
use Selfoss\helpers\View;
99

1010
/**
1111
* Controller for user related tasks

src/controllers/Index.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace controllers;
5+
namespace Selfoss\controllers;
66

77
use Bramus\Router\Router;
8-
use daos\ItemOptions;
9-
use helpers\Authentication;
10-
use helpers\StringKeyedArray;
11-
use helpers\View;
12-
use helpers\ViewHelper;
8+
use Selfoss\daos\ItemOptions;
9+
use Selfoss\helpers\Authentication;
10+
use Selfoss\helpers\StringKeyedArray;
11+
use Selfoss\helpers\View;
12+
use Selfoss\helpers\ViewHelper;
1313

1414
/**
1515
* Controller for root
@@ -20,15 +20,15 @@
2020
*/
2121
class Index {
2222
private Authentication $authentication;
23-
private \daos\Items $itemsDao;
23+
private \Selfoss\daos\Items $itemsDao;
2424
private Router $router;
25-
private \daos\Sources $sourcesDao;
25+
private \Selfoss\daos\Sources $sourcesDao;
2626
private Tags $tagsController;
27-
private \daos\Tags $tagsDao;
27+
private \Selfoss\daos\Tags $tagsDao;
2828
private View $view;
2929
private ViewHelper $viewHelper;
3030

31-
public function __construct(Authentication $authentication, \daos\Items $itemsDao, Router $router, \daos\Sources $sourcesDao, Tags $tagsController, \daos\Tags $tagsDao, View $view, ViewHelper $viewHelper) {
31+
public function __construct(Authentication $authentication, \Selfoss\daos\Items $itemsDao, Router $router, \Selfoss\daos\Sources $sourcesDao, Tags $tagsController, \Selfoss\daos\Tags $tagsDao, View $view, ViewHelper $viewHelper) {
3232
$this->authentication = $authentication;
3333
$this->itemsDao = $itemsDao;
3434
$this->router = $router;

src/controllers/Items.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
declare(strict_types=1);
44

5-
namespace controllers;
5+
namespace Selfoss\controllers;
66

7-
use daos\ItemOptions;
87
use DateTimeInterface;
9-
use helpers\Authentication;
10-
use helpers\Misc;
11-
use helpers\Request;
12-
use helpers\View;
138
use InvalidArgumentException;
9+
use Selfoss\daos\ItemOptions;
10+
use Selfoss\helpers\Authentication;
11+
use Selfoss\helpers\Misc;
12+
use Selfoss\helpers\Request;
13+
use Selfoss\helpers\View;
1414

1515
/**
1616
* Controller for item handling
@@ -21,13 +21,13 @@
2121
*/
2222
class Items {
2323
private Authentication $authentication;
24-
private \daos\Items $itemsDao;
24+
private \Selfoss\daos\Items $itemsDao;
2525
private Request $request;
2626
private View $view;
2727

2828
public function __construct(
2929
Authentication $authentication,
30-
\daos\Items $itemsDao,
30+
\Selfoss\daos\Items $itemsDao,
3131
Request $request,
3232
View $view
3333
) {

src/controllers/Items/Stats.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
declare(strict_types=1);
44

5-
namespace controllers\Items;
5+
namespace Selfoss\controllers\Items;
66

7-
use helpers\Authentication;
8-
use helpers\View;
7+
use Selfoss\helpers\Authentication;
8+
use Selfoss\helpers\View;
99

1010
/**
1111
* Controller for viewing item statistics
1212
*/
1313
class Stats {
1414
private Authentication $authentication;
15-
private \daos\Items $itemsDao;
16-
private \daos\Sources $sourcesDao;
17-
private \daos\Tags $tagsDao;
15+
private \Selfoss\daos\Items $itemsDao;
16+
private \Selfoss\daos\Sources $sourcesDao;
17+
private \Selfoss\daos\Tags $tagsDao;
1818
private View $view;
1919

20-
public function __construct(Authentication $authentication, \daos\Items $itemsDao, \daos\Sources $sourcesDao, \daos\Tags $tagsDao, View $view) {
20+
public function __construct(Authentication $authentication, \Selfoss\daos\Items $itemsDao, \Selfoss\daos\Sources $sourcesDao, \Selfoss\daos\Tags $tagsDao, View $view) {
2121
$this->authentication = $authentication;
2222
$this->itemsDao = $itemsDao;
2323
$this->sourcesDao = $sourcesDao;

0 commit comments

Comments
 (0)