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

Commit

Permalink
Fix violation to SOLID principles
Browse files Browse the repository at this point in the history
Declaration of method `query` should be compatible with parent class one, otherwise triggers a PHP strict error
  • Loading branch information
mouhamed committed Jan 4, 2014
1 parent 1ad040a commit 45d1614
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BjyProfiler/Db/Adapter/ProfilingAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Zend\Db\Adapter\Adapter;
use Zend\Db\Adapter\Driver as ZdbDriver;
use Zend\Db\Adapter\Profiler\ProfilerInterface;
use Zend\Db\ResultSet;

class ProfilingAdapter extends Adapter
{
Expand All @@ -22,7 +23,7 @@ public function getProfiler()
return $this->profiler;
}

public function query($sql, $parametersOrQueryMode = self::QUERY_MODE_PREPARE)
public function query($sql, $parametersOrQueryMode = self::QUERY_MODE_PREPARE, ResultSet\ResultSetInterface $resultPrototype = null)
{
$this->getProfiler()->startQuery($sql);
$return = parent::query($sql, $parametersOrQueryMode);

This comment has been minimized.

Copy link
@bartko-s

bartko-s Apr 5, 2014

@bjyoungblood Why $resultPrototype param is ignored???

Expand Down

1 comment on commit 45d1614

@stijnhau
Copy link

Choose a reason for hiding this comment

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

should the parameter also be passed to the parent function itself for the cases it can be used.

Please sign in to comment.