Advertisement
Isigar

Druhy zápisu podmínky

Jan 7th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. /**
  2.      *
  3.      */
  4.     public function fromClass(ClassType $reflection)
  5.     {
  6.         $methods = $reflection->getMethods();
  7.         $array = [];
  8.         foreach($methods as $one)
  9.         {
  10.             /**
  11.              * Dva druhy zápisu. Jeden kratší, druhý dlouhý oba dělají to samé.
  12.              */
  13.             Strings::startsWith($one->getName(),"get")
  14.                 ? $one->getDeclaringClass() == $reflection->getName() ? $array[] = $one : null
  15.                 : null;
  16.            
  17.             if(Strings::startsWith($one->getName(),"get"))
  18.             {
  19.                 if($one->getDeclaringClass() == $reflection->getName())
  20.                 {
  21.                     $array[] = $one;
  22.                 }
  23.                 else
  24.                 {
  25.                     continue;
  26.                 }
  27.             }
  28.             else
  29.             {
  30.                 continue;
  31.             }
  32.         }
  33.         Dumper::dump($array);
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement