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
23b24999
Unverified
Commit
23b24999
authored
Jul 11, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using array_replace_recursive to merge arrays instead
parent
893a3270
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
5 deletions
+5
-5
FileIsCreating.php
Modules/Media/Events/FileIsCreating.php
+1
-1
FileIsUpdating.php
Modules/Media/Events/FileIsUpdating.php
+1
-2
EloquentFileRepositoryTest.php
Modules/Media/Tests/EloquentFileRepositoryTest.php
+1
-0
PageIsCreating.php
Modules/Page/Events/PageIsCreating.php
+1
-1
PageIsUpdating.php
Modules/Page/Events/PageIsUpdating.php
+1
-1
No files found.
Modules/Media/Events/FileIsCreating.php
View file @
23b24999
...
...
@@ -36,7 +36,7 @@ final class FileIsCreating implements EntityIsChanging
*/
public
function
setAttributes
(
array
$attributes
)
{
$this
->
attributes
+=
$attributes
;
$this
->
attributes
=
array_replace_recursive
(
$this
->
attributes
,
$attributes
)
;
}
/**
...
...
Modules/Media/Events/FileIsUpdating.php
View file @
23b24999
...
...
@@ -7,7 +7,6 @@ use Modules\Media\Entities\File;
final
class
FileIsUpdating
implements
EntityIsChanging
{
/**
* @var File
*/
...
...
@@ -49,7 +48,7 @@ final class FileIsUpdating implements EntityIsChanging
*/
public
function
setAttributes
(
array
$attributes
)
{
$this
->
attributes
+=
$attributes
;
$this
->
attributes
=
array_replace_recursive
(
$this
->
attributes
,
$attributes
)
;
}
/**
...
...
Modules/Media/Tests/EloquentFileRepositoryTest.php
View file @
23b24999
...
...
@@ -209,6 +209,7 @@ class EloquentFileRepositoryTest extends MediaTestCase
]);
$this
->
assertEquals
(
'bettername.jpg'
,
$file
->
filename
);
$this
->
assertEquals
(
'Hello World'
,
$file
->
translate
(
'en'
)
->
description
);
}
private
function
createFile
(
$fileName
=
'random/name.jpg'
)
...
...
Modules/Page/Events/PageIsCreating.php
View file @
23b24999
...
...
@@ -36,7 +36,7 @@ class PageIsCreating implements EntityIsChanging
*/
public
function
setAttributes
(
array
$attributes
)
{
$this
->
attributes
=
array_
merg
e
(
$this
->
attributes
,
$attributes
);
$this
->
attributes
=
array_
replace_recursiv
e
(
$this
->
attributes
,
$attributes
);
}
/**
...
...
Modules/Page/Events/PageIsUpdating.php
View file @
23b24999
...
...
@@ -42,7 +42,7 @@ class PageIsUpdating implements EntityIsChanging
*/
public
function
setAttributes
(
array
$attributes
)
{
$this
->
attributes
=
array_
merg
e
(
$this
->
attributes
,
$attributes
);
$this
->
attributes
=
array_
replace_recursiv
e
(
$this
->
attributes
,
$attributes
);
}
/**
...
...
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