Skip to content

Commit

Permalink
Zend\Validator\Barcode cleanup
Browse files Browse the repository at this point in the history
- s/AdapterInterface/Adapter/g
  • Loading branch information
weierophinney committed Jul 6, 2010
1 parent 98933fd commit 718443a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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
*/
interface AdapterInterface
interface Adapter
{
/**
* Checks the length of a barcode
Expand Down Expand Up @@ -67,7 +67,7 @@ public function getCheck();
* Sets the checksum validation
*
* @param boolean $check
* @return Zend_Validate_Barcode_Adapter Provides fluid interface
* @return Zend\Validate\Barcode\Adapter Provides fluid interface
*/
public function setCheck($check);
}
5 changes: 2 additions & 3 deletions library/Zend/Validator/Barcode/AdapterAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
namespace Zend\Validator\Barcode;

/**
* @uses \Zend\Validator\Barcode\AdapterInterface
* @uses \Zend\Validator\Barcode\Adapter
* @category Zend
* @package Zend_Validate
* @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 AdapterAbstract
implements AdapterInterface
abstract class AdapterAbstract implements Adapter
{
/**
* Allowed barcode lengths
Expand Down
13 changes: 4 additions & 9 deletions library/Zend/Validator/Barcode/Barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,13 @@ public function getAdapter()
public function setAdapter($adapter, $options = null)
{
$adapter = ucfirst(strtolower($adapter));
// if (\Zend\Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) {
$adapter = '\\Zend\\Validator\\Barcode\\' . $adapter;
// }
//
// if (!class_exists($adapter)) {
\Zend\Loader::loadClass($adapter);
// }
$adapter = '\\Zend\\Validator\\Barcode\\' . $adapter;
\Zend\Loader::loadClass($adapter);

$this->_adapter = new $adapter($options);
if (!$this->_adapter instanceof AdapterInterface) {
if (!$this->_adapter instanceof Adapter) {
throw new Validator\Exception(
"Adapter " . $adapter . " does not implement Zend\\Validate\\Barcode\\AdapterInterface"
"Adapter " . $adapter . " does not implement Zend\\Validate\\Barcode\\Adapter"
);
}

Expand Down
6 changes: 3 additions & 3 deletions working/PHPNamespacer-MappedClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16163,10 +16163,10 @@
<mappedClass>
<originalRelativeFilePath>Zend/Validate/Barcode/AdapterInterface.php</originalRelativeFilePath>
<originalClassName>Zend_Validate_Barcode_AdapterInterface</originalClassName>
<newRelativeFilePath>Zend/Validator/Barcode/AdapterInterface.php</newRelativeFilePath>
<newRelativeFilePath>Zend/Validator/Barcode/Adapter.php</newRelativeFilePath>
<newNamespace>Zend\Validator\Barcode</newNamespace>
<newClassName>AdapterInterface</newClassName>
<newFullyQualifiedName>Zend\Validator\Barcode\AdapterInterface</newFullyQualifiedName>
<newClassName>Adapter</newClassName>
<newFullyQualifiedName>Zend\Validator\Barcode\Adapter</newFullyQualifiedName>
</mappedClass>
<mappedClass>
<originalRelativeFilePath>Zend/Validate/Barcode/Code25.php</originalRelativeFilePath>
Expand Down

0 comments on commit 718443a

Please sign in to comment.