Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 24, 2022
1 parent 47aeec1 commit 5d1c0e3
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 12 deletions.
9 changes: 9 additions & 0 deletions ncs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<ruleset name="Custom" namespace="Nette">
<rule ref="$presets/php72.xml"/>

<rule ref="Squiz.Commenting.FunctionComment.ExtraParamComment">
<exclude-pattern>./src/Application/UI/Control.php</exclude-pattern>
<exclude-pattern>./src/Application/UI/Presenter.php</exclude-pattern>
</rule>
</ruleset>
6 changes: 4 additions & 2 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,8 @@ protected function createRequest(
string $destination,
array $args,
string $mode
): ?string {
): ?string
{
// note: createRequest supposes that saveState(), run() & tryCall() behaviour is final

$this->lastCreatedRequest = $this->lastCreatedRequestFlag = null;
Expand Down Expand Up @@ -1034,7 +1035,8 @@ public static function argsToParams(
array &$args,
array $supplemental = [],
?array &$missing = null
): void {
): void
{
$i = 0;
$rm = new \ReflectionMethod($class, $method);
foreach ($rm->getParameters() as $param) {
Expand Down
3 changes: 2 additions & 1 deletion src/Bridges/ApplicationDI/ApplicationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ private function findPresenters(): array
public static function initializeBlueScreenPanel(
Tracy\BlueScreen $blueScreen,
Nette\Application\Application $application
): void {
): void
{
$blueScreen->addPanel(function (?\Throwable $e) use ($application, $blueScreen): ?array {
$dumper = $blueScreen->getDumper();
return $e ? null : [
Expand Down
3 changes: 2 additions & 1 deletion src/Bridges/ApplicationLatte/TemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ private function setupLatte2(
?UI\Control $control,
?UI\Presenter $presenter,
Template $template
): void {
): void
{
if ($latte->onCompile instanceof \Traversable) {
$latte->onCompile = iterator_to_array($latte->onCompile);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private function analyse(
?string $path = null,
int $level = -1,
int $flag = 0
): void {
): void
{
if ($router instanceof Routing\RouteList) {
if ($httpRequest) {
try {
Expand Down
4 changes: 2 additions & 2 deletions tests/Bridges.Latte2/UIMacros.link.2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ link:['login']
<a href="link:['default!#hash',10,20]"></a>
EOD

, strtr($latte->renderToString(<<<'EOD'
, strtr($latte->renderToString(<<<'EOD'
{plink Homepage:}
{plink Homepage: }
Expand Down Expand Up @@ -122,4 +122,4 @@ EOD
<a n:href="default!#hash 10, 20"></a>
EOD
, $params), ['&#039;' => "'", '&apos;' => "'", '&#123;' => '{']));
, $params), ['&#039;' => "'", '&apos;' => "'", '&#123;' => '{']));
2 changes: 1 addition & 1 deletion tests/Bridges.Latte3/{control}.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Assert::match(
$ʟ_tmp->renderType() /* line 1 */;
%A%
XX
,
,
$latte->compile('{control form:type}'),
);

Expand Down
4 changes: 2 additions & 2 deletions tests/Bridges.Latte3/{link}.2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Assert::match(<<<'EOD'
<a href="link:['default!#hash',10,20]"></a>
EOD

, strtr($latte->renderToString(<<<'EOD'
, strtr($latte->renderToString(<<<'EOD'
{plink Homepage:}
{plink Homepage: }
Expand Down Expand Up @@ -121,4 +121,4 @@ Assert::match(<<<'EOD'
<a n:href="default!#hash 10, 20"></a>
EOD
, $params), ['&#039;' => "'", '&apos;' => "'", '&#123;' => '{']));
, $params), ['&#039;' => "'", '&apos;' => "'", '&#123;' => '{']));
3 changes: 2 additions & 1 deletion tests/UI/Component.isLinkCurrent().asserts.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function callIsComponentLinkCurrent(
Application\Request $request,
$destination,
array $args
): bool {
): bool
{
$url = new Http\UrlScript('http://localhost/index.php', '/index.php');
$presenterFactory = Mockery::mock(Nette\Application\IPresenterFactory::class);
$presenterFactory->shouldReceive('getPresenterClass')->andReturn('TestPresenter');
Expand Down
3 changes: 2 additions & 1 deletion tests/UI/Presenter.storeRequest().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class MockSession extends Http\Session
public function getSection(
string $section,
string $class = Nette\Http\SessionSection::class
): Nette\Http\SessionSection {
): Nette\Http\SessionSection
{
return $this->testSection;
}
}
Expand Down

0 comments on commit 5d1c0e3

Please sign in to comment.