| Conditions | 1 |
| Paths | 1 |
| Total Lines | 63 |
| Code Lines | 2 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 27 | public function __construct() |
||
| 28 | { |
||
| 29 | /** @var \FFI\Libc\ptrace_ffi ffi */ |
||
| 30 | $this->ffi = \FFI::cdef(' |
||
| 31 | struct user_regs_struct { |
||
| 32 | unsigned long r15; |
||
| 33 | unsigned long r14; |
||
| 34 | unsigned long r13; |
||
| 35 | unsigned long r12; |
||
| 36 | unsigned long bp; |
||
| 37 | unsigned long bx; |
||
| 38 | unsigned long r11; |
||
| 39 | unsigned long r10; |
||
| 40 | unsigned long r9; |
||
| 41 | unsigned long r8; |
||
| 42 | unsigned long ax; |
||
| 43 | unsigned long cx; |
||
| 44 | unsigned long dx; |
||
| 45 | unsigned long si; |
||
| 46 | unsigned long di; |
||
| 47 | unsigned long orig_ax; |
||
| 48 | unsigned long ip; |
||
| 49 | unsigned long cs; |
||
| 50 | unsigned long flags; |
||
| 51 | unsigned long sp; |
||
| 52 | unsigned long ss; |
||
| 53 | unsigned long fs_base; |
||
| 54 | unsigned long gs_base; |
||
| 55 | unsigned long ds; |
||
| 56 | unsigned long es; |
||
| 57 | unsigned long fs; |
||
| 58 | unsigned long gs; |
||
| 59 | }; |
||
| 60 | typedef int pid_t; |
||
| 61 | enum __ptrace_request |
||
| 62 | { |
||
| 63 | PTRACE_TRACEME = 0, |
||
| 64 | PTRACE_PEEKTEXT = 1, |
||
| 65 | PTRACE_PEEKDATA = 2, |
||
| 66 | PTRACE_PEEKUSER = 3, |
||
| 67 | PTRACE_POKETEXT = 4, |
||
| 68 | PTRACE_POKEDATA = 5, |
||
| 69 | PTRACE_POKEUSER = 6, |
||
| 70 | PTRACE_CONT = 7, |
||
| 71 | PTRACE_KILL = 8, |
||
| 72 | PTRACE_SINGLESTEP = 9, |
||
| 73 | PTRACE_GETREGS = 12, |
||
| 74 | PTRACE_SETREGS = 13, |
||
| 75 | PTRACE_GETFPREGS = 14, |
||
| 76 | PTRACE_SETFPREGS = 15, |
||
| 77 | PTRACE_ATTACH = 16, |
||
| 78 | PTRACE_DETACH = 17, |
||
| 79 | PTRACE_GETFPXREGS = 18, |
||
| 80 | PTRACE_SETFPXREGS = 19, |
||
| 81 | PTRACE_SYSCALL = 24, |
||
| 82 | PTRACE_SETOPTIONS = 0x4200, |
||
| 83 | PTRACE_GETEVENTMSG = 0x4201, |
||
| 84 | PTRACE_GETSIGINFO = 0x4202, |
||
| 85 | PTRACE_SETSIGINFO = 0x4203 |
||
| 86 | }; |
||
| 87 | long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data); |
||
| 88 | int errno; |
||
| 89 | ', 'libc.so.6'); |
||
| 90 | } |
||
| 127 |