aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2022-07-06 12:28:01 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2022-07-06 12:28:01 +0000
commit5ebdfdc4bb3e8c02c9ba98e2d30367a0c48dbac7 (patch)
treec7e64f1f97fd7b37b462912404c1b5778e78286f /lib
parent3759c3248b0ca775c045ec4336748a6668b3eba5 (diff)
use own constructor interface for StandardFile, fixes #1280
Closes #1280 Merge request studip/studip!784
Diffstat (limited to 'lib')
-rw-r--r--lib/filesystem/FileType.php8
-rw-r--r--lib/filesystem/StandardFile.php2
-rw-r--r--lib/filesystem/StandardFileInterface.php11
-rw-r--r--lib/filesystem/UnknownFileType.php2
4 files changed, 13 insertions, 10 deletions
diff --git a/lib/filesystem/FileType.php b/lib/filesystem/FileType.php
index 60bfa44..003ee85 100644
--- a/lib/filesystem/FileType.php
+++ b/lib/filesystem/FileType.php
@@ -3,14 +3,6 @@
interface FileType
{
/**
- * StandardFile constructor.
- * @param $fileref
- * @param null $file : (optional) Is set if fileref and file are both new and not connected with
- * each other in the database.
- */
- public function __construct($fileref, $file = null);
-
- /**
* Returns the name of the icon shape that shall be used with the FileType implementation.
*
* @param string $role role of icon
diff --git a/lib/filesystem/StandardFile.php b/lib/filesystem/StandardFile.php
index 3fe3672..5c9b5e8 100644
--- a/lib/filesystem/StandardFile.php
+++ b/lib/filesystem/StandardFile.php
@@ -12,7 +12,7 @@
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
*/
-class StandardFile implements FileType, ArrayAccess
+class StandardFile implements FileType, ArrayAccess, StandardFileInterface
{
/**
diff --git a/lib/filesystem/StandardFileInterface.php b/lib/filesystem/StandardFileInterface.php
new file mode 100644
index 0000000..a246550
--- /dev/null
+++ b/lib/filesystem/StandardFileInterface.php
@@ -0,0 +1,11 @@
+<?php
+interface StandardFileInterface
+{
+ /**
+ * StandardFile constructor.
+ * @param $fileref
+ * @param null $file : (optional) Is set if fileref and file are both new and not connected with
+ * each other in the database.
+ */
+ public function __construct($fileref, $file = null);
+}
diff --git a/lib/filesystem/UnknownFileType.php b/lib/filesystem/UnknownFileType.php
index c8df875..effe751 100644
--- a/lib/filesystem/UnknownFileType.php
+++ b/lib/filesystem/UnknownFileType.php
@@ -20,7 +20,7 @@ class UnknownFileType implements FileType, ArrayAccess
*/
protected $fileref = null;
- public function __construct($fileref = null, $file = null)
+ public function __construct($fileref = null)
{
$this->fileref = $fileref;
}