Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
e548ba18
Unverified
Commit
e548ba18
authored
Sep 21, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove return type hint, can return null as well
parent
956422fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
EloquentFolderRepository.php
.../Media/Repositories/Eloquent/EloquentFolderRepository.php
+5
-4
FolderRepository.php
Modules/Media/Repositories/FolderRepository.php
+2
-2
No files found.
Modules/Media/Repositories/Eloquent/EloquentFolderRepository.php
View file @
e548ba18
...
...
@@ -13,9 +13,9 @@ class EloquentFolderRepository extends EloquentBaseRepository implements FolderR
/**
* Find a folder by its ID
* @param int $folderId
* @return File
* @return File
|null
*/
public
function
findFolder
(
int
$folderId
)
:
File
public
function
findFolder
(
int
$folderId
)
{
return
$this
->
model
->
where
(
'is_folder'
,
1
)
->
where
(
'id'
,
$folderId
)
->
first
();
}
...
...
@@ -44,8 +44,9 @@ class EloquentFolderRepository extends EloquentBaseRepository implements FolderR
{
if
(
array_key_exists
(
'parent_id'
,
$data
))
{
$parent
=
$this
->
findFolder
(
$data
[
'parent_id'
]);
return
$parent
->
path
->
getRelativeUrl
()
.
'/'
.
str_slug
(
array_get
(
$data
,
'name'
));
if
(
$parent
!==
null
)
{
return
$parent
->
path
->
getRelativeUrl
()
.
'/'
.
str_slug
(
array_get
(
$data
,
'name'
));
}
}
return
config
(
'asgard.media.config.files-path'
)
.
str_slug
(
array_get
(
$data
,
'name'
));
...
...
Modules/Media/Repositories/FolderRepository.php
View file @
e548ba18
...
...
@@ -10,7 +10,7 @@ interface FolderRepository extends BaseRepository
/**
* Find a folder by its ID
* @param int $folderId
* @return File
* @return File
|null
*/
public
function
findFolder
(
int
$folderId
)
:
File
;
public
function
findFolder
(
int
$folderId
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment