StrikeIron Service refactored #845

Merged
merged 3 commits into from Feb 28, 2012

Projects

None yet

2 participants

Member
Maks3w commented Feb 26, 2012

I adapted the code for StrikeIron Service to be compatible with the Framework.

Also adapt the logic for the missing Zend\Loader::loadClass() and complete an incomplete test case.

@weierophinney weierophinney commented on an outdated diff Feb 27, 2012
library/Zend/Service/StrikeIron/Base.php
* @uses SoapHeader
* @uses SoapClient
- * @uses Zend_Service_StrikeIron_Decorator
- * @uses Zend_Service_StrikeIron_Exception
+ * @uses \Zend\Service\StrikeIron\Decorator
+ * @uses \Zend\Service\StrikeIron\Exception
weierophinney
weierophinney Feb 27, 2012 Owner

You can get rid of all @uses annotations

@weierophinney weierophinney commented on the diff Feb 27, 2012
library/Zend/Service/StrikeIron/Base.php
@@ -53,12 +58,12 @@ class Zend_Service_StrikeIron_Base
* Class constructor
*
* @param array $options Key/value pair options
- * @throws Zend_Service_StrikeIron_Exception
weierophinney
weierophinney Feb 27, 2012 Owner

Reference these based on current namespace and/or imports.

@weierophinney weierophinney and 1 other commented on an outdated diff Feb 27, 2012
library/Zend/Service/StrikeIron/Base.php
@@ -111,7 +116,7 @@ protected function _initSoapClient()
}
if (! isset($this->_options['client'])) {
- $this->_options['client'] = new SoapClient($this->_options['wsdl'],
+ $this->_options['client'] = new \SoapClient($this->_options['wsdl'],
weierophinney
weierophinney Feb 27, 2012 Owner

Import SoapClient

weierophinney
weierophinney Feb 27, 2012 Owner

I'm wondering if we'd want to use the Zend\Soap\Client implementation. Not sure if you need to do that for this refactor, though.

Maks3w
Maks3w Feb 28, 2012 Member

You know, if something works don't touch ;-)

@weierophinney weierophinney commented on an outdated diff Feb 27, 2012
library/Zend/Service/StrikeIron/Base.php
@@ -145,7 +150,7 @@ protected function _initSoapHeaders()
// add default LicenseInfo header if a custom one was not supplied
if (! $foundLicenseInfo) {
- $this->_options['headers'][] = new SoapHeader('http://ws.strikeiron.com',
+ $this->_options['headers'][] = new \SoapHeader('http://ws.strikeiron.com',
weierophinney
weierophinney Feb 27, 2012 Owner

Import SoapHeader

@weierophinney weierophinney commented on an outdated diff Feb 27, 2012
...end/Service/StrikeIron/Exception/RuntimeException.php
+
+/**
+ * @namespace
+ */
+namespace Zend\Service\StrikeIron\Exception;
+
+/**
+ * @category Zend
+ * @package Zend_Service
+ * @subpackage StrikeIron
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class RuntimeException
+ extends \RuntimeException
+ implements \Zend\Service\StrikeIron\Exception
weierophinney
weierophinney Feb 27, 2012 Owner

Import this.

Owner

Similar comments to the Technorati refactor:

  • Remove all @uses annotations
  • Import all classes you use from outside the namespace (or in the parent namespace), including PHP built-ins
  • Classnames in docblocks follow the same resolution rules as PHP.

Thanks!

@Maks3w Maks3w Normalize class names
Remote underscore for non-public elements.
Remove @uses docblocks
e8a6245
Member
Maks3w commented Feb 28, 2012

Done

@Maks3w Maks3w closed this Feb 28, 2012
@Maks3w Maks3w reopened this Feb 28, 2012
@weierophinney weierophinney merged commit e8a6245 into zendframework:master Feb 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment