The target is to combine several rules:
You can use this code:
DirectoryIndex index.php
RewriteEngine On
# remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} \s(.+?)/+[?\s]
RewriteRule ^(.+?)/$ /$1 [R=301,L]
# To internally forward /dir/file to /dir/file.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f [NC]
RewriteRule ^(.+?)/?$ /$1.php [L]
There is a separate setting in apache called DirectorySlash
that can be enabled/disabled. You can read more at httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryslash but be sure to read the part about why this is done right below where it says "some good reasons". Also note the security issue.