@@ -31,11 +31,11 @@ |
||
31 | 31 | * @since 5.0.0 |
32 | 32 | */ |
33 | 33 | interface Share_Backend_Collection extends Share_Backend { |
34 | - /** |
|
35 | - * Get the sources of the children of the item |
|
36 | - * @param string $itemSource |
|
37 | - * @return array Returns an array of children each inside an array with the keys: source, target, and file_path if applicable |
|
38 | - * @since 5.0.0 |
|
39 | - */ |
|
40 | - public function getChildren($itemSource); |
|
34 | + /** |
|
35 | + * Get the sources of the children of the item |
|
36 | + * @param string $itemSource |
|
37 | + * @return array Returns an array of children each inside an array with the keys: source, target, and file_path if applicable |
|
38 | + * @since 5.0.0 |
|
39 | + */ |
|
40 | + public function getChildren($itemSource); |
|
41 | 41 | } |
@@ -42,73 +42,73 @@ |
||
42 | 42 | */ |
43 | 43 | abstract class OCSController extends ApiController { |
44 | 44 | |
45 | - /** @var int */ |
|
46 | - private $ocsVersion; |
|
45 | + /** @var int */ |
|
46 | + private $ocsVersion; |
|
47 | 47 | |
48 | - /** |
|
49 | - * constructor of the controller |
|
50 | - * @param string $appName the name of the app |
|
51 | - * @param IRequest $request an instance of the request |
|
52 | - * @param string $corsMethods comma separated string of HTTP verbs which |
|
53 | - * should be allowed for websites or webapps when calling your API, defaults to |
|
54 | - * 'PUT, POST, GET, DELETE, PATCH' |
|
55 | - * @param string $corsAllowedHeaders comma separated string of HTTP headers |
|
56 | - * which should be allowed for websites or webapps when calling your API, |
|
57 | - * defaults to 'Authorization, Content-Type, Accept' |
|
58 | - * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS |
|
59 | - * request should be cached, defaults to 1728000 seconds |
|
60 | - * @since 8.1.0 |
|
61 | - */ |
|
62 | - public function __construct($appName, |
|
63 | - IRequest $request, |
|
64 | - $corsMethods='PUT, POST, GET, DELETE, PATCH', |
|
65 | - $corsAllowedHeaders='Authorization, Content-Type, Accept', |
|
66 | - $corsMaxAge=1728000){ |
|
67 | - parent::__construct($appName, $request, $corsMethods, |
|
68 | - $corsAllowedHeaders, $corsMaxAge); |
|
69 | - $this->registerResponder('json', function ($data) { |
|
70 | - return $this->buildOCSResponse('json', $data); |
|
71 | - }); |
|
72 | - $this->registerResponder('xml', function ($data) { |
|
73 | - return $this->buildOCSResponse('xml', $data); |
|
74 | - }); |
|
75 | - } |
|
48 | + /** |
|
49 | + * constructor of the controller |
|
50 | + * @param string $appName the name of the app |
|
51 | + * @param IRequest $request an instance of the request |
|
52 | + * @param string $corsMethods comma separated string of HTTP verbs which |
|
53 | + * should be allowed for websites or webapps when calling your API, defaults to |
|
54 | + * 'PUT, POST, GET, DELETE, PATCH' |
|
55 | + * @param string $corsAllowedHeaders comma separated string of HTTP headers |
|
56 | + * which should be allowed for websites or webapps when calling your API, |
|
57 | + * defaults to 'Authorization, Content-Type, Accept' |
|
58 | + * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS |
|
59 | + * request should be cached, defaults to 1728000 seconds |
|
60 | + * @since 8.1.0 |
|
61 | + */ |
|
62 | + public function __construct($appName, |
|
63 | + IRequest $request, |
|
64 | + $corsMethods='PUT, POST, GET, DELETE, PATCH', |
|
65 | + $corsAllowedHeaders='Authorization, Content-Type, Accept', |
|
66 | + $corsMaxAge=1728000){ |
|
67 | + parent::__construct($appName, $request, $corsMethods, |
|
68 | + $corsAllowedHeaders, $corsMaxAge); |
|
69 | + $this->registerResponder('json', function ($data) { |
|
70 | + return $this->buildOCSResponse('json', $data); |
|
71 | + }); |
|
72 | + $this->registerResponder('xml', function ($data) { |
|
73 | + return $this->buildOCSResponse('xml', $data); |
|
74 | + }); |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @param int $version |
|
79 | - * @since 11.0.0 |
|
80 | - * @internal |
|
81 | - */ |
|
82 | - public function setOCSVersion($version) { |
|
83 | - $this->ocsVersion = $version; |
|
84 | - } |
|
77 | + /** |
|
78 | + * @param int $version |
|
79 | + * @since 11.0.0 |
|
80 | + * @internal |
|
81 | + */ |
|
82 | + public function setOCSVersion($version) { |
|
83 | + $this->ocsVersion = $version; |
|
84 | + } |
|
85 | 85 | |
86 | - /** |
|
87 | - * Since the OCS endpoints default to XML we need to find out the format |
|
88 | - * again |
|
89 | - * @param mixed $response the value that was returned from a controller and |
|
90 | - * is not a Response instance |
|
91 | - * @param string $format the format for which a formatter has been registered |
|
92 | - * @throws \DomainException if format does not match a registered formatter |
|
93 | - * @return Response |
|
94 | - * @since 9.1.0 |
|
95 | - */ |
|
96 | - public function buildResponse($response, $format = 'xml') { |
|
97 | - return parent::buildResponse($response, $format); |
|
98 | - } |
|
86 | + /** |
|
87 | + * Since the OCS endpoints default to XML we need to find out the format |
|
88 | + * again |
|
89 | + * @param mixed $response the value that was returned from a controller and |
|
90 | + * is not a Response instance |
|
91 | + * @param string $format the format for which a formatter has been registered |
|
92 | + * @throws \DomainException if format does not match a registered formatter |
|
93 | + * @return Response |
|
94 | + * @since 9.1.0 |
|
95 | + */ |
|
96 | + public function buildResponse($response, $format = 'xml') { |
|
97 | + return parent::buildResponse($response, $format); |
|
98 | + } |
|
99 | 99 | |
100 | - /** |
|
101 | - * Unwrap data and build ocs response |
|
102 | - * @param string $format json or xml |
|
103 | - * @param DataResponse $data the data which should be transformed |
|
104 | - * @since 8.1.0 |
|
105 | - * @return \OC\AppFramework\OCS\BaseResponse |
|
106 | - */ |
|
107 | - private function buildOCSResponse($format, DataResponse $data) { |
|
108 | - if ($this->ocsVersion === 1) { |
|
109 | - return new \OC\AppFramework\OCS\V1Response($data, $format); |
|
110 | - } |
|
111 | - return new \OC\AppFramework\OCS\V2Response($data, $format); |
|
112 | - } |
|
100 | + /** |
|
101 | + * Unwrap data and build ocs response |
|
102 | + * @param string $format json or xml |
|
103 | + * @param DataResponse $data the data which should be transformed |
|
104 | + * @since 8.1.0 |
|
105 | + * @return \OC\AppFramework\OCS\BaseResponse |
|
106 | + */ |
|
107 | + private function buildOCSResponse($format, DataResponse $data) { |
|
108 | + if ($this->ocsVersion === 1) { |
|
109 | + return new \OC\AppFramework\OCS\V1Response($data, $format); |
|
110 | + } |
|
111 | + return new \OC\AppFramework\OCS\V2Response($data, $format); |
|
112 | + } |
|
113 | 113 | |
114 | 114 | } |
@@ -61,15 +61,15 @@ |
||
61 | 61 | */ |
62 | 62 | public function __construct($appName, |
63 | 63 | IRequest $request, |
64 | - $corsMethods='PUT, POST, GET, DELETE, PATCH', |
|
65 | - $corsAllowedHeaders='Authorization, Content-Type, Accept', |
|
66 | - $corsMaxAge=1728000){ |
|
64 | + $corsMethods = 'PUT, POST, GET, DELETE, PATCH', |
|
65 | + $corsAllowedHeaders = 'Authorization, Content-Type, Accept', |
|
66 | + $corsMaxAge = 1728000) { |
|
67 | 67 | parent::__construct($appName, $request, $corsMethods, |
68 | 68 | $corsAllowedHeaders, $corsMaxAge); |
69 | - $this->registerResponder('json', function ($data) { |
|
69 | + $this->registerResponder('json', function($data) { |
|
70 | 70 | return $this->buildOCSResponse('json', $data); |
71 | 71 | }); |
72 | - $this->registerResponder('xml', function ($data) { |
|
72 | + $this->registerResponder('xml', function($data) { |
|
73 | 73 | return $this->buildOCSResponse('xml', $data); |
74 | 74 | }); |
75 | 75 | } |
@@ -29,36 +29,36 @@ |
||
29 | 29 | * @since 8.0.0 |
30 | 30 | */ |
31 | 31 | class DataDownloadResponse extends DownloadResponse { |
32 | - /** |
|
33 | - * @var string |
|
34 | - */ |
|
35 | - private $data; |
|
32 | + /** |
|
33 | + * @var string |
|
34 | + */ |
|
35 | + private $data; |
|
36 | 36 | |
37 | - /** |
|
38 | - * Creates a response that prompts the user to download the text |
|
39 | - * @param string $data text to be downloaded |
|
40 | - * @param string $filename the name that the downloaded file should have |
|
41 | - * @param string $contentType the mimetype that the downloaded file should have |
|
42 | - * @since 8.0.0 |
|
43 | - */ |
|
44 | - public function __construct($data, $filename, $contentType) { |
|
45 | - $this->data = $data; |
|
46 | - parent::__construct($filename, $contentType); |
|
47 | - } |
|
37 | + /** |
|
38 | + * Creates a response that prompts the user to download the text |
|
39 | + * @param string $data text to be downloaded |
|
40 | + * @param string $filename the name that the downloaded file should have |
|
41 | + * @param string $contentType the mimetype that the downloaded file should have |
|
42 | + * @since 8.0.0 |
|
43 | + */ |
|
44 | + public function __construct($data, $filename, $contentType) { |
|
45 | + $this->data = $data; |
|
46 | + parent::__construct($filename, $contentType); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @param string $data |
|
51 | - * @since 8.0.0 |
|
52 | - */ |
|
53 | - public function setData($data) { |
|
54 | - $this->data = $data; |
|
55 | - } |
|
49 | + /** |
|
50 | + * @param string $data |
|
51 | + * @since 8.0.0 |
|
52 | + */ |
|
53 | + public function setData($data) { |
|
54 | + $this->data = $data; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @return string |
|
59 | - * @since 8.0.0 |
|
60 | - */ |
|
61 | - public function render() { |
|
62 | - return $this->data; |
|
63 | - } |
|
57 | + /** |
|
58 | + * @return string |
|
59 | + * @since 8.0.0 |
|
60 | + */ |
|
61 | + public function render() { |
|
62 | + return $this->data; |
|
63 | + } |
|
64 | 64 | } |
@@ -32,48 +32,48 @@ |
||
32 | 32 | */ |
33 | 33 | interface IOutput { |
34 | 34 | |
35 | - /** |
|
36 | - * @param string $out |
|
37 | - * @since 8.1.0 |
|
38 | - */ |
|
39 | - public function setOutput($out); |
|
35 | + /** |
|
36 | + * @param string $out |
|
37 | + * @since 8.1.0 |
|
38 | + */ |
|
39 | + public function setOutput($out); |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param string|resource $path or file handle |
|
43 | - * |
|
44 | - * @return bool false if an error occurred |
|
45 | - * @since 8.1.0 |
|
46 | - */ |
|
47 | - public function setReadfile($path); |
|
41 | + /** |
|
42 | + * @param string|resource $path or file handle |
|
43 | + * |
|
44 | + * @return bool false if an error occurred |
|
45 | + * @since 8.1.0 |
|
46 | + */ |
|
47 | + public function setReadfile($path); |
|
48 | 48 | |
49 | - /** |
|
50 | - * @param string $header |
|
51 | - * @since 8.1.0 |
|
52 | - */ |
|
53 | - public function setHeader($header); |
|
49 | + /** |
|
50 | + * @param string $header |
|
51 | + * @since 8.1.0 |
|
52 | + */ |
|
53 | + public function setHeader($header); |
|
54 | 54 | |
55 | - /** |
|
56 | - * @return int returns the current http response code |
|
57 | - * @since 8.1.0 |
|
58 | - */ |
|
59 | - public function getHttpResponseCode(); |
|
55 | + /** |
|
56 | + * @return int returns the current http response code |
|
57 | + * @since 8.1.0 |
|
58 | + */ |
|
59 | + public function getHttpResponseCode(); |
|
60 | 60 | |
61 | - /** |
|
62 | - * @param int $code sets the http status code |
|
63 | - * @since 8.1.0 |
|
64 | - */ |
|
65 | - public function setHttpResponseCode($code); |
|
61 | + /** |
|
62 | + * @param int $code sets the http status code |
|
63 | + * @since 8.1.0 |
|
64 | + */ |
|
65 | + public function setHttpResponseCode($code); |
|
66 | 66 | |
67 | - /** |
|
68 | - * @param string $name |
|
69 | - * @param string $value |
|
70 | - * @param int $expire |
|
71 | - * @param string $path |
|
72 | - * @param string $domain |
|
73 | - * @param bool $secure |
|
74 | - * @param bool $httpOnly |
|
75 | - * @since 8.1.0 |
|
76 | - */ |
|
77 | - public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly); |
|
67 | + /** |
|
68 | + * @param string $name |
|
69 | + * @param string $value |
|
70 | + * @param int $expire |
|
71 | + * @param string $path |
|
72 | + * @param string $domain |
|
73 | + * @param bool $secure |
|
74 | + * @param bool $httpOnly |
|
75 | + * @since 8.1.0 |
|
76 | + */ |
|
77 | + public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly); |
|
78 | 78 | |
79 | 79 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $this->filename = $filename; |
46 | 46 | $this->contentType = $contentType; |
47 | 47 | |
48 | - $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); |
|
48 | + $this->addHeader('Content-Disposition', 'attachment; filename="'.$filename.'"'); |
|
49 | 49 | $this->addHeader('Content-Type', $contentType); |
50 | 50 | } |
51 | 51 |
@@ -32,24 +32,24 @@ |
||
32 | 32 | */ |
33 | 33 | class DownloadResponse extends Response { |
34 | 34 | |
35 | - private $filename; |
|
36 | - private $contentType; |
|
37 | - |
|
38 | - /** |
|
39 | - * Creates a response that prompts the user to download the file |
|
40 | - * @param string $filename the name that the downloaded file should have |
|
41 | - * @param string $contentType the mimetype that the downloaded file should have |
|
42 | - * @since 7.0.0 |
|
43 | - */ |
|
44 | - public function __construct($filename, $contentType) { |
|
45 | - parent::__construct(); |
|
46 | - |
|
47 | - $this->filename = $filename; |
|
48 | - $this->contentType = $contentType; |
|
49 | - |
|
50 | - $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); |
|
51 | - $this->addHeader('Content-Type', $contentType); |
|
52 | - } |
|
35 | + private $filename; |
|
36 | + private $contentType; |
|
37 | + |
|
38 | + /** |
|
39 | + * Creates a response that prompts the user to download the file |
|
40 | + * @param string $filename the name that the downloaded file should have |
|
41 | + * @param string $contentType the mimetype that the downloaded file should have |
|
42 | + * @since 7.0.0 |
|
43 | + */ |
|
44 | + public function __construct($filename, $contentType) { |
|
45 | + parent::__construct(); |
|
46 | + |
|
47 | + $this->filename = $filename; |
|
48 | + $this->contentType = $contentType; |
|
49 | + |
|
50 | + $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); |
|
51 | + $this->addHeader('Content-Type', $contentType); |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | 55 | } |
@@ -44,69 +44,69 @@ |
||
44 | 44 | abstract class Middleware { |
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * This is being run in normal order before the controller is being |
|
49 | - * called which allows several modifications and checks |
|
50 | - * |
|
51 | - * @param Controller $controller the controller that is being called |
|
52 | - * @param string $methodName the name of the method that will be called on |
|
53 | - * the controller |
|
54 | - * @since 6.0.0 |
|
55 | - */ |
|
56 | - public function beforeController($controller, $methodName){ |
|
47 | + /** |
|
48 | + * This is being run in normal order before the controller is being |
|
49 | + * called which allows several modifications and checks |
|
50 | + * |
|
51 | + * @param Controller $controller the controller that is being called |
|
52 | + * @param string $methodName the name of the method that will be called on |
|
53 | + * the controller |
|
54 | + * @since 6.0.0 |
|
55 | + */ |
|
56 | + public function beforeController($controller, $methodName){ |
|
57 | 57 | |
58 | - } |
|
58 | + } |
|
59 | 59 | |
60 | 60 | |
61 | - /** |
|
62 | - * This is being run when either the beforeController method or the |
|
63 | - * controller method itself is throwing an exception. The middleware is |
|
64 | - * asked in reverse order to handle the exception and to return a response. |
|
65 | - * If the response is null, it is assumed that the exception could not be |
|
66 | - * handled and the error will be thrown again |
|
67 | - * |
|
68 | - * @param Controller $controller the controller that is being called |
|
69 | - * @param string $methodName the name of the method that will be called on |
|
70 | - * the controller |
|
71 | - * @param \Exception $exception the thrown exception |
|
72 | - * @throws \Exception the passed in exception if it can't handle it |
|
73 | - * @return Response a Response object in case that the exception was handled |
|
74 | - * @since 6.0.0 |
|
75 | - */ |
|
76 | - public function afterException($controller, $methodName, \Exception $exception){ |
|
77 | - throw $exception; |
|
78 | - } |
|
61 | + /** |
|
62 | + * This is being run when either the beforeController method or the |
|
63 | + * controller method itself is throwing an exception. The middleware is |
|
64 | + * asked in reverse order to handle the exception and to return a response. |
|
65 | + * If the response is null, it is assumed that the exception could not be |
|
66 | + * handled and the error will be thrown again |
|
67 | + * |
|
68 | + * @param Controller $controller the controller that is being called |
|
69 | + * @param string $methodName the name of the method that will be called on |
|
70 | + * the controller |
|
71 | + * @param \Exception $exception the thrown exception |
|
72 | + * @throws \Exception the passed in exception if it can't handle it |
|
73 | + * @return Response a Response object in case that the exception was handled |
|
74 | + * @since 6.0.0 |
|
75 | + */ |
|
76 | + public function afterException($controller, $methodName, \Exception $exception){ |
|
77 | + throw $exception; |
|
78 | + } |
|
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * This is being run after a successful controllermethod call and allows |
|
83 | - * the manipulation of a Response object. The middleware is run in reverse order |
|
84 | - * |
|
85 | - * @param Controller $controller the controller that is being called |
|
86 | - * @param string $methodName the name of the method that will be called on |
|
87 | - * the controller |
|
88 | - * @param Response $response the generated response from the controller |
|
89 | - * @return Response a Response object |
|
90 | - * @since 6.0.0 |
|
91 | - */ |
|
92 | - public function afterController($controller, $methodName, Response $response){ |
|
93 | - return $response; |
|
94 | - } |
|
81 | + /** |
|
82 | + * This is being run after a successful controllermethod call and allows |
|
83 | + * the manipulation of a Response object. The middleware is run in reverse order |
|
84 | + * |
|
85 | + * @param Controller $controller the controller that is being called |
|
86 | + * @param string $methodName the name of the method that will be called on |
|
87 | + * the controller |
|
88 | + * @param Response $response the generated response from the controller |
|
89 | + * @return Response a Response object |
|
90 | + * @since 6.0.0 |
|
91 | + */ |
|
92 | + public function afterController($controller, $methodName, Response $response){ |
|
93 | + return $response; |
|
94 | + } |
|
95 | 95 | |
96 | 96 | |
97 | - /** |
|
98 | - * This is being run after the response object has been rendered and |
|
99 | - * allows the manipulation of the output. The middleware is run in reverse order |
|
100 | - * |
|
101 | - * @param Controller $controller the controller that is being called |
|
102 | - * @param string $methodName the name of the method that will be called on |
|
103 | - * the controller |
|
104 | - * @param string $output the generated output from a response |
|
105 | - * @return string the output that should be printed |
|
106 | - * @since 6.0.0 |
|
107 | - */ |
|
108 | - public function beforeOutput($controller, $methodName, $output){ |
|
109 | - return $output; |
|
110 | - } |
|
97 | + /** |
|
98 | + * This is being run after the response object has been rendered and |
|
99 | + * allows the manipulation of the output. The middleware is run in reverse order |
|
100 | + * |
|
101 | + * @param Controller $controller the controller that is being called |
|
102 | + * @param string $methodName the name of the method that will be called on |
|
103 | + * the controller |
|
104 | + * @param string $output the generated output from a response |
|
105 | + * @return string the output that should be printed |
|
106 | + * @since 6.0.0 |
|
107 | + */ |
|
108 | + public function beforeOutput($controller, $methodName, $output){ |
|
109 | + return $output; |
|
110 | + } |
|
111 | 111 | |
112 | 112 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * the controller |
54 | 54 | * @since 6.0.0 |
55 | 55 | */ |
56 | - public function beforeController($controller, $methodName){ |
|
56 | + public function beforeController($controller, $methodName) { |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * @return Response a Response object in case that the exception was handled |
74 | 74 | * @since 6.0.0 |
75 | 75 | */ |
76 | - public function afterException($controller, $methodName, \Exception $exception){ |
|
76 | + public function afterException($controller, $methodName, \Exception $exception) { |
|
77 | 77 | throw $exception; |
78 | 78 | } |
79 | 79 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @return Response a Response object |
90 | 90 | * @since 6.0.0 |
91 | 91 | */ |
92 | - public function afterController($controller, $methodName, Response $response){ |
|
92 | + public function afterController($controller, $methodName, Response $response) { |
|
93 | 93 | return $response; |
94 | 94 | } |
95 | 95 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @return string the output that should be printed |
106 | 106 | * @since 6.0.0 |
107 | 107 | */ |
108 | - public function beforeOutput($controller, $methodName, $output){ |
|
108 | + public function beforeOutput($controller, $methodName, $output) { |
|
109 | 109 | return $output; |
110 | 110 | } |
111 | 111 |
@@ -35,63 +35,63 @@ |
||
35 | 35 | */ |
36 | 36 | class Http { |
37 | 37 | |
38 | - const STATUS_CONTINUE = 100; |
|
39 | - const STATUS_SWITCHING_PROTOCOLS = 101; |
|
40 | - const STATUS_PROCESSING = 102; |
|
41 | - const STATUS_OK = 200; |
|
42 | - const STATUS_CREATED = 201; |
|
43 | - const STATUS_ACCEPTED = 202; |
|
44 | - const STATUS_NON_AUTHORATIVE_INFORMATION = 203; |
|
45 | - const STATUS_NO_CONTENT = 204; |
|
46 | - const STATUS_RESET_CONTENT = 205; |
|
47 | - const STATUS_PARTIAL_CONTENT = 206; |
|
48 | - const STATUS_MULTI_STATUS = 207; |
|
49 | - const STATUS_ALREADY_REPORTED = 208; |
|
50 | - const STATUS_IM_USED = 226; |
|
51 | - const STATUS_MULTIPLE_CHOICES = 300; |
|
52 | - const STATUS_MOVED_PERMANENTLY = 301; |
|
53 | - const STATUS_FOUND = 302; |
|
54 | - const STATUS_SEE_OTHER = 303; |
|
55 | - const STATUS_NOT_MODIFIED = 304; |
|
56 | - const STATUS_USE_PROXY = 305; |
|
57 | - const STATUS_RESERVED = 306; |
|
58 | - const STATUS_TEMPORARY_REDIRECT = 307; |
|
59 | - const STATUS_BAD_REQUEST = 400; |
|
60 | - const STATUS_UNAUTHORIZED = 401; |
|
61 | - const STATUS_PAYMENT_REQUIRED = 402; |
|
62 | - const STATUS_FORBIDDEN = 403; |
|
63 | - const STATUS_NOT_FOUND = 404; |
|
64 | - const STATUS_METHOD_NOT_ALLOWED = 405; |
|
65 | - const STATUS_NOT_ACCEPTABLE = 406; |
|
66 | - const STATUS_PROXY_AUTHENTICATION_REQUIRED = 407; |
|
67 | - const STATUS_REQUEST_TIMEOUT = 408; |
|
68 | - const STATUS_CONFLICT = 409; |
|
69 | - const STATUS_GONE = 410; |
|
70 | - const STATUS_LENGTH_REQUIRED = 411; |
|
71 | - const STATUS_PRECONDITION_FAILED = 412; |
|
72 | - const STATUS_REQUEST_ENTITY_TOO_LARGE = 413; |
|
73 | - const STATUS_REQUEST_URI_TOO_LONG = 414; |
|
74 | - const STATUS_UNSUPPORTED_MEDIA_TYPE = 415; |
|
75 | - const STATUS_REQUEST_RANGE_NOT_SATISFIABLE = 416; |
|
76 | - const STATUS_EXPECTATION_FAILED = 417; |
|
77 | - const STATUS_IM_A_TEAPOT = 418; |
|
78 | - const STATUS_UNPROCESSABLE_ENTITY = 422; |
|
79 | - const STATUS_LOCKED = 423; |
|
80 | - const STATUS_FAILED_DEPENDENCY = 424; |
|
81 | - const STATUS_UPGRADE_REQUIRED = 426; |
|
82 | - const STATUS_PRECONDITION_REQUIRED = 428; |
|
83 | - const STATUS_TOO_MANY_REQUESTS = 429; |
|
84 | - const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; |
|
85 | - const STATUS_INTERNAL_SERVER_ERROR = 500; |
|
86 | - const STATUS_NOT_IMPLEMENTED = 501; |
|
87 | - const STATUS_BAD_GATEWAY = 502; |
|
88 | - const STATUS_SERVICE_UNAVAILABLE = 503; |
|
89 | - const STATUS_GATEWAY_TIMEOUT = 504; |
|
90 | - const STATUS_HTTP_VERSION_NOT_SUPPORTED = 505; |
|
91 | - const STATUS_VARIANT_ALSO_NEGOTIATES = 506; |
|
92 | - const STATUS_INSUFFICIENT_STORAGE = 507; |
|
93 | - const STATUS_LOOP_DETECTED = 508; |
|
94 | - const STATUS_BANDWIDTH_LIMIT_EXCEEDED = 509; |
|
95 | - const STATUS_NOT_EXTENDED = 510; |
|
96 | - const STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511; |
|
38 | + const STATUS_CONTINUE = 100; |
|
39 | + const STATUS_SWITCHING_PROTOCOLS = 101; |
|
40 | + const STATUS_PROCESSING = 102; |
|
41 | + const STATUS_OK = 200; |
|
42 | + const STATUS_CREATED = 201; |
|
43 | + const STATUS_ACCEPTED = 202; |
|
44 | + const STATUS_NON_AUTHORATIVE_INFORMATION = 203; |
|
45 | + const STATUS_NO_CONTENT = 204; |
|
46 | + const STATUS_RESET_CONTENT = 205; |
|
47 | + const STATUS_PARTIAL_CONTENT = 206; |
|
48 | + const STATUS_MULTI_STATUS = 207; |
|
49 | + const STATUS_ALREADY_REPORTED = 208; |
|
50 | + const STATUS_IM_USED = 226; |
|
51 | + const STATUS_MULTIPLE_CHOICES = 300; |
|
52 | + const STATUS_MOVED_PERMANENTLY = 301; |
|
53 | + const STATUS_FOUND = 302; |
|
54 | + const STATUS_SEE_OTHER = 303; |
|
55 | + const STATUS_NOT_MODIFIED = 304; |
|
56 | + const STATUS_USE_PROXY = 305; |
|
57 | + const STATUS_RESERVED = 306; |
|
58 | + const STATUS_TEMPORARY_REDIRECT = 307; |
|
59 | + const STATUS_BAD_REQUEST = 400; |
|
60 | + const STATUS_UNAUTHORIZED = 401; |
|
61 | + const STATUS_PAYMENT_REQUIRED = 402; |
|
62 | + const STATUS_FORBIDDEN = 403; |
|
63 | + const STATUS_NOT_FOUND = 404; |
|
64 | + const STATUS_METHOD_NOT_ALLOWED = 405; |
|
65 | + const STATUS_NOT_ACCEPTABLE = 406; |
|
66 | + const STATUS_PROXY_AUTHENTICATION_REQUIRED = 407; |
|
67 | + const STATUS_REQUEST_TIMEOUT = 408; |
|
68 | + const STATUS_CONFLICT = 409; |
|
69 | + const STATUS_GONE = 410; |
|
70 | + const STATUS_LENGTH_REQUIRED = 411; |
|
71 | + const STATUS_PRECONDITION_FAILED = 412; |
|
72 | + const STATUS_REQUEST_ENTITY_TOO_LARGE = 413; |
|
73 | + const STATUS_REQUEST_URI_TOO_LONG = 414; |
|
74 | + const STATUS_UNSUPPORTED_MEDIA_TYPE = 415; |
|
75 | + const STATUS_REQUEST_RANGE_NOT_SATISFIABLE = 416; |
|
76 | + const STATUS_EXPECTATION_FAILED = 417; |
|
77 | + const STATUS_IM_A_TEAPOT = 418; |
|
78 | + const STATUS_UNPROCESSABLE_ENTITY = 422; |
|
79 | + const STATUS_LOCKED = 423; |
|
80 | + const STATUS_FAILED_DEPENDENCY = 424; |
|
81 | + const STATUS_UPGRADE_REQUIRED = 426; |
|
82 | + const STATUS_PRECONDITION_REQUIRED = 428; |
|
83 | + const STATUS_TOO_MANY_REQUESTS = 429; |
|
84 | + const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; |
|
85 | + const STATUS_INTERNAL_SERVER_ERROR = 500; |
|
86 | + const STATUS_NOT_IMPLEMENTED = 501; |
|
87 | + const STATUS_BAD_GATEWAY = 502; |
|
88 | + const STATUS_SERVICE_UNAVAILABLE = 503; |
|
89 | + const STATUS_GATEWAY_TIMEOUT = 504; |
|
90 | + const STATUS_HTTP_VERSION_NOT_SUPPORTED = 505; |
|
91 | + const STATUS_VARIANT_ALSO_NEGOTIATES = 506; |
|
92 | + const STATUS_INSUFFICIENT_STORAGE = 507; |
|
93 | + const STATUS_LOOP_DETECTED = 508; |
|
94 | + const STATUS_BANDWIDTH_LIMIT_EXCEEDED = 509; |
|
95 | + const STATUS_NOT_EXTENDED = 510; |
|
96 | + const STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511; |
|
97 | 97 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * defaults to 'Authorization, Content-Type, Accept' |
56 | 56 | * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS |
57 | 57 | * request should be cached, defaults to 1728000 seconds |
58 | - * @since 7.0.0 |
|
58 | + * @since 7.0.0 |
|
59 | 59 | */ |
60 | 60 | public function __construct($appName, |
61 | 61 | IRequest $request, |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @NoAdminRequired |
77 | 77 | * @NoCSRFRequired |
78 | 78 | * @PublicPage |
79 | - * @since 7.0.0 |
|
79 | + * @since 7.0.0 |
|
80 | 80 | */ |
81 | 81 | public function preflightedCors() { |
82 | 82 | if(isset($this->request->server['HTTP_ORIGIN'])) { |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function __construct($appName, |
61 | 61 | IRequest $request, |
62 | - $corsMethods='PUT, POST, GET, DELETE, PATCH', |
|
63 | - $corsAllowedHeaders='Authorization, Content-Type, Accept', |
|
64 | - $corsMaxAge=1728000){ |
|
62 | + $corsMethods = 'PUT, POST, GET, DELETE, PATCH', |
|
63 | + $corsAllowedHeaders = 'Authorization, Content-Type, Accept', |
|
64 | + $corsMaxAge = 1728000) { |
|
65 | 65 | parent::__construct($appName, $request); |
66 | 66 | $this->corsMethods = $corsMethods; |
67 | 67 | $this->corsAllowedHeaders = $corsAllowedHeaders; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @since 7.0.0 |
80 | 80 | */ |
81 | 81 | public function preflightedCors() { |
82 | - if(isset($this->request->server['HTTP_ORIGIN'])) { |
|
82 | + if (isset($this->request->server['HTTP_ORIGIN'])) { |
|
83 | 83 | $origin = $this->request->server['HTTP_ORIGIN']; |
84 | 84 | } else { |
85 | 85 | $origin = '*'; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $response = new Response(); |
89 | 89 | $response->addHeader('Access-Control-Allow-Origin', $origin); |
90 | 90 | $response->addHeader('Access-Control-Allow-Methods', $this->corsMethods); |
91 | - $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge); |
|
91 | + $response->addHeader('Access-Control-Max-Age', (string) $this->corsMaxAge); |
|
92 | 92 | $response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders); |
93 | 93 | $response->addHeader('Access-Control-Allow-Credentials', 'false'); |
94 | 94 | return $response; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * @param string $msg the error message |
38 | 38 | * @since 7.0.0 |
39 | 39 | */ |
40 | - public function __construct($msg){ |
|
40 | + public function __construct($msg) { |
|
41 | 41 | parent::__construct($msg); |
42 | 42 | } |
43 | 43 |
@@ -33,13 +33,13 @@ |
||
33 | 33 | */ |
34 | 34 | class MultipleObjectsReturnedException extends \Exception implements IMapperException { |
35 | 35 | |
36 | - /** |
|
37 | - * Constructor |
|
38 | - * @param string $msg the error message |
|
39 | - * @since 7.0.0 |
|
40 | - */ |
|
41 | - public function __construct($msg){ |
|
42 | - parent::__construct($msg); |
|
43 | - } |
|
36 | + /** |
|
37 | + * Constructor |
|
38 | + * @param string $msg the error message |
|
39 | + * @since 7.0.0 |
|
40 | + */ |
|
41 | + public function __construct($msg){ |
|
42 | + parent::__construct($msg); |
|
43 | + } |
|
44 | 44 | |
45 | 45 | } |