summaryrefslogtreecommitdiff
path: root/src/Http
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-14 02:17:27 +0100
committermsquare <msquare@notrademark.de>2018-12-02 12:53:31 +0100
commitc9d7e88cc70b6ad124c28be479a6e64c4b174ea6 (patch)
treeee4a37c27b05c1ef4ccc6a01cc088b510f5084ef /src/Http
parent55beca95cd8d6ecfe610daea304c8374a10485af (diff)
Implemented controller permissions
Diffstat (limited to 'src/Http')
-rw-r--r--src/Http/Exceptions/HttpForbidden.php23
-rw-r--r--src/Http/Request.php2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/Http/Exceptions/HttpForbidden.php b/src/Http/Exceptions/HttpForbidden.php
new file mode 100644
index 00000000..01c0a5ec
--- /dev/null
+++ b/src/Http/Exceptions/HttpForbidden.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Engelsystem\Http\Exceptions;
+
+use Throwable;
+
+class HttpForbidden extends HttpException
+{
+ /**
+ * @param string $message
+ * @param array $headers
+ * @param int $code
+ * @param Throwable|null $previous
+ */
+ public function __construct(
+ string $message = '',
+ array $headers = [],
+ int $code = 0,
+ Throwable $previous = null
+ ) {
+ parent::__construct(403, $message, $headers, $code, $previous);
+ }
+}
diff --git a/src/Http/Request.php b/src/Http/Request.php
index 0d8d28b4..06900a18 100644
--- a/src/Http/Request.php
+++ b/src/Http/Request.php
@@ -363,7 +363,7 @@ class Request extends SymfonyRequest implements ServerRequestInterface
foreach ($uploadedFiles as $file) {
/** @var UploadedFileInterface $file */
$filename = tempnam(sys_get_temp_dir(), 'upload');
- $handle = fopen($filename, "w");
+ $handle = fopen($filename, 'w');
fwrite($handle, $file->getStream()->getContents());
fclose($handle);