Skip to content

Commit

Permalink
Update packages (#249)
Browse files Browse the repository at this point in the history
Update packages, require nette/di 3.1.8+, changes required for Texy 3.2.0, Psalm 5.16.0 

 - efabrica/phpstan-latte updated from 0.16.1 to 0.16.2 patch
   See changes: efabrica-team/phpstan-latte@0.16.1...0.16.2
   Release notes: https://github.com/efabrica-team/phpstan-latte/releases/tag/0.16.2

 - latte/latte updated from v3.0.10 to v3.0.12 patch
   See changes: nette/latte@v3.0.10...v3.0.12
   Release notes: https://github.com/nette/latte/releases/tag/v3.0.12

 - phpstan/phpdoc-parser updated from 1.24.2 to 1.24.3 patch
   See changes: phpstan/phpdoc-parser@1.24.2...1.24.3
   Release notes: https://github.com/phpstan/phpdoc-parser/releases/tag/1.24.3

 - phpstan/phpstan updated from 1.10.41 to 1.10.44 patch
   See changes: phpstan/phpstan@1.10.41...1.10.44
   Release notes: https://github.com/phpstan/phpstan/releases/tag/1.10.44

 - psalm/phar updated from 5.15.0 to 5.16.0 minor
   See changes: psalm/phar@5.15.0...5.16.0
   Release notes: https://github.com/psalm/phar/releases/tag/5.16.0

 - roave/security-advisories updated from dev-latest@705b497 to dev-latest@2b23329
   See changes: Roave/SecurityAdvisories@705b497...2b23329

 - symfony/cache updated from v6.3.6 to v6.3.8 patch
   See changes: symfony/cache@v6.3.6...v6.3.8
   Release notes: https://github.com/symfony/cache/releases/tag/v6.3.8

 - symfony/cache-contracts updated from v3.3.0 to v3.4.0 minor
   See changes: symfony/cache-contracts@v3.3.0...v3.4.0
   Release notes: https://github.com/symfony/cache-contracts/releases/tag/v3.4.0

 - symfony/config updated from v6.3.2 to v6.3.8 patch
   See changes: symfony/config@v6.3.2...v6.3.8
   Release notes: https://github.com/symfony/config/releases/tag/v6.3.8

 - symfony/deprecation-contracts updated from v3.3.0 to v3.4.0 minor
   See changes: symfony/deprecation-contracts@v3.3.0...v3.4.0
   Release notes: https://github.com/symfony/deprecation-contracts/releases/tag/v3.4.0

 - symfony/service-contracts updated from v3.3.0 to v3.4.0 minor
   See changes: symfony/service-contracts@v3.3.0...v3.4.0
   Release notes: https://github.com/symfony/service-contracts/releases/tag/v3.4.0

 - symfony/translation-contracts updated from v3.3.0 to v3.4.0 minor
   See changes: symfony/translation-contracts@v3.3.0...v3.4.0
   Release notes: https://github.com/symfony/translation-contracts/releases/tag/v3.4.0

 - texy/texy updated from v3.1.7 to v3.2.0 minor
   See changes: dg/texy@v3.1.7...v3.2.0
   Release notes: https://github.com/dg/texy/releases/tag/v3.2.0
  • Loading branch information
spaze authored Nov 23, 2023
2 parents a423c45 + eb9f136 commit 0c11c45
Show file tree
Hide file tree
Showing 146 changed files with 1,221 additions and 1,574 deletions.
3 changes: 3 additions & 0 deletions site/app/DateTime/DateTimeZoneFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class DateTimeZoneFactory
*/
public function get(string $timezone): DateTimeZone
{
if ($timezone === '') {
throw new InvalidTimezoneException($timezone);
}
try {
return new DateTimeZone($timezone);
} catch (Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion site/app/Formatter/TexyFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getTexy(): Texy
$this->texy->headingModule->idPrefix = '';
$this->texy->typographyModule->locale = substr($this->translator->getDefaultLocale(), 0, 2); // en_US → en
$this->texy->allowed['phrase/del'] = true;
$this->texy->addHandler('phrase', [$this->phraseHandler, 'solve']);
$this->texy->addHandler('phrase', $this->phraseHandler->solve(...));
$this->setTopHeading($this->topHeading);
return $this->texy;
}
Expand Down
10 changes: 5 additions & 5 deletions site/app/Formatter/TexyPhraseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
public function solve(HandlerInvocation $invocation, string $phrase, string $content, Modifier $modifier, ?Link $link): HtmlElement|string|false
{
if (!$link) {
return $this->proceed($invocation);
return $this->proceed($invocation, $phrase, $content, $modifier, $link);
}

$localeRegExp = '([a-z]{2}_[A-Z]{2})';
Expand Down Expand Up @@ -87,15 +87,15 @@ public function solve(HandlerInvocation $invocation, string $phrase, string $con
$name = $this->trainingLocales->getLocaleActions($name)[$this->translator->getDefaultLocale()];
$link->URL = $presenter->link('//:' . self::TRAINING_ACTION, $name);
$el = HtmlElement::el();
$trainingLink = $texy->phraseModule->solve($invocation, $phrase, $content, $modifier, $link);
$trainingLink = $this->proceed($invocation, $phrase, $content, $modifier, $link);
if ($trainingLink) {
$el->add($trainingLink);
$el->add($texy->protect($this->getTrainingSuffix($name), $texy::CONTENT_TEXTUAL));
return $el;
}
}

return $this->proceed($invocation);
return $this->proceed($invocation, $phrase, $content, $modifier, $link);
}


Expand Down Expand Up @@ -149,9 +149,9 @@ private function getTrainingSuffix(string $training): string
/**
* @throws UnexpectedHandlerInvocationReturnType
*/
private function proceed(HandlerInvocation $invocation): HtmlElement|string|false
private function proceed(HandlerInvocation $invocation, string $phrase, string $content, Modifier $modifier, ?Link $link): HtmlElement|string|false
{
$result = $invocation->proceed();
$result = $invocation->proceed($phrase, $content, $modifier, $link);
if (!$result instanceof HtmlElement && !is_string($result) && $result !== false) {
throw new UnexpectedHandlerInvocationReturnType($result);
}
Expand Down
2 changes: 1 addition & 1 deletion site/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nette/command-line": "^1.6",
"nette/component-model": "^3.0.2",
"nette/database": "^3.1.5",
"nette/di": "3.1.6",
"nette/di": "^3.1.8",
"nette/forms": "^3.1.7",
"nette/http": "^3.1.6",
"nette/mail": "^4.0",
Expand Down
Loading

0 comments on commit 0c11c45

Please sign in to comment.