| Conditions | 1 |
| Paths | 1 |
| Total Lines | 56 |
| Code Lines | 35 |
| 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 |
||
| 62 | private function getBaseDefaultContainerBuiderProphecy() |
||
| 63 | { |
||
| 64 | $containerBuilderProphecy = $this->prophesize('Symfony\Component\DependencyInjection\ContainerBuilder'); |
||
| 65 | |||
| 66 | $containerBuilderProphecy->setParameter('loopback_api.parameter.filter', 'filter')->shouldBeCalled(); |
||
| 67 | $containerBuilderProphecy->setParameter('loopback_api.parameter.order_filter', 'order')->shouldBeCalled(); |
||
| 68 | $containerBuilderProphecy->setParameter('loopback_api.parameter.search_filter', 'where')->shouldBeCalled(); |
||
| 69 | |||
| 70 | $containerBuilderProphecy->hasExtension('http://symfony.com/schema/dic/services')->shouldBeCalled(); |
||
| 71 | |||
| 72 | $containerBuilderProphecy |
||
| 73 | ->addResource(DependencyInjectionArgument::service(getcwd().'/src/Resources/config/services.xml')) |
||
| 74 | ->shouldBeCalled() |
||
| 75 | ; |
||
| 76 | |||
| 77 | $containerBuilderProphecy |
||
| 78 | ->setDefinition( |
||
| 79 | 'loopback_api.resource', |
||
| 80 | DependencyInjectionArgument::definition(Resource::class) |
||
| 81 | ) |
||
| 82 | ->shouldBeCalled() |
||
| 83 | ; |
||
| 84 | |||
| 85 | $containerBuilderProphecy |
||
| 86 | ->setDefinition( |
||
| 87 | 'loopback_api.http.query_extractor.order_filter_query_extractor', |
||
| 88 | DependencyInjectionArgument::definition('Fidry\LoopBackApiBundle\Http\Request\FilterQueryExtractor') |
||
| 89 | ) |
||
| 90 | ->shouldBeCalled() |
||
| 91 | ; |
||
| 92 | $containerBuilderProphecy |
||
| 93 | ->setDefinition( |
||
| 94 | 'loopback_api.http.query_extractor.where_filter_query_extractor', |
||
| 95 | DependencyInjectionArgument::definition('Fidry\LoopBackApiBundle\Http\Request\FilterQueryExtractor') |
||
| 96 | ) |
||
| 97 | ->shouldBeCalled() |
||
| 98 | ; |
||
| 99 | |||
| 100 | |||
| 101 | $containerBuilderProphecy |
||
| 102 | ->setDefinition( |
||
| 103 | 'loopback_api.filter.where_filter', |
||
| 104 | DependencyInjectionArgument::definition('Fidry\LoopBackApiBundle\Filter\WhereFilter') |
||
| 105 | ) |
||
| 106 | ->shouldBeCalled() |
||
| 107 | ; |
||
| 108 | $containerBuilderProphecy |
||
| 109 | ->setDefinition( |
||
| 110 | 'loopback_api.filter.order_filter', |
||
| 111 | DependencyInjectionArgument::definition('Fidry\LoopBackApiBundle\Filter\OrderFilter') |
||
| 112 | ) |
||
| 113 | ->shouldBeCalled() |
||
| 114 | ; |
||
| 115 | |||
| 116 | return $containerBuilderProphecy; |
||
| 117 | } |
||
| 118 | } |
||
| 119 |