Conditions | 1 |
Paths | 1 |
Total Lines | 73 |
Code Lines | 47 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
41 | public static function dependencies() { |
||
42 | self::$dependencies = [ |
||
43 | // Framework |
||
44 | |||
45 | // Traits |
||
46 | 'traits' => [ |
||
47 | 'static_class' => [ |
||
48 | 'path' => __DIR__.'/traits/static_class.php', |
||
49 | 'class' => \phoponent\framework\traits\static_class::class, |
||
50 | ], |
||
51 | 'view' => [ |
||
52 | 'path' => __DIR__.'/traits/view.php', |
||
53 | 'class' => \phoponent\framework\traits\view::class, |
||
54 | ], |
||
55 | 'model' => [ |
||
56 | 'path' => __DIR__.'/traits/model.php', |
||
57 | 'class' => \phoponent\framework\traits\model::class, |
||
58 | ], |
||
59 | 'service' => [ |
||
60 | 'path' => __DIR__.'/traits/service.php', |
||
61 | 'class' => \phoponent\framework\traits\service::class, |
||
62 | ], |
||
63 | 'command' => [ |
||
64 | 'path' => __DIR__.'/traits/command.php', |
||
65 | 'class' => \phoponent\framework\traits\command::class, |
||
66 | ], |
||
67 | ], |
||
68 | |||
69 | // Classes |
||
70 | 'classes' => [ |
||
71 | 'regexp' => [ |
||
72 | 'path' => __DIR__.'/classes/regexp.php', |
||
73 | \phoponent\framework\static_classe\regexp::class, |
||
74 | ], |
||
75 | 'phoponent' => [ |
||
76 | 'path' => __DIR__.'/classes/xphp.php', |
||
77 | \phoponent\framework\static_classe\xphp::class, |
||
78 | ], |
||
79 | 'component' => [ |
||
80 | 'path' => __DIR__.'/classes/xphp_tag.php', |
||
81 | \phoponent\framework\classe\xphp_tag::class, |
||
82 | ], |
||
83 | 'class_command' => [ |
||
84 | 'path' => __DIR__.'/classes/command.php', |
||
85 | \phoponent\framework\static_classe\command::class, |
||
86 | ], |
||
87 | ], |
||
88 | |||
89 | // Services |
||
90 | 'services' => [ |
||
91 | 'json_reader' => [ |
||
92 | 'path' => __DIR__.'/services/json_reader.php', |
||
93 | 'class' => \phoponent\framework\service\json_reader::class, |
||
94 | ], |
||
95 | 'json_writer' => [ |
||
96 | 'path' => __DIR__.'/services/json_writer.php', |
||
97 | 'class' => \phoponent\framework\service\json_writer::class, |
||
98 | ], |
||
99 | 'translation' => [ |
||
100 | 'path' => __DIR__.'/services/translation.php', |
||
101 | 'class' => \phoponent\framework\service\translation::class, |
||
102 | ], |
||
103 | ], |
||
104 | |||
105 | // Commandes |
||
106 | 'commands' => [ |
||
107 | 'help' => [ |
||
108 | 'path' => __DIR__.'/../commands/help.php', |
||
109 | 'class' => \phoponent\framework\command\help::class, |
||
110 | ], |
||
111 | 'make' => [ |
||
112 | 'path' => __DIR__.'/../commands/make.php', |
||
113 | 'class' => \phoponent\framework\command\make::class, |
||
114 | ] |
||
130 | } |