Skip to content

Commit

Permalink
Apply latest code-style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Nov 14, 2022
1 parent f8a9de2 commit ab9763b
Show file tree
Hide file tree
Showing 923 changed files with 542 additions and 1,460 deletions.
1 change: 0 additions & 1 deletion apps/comments/lib/Dav/EntityTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
* @package OCA\Comments\Dav
*/
class EntityTypeCollection extends RootCollection {

/** @var ILogger */
protected $logger;

Expand Down
1 change: 0 additions & 1 deletion apps/comments/lib/Dav/RootCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class RootCollection implements ICollection {

/** @var EntityTypeCollection[]|null */
private $entityTypeCollections;

Expand Down
1 change: 0 additions & 1 deletion apps/comments/tests/unit/Dav/EntityCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use OCP\Comments\ICommentsManager;

class EntityCollectionTest extends \Test\TestCase {

/** @var \OCP\Comments\ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
protected $commentsManager;
/** @var \OCP\IUserManager|\PHPUnit\Framework\MockObject\MockObject */
Expand Down
1 change: 0 additions & 1 deletion apps/comments/tests/unit/Dav/EntityTypeCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use OCP\Comments\ICommentsManager;

class EntityTypeCollectionTest extends \Test\TestCase {

/** @var \OCP\Comments\ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
protected $commentsManager;
/** @var \OCP\IUserManager|\PHPUnit\Framework\MockObject\MockObject */
Expand Down
1 change: 0 additions & 1 deletion apps/comments/tests/unit/Dav/RootCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
use Symfony\Component\EventDispatcher\EventDispatcher;

class RootCollectionTest extends \Test\TestCase {

/** @var \OCP\Comments\ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
protected $commentsManager;
/** @var \OCP\IUserManager|\PHPUnit\Framework\MockObject\MockObject */
Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170116150538.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/

class Version20170116150538 implements ISchemaMigration {

/** @var string */
private $prefix;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170116170538.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* Add fileid field to this table if needed
*/
class Version20170116170538 implements ISchemaMigration {

/**
* @param Schema $schema
* @param string $prefix
Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170202213905.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* Drop all entries that can't be resolved
*/
class Version20170202213905 implements ISqlMigration {

/** @var IUserManager */
private $userManager;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170202220512.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/

class Version20170202220512 implements ISchemaMigration {

/**
* @param Schema $schema
* @param array $options
Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170427182800.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/

class Version20170427182800 implements ISchemaMigration {

/** @var string */
private $prefix;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170927201245.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/

class Version20170927201245 implements ISchemaMigration {

/**
* @param Schema $schema
* @param array $options
Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20181115210344.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* migration here exists to align all update paths.
*/
class Version20181115210344 implements ISchemaMigration {

/**
* @param Schema $schema
* @param array $options
Expand Down
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20200427142541.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* Adds a new property type column to properties and dav_properties tables
*/
class Version20200427142541 implements ISchemaMigration {

/**
* @param Schema $schema
* @param array $options
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use Symfony\Component\EventDispatcher\GenericEvent;

class Application extends App {

/**
* Application constructor.
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/AppInfo/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* to the Sabre server.
*/
class PluginManager {

/**
* @var ServerContainer
*/
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Avatars/AvatarHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Sabre\DAV\ICollection;

class AvatarHome implements ICollection {

/** @var array */
private $principalInfo;
/** @var IAvatarManager */
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Avatars/RootCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Sabre\DAVACL\AbstractPrincipalCollection;

class RootCollection extends AbstractPrincipalCollection {

/**
* This method returns a node for a principal.
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
* @package OCA\DAV\CalDAV
*/
class CalDavBackend extends AbstractBackend implements SyncSupport, SubscriptionSupport, SchedulingSupport {

/**
* We need to specify a max date, because we need to stop *somewhere*
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CalDAV/CalendarHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Sabre\DAV\Exception\NotFound;

class CalendarHome extends \Sabre\CalDAV\CalendarHome {

/** @var \OCP\IL10N */
private $l10n;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CalDAV/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Sabre\VObject\Reader;

class CalendarObject extends \Sabre\CalDAV\CalendarObject {

/**
* @inheritdoc
*/
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CalDAV/PublicCalendarRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
use Sabre\DAV\Exception\MethodNotAllowed;

class PublicCalendarRoot extends Collection {

/** @var CalDavBackend */
protected $caldavBackend;

Expand Down
80 changes: 39 additions & 41 deletions apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,64 +167,62 @@ public function httpPost(RequestInterface $request, ResponseInterface $response)
$this->server->xml->parse($requestBody, $request->getUrl(), $documentType);

switch ($documentType) {

case '{'.self::NS_CALENDARSERVER.'}publish-calendar':

// We can only deal with IShareableCalendar objects
if (!$node instanceof Calendar) {
return;
}
$this->server->transactionType = 'post-publish-calendar';
// We can only deal with IShareableCalendar objects
if (!$node instanceof Calendar) {
return;
}
$this->server->transactionType = 'post-publish-calendar';

// Getting ACL info
$acl = $this->server->getPlugin('acl');
// Getting ACL info
$acl = $this->server->getPlugin('acl');

// If there's no ACL support, we allow everything
if ($acl) {
'@phan-var \OCA\DAV\Connector\Sabre\DavAclPlugin $acl';
$acl->checkPrivileges($path, '{DAV:}write');
}
// If there's no ACL support, we allow everything
if ($acl) {
'@phan-var \OCA\DAV\Connector\Sabre\DavAclPlugin $acl';
$acl->checkPrivileges($path, '{DAV:}write');
}

$node->setPublishStatus(true);
$node->setPublishStatus(true);

// iCloud sends back the 202, so we will too.
$response->setStatus(202);
// iCloud sends back the 202, so we will too.
$response->setStatus(202);

// Adding this because sending a response body may cause issues,
// and I wanted some type of indicator the response was handled.
$response->setHeader('X-Sabre-Status', 'everything-went-well');
// Adding this because sending a response body may cause issues,
// and I wanted some type of indicator the response was handled.
$response->setHeader('X-Sabre-Status', 'everything-went-well');

// Breaking the event chain
return false;
// Breaking the event chain
return false;

case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar':

// We can only deal with IShareableCalendar objects
if (!$node instanceof Calendar) {
return;
}
$this->server->transactionType = 'post-unpublish-calendar';

// Getting ACL info
$acl = $this->server->getPlugin('acl');
// We can only deal with IShareableCalendar objects
if (!$node instanceof Calendar) {
return;
}
$this->server->transactionType = 'post-unpublish-calendar';

// If there's no ACL support, we allow everything
if ($acl) {
'@phan-var \OCA\DAV\Connector\Sabre\DavAclPlugin $acl';
$acl->checkPrivileges($path, '{DAV:}write');
}
// Getting ACL info
$acl = $this->server->getPlugin('acl');

$node->setPublishStatus(false);
// If there's no ACL support, we allow everything
if ($acl) {
'@phan-var \OCA\DAV\Connector\Sabre\DavAclPlugin $acl';
$acl->checkPrivileges($path, '{DAV:}write');
}

$response->setStatus(200);
$node->setPublishStatus(false);

// Adding this because sending a response body may cause issues,
// and I wanted some type of indicator the response was handled.
$response->setHeader('X-Sabre-Status', 'everything-went-well');
$response->setStatus(200);

// Breaking the event chain
return false;
// Adding this because sending a response body may cause issues,
// and I wanted some type of indicator the response was handled.
$response->setHeader('X-Sabre-Status', 'everything-went-well');

// Breaking the event chain
return false;
}
}
}
1 change: 0 additions & 1 deletion apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
use Sabre\Xml\XmlSerializable;

class Publisher implements XmlSerializable {

/**
* @var string $publishUrl
*/
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
* @license http://sabre.io/license/ Modified BSD License
*/
class IMipPlugin extends SabreIMipPlugin {

/** @var IMailer */
private $mailer;

Expand Down Expand Up @@ -72,7 +71,6 @@ public function __construct(IMailer $mailer, ILogger $logger, IRequest $request)
* @return void
*/
public function schedule(ITip\Message $iTipMessage) {

// Not sending any emails if OC-CalDav-Import header is set
if ($this->request->getHeader('OC-CalDav-Import') !== null) {
return;
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Sabre\DAV\PropPatch;

class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable {

/**
* Updates the list of shares.
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/AddressBookImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Sabre\VObject\UUIDUtil;

class AddressBookImpl implements IAddressBook {

/** @var CardDavBackend */
private $backend;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/AddressBookRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace OCA\DAV\CardDAV;

class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot {

/**
* This method returns a node for a principal.
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
use Symfony\Component\EventDispatcher\GenericEvent;

class CardDavBackend implements BackendInterface, SyncSupport {

/** @var Principal */
private $principalBackend;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/ContactsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use OCP\IURLGenerator;

class ContactsManager {

/** @var CardDavBackend */
private $backend;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Sabre\VObject\Property\Text;

class Converter {

/**
* @param IUser $user
* @return VCard
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/ImageExportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use Sabre\VObject\Reader;

class ImageExportPlugin extends ServerPlugin {

/** @var Server */
protected $server;
/** @var ILogger */
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Sabre\VObject\Reader;

class SyncService {

/** @var CardDavBackend */
private $backend;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/CardDAV/UserAddressBooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace OCA\DAV\CardDAV;

class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {

/**
* Returns a list of addressbooks
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Command/CleanupChunks.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Symfony\Component\Console\Output\OutputInterface;

class CleanupChunks extends Command {

/** @var IUserManager */
protected $userManager;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Command/CreateAddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
use Symfony\Component\Console\Output\OutputInterface;

class CreateAddressBook extends Command {

/** @var IUserManager */
private $userManager;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Command/CreateCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use Symfony\Component\Console\Output\OutputInterface;

class CreateCalendar extends Command {

/** @var IUserManager */
protected $userManager;

Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Command/SyncBirthdayCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Symfony\Component\Console\Output\OutputInterface;

class SyncBirthdayCalendar extends Command {

/** @var BirthdayService */
private $birthdayService;

Expand Down
Loading

0 comments on commit ab9763b

Please sign in to comment.