Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracy panel: Better table responsivity (break service name). #259

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/Bug_report.md

This file was deleted.

9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/Feature_request.md

This file was deleted.

12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/Support_question.md

This file was deleted.

21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/Support_us.md

This file was deleted.

2 changes: 0 additions & 2 deletions .github/funding.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/pull_request_template.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/coding-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.1
php-version: 8.0
coverage: none

- run: composer create-project nette/code-checker temp/code-checker ^3 --no-progress
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: none

- run: composer install --no-progress --prefer-dist
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
php: ['8.0']

fail-fast: false

Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.1
php-version: 8.0
coverage: none

- run: composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: none

- run: composer install --no-progress --prefer-dist
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
}
],
"require": {
"php": ">=7.1 <8.1",
"php": ">=8.0 <8.1",
"ext-tokenizer": "*",
"nette/neon": "^3.0",
"nette/php-generator": "^3.3.3",
"nette/robot-loader": "^3.2",
"nette/neon": "^3.0 || ^4.0",
"nette/php-generator": "^3.3.3 || ^4.0",
"nette/robot-loader": "^3.3.1 || ^4.0",
"nette/schema": "^1.1",
"nette/utils": "^3.2"
"nette/utils": "^3.2 || ^4.0"
},
"require-dev": {
"nette/tester": "^2.2",
"tracy/tracy": "^2.3",
"nette/tester": "^2.4",
"tracy/tracy": "^2.8",
"phpstan/phpstan": "^0.12"
},
"conflict": {
Expand All @@ -41,7 +41,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "4.0-dev"
}
}
}
33 changes: 0 additions & 33 deletions contributing.md

This file was deleted.

21 changes: 0 additions & 21 deletions ecs.php

This file was deleted.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The recommended way to install is via Composer:
composer require nette/di
```

It requires PHP version 7.1 and supports PHP up to 8.0.
It requires PHP version 8.0.


Usage
Expand Down
9 changes: 3 additions & 6 deletions src/Bridges/DITracy/ContainerPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ class ContainerPanel implements Tracy\IBarPanel
{
use Nette\SmartObject;

/** @var float|null */
public static $compilationTime;
public static ?float $compilationTime = null;

/** @var Nette\DI\Container */
private $container;
private Nette\DI\Container $container;

/** @var float|null */
private $elapsedTime;
private ?float $elapsedTime;


public function __construct(Container $container)
Expand Down
4 changes: 2 additions & 2 deletions src/Bridges/DITracy/templates/ContainerPanel.panel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use Tracy\Helpers;
<thead>
<tr>
<th>Name</th>
<th>Autowired</th>
<th title="Autowired">ATW</th>
<th>Service</th>
<th>Tags</th>
</tr>
Expand All @@ -49,7 +49,7 @@ use Tracy\Helpers;
<?php $name = (string) $name ?>
<?php $autowired = in_array($name, array_merge($wiring[$type][0] ?? [], $wiring[$type][1] ?? []), true) ?>
<tr>
<td class="<?= isset($instances[$name]) ? 'created' : '' ?>"><?= is_numeric($name) ? "<small>$name</small>" : Helpers::escapeHtml($name) ?></td>
<td class="<?= isset($instances[$name]) ? 'created' : '' ?>"><?= is_numeric($name) ? "<small>$name</small>" : str_replace('.', '<wbr>.', Helpers::escapeHtml($name)) ?></td>
<td class="<?= $autowired ? 'yes' : '' ?>"><?= $autowired ? 'yes' : (isset($wiring[$type]) ? 'no' : '?') ?></td>
<td>
<?php if (isset($instances[$name]) && !$instances[$name] instanceof Nette\DI\Container): ?>
Expand Down
10 changes: 4 additions & 6 deletions src/DI/Autowiring.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ class Autowiring
{
use Nette\SmartObject;

/** @var ContainerBuilder */
private $builder;
private ContainerBuilder $builder;

/** @var array[] type => services, used by getByType() */
private $highPriority = [];
private array $highPriority = [];

/** @var array[] type => services, used by findByType() */
private $lowPriority = [];
private array $lowPriority = [];

/** @var string[] of classes excluded from autowiring */
private $excludedClasses = [];
private array $excludedClasses = [];


public function __construct(ContainerBuilder $builder)
Expand All @@ -40,7 +39,6 @@ public function __construct(ContainerBuilder $builder)

/**
* Resolves service name by type.
* @param bool $throw exception if service not found?
* @throws MissingServiceException when not found
* @throws ServiceCreationException when multiple found
*/
Expand Down
Loading