Make phpstan happier

This commit is contained in:
Greyscale 2020-09-01 18:31:46 +02:00
parent d9382954bc
commit 99007d8208
3 changed files with 12 additions and 4 deletions

View file

@ -0,0 +1,7 @@
<?php
namespace Benzine\Exceptions;
class DbRuntimeException extends BenzineException
{
}

View file

@ -11,10 +11,10 @@ class InflectionExtension extends AbstractExtension
public function getFilters()
{
$filters = [];
$filters['pluralize'] = new TwigFilter('pluralize', function ($word): string {
$filters['pluralize'] = new TwigFilter('pluralize', function (string $word): string {
return Inflect::pluralize($word);
});
$filters['singularize'] = new TwigFilter('singularize', function ($word): string {
$filters['singularize'] = new TwigFilter('singularize', function (string $word): string {
return Inflect::singularize($word);
});

View file

@ -4,6 +4,7 @@ namespace Benzine\Tests;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\WebDriverCapabilityType;
use Symfony\Component\Filesystem\Filesystem;
abstract class AbstractSeleniumTestCase extends AbstractBaseTestCase
{
@ -29,8 +30,8 @@ abstract class AbstractSeleniumTestCase extends AbstractBaseTestCase
self::$webDriver->manage()->timeouts()->implicitlyWait(3);
self::$screenshotsDir = APP_ROOT.'/build/Screenshots/'.date('Y-m-d H-i-s').'/';
if (!file_exists(self::$screenshotsDir)) {
mkdir(self::$screenshotsDir, 0777, true);
if (!(new Filesystem())->exists(self::$screenshotsDir)) {
(new Filesystem())->mkdir(self::$screenshotsDir, 0777);
}
}