Skip to content

Commit

Permalink
Various deprecation message fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Sep 21, 2024
1 parent 807c849 commit 017a75e
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 54 deletions.
4 changes: 0 additions & 4 deletions .idea/leantime-oss.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .idea/php-test-framework.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/phpunit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions app/Core/Events/DispatchesEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
trait DispatchesEvents
{
private static string $event_context = '';

/**
* dispatches an event with context
Expand Down Expand Up @@ -42,7 +41,7 @@ public static function dispatch_event(string $hook, mixed $available_params = []
*/
public static function dispatch_filter(string $hook, mixed $payload, mixed $available_params = [], string|int $function = null): mixed
{
return EventDispatcher::dispatch_filter($hook, $payload, $available_params, static::get_event_context($function));
return EventDispatcher::dispatch_filter($hook, $payload, $available_params, DispatchesEvents::get_event_context($function));
}

/**
Expand All @@ -53,17 +52,16 @@ public static function dispatch_filter(string $hook, mixed $payload, mixed $avai
* @param $function
* @return string
*/
protected static function get_event_context($function): string
public static function get_event_context($function): string
{
if (empty(self::$event_context)) {
self::$event_context = static::set_class_context();
}

$event_context = DispatchesEvents::set_class_context();

$function = !empty($function) && is_string($function) && !is_numeric($function)
? $function
: static::get_function_context(is_numeric($function) ? (int) $function : null);
: DispatchesEvents::get_function_context(is_numeric($function) ? (int) $function : null);

return self::$event_context . '.' . $function;
return $event_context . '.' . $function;
}

/**
Expand All @@ -74,7 +72,7 @@ protected static function get_event_context($function): string
*
* @return string
*/
private static function set_class_context(): string
public static function set_class_context(): string
{
return str_replace('\\', '.', strtolower(get_called_class()));
}
Expand All @@ -89,7 +87,7 @@ private static function set_class_context(): string
* @param ?int $functionInt
* @return string
*/
private static function get_function_context(?int $functionInt = null): string
public static function get_function_context(?int $functionInt = null): string
{
$tracePointer = is_int($functionInt) ? $functionInt : 3;

Expand Down
3 changes: 2 additions & 1 deletion app/Domain/Auth/Controllers/KeepAlive.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
use Symfony\Component\HttpFoundation\Response;

/**
*
* Keeping the session alive when not active
* @Deprecated With laravels new session management we should not need this anymore
*/
class KeepAlive extends Controller
{
Expand Down
12 changes: 9 additions & 3 deletions app/Domain/Calendar/Controllers/ExternalCal.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ public function run(): void
$cal = $this->calendarRepo->getExternalCalendar($calId, session("userdata.id"));

if (isset($cal["url"])) {
$content = $this->loadIcalUrl($cal["url"]);
session(["calendarCache.".$calId.".lastUpdate" => time()]);
session(["calendarCache.".$calId."content" => $content]);

try {
$content = $this->loadIcalUrl($cal["url"]);
session(["calendarCache." . $calId . ".lastUpdate" => time()]);
session(["calendarCache." . $calId . "content" => $content]);
}catch(\Exception $e) {
$content = "";
}
}
}

Expand Down Expand Up @@ -94,6 +99,7 @@ private function loadIcalUrl(string $url): string
}

try {

$response = $guzzle->request('GET', $url, [
'headers' => [
'Accept' => 'text/calendar',
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Goalcanvas/Templates/showCanvas.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class="delete">{{ __('links.icon.delete') }}</a></li>
<div class="pull-right">
<div class="btn-group viewDropDown">
@if (count($allCanvas) > 0 && !empty($statusLabels))
@if ($filter['status'] == 'all')
@if (($filter['status'] ?? '') == 'all')
<button class="btn dropdown-toggle" data-toggle="dropdown"><i class="fas fa-filter"></i>
{!! __('status.all') !!} {!! __('links.view') !!}</button>
@else
Expand Down
2 changes: 2 additions & 0 deletions app/Domain/Projects/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Project

public $status;

public $clientName;



public function __construct()
Expand Down
6 changes: 4 additions & 2 deletions app/Domain/Timesheets/Services/Timesheets.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public function isClocked(int $sessionId): false|array
*
* @api
*/
public function punchIn(int $ticketId): mixed
public function punchIn(int|string $ticketId): mixed
{
$ticketId = (int)$ticketId;
return $this->timesheetsRepo->punchIn($ticketId);
}

Expand All @@ -72,8 +73,9 @@ public function punchIn(int $ticketId): mixed
*
* @api
*/
public function punchOut(int $ticketId): float|false|int
public function punchOut(int|string $ticketId): float|false|int
{
$ticketId = (int)$ticketId;
return $this->timesheetsRepo->punchOut($ticketId);
}

Expand Down
1 change: 1 addition & 0 deletions app/Domain/Wiki/Models/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Template
public $title;
public $description;
public $content;
public $category;

public function __construct()
{
Expand Down
1 change: 1 addition & 0 deletions app/Domain/Wiki/Models/Wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Wiki
public $author;
public $created;
public $projectId;
public $category;

public function __construct()
{
Expand Down
19 changes: 0 additions & 19 deletions app/Domain/Wiki/Services/Wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,6 @@ public function updateArticle(Article $article): bool
return $this->wikiRepository->updateArticle($article);
}

public function getDefaultWiki($projectId) {

//Clear cache
$this->clearWikiCache();

$wikis = $this->wikiService->getAllProjectWikis($projectId);

if($wikis)

if ($wiki) {
//Set the session
session(["currentWiki" => $id]);
return true;
}

return false;

}

public function setCurrentWiki($id) {

//Clear cache
Expand Down
9 changes: 0 additions & 9 deletions app/Views/Templates/sections/pageBottom.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
</script>
@endif

@if ($loggedIn)
<script>
//5 min keep alive timer
setInterval(function(){
jQuery.get(leantime.appUrl+'/auth/keepAlive');
}, 300000);
</script>
@endif

<script src="{!! BASE_URL !!}/dist/js/compiled-footer.{!! $version !!}.min.js"></script>

@dispatchEvent('beforeBodyClose')

0 comments on commit 017a75e

Please sign in to comment.