Changeset 496
- Timestamp:
- 04/13/07 15:01:11 (2 years ago)
- Files:
-
- trunk/src/main/php/_test/BuddyQuoteService.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/service (added)
- trunk/src/main/php/net/stubbles/service/annotations (added)
- trunk/src/main/php/net/stubbles/service/annotations/stubWebMethodAnnotation.php (added)
- trunk/src/main/php/net/stubbles/websites/processors/stubJsonRpcProcessor.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/_test/BuddyQuoteService.php
r427 r496 4 4 * 5 5 * @author Richard Sternagel 6 * @author Stephan Schmidt 6 7 * @package stubbles 7 * @subpackage websites8 * @subpackage examples 8 9 */ 9 10 10 11 class BuddyQuoteService { 11 12 protected $buddyQuotes = array( 12 13 protected $buddyQuotes = array( 13 14 'Banane im Trompetenrohr kommt zum Glück sehr selten vor.', 14 15 'Banane auf dem Sofakissen muss man wohl entfernen müssen', … … 20 21 ); 21 22 23 /** 24 * Get a quote 25 * 26 * @WebMethod 27 * @param int $arrKey 28 * @return string 29 */ 22 30 public function getQuote($arrKey) { 23 31 return $this->buddyQuotes[$arrKey]; trunk/src/main/php/net/stubbles/websites/processors/stubJsonRpcProcessor.php
r487 r496 9 9 */ 10 10 stubClassLoader::load('net.stubbles.websites.processors.stubAbstractProcessor', 11 'net.stubbles.util.validators.stubRegexValidator'); 11 'net.stubbles.util.validators.stubRegexValidator', 12 'net.stubbles.service.annotations.stubWebMethodAnnotation'); 12 13 13 14 /** … … 18 19 * @package stubbles 19 20 * @subpackage websites_processors 20 * @todo paramAnnotation could define an individual Range for the RegExValidator21 21 * @todo Finish refactoring 22 22 * @todo Make methods testable 23 * @todo Check for annotations24 23 * @todo Do not validate the RAW POST Data using a regexp, as json_decode does enough validation 25 24 */ … … 127 126 if ($method == null) { 128 127 throw new stubException('Unknown method ' . $className . '.' . $methodName . '.'); 128 } 129 if (!$method->hasAnnotation('WebMethod')) { 130 throw new stubException('Method ' . $className . '.' . $methodName . ' is no WebMethod.'); 129 131 } 130 132 if ($method->getNumberOfRequiredParameters() > count($params)) {
