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

Link caching #15

Merged
merged 9 commits into from
Jan 11, 2023
Merged

Link caching #15

merged 9 commits into from
Jan 11, 2023

Conversation

naxvog
Copy link
Contributor

@naxvog naxvog commented Jan 11, 2023

Caches successfully visited links using the default cache provider according to the set cache time in the backend.

  • Performance: Avoids any DNS queries if a cached result is available
  • Default settings mechanism to avoid using the deprecated default-argument of serializeToForm

$this->web = $web;
$this->translator = $translator;
$this->cache = $cache;
$cacheTime = $settings->get('datlechin-link-preview.cache_time');
if (!is_numeric($cacheTime)) {
Copy link
Owner

Choose a reason for hiding this comment

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

PSR-12 here

Copy link
Contributor Author

@naxvog naxvog Jan 11, 2023

Choose a reason for hiding this comment

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

Can you please elaborate?
Checked the code against PSR-12 and found no issue in the marked segment. Are you referring to an empty line before the if-statement?

Copy link
Owner

Choose a reason for hiding this comment

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

a space after !
by the way, I'll update it later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Strange I set up my IDE to conform to PSR-12 an even ran PHP_CodeSniffer with the PSR12 preset and the space after the negation operator is removed every time I autoformat using the tool.

@datlechin datlechin merged commit 76224f6 into datlechin:master Jan 11, 2023
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

3 participants