Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasFranek committed Feb 5, 2019
2 parents c806f56 + ed40886 commit dddd005
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
10 changes: 5 additions & 5 deletions src/Models/Absences.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ class Absences extends AbstractModel implements AdministrativeModelInterface {
*/
private $absentTime;

/**
* @SerializedName("excuseStatus")
* @var string
*/
/**
* @SerializedName("excuseStatus")
* @var string
*/
private $excuseStatus;

/**
Expand Down Expand Up @@ -403,7 +403,7 @@ public function load() : self
])[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]);
Expand Down
20 changes: 10 additions & 10 deletions src/Repositories/AbsencesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
20 changes: 10 additions & 10 deletions src/Repositories/ClassRegEventsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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'),
Expand All @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/Types/TypeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions src/Webuntis.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Webuntis {

/**
* @var string
*/
*/
private $userRepo = null;

/**
Expand Down Expand Up @@ -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'];
}
}
Expand Down

0 comments on commit dddd005

Please sign in to comment.