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
616eb824
Commit
616eb824
authored
5 months ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
replace calls to self with calls to static, fixes #4758
Closes #4758 Merge request
studip/studip!3548
parent
eef7f9f6
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/SimpleCollection.php
+5
-12
5 additions, 12 deletions
lib/classes/SimpleCollection.php
with
5 additions
and
12 deletions
lib/classes/SimpleCollection.php
+
5
−
12
View file @
616eb824
<?php
if
(
!
defined
(
'SORT_NATURAL'
))
{
define
(
'SORT_NATURAL'
,
6
);
}
if
(
!
defined
(
'SORT_FLAG_CASE'
))
{
define
(
'SORT_FLAG_CASE'
,
8
);
}
/**
* SimpleCollection.php
* collection of assoc arrays with convenience
...
...
@@ -386,7 +379,7 @@ class SimpleCollection extends StudipArrayObject
*/
public
function
findBy
(
$key
,
$values
,
$op
=
'=='
)
{
$comp_func
=
s
elf
::
getCompFunc
(
$op
,
$values
);
$comp_func
=
s
tatic
::
getCompFunc
(
$op
,
$values
);
return
$this
->
filter
(
function
(
$record
)
use
(
$comp_func
,
$key
)
{
return
$comp_func
(
$record
[
$key
]);
});
...
...
@@ -404,7 +397,7 @@ class SimpleCollection extends StudipArrayObject
*/
public
function
findOneBy
(
$key
,
$values
,
$op
=
'=='
)
{
$comp_func
=
s
elf
::
getCompFunc
(
$op
,
$values
);
$comp_func
=
s
tatic
::
getCompFunc
(
$op
,
$values
);
return
$this
->
filter
(
function
(
$record
)
use
(
$comp_func
,
$key
)
{
return
$comp_func
(
$record
[
$key
]);
},
1
)
->
first
();
...
...
@@ -462,7 +455,7 @@ class SimpleCollection extends StudipArrayObject
}
}
}
return
s
elf
::
createFromArray
(
$results
);
return
s
tatic
::
createFromArray
(
$results
);
}
/**
...
...
@@ -621,7 +614,7 @@ class SimpleCollection extends StudipArrayObject
public
function
unsetBy
(
$key
,
$values
,
$op
=
'=='
)
{
$ret
=
false
;
$comp_func
=
s
elf
::
getCompFunc
(
$op
,
$values
);
$comp_func
=
s
tatic
::
getCompFunc
(
$op
,
$values
);
foreach
(
$this
->
storage
as
$k
=>
$record
)
{
if
(
$comp_func
(
$record
[
$key
]))
{
$this
->
offsetunset
(
$k
);
...
...
@@ -737,7 +730,7 @@ class SimpleCollection extends StudipArrayObject
$offset
=
$arg1
;
$row_count
=
$arg2
;
}
return
s
elf
::
createFromArray
(
array_slice
(
$this
->
storage
,
$offset
,
$row_count
,
true
));
return
s
tatic
::
createFromArray
(
array_slice
(
$this
->
storage
,
$offset
,
$row_count
,
true
));
}
/**
...
...
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