phpstan level 3, fixed deprecations, code cleanup (#811)

This commit is contained in:
Kevin Papst
2019-05-28 12:24:21 +02:00
committed by GitHub
parent d9dca96a32
commit 393abe9e62
69 changed files with 381 additions and 189 deletions

View File

@@ -46,7 +46,7 @@
{{ tables.data_table_header(tableName, columns) }}
{% for entry in entries %}
{% set currency = entry.project.customer.currency %}
{% set duration = entry.duration|duration() %}
{% set duration = entry.duration|duration %}
{% if entry.fixedRate is not null %}
{% set rate = entry.fixedRate %}
{% set duration = 1 %}

View File

@@ -42,7 +42,7 @@
{{ tables.data_table_header(tableName, columns) }}
{% for entry in entries %}
{% set duration = entry.duration|duration() %}
{% set duration = entry.duration|duration %}
{% if entry.fixedRate is not null %}
{% set rate = entry.fixedRate %}
{% set duration = 1 %}

View File

@@ -64,7 +64,7 @@
</thead>
<tbody>
{% for entry in model.calculator.entries %}
{% set duration = entry.duration|duration() %}
{% set duration = entry.duration|duration %}
{% if entry.fixedRate is not null %}
{% set rate = entry.fixedRate %}
{% set duration = 1 %}

View File

@@ -77,7 +77,7 @@
</thead>
<tbody>
{% for entry in model.calculator.entries %}
{% set duration = entry.duration|duration() %}
{% set duration = entry.duration|duration %}
{% if entry.fixedRate is not null %}
{% set rate = entry.fixedRate %}
{% set duration = 1 %}

View File

@@ -247,7 +247,7 @@
{% endmacro %}
{% macro timesheet(timesheet, view) %}
{%- filter spaceless -%}
{%- apply spaceless -%}
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {} %}
@@ -283,7 +283,7 @@
{% else %}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{%- endfilter -%}
{%- endapply -%}
{% endmacro %}
{% macro timesheets_team(view) %}

View File

@@ -31,7 +31,7 @@
{% endmacro %}
{% macro data_table_column_class(name, columns, column) %}
{% spaceless %}
{% apply spaceless %}
{% set class = '' %}
{% set always = false %}
@@ -67,7 +67,7 @@
{% if not class is empty %}
{{ class }}
{% endif %}
{% endspaceless %}
{% endapply %}
{% endmacro %}
{% macro data_table_header_options(name, columns, options) %}

View File

@@ -180,7 +180,7 @@
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">{{ 'label.actions'|trans }}
<span class="fa fa-caret-down"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
{%- filter spaceless -%}
{%- apply spaceless -%}
{%- for icon,values in actions %}
{% set class = '' %}
{% if icon == 'trash' %}
@@ -197,7 +197,7 @@
{% endif %}
</li>
{% endfor -%}
{% endfilter %}
{% endapply %}
</ul>
</div>
{% endif %}
@@ -205,7 +205,7 @@
{% macro action_button(icon, values, type) %}
{%- import _self as macro -%}
{%- filter spaceless -%}
{%- apply spaceless -%}
{% set id = null %}
{% set onclick = null %}
{% set modal = null %}
@@ -278,17 +278,17 @@
{%- endfor -%}
{%- endif -%}
>{% if title is not null %}{{ title }}{% else %}{{ macro.icon(icon) }}{% endif %}</a>
{% endfilter %}
{% endapply %}
{% endmacro %}
{% macro button_group(actions, type) %}
{%- import _self as macro -%}
<div class="btn-group">
{%- filter spaceless -%}
{%- apply spaceless -%}
{%- for icon,values in actions %}
{{ macro.action_button(icon, values, type) }}
{% endfor -%}
{% endfilter %}
{% endapply %}
</div>
{% endmacro %}

View File

@@ -30,7 +30,7 @@
{% if entries.count == 0 %}
{{ widgets.callout('warning', 'error.no_entries_found') }}
{% else %}
{{ tables.data_table_header(tableName, columns) }}
{{ tables.data_table_header(tableName, columns, false, 'kimai.userUpdate') }}
{% for entry in entries %}
<tr{% if is_granted('edit', entry) %} class="open-edit alternative-link" data-href="{{ path('user_profile_edit', {'username': entry.username}) }}"{% endif %}>

View File

@@ -64,7 +64,6 @@
var userProfileChartCanvas{{ year }} = $("#userProfileChart{{ year }}").get(0).getContext("2d");
{% if tab == 'charts' %}
var userProfileChart{{ year }} = new Chart(
userProfileChartCanvas{{ year }}, {
type: 'bar',
@@ -72,17 +71,6 @@
options: userProfileChartOptions()
}
);
{% endif %}
$('a[href="#charts"]').on('shown.bs.tab', function(event){
var userProfileChart{{ year }} = new Chart(
userProfileChartCanvas{{ year }}, {
type: 'bar',
data: userProfileChartData{{ year }},
options: userProfileChartOptions()
}
);
});
});
</script>
{% endblock %}