Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 2354c43e authored by Akhil's avatar Akhil 🙂
Browse files

Fix php lint

parent 044f1c76
Loading
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -36,8 +36,6 @@ use OCA\Calendar\Middleware\InvitationMiddleware;
use OCP\IRequest;
use OCP\IConfig;
use OCP\IDBConnection;
use OC\Core\Application as CoreApplication;
use OCP\Http\Client\IResponse;
use OCP\Calendar\IManager;
use OCP\Mail\IMailer;
use OCP\IL10N;
@@ -47,24 +45,21 @@ use OCP\ILogger;
use OCP\IUserManager;
use OCP\BackgroundJob\IJobList;

class Application extends App implements IBootstrap
{
class Application extends App implements IBootstrap {
	/** @var string */
	public const APP_ID = "calendar";

	/**
	 * @param array $params
	 */
	public function __construct(array $params = [])
	{
	public function __construct(array $params = []) {
		parent::__construct(self::APP_ID, $params);
	}

	/**
	 * @inheritDoc
	 */
	public function register(IRegistrationContext $context): void
	{
	public function register(IRegistrationContext $context): void {
		$context->registerDashboardWidget(CalendarWidget::class);

		// TODO: drop conditional code when the app is 23+
@@ -81,8 +76,7 @@ class Application extends App implements IBootstrap
	/**
	 * @inheritDoc
	 */
	public function boot(IBootContext $context): void
	{
	public function boot(IBootContext $context): void {
		$container = $this->getContainer();
		/**
		 * Middleware
+77 −83
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ declare(strict_types=1);

namespace OCA\Calendar\BackgroundJob;


use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\QueuedJob ;
use Psr\Log\LoggerInterface;
@@ -41,7 +40,6 @@ use Sabre\VObject\Parameter;
use OCP\Util;

class SendInviteResponseMailJob extends QueuedJob {

	private const translations = [
		"tentative" => [
			"meeting_title" => "Invitation Tentatively Accepted: %s",
@@ -79,8 +77,6 @@ class SendInviteResponseMailJob extends QueuedJob {
		$this->l10n = $l10n;
		$this->defaults = $defaults;
		$this->iusermanager = $iusermanager;


	}

	private function getMailAttributes(
@@ -108,8 +104,7 @@ class SendInviteResponseMailJob extends QueuedJob {
			"meeting_head" => $meetingHead,
		];
	}
	private function extract_emails_from($string)
	{
	private function extract_emails_from($string) {
		$string = (string) $string;
		$matches = [];
		$found = preg_match("/mailto:(.*)/i", $string, $matches);
@@ -190,7 +185,6 @@ class SendInviteResponseMailJob extends QueuedJob {
							$attendeeName = $attendee1["CN"];
							break;
						}

					}
				}
				$organizerName = empty($vObject->VEVENT->ORGANIZER["CN"])
+1 −2
Original line number Diff line number Diff line
@@ -151,5 +151,4 @@ EOF;

		return $row;
	}

}
+1 −7
Original line number Diff line number Diff line
@@ -12,19 +12,14 @@ use OCP\IConfig;
use OCP\IRequest;
use OCP\AppFramework\Http\Response;
use OCP\Calendar\IManager;
use Sabre\VObject\Reader;
use OCP\Defaults;
use OCP\Mail\IMailer;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IUserManager;
use OCP\IUser;
use OCP\L10N\IFactory;
use OCP\Util;


class InvitationMiddleware extends Middleware
{
class InvitationMiddleware extends Middleware {
	private $request;
	private $jobList;
	/** @var IManager */
@@ -90,7 +85,6 @@ class InvitationMiddleware extends Middleware
			$token = $this->request->getParam("token");

			$this->jobList->add(SendInviteResponseMailJob::class, ['token' => $token,'methodName' => $methodName]);

		}