| Conditions | 1 |
| Paths | 1 |
| Total Lines | 158 |
| Code Lines | 116 |
| 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 |
||
| 11 | public function init() |
||
| 12 | { |
||
| 13 | $this->setName('language') |
||
| 14 | ->setHydrator(new EntityHydrator()) |
||
| 15 | ->setObject(new LanguageEntity()) |
||
| 16 | ->setLabel('Language'); |
||
| 17 | |||
| 18 | $this->add( |
||
| 19 | array( |
||
| 20 | 'name' => 'language', |
||
| 21 | 'type' => 'Zend\Form\Element\Select', |
||
| 22 | 'options' => array( |
||
| 23 | 'label' => 'Language', |
||
| 24 | 'value_options' => NativeLanguageFieldset::$languagesOptions |
||
| 25 | ), |
||
| 26 | 'attributes' => array( |
||
| 27 | 'title' => /*@translate */ 'which language are you speeking', |
||
| 28 | 'class' => 'language-select', |
||
| 29 | 'data-autoinit' => "false", |
||
| 30 | ) |
||
| 31 | ) |
||
| 32 | ); |
||
| 33 | |||
| 34 | $this->add( |
||
| 35 | array( |
||
| 36 | 'name' => 'levelListening', |
||
| 37 | 'type' => 'Zend\Form\Element\Select', |
||
| 38 | 'options' => array( |
||
| 39 | 'label' => /*@translate */ 'Listening', |
||
| 40 | 'value_options' => array( |
||
| 41 | '' => /*@translate */ 'Understanding Listening ...', |
||
| 42 | 'a1' => /*@translate */ 'I can understand familiar words and very basic phrases concerning myself, my family and immediate concrete surroundings when people speak slowly and clearly.', |
||
| 43 | 'a2' => /*@translate */ 'I can understand phrases and the highest frequency vocabulary related to areas of most immediate personal relevance (e.g. very basic personal and family information, shopping, local area, employment). I can catch the main point in short, clear, simple messages and announcements.', |
||
| 44 | 'b1' => /*@translate */ 'I can understand the main points of clear standard speech on familiar matters regularly encountered in work, school, leisure, etc. I can understand the main point of many radio or TV programmes on current affairs or topics of personal or professional interest when the delivery is relatively slow and clear.', |
||
| 45 | 'b2' => /*@translate */ 'I can understand extended speech and lectures and follow even complex lines of argument provided the topic is reasonably familiar. I can understand most TV news and current affairs programmes. I can understand the majority of films in standard dialect.', |
||
| 46 | 'c1' => /*@translate */ 'I can understand extended speech even when it is not clearly structured and when relationships are only implied and not signalled explicitly. I can understand television programmes and films without too much effort.', |
||
| 47 | 'c2' => /*@translate */ 'I have no difficulty in understanding any kind of spoken language, whether live or broadcast, even when delivered at fast native speed, provided I have some time to get familiar with the accent.', |
||
| 48 | ) |
||
| 49 | ), |
||
| 50 | 'attributes' => [ |
||
| 51 | 'title' => /*@translate */ 'level', |
||
| 52 | 'class' => 'level-select', |
||
| 53 | 'data-placeholder' => /*@translate*/ 'Understanding Listening ...', |
||
| 54 | 'data-allowclear' => 'true', |
||
| 55 | 'data-searchbox' => -1, |
||
| 56 | ] |
||
| 57 | |||
| 58 | ) |
||
| 59 | ); |
||
| 60 | |||
| 61 | $this->add( |
||
| 62 | array( |
||
| 63 | 'name' => 'levelReading', |
||
| 64 | 'type' => 'Zend\Form\Element\Select', |
||
| 65 | 'options' => [ |
||
| 66 | 'label' => /*@translate */ 'Reading', |
||
| 67 | 'value_options' => [ |
||
| 68 | '' => /*@translate */ 'Understanding Reading ...', |
||
| 69 | 'a1' => /*@translate */ 'I can understand familiar names, words and very simple sentences, for example on notices and posters or in catalogues.', |
||
| 70 | 'a2' => /*@translate */ 'I can read very short, simple texts. I can find specific, predictable information in simple everyday material such as advertisements, prospectuses, menus and timetables and I can understand short simple personal letters.', |
||
| 71 | 'b1' => /*@translate */ 'I can understand texts that consist mainly of high frequency everyday or job-related language. I can understand the description of events, feelings and wishes in personal letters.', |
||
| 72 | 'b2' => /*@translate */ 'I can read articles and reports concerned with contemporary problems in which the writers adopt particular attitudes or viewpoints. I can understand contemporary literary prose.', |
||
| 73 | 'c1' => /*@translate */ 'I can understand long and complex factual and literary texts, appreciating distinctions of style. I can understand specialised articles and longer technical instructions, even when they do not relate to my field.', |
||
| 74 | 'c2' => /*@translate */ 'I can read with ease virtually all forms of the written language, including abstract, structurally or linguistically complex texts such as manuals, specialised articles and literary works.', |
||
| 75 | ] |
||
| 76 | ], |
||
| 77 | 'attributes' => [ |
||
| 78 | 'title' => /*@translate */ 'level', |
||
| 79 | 'class' => 'level-select', |
||
| 80 | 'data-placeholder' => /*@translate*/ 'Understanding Reading ...', |
||
| 81 | 'data-allowclear' => 'true', |
||
| 82 | 'data-searchbox' => -1, |
||
| 83 | 'data-autoinit' => "false" |
||
| 84 | ] |
||
| 85 | ) |
||
| 86 | ); |
||
| 87 | |||
| 88 | $this->add( |
||
| 89 | array( |
||
| 90 | 'name' => 'levelSpokenInteraction', |
||
| 91 | 'type' => 'Zend\Form\Element\Select', |
||
| 92 | 'options' => [ |
||
| 93 | 'label' => /*@translate */ 'Spoken Interaction', |
||
| 94 | 'value_options' => [ |
||
| 95 | '' => /*@translate */ 'Spoken Interaction ...', |
||
| 96 | 'a1' => /*@translate */ 'I can interact in a simple way provided the other person is prepared to repeat or rephrase things at a slower rate of speech and help me formulate what I\'m trying to say. I can ask and answer simple questions in areas of immediate need or on very familiar topics.', |
||
| 97 | 'a2' => /*@translate */ 'I can communicate in simple and routine tasks requiring a simple and direct exchange of information on familiar topics and activities. I can handle very short social exchanges, even though I can\'t usually understand enough to keep the conversation going myself.', |
||
| 98 | 'b1' => /*@translate */ 'I can deal with most situations likely to arise whilst travelling in an area where the language is spoken. I can enter unprepared into conversation on topics that are familiar, of personal interest or pertinent to everyday life (e.g. family, hobbies, work, travel and current events).', |
||
| 99 | 'b2' => /*@translate */ 'I can interact with a degree of fluency and spontaneity that makes regular interaction with native speakers quite possible. I can take an active part in discussion in familiar contexts, accounting for and sustaining my views.', |
||
| 100 | 'c1' => /*@translate */ 'I can express myself fluently and spontaneously without much obvious searching for expressions. I can use language flexibly and effectively for social and professional purposes. I can formulate ideas and opinions with precision and relate my contribution skilfully to those of other speakers.', |
||
| 101 | 'c2' => /*@translate */ 'I can take part effortlessly in any conversation or discussion and have a good familiarity with idiomatic expressions and colloquialisms. I can express myself fluently and convey finer shades of meaning precisely. If I do have a problem I can backtrack and restructure around the difficulty so smoothly that other people are hardly aware of it.', |
||
| 102 | ] |
||
| 103 | ], |
||
| 104 | 'attributes' => array( |
||
| 105 | 'title' => /*@translate */ |
||
| 106 | 'level', |
||
| 107 | 'class' => 'level-select', |
||
| 108 | 'data-allowclear' => 'true', |
||
| 109 | 'data-searchbox' => -1, |
||
| 110 | ) |
||
| 111 | |||
| 112 | ) |
||
| 113 | ); |
||
| 114 | |||
| 115 | $this->add( |
||
| 116 | array( |
||
| 117 | 'name' => 'levelSpokenProduction', |
||
| 118 | 'type' => 'Zend\Form\Element\Select', |
||
| 119 | 'options' => array( |
||
| 120 | 'label' => /*@translate */ |
||
| 121 | 'Spoken Production', |
||
| 122 | 'value_options' => array( |
||
| 123 | '' => /*@translate */ 'Spoken Production ...', |
||
| 124 | 'a1' => /*@translate */ 'I can use simple phrases and sentences to describe where I live and people I know.', |
||
| 125 | 'a2' => /*@translate */ 'I can use a series of phrases and sentences to describe in simple terms my family and other people, living conditions, my educational background and my present or most recent job.', |
||
| 126 | 'b1' => /*@translate */ 'I can connect phrases in a simple way in order to describe experiences and events, my dreams, hopes and ambitions. I can briefly give reasons and explanations for opinions and plans. I can narrate a story or relate the plot of a book or film and describe my reactions.', |
||
| 127 | 'b2' => /*@translate */ 'I can present clear, detailed descriptions on a wide range of subjects related to my field of interest. I can explain a viewpoint on a topical issue giving the advantages and disadvantages of various options.', |
||
| 128 | 'c1' => /*@translate */ 'I can present clear, detailed descriptions of complex subjects integrating sub-themes, developing particular points and rounding off with an appropriate conclusion.', |
||
| 129 | 'c2' => /*@translate */ 'I can present a clear, smoothly-flowing description or argument in a style appropriate to the context and with an effective logical structure which helps the recipient to notice and remember significant points.', |
||
| 130 | ) |
||
| 131 | ), |
||
| 132 | 'attributes' => array( |
||
| 133 | 'title' => /*@translate */ 'level', |
||
| 134 | 'class' => 'level-select', |
||
| 135 | 'data-allowclear' => 'true', |
||
| 136 | 'data-searchbox' => -1, |
||
| 137 | ) |
||
| 138 | |||
| 139 | ) |
||
| 140 | ); |
||
| 141 | |||
| 142 | $this->add( |
||
| 143 | array( |
||
| 144 | 'name' => 'levelWriting', |
||
| 145 | 'type' => 'Zend\Form\Element\Select', |
||
| 146 | 'options' => [ |
||
| 147 | 'label' => /*@translate */ 'Writing', |
||
| 148 | 'value_options' => [ |
||
| 149 | '' => /*@translate */ 'Writing ...', |
||
| 150 | 'a1' => /*@translate */ 'I can write a short, simple postcard, for example sending holiday greetings. I can fill in forms with personal details, for example entering my name, nationality and address on a hotel registration form.', |
||
| 151 | 'a2' => /*@translate */ 'I can write short, simple notes and messages. I can write a very simple personal letter, for example thanking someone for something.', |
||
| 152 | 'b1' => /*@translate */ 'I can write simple connected text on topics which are familiar or of personal interest. I can write personal letters describing experiences and impressions.', |
||
| 153 | 'b2' => /*@translate */ 'I can write clear, detailed text on a wide range of subjects related to my interests. I can write an essay or report, passing on information or giving reasons in support of or against a particular point of view. I can write letters highlighting the personal significance of events and experiences.', |
||
| 154 | 'c1' => /*@translate */ 'I can express myself in clear, well-structured text, expressing points of view at some length. I can write about complex subjects in a letter, an essay or a report, underlining what I consider to be the salient issues. I can select a style appropriate to the reader in mind.', |
||
| 155 | 'c2' => /*@translate */ 'I can write clear, smoothly-flowing text in an appropriate style. I can write complex letters, reports or articles which present a case with an effective logical structure which helps the recipient to notice and remember significant points. I can write summaries and reviews of professional or literary works.', |
||
| 156 | ] |
||
| 157 | ], |
||
| 158 | 'attributes' => array( |
||
| 159 | 'title' => /*@translate */ 'level', |
||
| 160 | 'class' => 'level-select', |
||
| 161 | 'data-allowclear' => 'true', |
||
| 162 | 'data-searchbox' => -1, |
||
| 163 | ) |
||
| 164 | |||
| 165 | ) |
||
| 166 | ); |
||
| 167 | |||
| 168 | } |
||
| 169 | } |
||
| 170 |