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

Commit

Permalink
Merge branch 'master' of git://git.zendframework.com/zf
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahar Evron committed Jul 25, 2010
7 parents b288c81 + 4dca7a7 + e331113 + a7e1ad0 + c0434da + bc3b794 + 137fd45 commit d2ea768
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
9 changes: 5 additions & 4 deletions src/Adapter/Adapter.php → src/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
* @namespace
*/
namespace Zend\ProgressBar\Adapter;
use Zend\Config;

use Zend\Config\Config;

/**
* Abstract class for Zend_ProgressBar_Adapters
Expand All @@ -33,7 +34,7 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Adapter
abstract class AbstractAdapter
{
/**
* Option keys to skip when calling setOptions()
Expand All @@ -57,7 +58,7 @@ public function __construct($options = null)
{
if (is_array($options)) {
$this->setOptions($options);
} elseif ($options instanceof Config\Config) {
} elseif ($options instanceof Config) {
$this->setConfig($options);
}
}
Expand All @@ -68,7 +69,7 @@ public function __construct($options = null)
* @param \Zend\Config\Config $config
* @return \Zend\ProgressBar\Adapter\Adapter
*/
public function setConfig(Config\Config $config)
public function setConfig(Config $config)
{
$this->setOptions($config->toArray());

Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Console extends Adapter
class Console extends AbstractAdapter
{
/**
* Percentage value of the progress
Expand Down
9 changes: 5 additions & 4 deletions src/Adapter/JsPull.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
* @namespace
*/
namespace Zend\ProgressBar\Adapter;
use Zend\Json;

use Zend\Json\Json;

/**
* Zend_ProgressBar_Adapter_JsPull offers a simple method for updating a
Expand All @@ -35,7 +36,7 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class JsPull extends Adapter
class JsPull extends AbstractAdapter
{
/**
* Wether to exit after json data send or not
Expand Down Expand Up @@ -78,7 +79,7 @@ public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $te
'finished' => false
);

$data = Json\Json::encode($arguments);
$data = Json::encode($arguments);

// Output the data
$this->_outputData($data);
Expand All @@ -91,7 +92,7 @@ public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $te
*/
public function finish()
{
$data = Json\Json::encode(array('finished' => true));
$data = Json::encode(array('finished' => true));

$this->_outputData($data);
}
Expand Down
6 changes: 4 additions & 2 deletions src/Adapter/JsPush.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/
namespace Zend\ProgressBar\Adapter;

use Zend\Json\Json;

/**
* Zend_ProgressBar_Adapter_JsPush offers a simple method for updating a
* progressbar in a browser.
Expand All @@ -34,7 +36,7 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class JsPush extends Adapter
class JsPush extends AbstractAdapter
{
/**
* Name of the JavaScript method to call on update
Expand Down Expand Up @@ -99,7 +101,7 @@ public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $te
);

$data = '<script type="text/javascript">'
. 'parent.' . $this->_updateMethodName . '(' . \Zend\Json\Json::encode($arguments) . ');'
. 'parent.' . $this->_updateMethodName . '(' . Json::encode($arguments) . ');'
. '</script>';

// Output the data
Expand Down
2 changes: 1 addition & 1 deletion src/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ProgressBar
* @param string $persistenceNamespace
* @throws \Zend\ProgressBar\Exception When $min is greater than $max
*/
public function __construct(Adapter\Adapter $adapter, $min = 0, $max = 100, $persistenceNamespace = null)
public function __construct(Adapter\AbstractAdapter $adapter, $min = 0, $max = 100, $persistenceNamespace = null)
{
// Check min/max values and set them
if ($min > $max) {
Expand Down
2 changes: 1 addition & 1 deletion test/ProgressBarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getText()
}
}

class MockUp extends \Zend\ProgressBar\Adapter\Adapter
class MockUp extends \Zend\ProgressBar\Adapter\AbstractAdapter
{
protected $_current;
protected $_max;
Expand Down

0 comments on commit d2ea768

Please sign in to comment.