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
6 changes: 3 additions & 3 deletions lib/Command/LocalizationService/ResetDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OCA\GeoBlocker\Command\LocalizationService;

use OCP\ILogger;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -19,10 +19,10 @@ class ResetDB extends Command {
private $ls_factory;
/** @var OutputInterface */
private $output;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;

public function __construct(LocalizationServiceFactory $ls_factory, ILogger $logger) {
public function __construct(LocalizationServiceFactory $ls_factory, LoggerInterface $logger) {
parent::__construct();
$this->ls_factory = $ls_factory;
$this->logger = $logger;
Expand Down
6 changes: 3 additions & 3 deletions lib/Command/LocalizationService/UpdateDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OCA\GeoBlocker\Command\LocalizationService;

use OCP\ILogger;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -19,10 +19,10 @@ class UpdateDB extends Command {
private $ls_factory;
/** @var OutputInterface */
private $output;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;

public function __construct(LocalizationServiceFactory $ls_factory, ILogger $logger) {
public function __construct(LocalizationServiceFactory $ls_factory, LoggerInterface $logger) {
parent::__construct();
$this->ls_factory = $ls_factory;
$this->logger = $logger;
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/ServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use OCP\IConfig;
use OCP\IL10N;
use OCP\IDBConnection;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\JSONResponse;
Expand All @@ -20,13 +20,13 @@ class ServiceController extends Controller {
private $l;
/** @var IDBConnection */
private $db;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;
/** @var LocalizationServiceFactory */
private $location_service_factory;

public function __construct(string $AppName, IRequest $request,
IConfig $config, IL10N $l, IDBConnection $db, ILogger $logger) {
IConfig $config, IL10N $l, IDBConnection $db, LoggerInterface $logger) {
parent::__construct($AppName, $request);
$this->config = new GeoBlockerConfig($config);
$this->l = $l;
Expand Down
6 changes: 3 additions & 3 deletions lib/GeoBlocker/GeoBlocker.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
namespace OCA\GeoBlocker\GeoBlocker;

use OCA\GeoBlocker\Config\GeoBlockerConfig;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use OCP\IL10N;
use OCA\GeoBlocker\LocalizationServices\ILocalizationService;
use OC\User\LoginException;

class GeoBlocker {
/** @var String */
private $user;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;
/** @var GeoBlockerConfig */
private $config;
Expand All @@ -27,7 +27,7 @@ class GeoBlocker {
public const kInvalidIPCode = 'INVALID_IP';
private const kNotShownString = 'NOT_SHOWN_IN_LOG';

public function __construct(String $user, ILogger $logger,
public function __construct(String $user, LoggerInterface $logger,
GeoBlockerConfig $config, IL10N $l,
ILocalizationService $location_service) {
$this->user = $user;
Expand Down
4 changes: 2 additions & 2 deletions lib/Hooks/UserHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use OCA\GeoBlocker\Config\GeoBlockerConfig;
use OCP\IConfig;
use OCP\IUserSession;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use OCP\IRequest;
use OCA\GeoBlocker\GeoBlocker\GeoBlocker;
use OCP\IL10N;
Expand All @@ -20,7 +20,7 @@ class UserHooks {
private $l;
private $db;

public function __construct(IUserSession $userSession, ILogger $logger,
public function __construct(IUserSession $userSession, LoggerInterface $logger,
IRequest $request, IConfig $config, IL10N $l, IDBConnection $db) {
$this->userSession = $userSession;
$this->logger = $logger;
Expand Down
6 changes: 3 additions & 3 deletions lib/LocalizationServices/LocalizationServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
use OCA\GeoBlocker\Config\GeoBlockerConfig;
use OCA\GeoBlocker\Db\RIRServiceMapper;
use OutOfRangeException;
use OCP\ILogger;
use Psr\Log\LoggerInterface;

class LocalizationServiceFactory {
/** @var IL10N */
private $l;
/** @var GeoBlockerConfig */
private $config;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;
/** @var int */
private $count_ids = 4;
/** @var IDBConnection */
private $db;

public function __construct(GeoBlockerConfig $config, IL10N $l,
IDBConnection $db, ILogger $logger) {
IDBConnection $db, LoggerInterface $logger) {
$this->l = $l;
$this->config = $config;
$this->logger = $logger;
Expand Down
6 changes: 3 additions & 3 deletions lib/LocalizationServices/MaxMindGeoLite2.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use MaxMind\Db\Reader\InvalidDatabaseException;
use InvalidArgumentException;
use GeoIp2\Exception\AddressNotFoundException;
use OCP\ILogger;
use Psr\Log\LoggerInterface;

class DatabaseReaderNotFoundException extends \Exception {
}
Expand All @@ -27,7 +27,7 @@ class MaxMindGeoLite2 implements
private $l;
/** @var GeoBlockerConfig */
private $config;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;
/** @var String */
private $database_file_location;
Expand All @@ -36,7 +36,7 @@ class MaxMindGeoLite2 implements
private const kStatusTestIP = '9.9.9.9';
private const kStatusTestResult = 'US';

public function __construct(GeoBlockerConfig $config, IL10N $l, ILogger $logger) {
public function __construct(GeoBlockerConfig $config, IL10N $l, LoggerInterface $logger) {
$this->l = $l;
$this->config = $config;
$this->logger = $logger;
Expand Down
6 changes: 3 additions & 3 deletions lib/LocalizationServices/RIRData.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use Exception;
use OCP\IL10N;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use OCA\GeoBlocker\Db\RIRServiceMapper;
use OCA\GeoBlocker\Db\RIRServiceDBEntity;
use OCA\GeoBlocker\Config\GeoBlockerConfig;
Expand All @@ -22,7 +22,7 @@ class RIRData implements ILocalizationService, IDatabaseDate, IDatabaseUpdate {
private $rir_data_checks;
/** @var GeoBlockerConfig */
private $config;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;

private $rir_ftps = [
Expand All @@ -41,7 +41,7 @@ class RIRData implements ILocalizationService, IDatabaseDate, IDatabaseUpdate {

public function __construct(RIRDataChecks $rir_data_checks,
RIRServiceMapper $rir_service_mapper, GeoBlockerConfig $config,
IL10N $l, ILogger $logger) {
IL10N $l, LoggerInterface $logger) {
$this->rir_data_checks = $rir_data_checks;
$this->l = $l;
$this->rir_service_mapper = $rir_service_mapper;
Expand Down
6 changes: 3 additions & 3 deletions lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
use OCA\GeoBlocker\Config\GeoBlockerConfig;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use OCP\IRequest;
use OCP\IUserSession;
use OCP\IL10N;
Expand All @@ -15,7 +15,7 @@
class Admin implements ISettings {
/** @var GeoBlockerConfig */
private $config;
/** @var ILogger */
/** @var LoggerInterface */
private $logger;
/** @var IRequest */
private $request;
Expand All @@ -25,7 +25,7 @@ class Admin implements ISettings {
private $l;
/** @var IDBConnection */
private $db;
public function __construct(GeoBlockerConfig $config, ILogger $logger,
public function __construct(GeoBlockerConfig $config, LoggerInterface $logger,
IRequest $request, IUserSession $user_session, IL10N $l, IDBConnection $db) {
$this->config = $config;
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/GeoBlockerIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setUp(): void {

private function mySetUp(): void {
$this->user = 'admin';
$this->logger = $this->getMockBuilder('OCP\ILogger')->getMock();
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$tmp_config = $this->getMockBuilder('OCP\IConfig')->getMock();
$this->config = $this->getMockBuilder(
'OCA\GeoBlocker\Config\GeoBlockerConfig')->setConstructorArgs(
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/GeoBlocker/GeoBlockerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GeoBlockerTest extends TestCase {

private function mySetUp(): void {
$this->user = 'admin';
$this->logger = $this->getMockBuilder('OCP\ILogger')->getMock();
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$tmp_config = $this->getMockBuilder('OCP\IConfig')->getMock();
$this->config = $this->getMockBuilder(
'OCA\GeoBlocker\Config\GeoBlockerConfig')->setConstructorArgs(
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/LocalizationServices/MaxMindGeoLite2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function setUp(): void {
$this->l = $this->getMockBuilder('OCP\IL10N')->getMock();
$this->l->method('t')->will(
$this->returnCallback([$this,'callbackLTJustRouteThrough']));
$this->logger = $this->getMockBuilder('OCP\ILogger')->getMock();
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$tmp_config = $this->getMockBuilder('OCP\IConfig')->getMock();
$this->config = $this->getMockBuilder(
'OCA\GeoBlocker\Config\GeoBlockerConfig')->setConstructorArgs(
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/LocalizationServices/RIRDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function setUp(): void {
$this->l = $this->getMockBuilder('OCP\IL10N')->getMock();
$this->l->method('t')->will(
$this->returnCallback([$this,'callbackLTJustRouteThrough']));
$this->logger = $this->getMockBuilder('OCP\ILogger')->getMock();
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$this->rir_data = new RIRData($this->rir_data_checks,
$this->rir_service_mapper, $this->config, $this->l, $this->logger);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/UnitMissingServiceTests/MaxMindGeoLite2TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class MaxMindGeoLite2TestBase extends TestCase {
public function setUp(): void {
parent::setUp();
$this->l = $this->getMockBuilder('OCP\IL10N')->getMock();
$this->logger = $this->getMockBuilder('OCP\ILogger')->getMock();
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$this->l->method('t')->will(
$this->returnCallback([$this,'callbackLTJustRouteThrough']));
$tmp_config = $this->getMockBuilder('OCP\IConfig')->getMock();
Expand Down
Loading