Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Vips
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uni Osnabrück
Plugins
Vips
Commits
b8356748
Commit
b8356748
authored
1 year ago
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
add workaround for API change in BlockType, fixes
#250
parent
99855b2a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/TestBlock.php
+23
-2
23 additions, 2 deletions
lib/TestBlock.php
with
23 additions
and
2 deletions
lib/TestBlock.php
+
23
−
2
View file @
b8356748
...
@@ -12,8 +12,29 @@
...
@@ -12,8 +12,29 @@
use
Courseware\BlockTypes\BlockType
;
use
Courseware\BlockTypes\BlockType
;
use
Opis\JsonSchema\Schema
;
use
Opis\JsonSchema\Schema
;
// use old API with Stud.IP < 6.0
if
(
class_exists
(
'Opis\JsonSchema\Schema'
))
{
trait
VipsJsonSchema
{
public
static
function
getJsonSchema
():
Schema
{
return
Schema
::
fromJsonString
(
self
::
_getJsonSchema
());
}
}
}
else
{
trait
VipsJsonSchema
{
public
static
function
getJsonSchema
():
string
{
return
self
::
_getJsonSchema
();
}
}
}
class
TestBlock
extends
BlockType
class
TestBlock
extends
BlockType
{
{
use
VipsJsonSchema
;
/**
/**
* Get a short string describing this type of block.
* Get a short string describing this type of block.
*/
*/
...
@@ -49,7 +70,7 @@ class TestBlock extends BlockType
...
@@ -49,7 +70,7 @@ class TestBlock extends BlockType
/**
/**
* Get the JSON schema for the payload of this block type.
* Get the JSON schema for the payload of this block type.
*/
*/
public
static
function
getJsonSchema
():
Schema
public
static
function
_
getJsonSchema
():
string
{
{
$schema
=
[
$schema
=
[
'type'
=>
'object'
,
'type'
=>
'object'
,
...
@@ -60,7 +81,7 @@ class TestBlock extends BlockType
...
@@ -60,7 +81,7 @@ class TestBlock extends BlockType
]
]
];
];
return
Schema
::
fromJsonString
(
json_encode
(
$schema
)
)
;
return
json_encode
(
$schema
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment