| Conditions | 1 |
| Paths | 1 |
| Total Lines | 58 |
| Code Lines | 43 |
| 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 |
||
| 22 | private function getVoiceConstraints(): array |
||
| 23 | { |
||
| 24 | return [ |
||
| 25 | IbmWatsonVoicesInterface::VOICE_ALLISON => new TtsVoiceFormat( |
||
| 26 | new Language(Language::CODE_ENGLISH), |
||
| 27 | TtsVoiceFormat::GENDER_MALE |
||
| 28 | ), |
||
| 29 | IbmWatsonVoicesInterface::VOICE_BIRGIT => new TtsVoiceFormat( |
||
| 30 | new Language(Language::CODE_GERMAN), |
||
| 31 | TtsVoiceFormat::GENDER_FEMALE |
||
| 32 | ), |
||
| 33 | IbmWatsonVoicesInterface::VOICE_DIETER => new TtsVoiceFormat( |
||
| 34 | new Language(Language::CODE_GERMAN), |
||
| 35 | TtsVoiceFormat::GENDER_MALE |
||
| 36 | ), |
||
| 37 | IbmWatsonVoicesInterface::VOICE_EMI => new TtsVoiceFormat( |
||
| 38 | new Language(Language::CODE_JAPANESE), |
||
| 39 | TtsVoiceFormat::GENDER_FEMALE |
||
| 40 | ), |
||
| 41 | IbmWatsonVoicesInterface::VOICE_ENRIQUE => new TtsVoiceFormat( |
||
| 42 | new Language(Language::CODE_SPANISH), |
||
| 43 | TtsVoiceFormat::GENDER_MALE |
||
| 44 | ), |
||
| 45 | IbmWatsonVoicesInterface::VOICE_FRANCESCA => new TtsVoiceFormat( |
||
| 46 | new Language(Language::CODE_ITALIAN), |
||
| 47 | TtsVoiceFormat::GENDER_FEMALE |
||
| 48 | ), |
||
| 49 | IbmWatsonVoicesInterface::VOICE_ISABELA => new TtsVoiceFormat( |
||
| 50 | new Language(Language::CODE_PORTUGUESE), |
||
| 51 | TtsVoiceFormat::GENDER_FEMALE |
||
| 52 | ), |
||
| 53 | IbmWatsonVoicesInterface::VOICE_KATE => new TtsVoiceFormat( |
||
| 54 | new Language(Language::CODE_ENGLISH), |
||
| 55 | TtsVoiceFormat::GENDER_FEMALE |
||
| 56 | ), |
||
| 57 | IbmWatsonVoicesInterface::VOICE_LAURA => new TtsVoiceFormat( |
||
| 58 | new Language(Language::CODE_SPANISH), |
||
| 59 | TtsVoiceFormat::GENDER_FEMALE |
||
| 60 | ), |
||
| 61 | IbmWatsonVoicesInterface::VOICE_LISA => new TtsVoiceFormat( |
||
| 62 | new Language(Language::CODE_ENGLISH), |
||
| 63 | TtsVoiceFormat::GENDER_FEMALE |
||
| 64 | ), |
||
| 65 | IbmWatsonVoicesInterface::VOICE_MICHAEL => new TtsVoiceFormat( |
||
| 66 | new Language(Language::CODE_ENGLISH), |
||
| 67 | TtsVoiceFormat::GENDER_MALE |
||
| 68 | ), |
||
| 69 | IbmWatsonVoicesInterface::VOICE_RENEE => new TtsVoiceFormat( |
||
| 70 | new Language(Language::CODE_FRENCH), |
||
| 71 | TtsVoiceFormat::GENDER_FEMALE |
||
| 72 | ), |
||
| 73 | IbmWatsonVoicesInterface::VOICE_SOFIA_LA => new TtsVoiceFormat( |
||
| 74 | new Language(Language::CODE_SPANISH), |
||
| 75 | TtsVoiceFormat::GENDER_FEMALE |
||
| 76 | ), |
||
| 77 | IbmWatsonVoicesInterface::VOICE_SOFIA_US => new TtsVoiceFormat( |
||
| 78 | new Language(Language::CODE_SPANISH), |
||
| 79 | TtsVoiceFormat::GENDER_FEMALE |
||
| 80 | ), |
||
| 165 |