| Conditions | 1 |
| Paths | 1 |
| Total Lines | 73 |
| 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 |
||
| 46 | protected function registerDependencies() |
||
| 47 | { |
||
| 48 | $this->dependency_map->registerDependencies( |
||
| 49 | 'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData', |
||
| 50 | [ |
||
| 51 | 'EventEspresso\core\domain\entities\admin\GraphQLData\Datetimes' => EE_Dependency_Map::load_from_cache, |
||
| 52 | 'EventEspresso\core\domain\entities\admin\GraphQLData\Prices' => EE_Dependency_Map::load_from_cache, |
||
| 53 | 'EventEspresso\core\domain\entities\admin\GraphQLData\PriceTypes' => EE_Dependency_Map::load_from_cache, |
||
| 54 | 'EventEspresso\core\domain\entities\admin\GraphQLData\Tickets' => EE_Dependency_Map::load_from_cache, |
||
| 55 | 'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities' => EE_Dependency_Map::load_from_cache, |
||
| 56 | 'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations' => EE_Dependency_Map::load_from_cache, |
||
| 57 | ] |
||
| 58 | ); |
||
| 59 | $this->dependency_map->registerDependencies( |
||
| 60 | 'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations', |
||
| 61 | [ |
||
| 62 | 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
||
| 63 | 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
||
| 64 | 'EEM_Price' => EE_Dependency_Map::load_from_cache, |
||
| 65 | 'EEM_Price_Type' => EE_Dependency_Map::load_from_cache, |
||
| 66 | 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
||
| 67 | ] |
||
| 68 | ); |
||
| 69 | $this->dependency_map->registerDependencies( |
||
| 70 | 'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities', |
||
| 71 | [ |
||
| 72 | 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
||
| 73 | 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
||
| 74 | 'EEM_Price' => EE_Dependency_Map::load_from_cache, |
||
| 75 | 'EEM_Price_Type' => EE_Dependency_Map::load_from_cache, |
||
| 76 | 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
||
| 77 | 'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes' => EE_Dependency_Map::load_from_cache, |
||
| 78 | ] |
||
| 79 | ); |
||
| 80 | $this->dependency_map->registerDependencies( |
||
| 81 | 'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes', |
||
| 82 | [ |
||
| 83 | 'EventEspresso\core\domain\services\admin\entities\DefaultTickets' => EE_Dependency_Map::load_from_cache, |
||
| 84 | 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
||
| 85 | ] |
||
| 86 | ); |
||
| 87 | $this->dependency_map->registerDependencies( |
||
| 88 | 'EventEspresso\core\domain\services\admin\entities\DefaultTickets', |
||
| 89 | [ |
||
| 90 | 'EventEspresso\core\domain\services\admin\entities\DefaultPrices' => EE_Dependency_Map::load_from_cache, |
||
| 91 | 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
||
| 92 | ] |
||
| 93 | ); |
||
| 94 | $this->dependency_map->registerDependencies( |
||
| 95 | 'EventEspresso\core\domain\services\admin\entities\DefaultPrices', |
||
| 96 | [ |
||
| 97 | 'EEM_Price' => EE_Dependency_Map::load_from_cache, |
||
| 98 | 'EEM_Price_Type' => EE_Dependency_Map::load_from_cache, |
||
| 99 | ] |
||
| 100 | ); |
||
| 101 | $this->dependency_map->registerDependencies( |
||
| 102 | 'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor', |
||
| 103 | [ |
||
| 104 | 'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData' => EE_Dependency_Map::load_from_cache, |
||
| 105 | 'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache, |
||
| 106 | ] |
||
| 107 | ); |
||
| 108 | /** @var EventEspressoData $primary_data_node */ |
||
| 109 | $primary_data_node = $this->loader->getShared( |
||
| 110 | 'EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData' |
||
| 111 | ); |
||
| 112 | $primary_data_node->setTargetScript(EspressoCoreAppAssetManager::JS_HANDLE_EDITOR); |
||
| 113 | /** @var EventEditor $data_node */ |
||
| 114 | $data_node = $this->loader->getShared( |
||
| 115 | 'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor' |
||
| 116 | ); |
||
| 117 | $this->setDataNode($data_node); |
||
| 118 | } |
||
| 119 | |||
| 139 |