Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code quality/no spaces inside parenthesis #31273

Merged
merged 5 commits into from
Apr 30, 2018
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ return PhpCsFixer\Config::create()
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'no_spaces_inside_parenthesis' => true,
'no_extra_consecutive_blank_lines' => true,
])
->setFinder($finder)
;
3 changes: 1 addition & 2 deletions apps/comments/lib/Dav/CommentNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace OCA\Comments\Dav;


use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
use OCP\Comments\MessageTooLongException;
Expand Down Expand Up @@ -118,7 +117,7 @@ static public function getPropertyNames() {

protected function checkWriteAccessOnComment() {
$user = $this->userSession->getUser();
if( $this->comment->getActorType() !== 'users'
if($this->comment->getActorType() !== 'users'
|| \is_null($user)
|| $this->comment->getActorId() !== $user->getUID()
) {
Expand Down
4 changes: 1 addition & 3 deletions apps/comments/lib/Dav/CommentsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function onReport($reportName, $report, $uri) {
foreach($results as $node) {
$nodePath = $this->server->getRequestUri() . '/' . $node->comment->getId();
$resultSet = $this->server->getPropertiesForPath($nodePath, CommentNode::getPropertyNames());
if(isset($resultSet[0], $resultSet[0][200]) ) {
if(isset($resultSet[0], $resultSet[0][200])) {
$responses[] = new Response(
$this->server->getBaseUri() . $nodePath,
[200 => $resultSet[0][200]],
Expand Down Expand Up @@ -254,6 +254,4 @@ private function createComment($objectType, $objectId, $data, $contentType = 'ap
}
}



}
2 changes: 0 additions & 2 deletions apps/comments/tests/unit/Dav/CommentsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,4 @@ public function testOnReport() {
$this->plugin->onReport(CommentsPluginImplementation::REPORT_NAME, $parameters, '/' . $path);
}



}
1 change: 0 additions & 1 deletion apps/dav/appinfo/Migrations/Version20170202213905.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use OCP\IUserManager;
use OCP\Migration\ISqlMigration;


/*
* Resolve userid/propertypath into fileid
* Update all entries with actual fileid if possible
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/appinfo/v1/caldav.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
$server->addPlugin(new \Sabre\DAV\Sync\Plugin());
$server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
$server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin());
$server->addPlugin(new OCA\DAV\CalDAV\Schedule\IMipPlugin( \OC::$server->getMailer(), \OC::$server->getLogger(), \OC::$server->getRequest()));
$server->addPlugin(new OCA\DAV\CalDAV\Schedule\IMipPlugin(\OC::$server->getMailer(), \OC::$server->getLogger(), \OC::$server->getRequest()));
$server->addPlugin(new ExceptionLoggerPlugin('caldav', \OC::$server->getLogger()));

// And off we go!
Expand Down
3 changes: 0 additions & 3 deletions apps/dav/lib/Avatars/AvatarHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Avatars;


use OCP\IAvatarManager;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\MethodNotAllowed;
Expand Down Expand Up @@ -115,5 +113,4 @@ function getLastModified() {
return null;
}


}
2 changes: 0 additions & 2 deletions apps/dav/lib/Avatars/AvatarNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Avatars;


use OCP\IAvatar;
use Sabre\DAV\File;

Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/CalDAV/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\CalDAV;


use Sabre\VObject\Component;
use Sabre\VObject\Property;
use Sabre\VObject\Reader;
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\CalDAV\Schedule;


class Plugin extends \Sabre\CalDAV\Schedule\Plugin {

public function getAddressesForPrincipal($principal) {
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*
*/


namespace OCA\DAV;

use OCP\Capabilities\ICapability;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/AddressBookImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected function vCard2Array($uri, VCard $vCard) {
$result[$property->name] = $property->getValue();
}
}
if ($this->addressBookInfo['principaluri'] === 'principals/system/system' ) {
if ($this->addressBookInfo['principaluri'] === 'principals/system/system') {
$result['isSystemBook'] = true;
if ($this->addressBookInfo['uri'] === 'system') {
$result['isLocalSystemBook'] = true;
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CardDAV/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function createCardFromUser(IUser $user) {

$uid = $user->getUID();
$displayName = $user->getDisplayName();
$displayName = empty($displayName ) ? $uid : $displayName;
$displayName = empty($displayName) ? $uid : $displayName;
$emailAddress = $user->getEMailAddress();
$cloudId = $user->getCloudId();
$image = $this->getAvatarImage($user);
Expand Down Expand Up @@ -71,7 +71,7 @@ public function createCardFromUser(IUser $user) {
public function updateCard(VCard $vCard, IUser $user) {
$uid = $user->getUID();
$displayName = $user->getDisplayName();
$displayName = empty($displayName ) ? $uid : $displayName;
$displayName = empty($displayName) ? $uid : $displayName;
$emailAddress = $user->getEMailAddress();
$cloudId = $user->getCloudId();
$image = $this->getAvatarImage($user);
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 @@ -280,5 +280,4 @@ public function syncInstance(\Closure $progressCallback = null) {
}
}


}
1 change: 0 additions & 1 deletion apps/dav/lib/Connector/Sabre/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

class Auth extends AbstractBasic {


const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND';

/** @var ISession */
Expand Down
4 changes: 1 addition & 3 deletions apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ private function createFileChunked($data) {
/** @var \OC\Files\Storage\Storage $targetStorage */
list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile);


$chunk_handler->file_assemble($partStorage, $partInternalPath);

if (!self::isChecksumValid($partStorage, $partInternalPath)) {
Expand Down Expand Up @@ -547,8 +546,7 @@ private function createFileChunked($data) {
// FIXME: should call refreshInfo but can't because $this->path is not the of the final file
$info = $this->fileView->getFileInfo($targetPath);


if (isset($partStorage, $partInternalPath) ) {
if (isset($partStorage, $partInternalPath)) {
$checksums = $partStorage->getMetaData($partInternalPath)['checksum'];
} else {
$checksums = $targetStorage->getMetaData($targetInternalPath)['checksum'];
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function __construct(IConfig $config = null) {
}
}


/**
* This initializes the plugin.
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Connector/Sabre/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;


abstract class Node implements \Sabre\DAV\INode {

/**
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/DAV/CopyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*
*/


namespace OCA\DAV\DAV;

use OCA\DAV\Connector\Sabre\Exception\Forbidden;
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Files/ICopySource.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Files;


/**
* Interface ICopySource
* This interface allows special handling of copy operations based on the copy source.
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Files/IFileNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Files;


use OCP\Files\Node;

interface IFileNode {
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Files/IProvidesAdditionalHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Files;


/**
* Interface IProvidesAdditionalHeaders
* This interface allows to add additional headers to the response
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Meta/MetaFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Meta;


use OC\Files\Meta\MetaFileVersionNode;
use OCA\DAV\Files\ICopySource;
use OCA\DAV\Files\IProvidesAdditionalHeaders;
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Meta/MetaFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Meta;


use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\Node;
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Meta/RootCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Meta;


use OC\Files\Meta\MetaFileIdNode;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/SystemTag/SystemTagPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ private function createTag($data, $contentType = 'application/json') {
}
}


/**
* Retrieves system tag properties
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class SystemTagsObjectMappingCollection implements ICollection {
*/
private $user;


/**
* Constructor
*
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Upload/AssemblyStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ public function stream_close() {
return true;
}


/**
* Load the source from the stream context and return the context options
*
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Upload/ChunkLocationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Upload;


use OC\Files\Mount\MountPoint;
use OC\Files\Storage\Local;
use OCP\Files\Config\IMountProvider;
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/lib/Upload/ChunkingPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Upload;


use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
Expand Down
1 change: 0 additions & 1 deletion apps/dav/lib/Upload/ChunkingPluginZsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
namespace OCA\DAV\Upload;


use OCA\DAV\Connector\Sabre\File;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Server;
Expand Down
1 change: 0 additions & 1 deletion apps/dav/tests/unit/AppInfo/PluginManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class PluginManagerTest extends TestCase {
public function test() {
$server = $this->createMock(ServerContainer::class);


$appManager = $this->createMock(IAppManager::class);
$appManager->method('getInstalledApps')
->willReturn(['adavapp', 'adavapp2']);
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/tests/unit/Avatars/AvatarHomeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Tests\Unit\Avatars;


use OCA\DAV\Avatars\AvatarHome;
use OCA\DAV\Avatars\AvatarNode;
use OCP\IAvatar;
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/tests/unit/Avatars/AvatarNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
*
*/


namespace OCA\DAV\Tests\Unit\Avatars;


use OCA\DAV\Avatars\AvatarNode;
use OCP\IAvatar;
use OCP\IImage;
Expand Down
1 change: 0 additions & 1 deletion apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,4 @@ protected function createPublicCalendar() {
return $calendar;
}


}
1 change: 0 additions & 1 deletion apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function testSerializeNotPublished() {
<x1:pre-publish-url xmlns:d="DAV:" xmlns:x1="' . self::NS_CALENDARSERVER . '">urltopublish</x1:pre-publish-url>', $xml);
}


protected $elementMap = [];
protected $namespaceMap = ['DAV:' => 'd'];
protected $contextUri = '/';
Expand Down
2 changes: 0 additions & 2 deletions apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
*
*/


namespace OCA\DAV\Tests\unit\CardDAV;


use OCA\DAV\CardDAV\AddressBook;
use OCA\DAV\CardDAV\AddressBookImpl;
use OCA\DAV\CardDAV\CardDavBackend;
Expand Down
1 change: 0 additions & 1 deletion apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public function setUp() {
$query = $this->db->getQueryBuilder();
$query->delete('cards')->execute();


$this->tearDown();
}

Expand Down
Loading