Advertisement
dragonrun1

WI-27754.php

Aug 3rd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1. <?php
  2. use \DomainException;
  3. use \InvalidArgumentException;
  4.  
  5. /**
  6.  * junk_anno_issue.php
  7.  *
  8.  * PHP version 5.4
  9.  *
  10.  * @since  20150803 19:33
  11.  * @author Michael Cummings <mgcummings@yahoo.com>
  12.  */
  13. class test
  14. {
  15.     /**
  16.      * Hi I'm a docblock.
  17.      *
  18.      * @param string $eventName
  19.      * @param array $listener
  20.      * @param int $priority
  21.      *
  22.      * @throws DomainException
  23.      * @throws InvalidArgumentException
  24.      */
  25.     public function addListener($eventName, array $listener, $priority = 0)
  26.     {
  27.         $this->checkEventName($eventName);
  28.         $this->checkAllowedListener($listener);
  29.         /* other code */
  30.     }
  31.     /**
  32.      * Hi I'm a docblock too.
  33.      *
  34.      * @param string $eventName
  35.      *
  36.      * @throws DomainException
  37.      */
  38.     public function checkEventName($eventName)
  39.     {
  40.         $eventName = (string)$eventName;
  41.         throw new DomainException('oops');
  42.     }
  43.     /**
  44.      * Hi I'm a docblock three.
  45.      *
  46.      * @param $listener
  47.      *
  48.      * @throws InvalidArgumentException
  49.      */
  50.     public function checkAllowedListener($listener)
  51.     {
  52.         $listener = (array)$listener;
  53.         throw new InvalidArgumentException;
  54.     }
  55. }
  56. class test1 extends test
  57. {
  58.     /**
  59.      * REMOVE THIS ONE!!!
  60.      *
  61.      * @inheritdoc
  62.      */
  63.     public function addListener($eventName, array $listener, $priority = 0)
  64.     {
  65.         $this->checkEventName($eventName);
  66.         $this->checkAllowedListener($listener);
  67.         /* other code */
  68.     }
  69.     /**
  70.      * @param $eventName
  71.      *
  72.      * @throws DomainException
  73.      */
  74.     public function checkEventName($eventName)
  75.     {
  76.         $eventName = (string)$eventName;
  77.         throw new DomainException('oops');
  78.     }
  79.     /**
  80.      * @param $listener
  81.      */
  82.     public function checkAllowedListener($listener)
  83.     {
  84.         $listener = (array)$listener;
  85.         throw new InvalidArgumentException;
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement