Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8d8a9b7c
authored
Jun 10, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix slice on collection
1 parent
091da35c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
app/Service/Requests/APIRequest.php
app/Service/Requests/APIRequest.php
View file @
8d8a9b7
...
...
@@ -4,6 +4,7 @@ namespace App\Service\Requests;
use
App\Models\Tokens
;
use
App\Service\API\API
;
use
Ramsey\Collection\Collection
;
class
APIRequest
implements
\App\Service\Contract\APIRequest
{
...
...
@@ -107,6 +108,9 @@ class APIRequest implements \App\Service\Contract\APIRequest
private
function
sliceArray
(
$params
,
$offset
,
$length
=
null
)
:
array
{
if
(
$params
instanceof
Collection
)
{
$params
=
$params
->
toArray
();
}
return
array_values
(
array_slice
(
$params
,
$offset
,
$length
));
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment