refactor: order imports

pull/83/head
sualko 2020-09-23 12:33:09 +02:00
parent 5debcb6d2a
commit 68ea352311
32 changed files with 128 additions and 120 deletions

View File

@ -4,10 +4,18 @@ declare(strict_types=1);
require_once './vendor/autoload.php';
use Nextcloud\CodingStandard\Config;
use Nextcloud\CodingStandard\Config as NextcloudConfig;
use PhpCsFixer\Config;
$nextcloudConfig = new NextcloudConfig();
$config = new Config();
$rules = $nextcloudConfig->getRules();
$rules['ordered_imports'] = ['sort_algorithm' => 'alpha'];
$config
->setIndent("\t")
->setRules($rules)
->getFinder()
->ignoreVCSIgnored(true)
->notPath('build')

View File

@ -2,13 +2,13 @@
namespace OCA\BigBlueButton\Activity;
use OCA\BigBlueButton\AppInfo\Application;
use OCA\BigBlueButton\Event\MeetingEndedEvent;
use OCA\BigBlueButton\Event\MeetingStartedEvent;
use OCA\BigBlueButton\Event\RecordingReadyEvent;
use OCP\Activity\IManager as IActivityManager;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Activity\IManager as IActivityManager;
use OCA\BigBlueButton\Event\MeetingStartedEvent;
use OCA\BigBlueButton\Event\MeetingEndedEvent;
use OCA\BigBlueButton\Event\RecordingReadyEvent;
use OCA\BigBlueButton\AppInfo\Application;
use OCP\IUserSession;
class MeetingListener implements IEventListener {

View File

@ -4,15 +4,15 @@ namespace OCA\BigBlueButton\Activity;
use OCA\BigBlueButton\AppInfo\Application;
use OCA\BigBlueButton\Db\RoomShare;
use OCP\Activity\IProvider;
use OCP\Activity\IEvent;
use OCP\Activity\IManager;
use OCP\IL10N;
use OCP\IUserManager;
use OCP\Activity\IProvider;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory;
class Provider implements IProvider {

View File

@ -2,12 +2,12 @@
namespace OCA\BigBlueButton\Activity;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Activity\IManager as IActivityManager;
use OCA\BigBlueButton\AppInfo\Application;
use OCA\BigBlueButton\Event\RoomCreatedEvent;
use OCA\BigBlueButton\Event\RoomDeletedEvent;
use OCA\BigBlueButton\AppInfo\Application;
use OCP\Activity\IManager as IActivityManager;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
class RoomListener implements IEventListener {

View File

@ -2,16 +2,16 @@
namespace OCA\BigBlueButton\Activity;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Activity\IManager as IActivityManager;
use OCP\IGroupManager;
use OCA\BigBlueButton\Event\RoomShareCreatedEvent;
use OCA\BigBlueButton\Event\RoomShareDeletedEvent;
use OCA\BigBlueButton\AppInfo\Application;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Event\RoomShareCreatedEvent;
use OCA\BigBlueButton\Event\RoomShareDeletedEvent;
use OCA\BigBlueButton\Service\RoomService;
use OCP\Activity\IManager as IActivityManager;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\IGroupManager;
class RoomShareListener implements IEventListener {

View File

@ -2,22 +2,22 @@
namespace OCA\BigBlueButton\AppInfo;
use \OCP\IConfig;
use \OCP\Settings\IManager as ISettingsManager;
use \OCP\AppFramework\App;
use \OCP\EventDispatcher\IEventDispatcher;
use \OCA\BigBlueButton\Middleware\JoinMiddleware;
use \OCA\BigBlueButton\Middleware\HookMiddleware;
use \OCA\BigBlueButton\Activity\MeetingListener;
use \OCA\BigBlueButton\Activity\RoomListener;
use \OCA\BigBlueButton\Activity\RoomShareListener;
use \OCA\BigBlueButton\Event\MeetingEndedEvent;
use \OCA\BigBlueButton\Event\MeetingStartedEvent;
use \OCA\BigBlueButton\Event\RecordingReadyEvent;
use \OCA\BigBlueButton\Event\RoomCreatedEvent;
use \OCA\BigBlueButton\Event\RoomDeletedEvent;
use \OCA\BigBlueButton\Activity\RoomListener;
use \OCA\BigBlueButton\Event\RoomShareCreatedEvent;
use \OCA\BigBlueButton\Event\RoomShareDeletedEvent;
use \OCA\BigBlueButton\Activity\RoomShareListener;
use \OCA\BigBlueButton\Event\MeetingStartedEvent;
use \OCA\BigBlueButton\Event\MeetingEndedEvent;
use \OCA\BigBlueButton\Event\RecordingReadyEvent;
use \OCA\BigBlueButton\Activity\MeetingListener;
use \OCA\BigBlueButton\Middleware\HookMiddleware;
use \OCA\BigBlueButton\Middleware\JoinMiddleware;
use \OCP\AppFramework\App;
use \OCP\EventDispatcher\IEventDispatcher;
use \OCP\IConfig;
use \OCP\Settings\IManager as ISettingsManager;
if ((@include_once __DIR__ . '/../../vendor/autoload.php') === false) {
throw new \Exception('Cannot include autoload. Did you run install dependencies using composer?');

View File

@ -3,21 +3,21 @@
namespace OCA\BigBlueButton\BigBlueButton;
use BigBlueButton\BigBlueButton;
use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\JoinMeetingParameters;
use BigBlueButton\Parameters\GetRecordingsParameters;
use BigBlueButton\Core\Record;
use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\DeleteRecordingsParameters;
use BigBlueButton\Parameters\GetRecordingsParameters;
use BigBlueButton\Parameters\IsMeetingRunningParameters;
use OCP\EventDispatcher\IEventDispatcher;
use OCA\BigBlueButton\Event\MeetingStartedEvent;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Permission;
use BigBlueButton\Parameters\JoinMeetingParameters;
use OCA\BigBlueButton\Crypto;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Event\MeetingStartedEvent;
use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\UrlHelper;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IURLGenerator;
use OCP\IL10N;
use OCP\IURLGenerator;
class API {
/** @var IConfig */

View File

@ -4,12 +4,12 @@ namespace OCA\BigBlueButton\Controller;
use Closure;
use Exception;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCA\BigBlueButton\Service\RoomNotFound;
use OCA\BigBlueButton\Service\RoomShareNotFound;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
trait Errors {
protected function handleNotFound(Closure $callback): DataResponse {
try {

View File

@ -3,12 +3,12 @@
namespace OCA\BigBlueButton\Controller;
use OCA\BigBlueButton\Db\Room;
use OCP\IRequest;
use OCP\EventDispatcher\IEventDispatcher;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Event\MeetingEndedEvent;
use OCA\BigBlueButton\Event\RecordingReadyEvent;
use OCA\BigBlueButton\Service\RoomService;
use OCP\AppFramework\Controller;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IRequest;
class HookController extends Controller {
/** @var string */

View File

@ -8,13 +8,13 @@ use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\NoPermissionException;
use OCA\BigBlueButton\NotFoundException;
use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\Service\RoomService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCA\BigBlueButton\Service\RoomService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
class JoinController extends Controller {
/** @var string */

View File

@ -2,10 +2,10 @@
namespace OCA\BigBlueButton\Controller;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IRequest;
class PageController extends Controller {
/** @var IConfig */

View File

@ -3,14 +3,14 @@
namespace OCA\BigBlueButton\Controller;
use OCA\BigBlueButton\Db\Restriction;
use OCP\IRequest;
use OCP\IGroupManager;
use OCP\IUserManager;
use OCA\BigBlueButton\Service\RestrictionService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Controller;
use OCP\IGroupManager;
use OCP\IRequest;
use OCA\BigBlueButton\Service\RestrictionService;
use OCP\IUserManager;
class RestrictionController extends Controller {
/** @var RestrictionService */

View File

@ -2,15 +2,15 @@
namespace OCA\BigBlueButton\Controller;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\CircleHelper;
use OCP\IRequest;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\Service\RoomService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Controller;
use OCP\IGroupManager;
use OCP\IRequest;
use OCP\IUserManager;
class RoomController extends Controller {

View File

@ -2,16 +2,16 @@
namespace OCA\BigBlueButton\Controller;
use OCA\BigBlueButton\CircleHelper;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Service\RoomShareNotFound;
use OCA\BigBlueButton\CircleHelper;
use OCP\IRequest;
use OCA\BigBlueButton\Service\RoomShareService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Controller;
use OCA\BigBlueButton\Service\RoomShareService;
use OCP\IRequest;
use OCP\IUserManager;
class RoomShareController extends Controller {

View File

@ -4,12 +4,12 @@ namespace OCA\BigBlueButton\Controller;
use OCA\BigBlueButton\BigBlueButton\API;
use OCA\BigBlueButton\Permission;
use OCP\IRequest;
use OCA\BigBlueButton\Service\RoomService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Controller;
use OCA\BigBlueButton\Service\RoomService;
use OCP\IRequest;
class ServerController extends Controller {
/** @var RoomService */

View File

@ -2,8 +2,8 @@
namespace OCA\BigBlueButton\Event;
use OCP\EventDispatcher\Event;
use OCA\BigBlueButton\Db\Room;
use OCP\EventDispatcher\Event;
abstract class RoomEvent extends Event {

View File

@ -2,8 +2,8 @@
namespace OCA\BigBlueButton\Event;
use OCP\EventDispatcher\Event;
use OCA\BigBlueButton\Db\RoomShare;
use OCP\EventDispatcher\Event;
abstract class RoomShareEvent extends Event {

View File

@ -3,11 +3,11 @@
namespace OCA\BigBlueButton\Middleware;
use OCA\BigBlueButton\Controller\HookController;
use OCA\BigBlueButton\Crypto;
use OCA\BigBlueButton\NoPermissionException;
use OCA\BigBlueButton\NotFoundException;
use OCA\BigBlueButton\Crypto;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Middleware;
use OCP\IRequest;

View File

@ -6,8 +6,8 @@ namespace OCA\BigBlueButton\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version000000Date20200416124731 extends SimpleMigrationStep {

View File

@ -2,9 +2,9 @@
namespace OCA\BigBlueButton;
use OCP\Template;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\Response;
use OCP\Template;
class NoPermissionResponse extends Response {
public function __construct() {

View File

@ -2,9 +2,9 @@
namespace OCA\BigBlueButton;
use OCP\Template;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\Response;
use OCP\Template;
class NotFoundResponse extends Response {
public function __construct() {

View File

@ -3,14 +3,14 @@
namespace OCA\BigBlueButton;
use Closure;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Service\RestrictionService;
use OCA\BigBlueButton\Service\RoomShareService;
use OCA\BigBlueButton\Db\Restriction;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Db\Restriction;
use OCP\IUserManager;
use OCA\BigBlueButton\Service\RestrictionService;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Service\RoomShareService;
use OCP\IGroupManager;
use OCP\IUserManager;
class Permission {

View File

@ -4,12 +4,12 @@ namespace OCA\BigBlueButton\Service;
use Exception;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCA\BigBlueButton\Db\Restriction;
use OCA\BigBlueButton\Db\RestrictionMapper;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
class RestrictionService {
/** @var RestrictionMapper */
private $mapper;

View File

@ -4,14 +4,14 @@ namespace OCA\BigBlueButton\Service;
use Exception;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\EventDispatcher\IEventDispatcher;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\RoomMapper;
use OCA\BigBlueButton\Event\RoomCreatedEvent;
use OCA\BigBlueButton\Event\RoomDeletedEvent;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\EventDispatcher\IEventDispatcher;
class RoomService {

View File

@ -4,14 +4,14 @@ namespace OCA\BigBlueButton\Service;
use Exception;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\EventDispatcher\IEventDispatcher;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Db\RoomShareMapper;
use OCA\BigBlueButton\Event\RoomShareCreatedEvent;
use OCA\BigBlueButton\Event\RoomShareDeletedEvent;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\EventDispatcher\IEventDispatcher;
class RoomShareService {

View File

@ -2,10 +2,10 @@
namespace OCA\BigBlueButton\Settings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
use OCP\IConfig;
use \OCP\IL10N;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\ISettings;
class Personal implements ISettings {
/** @var IConfig */

View File

@ -7,8 +7,8 @@ use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\RoomMapper;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Db\RoomShareMapper;
use PHPUnit\Framework\TestCase;
use OCP\IDBConnection;
use PHPUnit\Framework\TestCase;
class RoomMapperTest extends TestCase {
/** @var IDBConnection */

View File

@ -5,8 +5,8 @@ namespace OCA\BigBlueButton\Tests\Integration\Service;
use OC;
use OCA\BigBlueButton\Db\RestrictionMapper;
use OCA\BigBlueButton\Service\RestrictionService;
use PHPUnit\Framework\TestCase;
use OCP\IDBConnection;
use PHPUnit\Framework\TestCase;
class RestrictionServiceTest extends TestCase {
/** @var IDBConnection */

View File

@ -2,20 +2,20 @@
namespace OCA\BigBlueButton\Tests\Controller;
use PHPUnit\Framework\TestCase;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\IRequest;
use OCP\IUser;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Controller\JoinController;
use OCA\BigBlueButton\BigBlueButton\API;
use OCA\BigBlueButton\NotFoundException;
use OCA\BigBlueButton\Controller\JoinController;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\NotFoundException;
use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\Service\RoomService;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserSession;
use PHPUnit\Framework\TestCase;
class JoinControllerTest extends TestCase {
private $request;

View File

@ -2,16 +2,16 @@
namespace OCA\BigBlueButton\Tests\Controller;
use PHPUnit\Framework\TestCase;
use OCP\IRequest;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\CircleHelper;
use OCA\BigBlueButton\Controller\RoomShareController;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Service\RoomShareService;
use OCA\BigBlueButton\CircleHelper;
use OCP\AppFramework\Http;
use OCP\IRequest;
use OCP\IUserManager;
use PHPUnit\Framework\TestCase;
class RoomShareControllerTest extends TestCase {
private $request;

View File

@ -2,17 +2,17 @@
namespace OCA\BigBlueButton\Tests;
use OCA\BigBlueButton\CircleHelper;
use OCA\BigBlueButton\Db\Restriction;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Db\Restriction;
use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\Service\RestrictionService;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Service\RoomShareService;
use OCA\BigBlueButton\Service\RestrictionService;
use OCA\BigBlueButton\CircleHelper;
use OCP\IUserManager;
use OCP\IGroupManager;
use OCP\IUser;
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

View File

@ -2,13 +2,13 @@
namespace OCA\BigBlueButton\Tests\Unit\Service;
use PHPUnit\Framework\TestCase;
use OCA\BigBlueButton\Service\RestrictionService;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Db\Restriction;
use OCA\BigBlueButton\Db\RestrictionMapper;
use OCA\BigBlueButton\Db\Room;
use OCA\BigBlueButton\Service\RestrictionService;
use PHPUnit\Framework\TestCase;
class RestrictionServiceTest extends TestCase {
protected $mapper;