1111use Kir \MySQL \Builder \Helpers \YieldPolyfillIterator ;
1212use Kir \MySQL \Databases \MySQL ;
1313use PDO ;
14+ use RuntimeException ;
1415use Traversable ;
1516
1617/**
@@ -193,7 +194,7 @@ public function fetchValue($default = null) {
193194 }
194195
195196 /**
196- * @return bool
197+ * @return int
197198 */
198199 public function getFoundRows () {
199200 return $ this ->foundRows ;
@@ -202,14 +203,14 @@ public function getFoundRows() {
202203 /**
203204 * @param callback $fn
204205 * @return mixed
205- * @throws \Exception
206+ * @throws RuntimeException
206207 */
207208 private function createTempStatement ($ fn ) {
208209 $ stmt = $ this ->createStatement ();
209210 $ res = null ;
210211 try {
211212 $ res = call_user_func ($ fn , $ stmt );
212- } catch (\ Exception $ e ) { // PHP 5.4 compatibility
213+ } catch (RuntimeException $ e ) { // PHP 5.4 compatibility
213214 $ stmt ->closeCursor ();
214215 throw $ e ;
215216 }
@@ -221,6 +222,7 @@ private function createTempStatement($fn) {
221222 * @return QueryStatement
222223 */
223224 private function createStatement () {
225+ /** @var MySQL $db */
224226 $ db = $ this ->db ();
225227 $ query = $ this ->__toString ();
226228 $ statement = $ db ->prepare ($ query );
@@ -243,7 +245,7 @@ public function getIterator() {
243245 * @param int $mode
244246 * @param mixed $arg0
245247 * @return mixed
246- * @throws \Exception
248+ * @throws RuntimeException
247249 */
248250 private function fetchAll (Closure $ callback = null , $ mode , $ arg0 = null ) {
249251 return $ this ->createTempStatement (function (QueryStatement $ statement ) use ($ callback , $ mode , $ arg0 ) {
@@ -276,7 +278,7 @@ private function fetchAll(Closure $callback = null, $mode, $arg0 = null) {
276278 * @param Closure $callback
277279 * @param int $mode
278280 * @param mixed $arg0
279- * @return Generator |YieldPolyfillIterator|mixed[]
281+ * @return Traversable |YieldPolyfillIterator|mixed[]
280282 */
281283 private function fetchLazy (Closure $ callback = null , $ mode , $ arg0 = null ) {
282284 if (version_compare (PHP_VERSION , '5.5 ' , '< ' )) {
0 commit comments