| Conditions | 6 | 
| Paths | 8 | 
| Total Lines | 22 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 37 | public function post()  | 
            ||
| 38 |     { | 
            ||
| 39 | $app = $this->app;  | 
            ||
| 40 | $watches = $this->watches;  | 
            ||
| 41 | |||
| 42 | $saved = false;  | 
            ||
| 43 | $request = $app->request();  | 
            ||
| 44 |         foreach ((array)$request->post('watch') as $data) { | 
            ||
| 45 |             if (empty($data['id'])) { | 
            ||
| 46 | $watches->addWatchedFunction($data['name']);  | 
            ||
| 47 |             } elseif (!empty($data['removed']) && $data['removed'] === '1') { | 
            ||
| 48 | $watches->removeWatchedFunction($data['id']);  | 
            ||
| 49 |             } else { | 
            ||
| 50 | $watches->updateWatchedFunction($data['id'], $data['name']);  | 
            ||
| 51 | }  | 
            ||
| 52 | $saved = true;  | 
            ||
| 53 | }  | 
            ||
| 54 |         if ($saved) { | 
            ||
| 55 |             $app->flash('success', 'Watch functions updated.'); | 
            ||
| 56 | }  | 
            ||
| 57 |         $app->redirect($app->urlFor('watch.list')); | 
            ||
| 58 | }  | 
            ||
| 59 | |||
| 76 |