Skip to content

Commit

Permalink
Fix deprecated use of spaceless filter on Twig
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Aug 29, 2024
1 parent 1d73711 commit 1093ffe
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 32 deletions.
6 changes: 2 additions & 4 deletions resources/Twig/Debug.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% if app.isDebugEnabled -%}
{% apply spaceless %}
<script>var berlioz_debug_report = '{{ app.debugUniqid }}';</script>
<script async src="{{ path('_berlioz/console/toolbar-dist') }}"></script>
{% endapply %}
{{- '' }}<script>var berlioz_debug_report = '{{ app.debugUniqid }}';</script>
{{- '' }}<script async src="{{ path('_berlioz/console/toolbar-dist') }}"></script>
{%- endif %}
18 changes: 8 additions & 10 deletions resources/Twig/Debug/router.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,14 @@ Host: {{ section.serverRequest.uri.host }}
{% set routeFound = false %}
{%- for route in section.routes %}
<tr class="
{%- apply spaceless -%}
{% if section.route is not empty and routeFound is same as(false) %}
{% if section.route.name == route.name %}
{% set routeFound = true %}
bg-success text-white
{% else %}
text-muted
{% endif %}
{% endif %}
{%- endapply -%}
{%- if section.route is not empty and routeFound is same as(false) -%}
{%- if section.route.name == route.name -%}
{%- set routeFound = true -%}
bg-success text-white
{%- else -%}
text-muted
{%- endif -%}
{%- endif -%}
">
<th scope="row">{{ route.name|default('--') }}</th>
<td>
Expand Down
17 changes: 7 additions & 10 deletions resources/Twig/Http/error.html.twig
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% apply spaceless %}
<title>
{% if httpException.code < 500 %}
Oops, the page you're looking for doesn't exist
{% elseif httpException.code >= 500 %}
Looks like we're having some server issues
{% endif %}
- {{ httpException.code }} error
</title>
{% endapply %}
<title>
{%- if httpException.code < 500 -%}
Oops, the page you're looking for doesn't exist
{%- elseif httpException.code >= 500 -%}
Looks like we're having some server issues
{%- endif -%}
{{- ' ' }}- {{ httpException.code }} error</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" media="screen" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600"/>
<style>
Expand Down
4 changes: 1 addition & 3 deletions resources/Twig/Http/maintenance.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% apply spaceless %}
<title>Maintenance</title>
{% endapply %}
<title>Maintenance</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" media="screen" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600"/>
<style>
Expand Down
10 changes: 5 additions & 5 deletions tests/Container/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@

class ServiceProviderTest extends ProviderTestCase
{
private Core $core;
private static Core $core;

protected function getCore(): Core
protected static function getCore(): Core
{
return $this->core ?? $this->core = new Core(new FakeDefaultDirectories(), false);
return self::$core ?? self::$core = new Core(new FakeDefaultDirectories(), false);
}

/**
* @inheritDoc
*/
public function providers(): array
public static function providers(): array
{
return [
[new ServiceProvider()],
[new RouteProvider($this->getCore())],
[new RouteProvider(self::getCore())],
];
}
}

0 comments on commit 1093ffe

Please sign in to comment.