Skip to content

Commit

Permalink
Merge pull request #54 from peckadesign/nette_di
Browse files Browse the repository at this point in the history
Uprava povolene verze nette/di
  • Loading branch information
pierotto authored Jul 11, 2023
2 parents 3a80b55 + edb1825 commit b9e97f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nette/application": "~2.4|~3.0.0|~3.1.0",
"nette/forms": "~2.4|~3.0.0|~3.1.0",
"contributte/recaptcha": "^3.1",
"nette/di": "~2.4|~3.0.0",
"nette/di": "~2.4|^3.0.0",
"nette/utils": "~2.4|~3.0.0|~3.1.0|~3.2.0",
"pd/utils": "^1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/RuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class RuleOptions implements \JsonSerializable
self::STATUS_TIMEOUT => '_form_validation_timeout',
];

private \Nette\Localization\ITranslator $translator;
private \Nette\Localization\Translator $translator;

private bool $optional;

Expand All @@ -45,7 +45,7 @@ final class RuleOptions implements \JsonSerializable


public function __construct(
\Nette\Localization\ITranslator $translator,
\Nette\Localization\Translator $translator,
bool $optional
) {
$this->translator = $translator;
Expand Down
4 changes: 2 additions & 2 deletions src/RuleOptionsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ final class RuleOptionsFactory
private const NETTE_RULE_ARGS = 'netteRuleArgs';


private \Nette\Localization\ITranslator $translator;
private \Nette\Localization\Translator $translator;


public function __construct(
\Nette\Localization\ITranslator $translator
\Nette\Localization\Translator $translator
) {
$this->translator = $translator;
}
Expand Down
12 changes: 6 additions & 6 deletions src/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()
/**
* @param \Nette\Forms\Controls\BaseControl $control
*/
public static function ajax(\Nette\Forms\IControl $control, \Pd\Forms\RuleOptions $options): bool
public static function ajax(\Nette\Forms\Control $control, \Pd\Forms\RuleOptions $options): bool
{
if ($options->isOptional()) {
return TRUE;
Expand Down Expand Up @@ -54,13 +54,13 @@ public static function ajax(\Nette\Forms\IControl $control, \Pd\Forms\RuleOption
/**
* Rule is never validated on backend, used for proxying nette rules as optional only
*/
public static function netteRuleProxy(\Nette\Forms\IControl $control, \Pd\Forms\RuleOptions $options): bool
public static function netteRuleProxy(\Nette\Forms\Control $control, \Pd\Forms\RuleOptions $options): bool
{
return TRUE;
}


public static function phone(\Nette\Forms\IControl $control, ?\Pd\Forms\RuleOptions $options): bool
public static function phone(\Nette\Forms\Control $control, ?\Pd\Forms\RuleOptions $options): bool
{
if ($options !== NULL && $options->isOptional()) {
return TRUE;
Expand All @@ -70,7 +70,7 @@ public static function phone(\Nette\Forms\IControl $control, ?\Pd\Forms\RuleOpti
}


public static function containsNumber(\Nette\Forms\IControl $control, ?\Pd\Forms\RuleOptions $options): bool
public static function containsNumber(\Nette\Forms\Control $control, ?\Pd\Forms\RuleOptions $options): bool
{
if ($options !== NULL && $options->isOptional()) {
return TRUE;
Expand All @@ -80,7 +80,7 @@ public static function containsNumber(\Nette\Forms\IControl $control, ?\Pd\Forms
}


public static function noExternalSources(\Nette\Forms\IControl $control, ?\Pd\Forms\RuleOptions $options): bool
public static function noExternalSources(\Nette\Forms\Control $control, ?\Pd\Forms\RuleOptions $options): bool
{
if ($options !== NULL && ($options->isOptional() || ! $control->getValue())) {
return TRUE;
Expand All @@ -90,7 +90,7 @@ public static function noExternalSources(\Nette\Forms\IControl $control, ?\Pd\Fo
}


public static function czechCompanyIdentifier(\Nette\Forms\IControl $control, ?\Pd\Forms\RuleOptions $options): bool
public static function czechCompanyIdentifier(\Nette\Forms\Control $control, ?\Pd\Forms\RuleOptions $options): bool
{
if ($options !== NULL && $options->isOptional()) {
return TRUE;
Expand Down

0 comments on commit b9e97f5

Please sign in to comment.