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

Adjust renamed "short_name" to "shortName" #95

Merged
merged 2 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'phpdoc_types' => [
// keep enabled, but without "alias" group to not fix
// "Callback" to "callback" in phpdoc
'groups' => ['simple', 'meta']
'groups' => ['simple', 'meta'],
],
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ In the manual mode, no checks will be performed, and you are responsible for aut

``` php
$app->auth = new \Atk4\Login\Auth([
'check' => false
'check' => false,
]);
$app->auth->setModel(new User($app->db));

Expand Down
2 changes: 1 addition & 1 deletion demos/_includes/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function initAuth(bool $check = true): void
{
$this->auth = new Auth($this, ['check' => $check, 'pageDashboard' => 'index']);

// Can not setmodel at this stage :(
// Cannot setmodel at this stage :(
$m = new \Atk4\Login\Model\User($this->db);
$this->auth->setModel($m);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ public function displayLoginForm(array $seed = []): void
{
$app = $this->getApp();

$app->catch_runaway_callbacks = false;
$app->catchRunawayCallbacks = false;
$app->html = null;
$app->initLayout([Narrow::class]);
$app->title = $app->title . ' - Login Required';
$app->title .= ' - Login Required';
$app->layout->template->set('title', $app->title);
$app->add(array_merge(
$this->formLoginSeed,
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Control/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public function setModel(Model $model, array $fields = null): void
// set function for dropdown row rendering
$this->renderRowFunction = function ($action) {
return [
'value' => $action->short_name,
'title' => $action->caption ?: $action->short_name,
'value' => $action->shortName,
'title' => $action->caption ?: $action->shortName,
'icon' => ($action->ui['icon'] ?? null),
];
};
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Control/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public function setModel(Model $model, array $fields = null): void
// set function for dropdown row rendering
$this->renderRowFunction = function ($field) {
return [
'value' => $field->short_name,
'value' => $field->shortName,
'title' => $field->getCaption(),
// 'icon' => ($field->short_name == $field->model->id_field ? 'key' : null), // can not get field->model here :(
// 'icon' => ($field->shortName == $field->model->id_field ? 'key' : null), // cannot get field->model here :(
];
};

Expand Down
4 changes: 2 additions & 2 deletions tests/GenericTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ protected function tearDown(): void
protected function createAppForSession(): App
{
$app = new App([
'catch_exceptions' => false,
'always_run' => false,
'catchExceptions' => false,
'alwaysRun' => false,
]);

$app->session = new class() extends App\SessionManager {
Expand Down