From 0f09f81eeeb965d37d0999fca874d539f46d04c1 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 5 Feb 2019 19:28:14 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- src/Models/Absences.php | 22 +++++++++---------- src/Repositories/AbsencesRepository.php | 20 ++++++++--------- src/Repositories/ClassRegEventsRepository.php | 20 ++++++++--------- src/Repositories/Repository.php | 4 ++-- src/Types/TypeHandler.php | 6 ++--- src/Webuntis.php | 4 ++-- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Models/Absences.php b/src/Models/Absences.php index 7b78888..0526aa9 100644 --- a/src/Models/Absences.php +++ b/src/Models/Absences.php @@ -68,10 +68,10 @@ class Absences extends AbstractModel implements AdministrativeModelInterface { */ private $absentTime; - /** - * @SerializedName("excuseStatus") - * @var string - */ + /** + * @SerializedName("excuseStatus") + * @var string + */ private $excuseStatus; /** @@ -395,15 +395,15 @@ public function load() : self } if($this->subject && !$this->subject instanceof AbstractModel) { - $this->subject = $query->get('Period')->findAll([], null, [ - 'options' => [ - 'element' => $this->subject, - 'type' => 3 - ] - ])[0]; + $this->subject = $query->get('Period')->findAll([], null, [ + 'options' => [ + 'element' => $this->subject, + 'type' => 3 + ] + ])[0]; } - if(!empty($this->teachers) && $this->teachers[0] && !$this->teachers[0] instanceof AbstractModel) { + if (!empty($this->teachers) && $this->teachers[0] && !$this->teachers[0] instanceof AbstractModel) { $temp = []; foreach ($this->teachers as $value) { $temp[] = $query->get('Teachers')->findBy(['id' => $value]); diff --git a/src/Repositories/AbsencesRepository.php b/src/Repositories/AbsencesRepository.php index 98d74f0..3cc6a28 100644 --- a/src/Repositories/AbsencesRepository.php +++ b/src/Repositories/AbsencesRepository.php @@ -16,14 +16,14 @@ class AbsencesRepository extends Repository { - /** - * return all Absences that have been searched for - * @param array $params - * @param array $sort - * @param int $limit - * @return array - * @throws RepositoryException - */ + /** + * return all Absences that have been searched for + * @param array $params + * @param array $sort + * @param int $limit + * @return array + * @throws RepositoryException + */ public function findBy(array $params, array $sort = [], int $limit = null, $startDate = null, \DateTime $endDate = null, bool $lazy = false) : array { if (empty($params)) { @@ -55,7 +55,7 @@ public function findAll(array $sort = [], int $limit = null, \DateTime $startDat { $configName = WebuntisConfiguration::getConfigNameByModel(new $this->model()); $config = WebuntisConfiguration::getConfig(); - if($lazy) { + if ($lazy) { $config[$configName]['ignore_children'] = true; WebuntisConfiguration::setConfig($config); } @@ -84,7 +84,7 @@ public function findAll(array $sort = [], int $limit = null, \DateTime $startDat if ($limit !== null) { $data = array_slice($data, 0, $limit); } - if($lazy) { + if ($lazy) { unset($config[$configName]['ignore_children']); WebuntisConfiguration::setConfig($config); } diff --git a/src/Repositories/ClassRegEventsRepository.php b/src/Repositories/ClassRegEventsRepository.php index 1ff3332..0859f31 100644 --- a/src/Repositories/ClassRegEventsRepository.php +++ b/src/Repositories/ClassRegEventsRepository.php @@ -15,14 +15,14 @@ class ClassRegEventsRepository extends Repository { - /** - * return all ClassRegEvents that have been searched for - * @param array $params - * @param array $sort - * @param int $limit - * @return array - * @throws RepositoryException - */ + /** + * return all ClassRegEvents that have been searched for + * @param array $params + * @param array $sort + * @param int $limit + * @return array + * @throws RepositoryException + */ public function findBy(array $params, array $sort = [], int $limit = null, $startDate = null, \DateTime $endDate = null, array $element = []) : array { if (empty($params)) { @@ -53,7 +53,7 @@ public function findBy(array $params, array $sort = [], int $limit = null, $star public function findAll(array $sort = [], int $limit = null, \DateTime $startDate = null, \DateTime $endDate = null, array $element = []) : array { if ($startDate && $endDate) { - if(!empty($element)) { + if (!empty($element)) { $data = $this->executionHandler->execute($this, ['options' => [ 'startDate' => date_format($startDate, 'Ymd'), @@ -73,7 +73,7 @@ public function findAll(array $sort = [], int $limit = null, \DateTime $startDat $query = new Query(); $schoolyear = $query->get('Schoolyears')->getCurrentSchoolyear(); - if(!empty($element)) { + if (!empty($element)) { $data = $this->executionHandler->execute($this, ['options' => [ 'startDate' => date_format($schoolyear->getStartDate(), 'Ymd'), diff --git a/src/Repositories/Repository.php b/src/Repositories/Repository.php index daaf82e..cb37df2 100755 --- a/src/Repositories/Repository.php +++ b/src/Repositories/Repository.php @@ -138,7 +138,7 @@ public function parse(array $result) : array protected function find(array $data, array $params) : array { if (!empty($data)) { - if($this->cache && $this->cache->contains($this->model::METHOD . '.' . serialize($params))) { + if ($this->cache && $this->cache->contains($this->model::METHOD . '.' . serialize($params))) { return $this->cache->fetch($this->model::METHOD . '.' . serialize($params)); } foreach ($params as $key => $value) { @@ -191,7 +191,7 @@ protected function find(array $data, array $params) : array } } } - if($this->cache) { + if ($this->cache) { $this->cache->save($this->model::METHOD . '.' . serialize($params), $data); } return $data; diff --git a/src/Types/TypeHandler.php b/src/Types/TypeHandler.php index 1b9920c..b64e08d 100755 --- a/src/Types/TypeHandler.php +++ b/src/Types/TypeHandler.php @@ -73,9 +73,9 @@ public function handle(AbstractModel &$model, array $data, array $fields) : void foreach ($fields as $key => $value) { $implements = class_implements(self::$types[$value['type']]); if (isset($implements[TypeInterface::class])) { - if(($value['type'] == 'model' || $value['type'] == 'modelCollection') && (isset($instanceConfig['ignore_children']) && $instanceConfig['ignore_children'])) { - if($value['type'] == 'model') { - if(is_numeric($data[$value['api']['name']]) && $data[$value['api']['name']] < PHP_INT_MAX) { + if (($value['type'] == 'model' || $value['type'] == 'modelCollection') && (isset($instanceConfig['ignore_children']) && $instanceConfig['ignore_children'])) { + if ($value['type'] == 'model') { + if (is_numeric($data[$value['api']['name']]) && $data[$value['api']['name']] < PHP_INT_MAX) { self::$types['int']::execute($model, $data, [$key => $value]); } else { self::$types['string']::execute($model, $data, [$key => $value]); diff --git a/src/Webuntis.php b/src/Webuntis.php index ae7d0f2..ce4f3aa 100755 --- a/src/Webuntis.php +++ b/src/Webuntis.php @@ -47,7 +47,7 @@ class Webuntis { /** * @var string - */ + */ private $userRepo = null; /** @@ -85,7 +85,7 @@ public function __construct(array $config, string $context) { $this->client = $manager->getClient(); $this->currentUserId = $manager->getCurrentUserId(); $this->currentUserType = $manager->getCurrentUserType(); - if(isset($config['user_type']) && $config['user_type']) { + if (isset($config['user_type']) && $config['user_type']) { $this->userRepo = $config['user_type']; } }