fix: phpstan level=3

This commit is contained in:
origami11@yandex.ru 2024-01-22 14:00:52 +03:00
parent bbc9d0e7fe
commit f594611656
6 changed files with 8 additions and 6 deletions

View file

@ -104,7 +104,7 @@ class Action
* @param string $viewClass * @param string $viewClass
* @return Composite * @return Composite
*/ */
public function getView($name, $viewClass = 'ctiso\\View\\Composite') public function getView($name, $viewClass = Composite::class)
{ {
$file = $name . self::TEMPLATE_EXTENSION; $file = $name . self::TEMPLATE_EXTENSION;

View file

@ -2,5 +2,6 @@
namespace ctiso\Model; namespace ctiso\Model;
class BaseMapper { abstract class BaseMapper {
abstract function getAllAsOptions(): array;
} }

View file

@ -31,7 +31,7 @@ class User implements UserInterface
} }
function isLogged() { function isLogged() {
return \ctiso\Filter\Authorization::isLogged(); return \ctiso\Filter\Authorization::isLogged();
} }
@ -41,7 +41,7 @@ class User implements UserInterface
if ($result->next()) { if ($result->next()) {
$this->access = $this->groups[$result->getString('access')]; $this->access = $this->groups[$result->getString('access')];
$this->name = $result->getString('login'); $this->name = $result->getString('login');
$this->id = $result->getInt('id_user'); $this->id = $result->getInt('id_user');
$this->password = $result->getString('password'); $this->password = $result->getString('password');
$this->fullname = implode(' ', array( $this->fullname = implode(' ', array(
$result->getString('surname'), $result->getString('surname'),

View file

@ -91,7 +91,7 @@ class Validator
if ($rule->skipEmpty()) { if ($rule->skipEmpty()) {
$data = $container->get($rule->field); $data = $container->get($rule->field);
if (!is_array($data)) { if (!is_array($data)) {
$value = trim($data); $value = trim($data ?: '');
return $value == ''; return $value == '';
} }
} }

View file

@ -8,6 +8,7 @@ namespace ctiso\View;
use ctiso\View\View, use ctiso\View\View,
PHPTAL; PHPTAL;
class Composite extends View class Composite extends View
{ {
private $tal; private $tal;

View file

@ -3,7 +3,7 @@
namespace ctiso\View; namespace ctiso\View;
use Exception; use Exception;
class View class View extends \stdClass
{ {
protected $_section = array(); // Вложенные шаблоны protected $_section = array(); // Вложенные шаблоны
// Блоки // Блоки