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

Fix problems with class variables overlapping #6

Merged
merged 6 commits into from
Jul 8, 2020

Conversation

OleksiiShcherba
Copy link
Contributor

робочий варіант з мінімумом змін в уже існуючих проектах де використовується бібліотека
протестив в одному з проектів

src/Router.php Outdated
Comment on lines 18 to 23
function __construct(array $data = []) {
$this->serviceName = $data['serviceName'] ?? null;
$this->actionName = $data['actionName'] ?? null;
$this->params = $data['params'] ?? null;
$this->routes = [];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут видно что количество водящих не динамическое и не большое - лучше передать их все напрямую

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

прям параметрами без обверти масивом

src/Router.php Outdated
throw new RoutingException(_("Empty routes"), 1);
}

$this->routes = $routes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в каждом обьекте роутера будет свой набор роутов дублирующийся массив на 100+ строк на каждый паралельный реквест. то что мы говорили про статический доступ

src/Router.php Outdated
throw new RoutingException(_("Route not found."), 501);
}

return new self($routeData);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Передать сразу конкретные переменные

src/Router.php Outdated

$routesCount = 0;

foreach ($this->routes as $regExpString => $route) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Юзать роуты не с обьекта

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а с класса

added static obj logic for specific env, made changes by pullrequest
src/Router.php Outdated
}
return self::$instance[$environment];
} else {
die("Некорректная среда");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нельзя просто взять и умереть нельзя останавливать процесс изза одного реквеста есть же паралельные реквесты

@oleksandr-diudiun oleksandr-diudiun self-requested a review July 8, 2020 15:14
@oleksandr-diudiun oleksandr-diudiun merged commit 90fd6ed into Memcrab:master Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants