Skip to content

Commit ee802da

Browse files
authored
Merge pull request #1375 from phil-davis/revert-1365
Revert PR 1365 "add params for put interface"
2 parents 5d73987 + 83bbb1a commit ee802da

File tree

12 files changed

+24
-34
lines changed

12 files changed

+24
-34
lines changed

lib/CalDAV/CalendarObject.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ public function get()
9292
* Updates the ICalendar-formatted object.
9393
*
9494
* @param string|resource $calendarData
95-
* @param object|null $params
9695
*
9796
* @return string
9897
*/
99-
public function put($calendarData, $params = null)
98+
public function put($calendarData)
10099
{
101100
if (is_resource($calendarData)) {
102101
$calendarData = stream_get_contents($calendarData);

lib/CalDAV/Schedule/SchedulingObject.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ public function get()
5959
* Updates the ICalendar-formatted object.
6060
*
6161
* @param string|resource $calendarData
62-
* @param object|null $params
6362
*
6463
* @return string
6564
*/
66-
public function put($calendarData, $params = null)
65+
public function put($calendarData)
6766
{
6867
throw new MethodNotAllowed('Updating scheduling objects is not supported');
6968
}

lib/CardDAV/Card.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,11 @@ public function get()
7878
/**
7979
* Updates the VCard-formatted object.
8080
*
81-
* @param string $cardData
82-
* @param object|null $params
81+
* @param string $cardData
8382
*
8483
* @return string|null
8584
*/
86-
public function put($cardData, $params = null)
85+
public function put($cardData)
8786
{
8887
if (is_resource($cardData)) {
8988
$cardData = stream_get_contents($cardData);

lib/DAV/CorePlugin.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ public function httpPut(RequestInterface $request, ResponseInterface $response)
429429
{
430430
$body = $request->getBodyAsStream();
431431
$path = $request->getPath();
432-
$params = (object) ['versioning' => $request->getHeader('versioning')];
433432

434433
// Intercepting Content-Range
435434
if ($request->getHeader('Content-Range')) {
@@ -490,7 +489,7 @@ public function httpPut(RequestInterface $request, ResponseInterface $response)
490489
if (!($node instanceof IFile)) {
491490
throw new Exception\Conflict('PUT is not allowed on non-files.');
492491
}
493-
if (!$this->server->updateFile($path, $body, $etag, $params)) {
492+
if (!$this->server->updateFile($path, $body, $etag)) {
494493
return false;
495494
}
496495

lib/DAV/FS/File.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ class File extends Node implements DAV\IFile
1818
/**
1919
* Updates the data.
2020
*
21-
* @param resource $data
22-
* @param object|null $params
21+
* @param resource $data
2322
*/
24-
public function put($data, $params = null)
23+
public function put($data)
2524
{
2625
file_put_contents($this->path, $data);
2726
clearstatcache(true, $this->path);

lib/DAV/FSExt/File.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport
2222
* Data is a readable stream resource.
2323
*
2424
* @param resource|string $data
25-
* @param object|null $params
2625
*
2726
* @return string
2827
*/
29-
public function put($data, $params = null)
28+
public function put($data)
3029
{
3130
file_put_contents($this->path, $data);
3231
clearstatcache(true, $this->path);

lib/DAV/File.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ abstract class File extends Node implements IFile
3434
* return an ETag, and just return null.
3535
*
3636
* @param string|resource $data
37-
* @param object|null $params
3837
*
3938
* @return string|null
4039
*/
41-
public function put($data, $params = null)
40+
public function put($data)
4241
{
4342
throw new Exception\Forbidden('Permission denied to change data');
4443
}

lib/DAV/IFile.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ interface IFile extends INode
3535
* return an ETag, and just return null.
3636
*
3737
* @param resource|string $data
38-
* @param object|null $params
3938
*
4039
* @return string|null
4140
*/
42-
public function put($data, $params = null);
41+
public function put($data);
4342

4443
/**
4544
* Returns the data.

lib/DAV/Server.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,14 +1114,13 @@ public function createFile($uri, $data, &$etag = null)
11141114
*
11151115
* This method will return true if the file was actually updated
11161116
*
1117-
* @param string $uri
1118-
* @param resource $data
1119-
* @param string $etag
1120-
* @param object|null $params
1117+
* @param string $uri
1118+
* @param resource $data
1119+
* @param string $etag
11211120
*
11221121
* @return bool
11231122
*/
1124-
public function updateFile($uri, $data, &$etag = null, $params = null)
1123+
public function updateFile($uri, $data, &$etag = null)
11251124
{
11261125
$node = $this->tree->getNodeForPath($uri);
11271126

@@ -1134,7 +1133,8 @@ public function updateFile($uri, $data, &$etag = null, $params = null)
11341133
if (!$this->emit('beforeWriteContent', [$uri, $node, &$data, &$modified])) {
11351134
return false;
11361135
}
1137-
$etag = $node->put($data, $params);
1136+
1137+
$etag = $node->put($data);
11381138
if ($modified) {
11391139
$etag = null;
11401140
}

tests/Sabre/DAV/Mock/File.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ public function setName($name)
8282
* different object on a subsequent GET you are strongly recommended to not
8383
* return an ETag, and just return null.
8484
*
85-
* @param resource $data
86-
* @param object|null $params
85+
* @param resource $data
8786
*
8887
* @return string|null
8988
*/
90-
public function put($data, $params = null)
89+
public function put($data)
9190
{
9291
if (is_resource($data)) {
9392
$data = stream_get_contents($data);

0 commit comments

Comments
 (0)