mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 02:03:40 +00:00
Various code optimalisations.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
|
@@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
@@ -123,7 +124,7 @@ class LoginController extends Controller
|
||||
public function showLoginForm(Request $request)
|
||||
{
|
||||
$count = DB::table('users')->count();
|
||||
if ($count === 0) {
|
||||
if (0 === $count) {
|
||||
return redirect(route('register')); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
|
@@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
|
@@ -59,7 +59,7 @@ class TwoFactorController extends Controller
|
||||
return redirect(route('index'));
|
||||
}
|
||||
|
||||
if (0 === \strlen((string)$secret)) {
|
||||
if ('' === (string)$secret) {
|
||||
throw new FireflyException('Your two factor authentication secret is empty, which it cannot be at this point. Please check the log files.');
|
||||
}
|
||||
$request->session()->flash('two-factor-secret', $secret);
|
||||
|
Reference in New Issue
Block a user