Example #1
0
<?php

eq(3, \org\rhaco\lang\Text::length("abc"));
eq(5, \org\rhaco\lang\Text::length(array("abc", "defgh", "i")));
Example #2
0
     print "\n" . 'class ' . $arg . ' in module ' . $module . ':' . PHP_EOL;
     print ' Description:' . PHP_EOL;
     print '   ' . str_replace("\n", "\n   ", $module_info[0]) . PHP_EOL;
     print "\n" . ' Parameter:' . PHP_EOL;
     $len = \org\rhaco\lang\Text::length(array_keys($module_info[1]));
     foreach ($module_info[1] as $p) {
         print '    ' . str_pad('', $len) . '    (' . $p[1] . ') ' . $p[0] . ' : ' . $p[2] . PHP_EOL;
     }
 } else {
     $rtn = \org\rhaco\Dt::class_info($arg);
     print "\n" . 'class ' . $rtn['package'] . ':' . PHP_EOL;
     print '  Version: ' . $rtn['version'] . PHP_EOL . PHP_EOL;
     print '  Description:' . PHP_EOL;
     print '   ' . str_replace("\n", "\n  ", $rtn['description']) . PHP_EOL . PHP_EOL;
     list($static_methods, $methods, $protected_static_methods, $protected_methods, $properties, $modules) = array($rtn['static_methods'], $rtn['methods'], $rtn['protected_static_methods'], $rtn['protected_methods'], $rtn['properties'], $rtn['modules']);
     $len = \org\rhaco\lang\Text::length(array_merge(array_keys($static_methods), array_keys($methods), array_keys($properties), array_keys($modules)));
     if (!empty($static_methods)) {
         print "\n" . '  Static methods defined here:' . PHP_EOL;
         foreach ($static_methods as $k => $v) {
             print '    ' . str_pad($k, $len) . ' : ' . $v . PHP_EOL;
         }
     }
     if (!empty($methods)) {
         print "\n" . '  Methods defined here:' . PHP_EOL;
         foreach ($methods as $k => $v) {
             print '    ' . str_pad($k, $len) . ' : ' . $v . PHP_EOL;
         }
     }
     if (!empty($properties)) {
         print "\n" . '  Properties defined here:' . PHP_EOL;
         foreach ($properties as $k => $v) {