Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

fix BC for #6890 #6924

Merged
merged 3 commits into from
Nov 25, 2014
Merged

fix BC for #6890 #6924

merged 3 commits into from
Nov 25, 2014

Conversation

turrsis
Copy link
Contributor

@turrsis turrsis commented Nov 25, 2014

This is reorganize of #6890 and c91bd9b.

Because defaultPlatform is realy BC and don't required in Zend\Db\Sql\Platform\* classes

@@ -10,6 +10,12 @@
namespace Zend\Db\Sql\Platform;

use Zend\Db\Adapter\AdapterInterface;
use Zend\Db\Adapter\Platform\PlatformInterface;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove blank line

@turrsis
Copy link
Contributor Author

turrsis commented Nov 25, 2014

Who can say why tests is failed?

@samsonasik
Copy link
Contributor

it's cs, there is travis build error :

  1. Sql/Platform/PlatformTest.php (braces)
You can fix with php-cs-fixer : php-cs-fixer fix tests/ZendTest/Db/Sql/Platform/PlatformTest.php --fixers=braces


$mockDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface');
$mockDriver->expects($this->any())->method('formatParameterName')->will($this->returnValue('?'));
$mockDriver->expects($this->any())->method('createStatement')->will($this->returnCallback(function () {return new Adapter\StatementContainer;}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the easiest way is to use php-cs-fixer :

php-cs-fixer fix tests/ZendTest/Db/Sql/Platform/PlatformTest.php --fixers=braces

@turrsis
Copy link
Contributor Author

turrsis commented Nov 25, 2014

@samsonasik Thank you! Problem was with new parameters, but with old version of php-cs-fixer.phar.

return $decorator;
}
foreach ($this->decorators as $type => $decorator) {
if ($subject instanceof $type && is_a($decorator, $type, true)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need is_a() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember - it was a long time ago.
This does not necessary and can be replaced to instanceof.
Do this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turrsis instanceof is sufficient: I'll fix on merge.

@Ocramius Ocramius merged commit 0315f5c into zendframework:develop Nov 25, 2014
Ocramius added a commit that referenced this pull request Nov 25, 2014
Ocramius added a commit that referenced this pull request Nov 25, 2014
Ocramius added a commit that referenced this pull request Nov 25, 2014
Ocramius added a commit that referenced this pull request Nov 25, 2014
@Ocramius Ocramius added this to the 2.4.0 milestone Nov 25, 2014
@Ocramius Ocramius self-assigned this Nov 25, 2014
@Ocramius
Copy link
Member

I manually merged this PR into develop at a0d8259

Thanks @turrsis!

@turrsis turrsis deleted the db/sql/fix-UseOfDifferentAdapters3 branch December 3, 2014 10:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants