Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
e7192bc1
Commit
e7192bc1
authored
6 months ago
by
David Siegfried
Committed by
Jan-Hendrik Willms
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
prevent php-warnings in visibility, fixes #4598
Closes #4598 Merge request
studip/studip!3408
parent
fa2e6a94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/classes/visibility/VisibilitySettings.php
+12
-14
12 additions, 14 deletions
lib/classes/visibility/VisibilitySettings.php
with
12 additions
and
14 deletions
lib/classes/visibility/VisibilitySettings.php
+
12
−
14
View file @
e7192bc1
...
...
@@ -37,22 +37,22 @@ class VisibilitySettings
];
/**
* @var array all visibilitystates
* @var array all visibilitystates
*/
public
$states
=
[];
/**
/**
* @var array all names of all states
*/
*/
private
$names
=
[];
/**
* I/O is expensive. Therefore we make the whole class sessionwide singleton
* to save some I/O.
*
*
* @return VisibilitySettings The sessionwide visibilitySettings
*/
static
public
function
getInstance
()
static
public
function
getInstance
()
{
static
$instance
;
...
...
@@ -85,11 +85,11 @@ class VisibilitySettings
* @param string $owner_id The owner of the visibility
* @param int $visibility the visibilityID
* @return boolean true if the user may see it, false if the user is not
* allowed to see
* allowed to see
*/
function
verify
(
$user_id
,
$owner_id
,
$visibility
)
{
return
$this
->
states
[
$visibility
]
&&
$this
->
states
[
$visibility
]
->
verify
(
$owner_id
,
$user_id
);
return
!
empty
(
$this
->
states
[
$visibility
]
)
&&
$this
->
states
[
$visibility
]
->
verify
(
$owner_id
,
$user_id
);
}
/**
...
...
@@ -104,7 +104,7 @@ class VisibilitySettings
/**
* Returns all keys of states
* @return array all keys of states
* @return array all keys of states
*/
function
getAllKeys
()
{
...
...
@@ -113,7 +113,7 @@ class VisibilitySettings
/**
* Returns all names of states
* @return array all names of states
* @return array all names of states
*/
function
getAllNames
()
{
...
...
@@ -122,7 +122,7 @@ class VisibilitySettings
/**
* Returns the number of possible states
* @return
type
* @return
int
*/
function
count
()
{
...
...
@@ -130,5 +130,3 @@ class VisibilitySettings
}
}
?>
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