Skip to content

Commit

Permalink
Fix CS v3.46.0 (#2139)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Jan 10, 2024
1 parent c9c543a commit c53f361
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation;

class App
{
Expand Down Expand Up @@ -743,12 +745,12 @@ protected function createRequestPathFromLocalPath(string $localPath): string
return (new ExceptionRenderer\Html(new \Exception()))->getVendorDirectory();
}, null, ExceptionRenderer\Html::class)();
} else {
$request = new \Symfony\Component\HttpFoundation\Request([], [], [], [], [], $_SERVER);
$request = new HttpFoundation\Request([], [], [], [], [], $_SERVER);
$requestUrlPath = $request->getBasePath();
$requestLocalPath = realpath($request->server->get('SCRIPT_FILENAME'));
}
}
$fs = new \Symfony\Component\Filesystem\Filesystem();
$fs = new Filesystem();
$localPathRelative = $fs->makePathRelative($localPath, dirname($requestLocalPath));
$res = '/' . $fs->makePathRelative($requestUrlPath . '/' . $localPathRelative, '/');
// fix https://github.com/symfony/symfony/pull/40051
Expand Down
3 changes: 2 additions & 1 deletion src/Behat/DumpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Atk4\Core\WarnDynamicPropertyTrait;
use Behat\Behat\Context\Context as BehatContext;
use Behat\Behat\Hook\Scope\AfterStepScope;
use Behat\Mink\Driver\Selenium2Driver;
use Behat\MinkExtension\Context\RawMinkContext;
use Behat\Testwork\Tester\Result\TestResult;

Expand All @@ -24,7 +25,7 @@ public function dumpPageAfterFailedStep(AfterStepScope $event): void
$session = $this->getMink()->getSession();

if ($event->getTestResult()->getResultCode() === TestResult::FAILED) {
if ($session->getDriver() instanceof \Behat\Mink\Driver\Selenium2Driver) {
if ($session->getDriver() instanceof Selenium2Driver) {
echo 'Dump of failed step:' . "\n";
echo 'Current page URL: ' . $session->getCurrentUrl() . "\n";
global $dumpPageCount;
Expand Down
3 changes: 2 additions & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Atk4\Ui;

use Atk4\Core\Factory;
use Atk4\Core\HookTrait;
use Atk4\Data\Field;
use Atk4\Data\Model;
use Atk4\Data\Model\EntityFieldPair;
Expand All @@ -20,7 +21,7 @@

class Form extends View
{
use \Atk4\Core\HookTrait;
use HookTrait;

/** Executed when form is submitted */
public const HOOK_SUBMIT = self::class . '@submit';
Expand Down
3 changes: 2 additions & 1 deletion src/Form/AbstractLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Atk4\Ui\Button;
use Atk4\Ui\Exception;
use Atk4\Ui\Form;
use Atk4\Ui\Misc\ProxyModel;
use Atk4\Ui\View;

/**
Expand Down Expand Up @@ -37,7 +38,7 @@ protected function _addControl(Control $control, Field $field): Control
public function addControl(string $name, $control = [], array $fieldSeed = []): Control
{
if ($this->form->model === null) {
$this->form->model = (new \Atk4\Ui\Misc\ProxyModel())->createEntity();
$this->form->model = (new ProxyModel())->createEntity();
}
$model = $this->form->model->getModel();

Expand Down
3 changes: 2 additions & 1 deletion src/Layout/Centered.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Atk4\Ui\Layout;

use Atk4\Core\DebugTrait;
use Atk4\Ui\Layout;

/**
Expand All @@ -15,7 +16,7 @@
*/
class Centered extends Layout
{
use \Atk4\Core\DebugTrait;
use DebugTrait;

public $defaultTemplate = 'layout/centered.html';

Expand Down
3 changes: 2 additions & 1 deletion src/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Atk4\Ui\Js\Jquery;
use Atk4\Ui\Js\JsExpression;
use Atk4\Ui\Js\JsExpressionable;
use Atk4\Ui\Misc\ProxyModel;

/**
* @phpstan-type JsCallbackSetClosure \Closure(Jquery, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed): (JsExpressionable|View|string|void)
Expand Down Expand Up @@ -145,7 +146,7 @@ public function addColumn(?string $name, $columnDecorator = [], $field = [])
}

if (!$this->model) {
$this->model = new \Atk4\Ui\Misc\ProxyModel();
$this->model = new ProxyModel();
}
$this->model->assertIsModel();

Expand Down
15 changes: 10 additions & 5 deletions src/Table/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

namespace Atk4\Ui\Table;

use Atk4\Core\AppScopeTrait;
use Atk4\Core\DiContainerTrait;
use Atk4\Core\InitializerTrait;
use Atk4\Core\NameTrait;
use Atk4\Core\TrackableTrait;
use Atk4\Data\Field;
use Atk4\Data\Model;
use Atk4\Ui\Js\Jquery;
Expand All @@ -21,11 +26,11 @@
*/
class Column
{
use \Atk4\Core\AppScopeTrait;
use \Atk4\Core\DiContainerTrait;
use \Atk4\Core\InitializerTrait;
use \Atk4\Core\NameTrait;
use \Atk4\Core\TrackableTrait;
use AppScopeTrait;
use DiContainerTrait;
use InitializerTrait;
use NameTrait;
use TrackableTrait;

public const HOOK_GET_HTML_TAGS = self::class . '@getHtmlTags';
public const HOOK_GET_HEADER_CELL_HTML = self::class . '@getHeaderCellHtml';
Expand Down
3 changes: 2 additions & 1 deletion src/Table/Column/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Atk4\Ui\Js\Jquery;
use Atk4\Ui\Js\JsExpression;
use Atk4\Ui\Js\JsExpressionable;
use Atk4\Ui\Js\JsFunction;
use Atk4\Ui\Table;

/**
Expand All @@ -27,7 +28,7 @@ class Checkbox extends Table\Column
public function jsChecked(): JsExpressionable
{
return (new Jquery($this->table))->find('.checked.' . $this->class)->closest('tr')
->map(new \Atk4\Ui\Js\JsFunction([], [new JsExpression('return $(this).data(\'id\')')]))
->map(new JsFunction([], [new JsExpression('return $(this).data(\'id\')')]))
->get()->join(',');
}

Expand Down
3 changes: 2 additions & 1 deletion tests/DemosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\ServerException;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -191,7 +192,7 @@ protected function getClient(): Client
$app->getResponse()->getBody()->rewind();
}

return new \GuzzleHttp\Promise\FulfilledPromise($app->getResponse());
return new FulfilledPromise($app->getResponse());
};

return new Client(['base_uri' => 'http://localhost/', 'handler' => $handler]);
Expand Down

0 comments on commit c53f361

Please sign in to comment.