code: public function getFlashes()
      {
          $types = array("error", "success");
          $result = array();
          foreach ($types as $value) {
              $flashesArr = $this->session->getFlash($value);
              if (count($flashesArr)) {
                  $result[$value] = $flashesArr;
              }
          }
          return $result;
      }
docs: {@inheritdoc}