Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
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
Tomáš Trávníček
doctrine-dbal
Commits
334cc7d9
Unverified
Commit
334cc7d9
authored
Aug 30, 2018
by
Alexander Deider
Committed by
Sergei Morozov
Sep 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schema\Sequence: force prospective type in setters for correct comparision
parent
a7dc38d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
Sequence.php
lib/Doctrine/DBAL/Schema/Sequence.php
+4
-4
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+2
-0
No files found.
lib/Doctrine/DBAL/Schema/Sequence.php
View file @
334cc7d9
...
@@ -57,8 +57,8 @@ class Sequence extends AbstractAsset
...
@@ -57,8 +57,8 @@ class Sequence extends AbstractAsset
public
function
__construct
(
$name
,
$allocationSize
=
1
,
$initialValue
=
1
,
$cache
=
null
)
public
function
__construct
(
$name
,
$allocationSize
=
1
,
$initialValue
=
1
,
$cache
=
null
)
{
{
$this
->
_setName
(
$name
);
$this
->
_setName
(
$name
);
$this
->
allocationSize
=
is_numeric
(
$allocationSize
)
?
$allocationSize
:
1
;
$this
->
setAllocationSize
(
$allocationSize
)
;
$this
->
initialValue
=
is_numeric
(
$initialValue
)
?
$initialValue
:
1
;
$this
->
setInitialValue
(
$initialValue
)
;
$this
->
cache
=
$cache
;
$this
->
cache
=
$cache
;
}
}
...
@@ -93,7 +93,7 @@ class Sequence extends AbstractAsset
...
@@ -93,7 +93,7 @@ class Sequence extends AbstractAsset
*/
*/
public
function
setAllocationSize
(
$allocationSize
)
public
function
setAllocationSize
(
$allocationSize
)
{
{
$this
->
allocationSize
=
is_numeric
(
$allocationSize
)
?
$allocationSize
:
1
;
$this
->
allocationSize
=
is_numeric
(
$allocationSize
)
?
(
int
)
$allocationSize
:
1
;
return
$this
;
return
$this
;
}
}
...
@@ -105,7 +105,7 @@ class Sequence extends AbstractAsset
...
@@ -105,7 +105,7 @@ class Sequence extends AbstractAsset
*/
*/
public
function
setInitialValue
(
$initialValue
)
public
function
setInitialValue
(
$initialValue
)
{
{
$this
->
initialValue
=
is_numeric
(
$initialValue
)
?
$initialValue
:
1
;
$this
->
initialValue
=
is_numeric
(
$initialValue
)
?
(
int
)
$initialValue
:
1
;
return
$this
;
return
$this
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
334cc7d9
...
@@ -435,11 +435,13 @@ class ComparatorTest extends \PHPUnit\Framework\TestCase
...
@@ -435,11 +435,13 @@ class ComparatorTest extends \PHPUnit\Framework\TestCase
$seq1
=
new
Sequence
(
'foo'
,
1
,
1
);
$seq1
=
new
Sequence
(
'foo'
,
1
,
1
);
$seq2
=
new
Sequence
(
'foo'
,
1
,
2
);
$seq2
=
new
Sequence
(
'foo'
,
1
,
2
);
$seq3
=
new
Sequence
(
'foo'
,
2
,
1
);
$seq3
=
new
Sequence
(
'foo'
,
2
,
1
);
$seq4
=
new
Sequence
(
'foo'
,
'1'
,
'1'
);
$c
=
new
Comparator
();
$c
=
new
Comparator
();
self
::
assertTrue
(
$c
->
diffSequence
(
$seq1
,
$seq2
));
self
::
assertTrue
(
$c
->
diffSequence
(
$seq1
,
$seq2
));
self
::
assertTrue
(
$c
->
diffSequence
(
$seq1
,
$seq3
));
self
::
assertTrue
(
$c
->
diffSequence
(
$seq1
,
$seq3
));
self
::
assertFalse
(
$c
->
diffSequence
(
$seq1
,
$seq4
));
}
}
public
function
testRemovedSequence
()
public
function
testRemovedSequence
()
...
...
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