diff --git a/src/Message/UploadedFile.php b/src/Message/UploadedFile.php index cb08460..9ce0747 100644 --- a/src/Message/UploadedFile.php +++ b/src/Message/UploadedFile.php @@ -117,21 +117,21 @@ class UploadedFile implements UploadedFileInterface * * @see http://php.net/is_uploaded_file * @see http://php.net/move_uploaded_file - * @param string $path Path to which to move the uploaded file. + * @param string $targetPath Path to which to move the uploaded file. * @return void * @throws InvalidArgumentException if the $path specified is invalid. * @throws RuntimeException on any error during the move operation, or on * the second or subsequent call to the method. */ - public function moveTo($path) + public function moveTo($targetPath) { if ($this->tmpName === null || !file_exists($this->tmpName)) { throw new RuntimeException("File {$this->tmpName} does not exist."); } if (php_sapi_name() === 'cli') { - rename($this->tmpName, $path); + rename($this->tmpName, $targetPath); } else { - move_uploaded_file($this->tmpName, $path); + move_uploaded_file($this->tmpName, $targetPath); } $this->moved = true; } diff --git a/src/Routing/Router.php b/src/Routing/Router.php index ba9ea8f..d4129c1 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -278,7 +278,7 @@ class Router implements MiddlewareInterface usort($matches, $compareByLength); } - $bestMatch = $matches[0]; + $bestMatch = array_values($matches)[0]; return $this->prefixRoutes[$bestMatch]; }