[Pkg-owncloud-commits] [php-sabredav] 92/220: CS
David Prévot
taffit at moszumanska.debian.org
Thu May 12 01:21:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit 4d9365277e182ca9c88e35be3e36d4e9be4f8abd
Author: Evert Pot <me at evertpot.com>
Date: Wed Mar 23 00:11:22 2016 -0400
CS
---
lib/DAV/Sharing/Plugin.php | 6 +++---
lib/DAV/Xml/Element/Sharee.php | 8 ++++----
lib/DAV/Xml/Property/Invite.php | 4 +---
lib/DAV/Xml/Property/ShareAccess.php | 4 ++--
lib/DAV/Xml/Request/ShareResource.php | 6 ++----
tests/Sabre/CalDAV/Backend/MockSharing.php | 2 +-
tests/Sabre/DAV/Mock/SharedNode.php | 6 +++---
tests/Sabre/DAV/Sharing/ShareResourceTest.php | 8 ++++----
tests/Sabre/DAV/Xml/Property/InviteTest.php | 2 +-
9 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/lib/DAV/Sharing/Plugin.php b/lib/DAV/Sharing/Plugin.php
index 7fa0389..7c8d462 100644
--- a/lib/DAV/Sharing/Plugin.php
+++ b/lib/DAV/Sharing/Plugin.php
@@ -135,7 +135,7 @@ class Plugin extends ServerPlugin {
}
// By default all sharees are marked as not having responded yet.
- foreach($sharees as $sharee) {
+ foreach ($sharees as $sharee) {
$sharee->inviteStatus = self::INVITE_NORESPONSE;
}
$node->updateInvites($sharees);
@@ -284,7 +284,7 @@ class Plugin extends ServerPlugin {
*/
function browserPostAction($path, $action, $postVars) {
- if ($action!=='share') {
+ if ($action !== 'share') {
return;
}
@@ -305,7 +305,7 @@ class Plugin extends ServerPlugin {
throw new BadRequest('The "access" POST must be readwrite, read or no-access');
}
$sharee = new Sharee([
- 'href' => $postVars['href'],
+ 'href' => $postVars['href'],
'access' => $accessMap[$postVars['access']],
]);
diff --git a/lib/DAV/Xml/Element/Sharee.php b/lib/DAV/Xml/Element/Sharee.php
index 2077c4f..820f821 100644
--- a/lib/DAV/Xml/Element/Sharee.php
+++ b/lib/DAV/Xml/Element/Sharee.php
@@ -77,7 +77,7 @@ class Sharee implements Element {
*/
function __construct(array $properties = []) {
- foreach($properties as $k=>$v) {
+ foreach ($properties as $k => $v) {
if (property_exists($this, $k)) {
$this->$k = $v;
@@ -111,11 +111,11 @@ class Sharee implements Element {
function xmlSerialize(Writer $writer) {
$writer->write([
- '{DAV:}href' => $this->href,
- '{DAV:}prop' => $this->properties,
+ '{DAV:}href' => $this->href,
+ '{DAV:}prop' => $this->properties,
'{DAV:}share-access' => new ShareAccess($this->access),
]);
- switch($this->inviteStatus) {
+ switch ($this->inviteStatus) {
case Plugin::INVITE_NORESPONSE :
$writer->writeElement('{DAV:}invite-noresponse');
break;
diff --git a/lib/DAV/Xml/Property/Invite.php b/lib/DAV/Xml/Property/Invite.php
index 0b61eac..1fab4d0 100644
--- a/lib/DAV/Xml/Property/Invite.php
+++ b/lib/DAV/Xml/Property/Invite.php
@@ -2,8 +2,6 @@
namespace Sabre\DAV\Xml\Property;
-use Sabre\DAV\Exception\BadRequest;
-use Sabre\DAV\Sharing\Plugin as SharingPlugin;
use Sabre\DAV\Sharing\Sharee;
use Sabre\Xml\XmlSerializable;
use Sabre\Xml\Writer;
@@ -63,7 +61,7 @@ class Invite implements XmlSerializable {
*/
function xmlSerialize(Writer $writer) {
- foreach($this->sharees as $sharee) {
+ foreach ($this->sharees as $sharee) {
$writer->writeElement('{DAV:}sharee', $sharee);
}
diff --git a/lib/DAV/Xml/Property/ShareAccess.php b/lib/DAV/Xml/Property/ShareAccess.php
index ab9bb37..b1a90de 100644
--- a/lib/DAV/Xml/Property/ShareAccess.php
+++ b/lib/DAV/Xml/Property/ShareAccess.php
@@ -124,8 +124,8 @@ class ShareAccess implements Element {
$elems = $reader->parseInnerTree();
$value = null;
- foreach($elems as $elem) {
- switch($elem['name']) {
+ foreach ($elems as $elem) {
+ switch ($elem['name']) {
case '{DAV:}not-shared' :
return new self(SharingPlugin::ACCESS_NOTSHARED);
case '{DAV:}sharedowner' :
diff --git a/lib/DAV/Xml/Request/ShareResource.php b/lib/DAV/Xml/Request/ShareResource.php
index b230689..965e585 100644
--- a/lib/DAV/Xml/Request/ShareResource.php
+++ b/lib/DAV/Xml/Request/ShareResource.php
@@ -4,9 +4,7 @@ namespace Sabre\DAV\Xml\Request;
use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
-use Sabre\Xml\Deserializer;
use Sabre\DAV\Xml\Element\Sharee;
-use Sabre\DAV\Exception\BadRequest;
/**
* ShareResource request parser.
@@ -63,9 +61,9 @@ class ShareResource implements XmlDeserializable {
static function xmlDeserialize(Reader $reader) {
$elems = $reader->parseInnerTree([
- '{DAV:}sharee' => 'Sabre\DAV\Xml\Element\Sharee',
+ '{DAV:}sharee' => 'Sabre\DAV\Xml\Element\Sharee',
'{DAV:}share-access' => 'Sabre\DAV\Xml\Property\ShareAccess',
- '{DAV:}prop' => 'Sabre\Xml\Deserializer\keyValue',
+ '{DAV:}prop' => 'Sabre\Xml\Deserializer\keyValue',
]);
$sharees = [];
diff --git a/tests/Sabre/CalDAV/Backend/MockSharing.php b/tests/Sabre/CalDAV/Backend/MockSharing.php
index 7a5216a..c1318fc 100644
--- a/tests/Sabre/CalDAV/Backend/MockSharing.php
+++ b/tests/Sabre/CalDAV/Backend/MockSharing.php
@@ -107,7 +107,7 @@ class MockSharing extends Mock implements NotificationSupport, SharingSupport {
foreach ($sharees as $sharee) {
$existingKey = null;
- foreach($this->shares[$calendarId] as $k=>$existingSharee) {
+ foreach ($this->shares[$calendarId] as $k => $existingSharee) {
if ($sharee->href === $existingSharee->href) {
$existingKey = $k;
}
diff --git a/tests/Sabre/DAV/Mock/SharedNode.php b/tests/Sabre/DAV/Mock/SharedNode.php
index d3a492d..bc28061 100644
--- a/tests/Sabre/DAV/Mock/SharedNode.php
+++ b/tests/Sabre/DAV/Mock/SharedNode.php
@@ -65,11 +65,11 @@ class SharedNode extends \Sabre\DAV\Node implements ISharedNode {
*/
function updateInvites(array $sharees) {
- foreach($sharees as $sharee) {
+ foreach ($sharees as $sharee) {
if ($sharee->access === \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS) {
// Removal
- foreach($this->invites as $k=>$invitee) {
+ foreach ($this->invites as $k => $invitee) {
if ($invitee->href = $sharee->href) {
unset($this->invites[$k]);
@@ -78,7 +78,7 @@ class SharedNode extends \Sabre\DAV\Node implements ISharedNode {
}
} else {
- foreach($this->invites as $k=>$invitee) {
+ foreach ($this->invites as $k => $invitee) {
if ($invitee->href = $sharee->href) {
// Overwriting an existing invitee
diff --git a/tests/Sabre/DAV/Sharing/ShareResourceTest.php b/tests/Sabre/DAV/Sharing/ShareResourceTest.php
index fd18cda..5a15ad9 100644
--- a/tests/Sabre/DAV/Sharing/ShareResourceTest.php
+++ b/tests/Sabre/DAV/Sharing/ShareResourceTest.php
@@ -44,14 +44,14 @@ XML;
$expected = [
new Sharee([
- 'href' => 'mailto:eric at example.com',
+ 'href' => 'mailto:eric at example.com',
'properties' => [
'{DAV:}displayname' => 'Eric York',
],
- 'access' => Plugin::ACCESS_READWRITE,
- 'comment' => 'Shared workspace',
+ 'access' => Plugin::ACCESS_READWRITE,
+ 'comment' => 'Shared workspace',
'inviteStatus' => Plugin::INVITE_NORESPONSE,
- ])
+ ])
];
$this->assertEquals(
diff --git a/tests/Sabre/DAV/Xml/Property/InviteTest.php b/tests/Sabre/DAV/Xml/Property/InviteTest.php
index bf7ebcd..d7a3f85 100644
--- a/tests/Sabre/DAV/Xml/Property/InviteTest.php
+++ b/tests/Sabre/DAV/Xml/Property/InviteTest.php
@@ -6,7 +6,7 @@ use Sabre\DAV\Sharing\Plugin;
use Sabre\DAV\Xml\Element\Sharee;
use Sabre\DAV\Xml\XmlTest;
-class InviteTestTest extends XmlTest {
+class InviteTest extends XmlTest {
function testSerialize() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-php/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list