Skip to content

Commit

Permalink
skip mixed type change
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Feb 20, 2025
1 parent a57421f commit 4f79c7a
Show file tree
Hide file tree
Showing 107 changed files with 277 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/ar-softdelete/src/SoftDeleteQueryBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function notDeleted()
* @param mixed $deleted filter value.
* @return \yii\db\ActiveQueryInterface|static
*/
public function filterDeleted(mixed $deleted)
public function filterDeleted($deleted)
{
if ($deleted === '' || $deleted === null || $deleted === []) {
return $this->notDeleted();
Expand Down
3 changes: 3 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;

return RectorConfig::configure()
Expand Down Expand Up @@ -37,5 +38,7 @@
ChangeSwitchToMatchRector::class => [
__DIR__ . '/src/elements/Entry.php',
],

MixedTypeRector::class,
])
->withPhpSets(php80: true);
1 change: 1 addition & 0 deletions src/Craft.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public static function parseEnv(?string $str = null): string|null|false
* $status = Craft::parseBooleanEnv('$SYSTEM_STATUS') ?? false;
* ```
*
* @param mixed $value
* @return bool|null
* @since 3.7.22
* @deprecated in 3.7.29. [[App::parseBooleanEnv()]] should be used instead.
Expand Down
1 change: 1 addition & 0 deletions src/auth/sso/BaseExternalProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ protected function populateUser(User $user, array $data): User
/**
* Normalize a callback
*
* @param mixed $callback
* @param string|null $defaultClass
* @return callable|null
* @throws \yii\base\InvalidConfigException
Expand Down
1 change: 1 addition & 0 deletions src/auth/sso/mapper/SetUserValueTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ trait SetUserValueTrait
* Set a value on a user; determine if we're setting a field value or property
*
* @param User $user
* @param mixed $value
* @return void
*/
protected function setValue(User $user, mixed $value): void
Expand Down
1 change: 1 addition & 0 deletions src/auth/sso/mapper/UserMapInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface UserMapInterface
{
/**
* @param User $user
* @param mixed $data
* @return User
*/
public function __invoke(User $user, mixed $data): User;
Expand Down
2 changes: 2 additions & 0 deletions src/base/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -2940,6 +2940,7 @@ public function afterValidate(): void
* Normalizes a field’s validation rule.
*
* @param string $attribute
* @param mixed $rule
* @param FieldInterface $field
* @param callable $isEmpty
* @return Validator
Expand Down Expand Up @@ -6627,6 +6628,7 @@ public function getLanguage(): string
/**
* Returns an element right before/after this one, from a given set of criteria.
*
* @param mixed $criteria
* @param int $dir
* @return ElementInterface|null
*/
Expand Down
2 changes: 2 additions & 0 deletions src/base/ElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -1073,13 +1073,15 @@ public function getLocalized(): ElementQueryInterface|ElementCollection;
/**
* Returns the next element relative to this one, from a given set of criteria.
*
* @param mixed $criteria
* @return self|null
*/
public function getNext(mixed $criteria = false): ?self;

/**
* Returns the previous element relative to this one, from a given set of criteria.
*
* @param mixed $criteria
* @return self|null
*/
public function getPrev(mixed $criteria = false): ?self;
Expand Down
1 change: 1 addition & 0 deletions src/base/MemoizableArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public function firstWhere(string $key, mixed $value = true, bool $strict = fals
*
* @param string $method
* @param string $key
* @param mixed $value
* @param bool $strict
* @return string
*/
Expand Down
1 change: 1 addition & 0 deletions src/base/PreviewableFieldInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function getPreviewHtml(mixed $value, ElementInterface $element): string;
* Return the HTML that should be shown for the field in the card preview.
* It can be used outside an element context, e.g. in a card view designer.
*
* @param mixed $value
* @param ElementInterface|null $element
* @return string
* @since 5.5.0
Expand Down
6 changes: 6 additions & 0 deletions src/base/conditions/BaseDateRangeConditionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public function getStartDate(): ?string
return $this->_startDate;
}

/**
* @param mixed $value
*/
public function setStartDate(mixed $value): void
{
$this->_startDate = ($value ? DateTimeHelper::toIso8601($value) : null);
Expand All @@ -99,6 +102,9 @@ public function getEndDate(): ?string
return $this->_endDate;
}

/**
* @param mixed $value
*/
public function setEndDate(mixed $value): void
{
$this->_endDate = ($value ? DateTimeHelper::toIso8601($value) : null);
Expand Down
1 change: 1 addition & 0 deletions src/base/conditions/BaseTextConditionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ protected function paramValue(): ?string
/**
* Returns whether the condition rule matches the given value.
*
* @param mixed $value
* @return bool
*/
protected function matchValue(mixed $value): bool
Expand Down
28 changes: 28 additions & 0 deletions src/config/GeneralConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3481,6 +3481,7 @@ public function actionTrigger(string $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $activateAccountSuccessPath
* @see getActivateAccountSuccessPath()
Expand Down Expand Up @@ -3896,6 +3897,7 @@ public function buildId(?string $value): self
*
* @group System
* @defaultAlt 1 day
* @param mixed $value
* @return self
* @see $cacheDuration
* @since 4.2.0
Expand Down Expand Up @@ -3943,6 +3945,7 @@ public function convertFilenamesToAscii(bool $value = true): self
*
* @group Security
* @defaultAlt 5 minutes
* @param mixed $value
* @return self
* @see $cooldownDuration
* @since 4.2.0
Expand Down Expand Up @@ -4148,6 +4151,7 @@ public function defaultCpLocale(?string $value): self
* ```
*
* @group System
* @param mixed $value
* @return self
* @see $defaultDirMode
* @since 4.2.0
Expand Down Expand Up @@ -4259,6 +4263,7 @@ public function defaultTemplateExtensions(array $value): self
*
* @group Security
* @defaultAlt 1 day
* @param mixed $value
* @return self
* @see $defaultTokenDuration
* @since 4.2.0
Expand Down Expand Up @@ -4588,6 +4593,7 @@ public function enableGql(bool $value = true): self
*
* @group Security
* @defaultAlt 5 minutes
* @param mixed $value
* @return self
* @see $elevatedSessionDuration
* @since 4.2.0
Expand Down Expand Up @@ -4994,6 +5000,7 @@ public function httpProxy(?string $value): self
* ```
*
* @group Image Handling
* @param mixed $value
* @return self
* @see $imageDriver
* @since 4.2.0
Expand Down Expand Up @@ -5062,6 +5069,7 @@ public function indexTemplateFilenames(array $value): self
*
* @group Security
* @defaultAlt 1 hour
* @param mixed $value
* @return self
* @see $invalidLoginWindowDuration
* @since 4.2.0
Expand All @@ -5084,6 +5092,7 @@ public function invalidLoginWindowDuration(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $invalidUserTokenPath
* @since 4.2.0
Expand Down Expand Up @@ -5211,6 +5220,7 @@ public function localeAliases(array $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $loginPath
* @since 4.2.0
Expand All @@ -5233,6 +5243,7 @@ public function loginPath(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $logoutPath
* @since 4.2.0
Expand Down Expand Up @@ -5659,6 +5670,7 @@ public function phpSessionName(string $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $postCpLoginRedirect
* @since 4.2.0
Expand All @@ -5682,6 +5694,7 @@ public function postCpLoginRedirect(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $postLoginRedirect
* @since 4.2.0
Expand All @@ -5702,6 +5715,7 @@ public function postLoginRedirect(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $postLogoutRedirect
* @since 4.2.0
Expand Down Expand Up @@ -5887,6 +5901,7 @@ public function previewIframeResizerOptions(array $value): self
*
* @group Security
* @defaultAlt 1 day
* @param mixed $value
* @return self
* @see $previewTokenDuration
* @since 4.2.0
Expand Down Expand Up @@ -5938,6 +5953,7 @@ public function privateTemplateTrigger(string $value): self
* ```
*
* @group Garbage Collection
* @param mixed $value
* @return self
* @see $purgePendingUsersDuration
* @since 4.2.0
Expand All @@ -5962,6 +5978,7 @@ public function purgePendingUsersDuration(mixed $value): self
*
* @group Garbage Collection
* @defaultAlt 90 days
* @param mixed $value
* @return self
* @see $purgeStaleUserSessionDuration
* @since 4.2.0
Expand All @@ -5985,6 +6002,7 @@ public function purgeStaleUserSessionDuration(mixed $value): self
*
* @group Garbage Collection
* @defaultAlt 30 days
* @param mixed $value
* @return self
* @see $purgeUnsavedDraftsDuration
* @since 4.2.0
Expand Down Expand Up @@ -6029,6 +6047,7 @@ public function rasterizeSvgThumbs(bool $value = true): self
*
* @group Session
* @defaultAlt 1 year
* @param mixed $value
* @return self
* @see $rememberUsernameDuration
* @since 4.2.0
Expand All @@ -6052,6 +6071,7 @@ public function rememberUsernameDuration(mixed $value): self
*
* @group Session
* @defaultAlt 14 days
* @param mixed $value
* @return self
* @throws InvalidConfigException
* @see $rememberedUserSessionDuration
Expand Down Expand Up @@ -6418,6 +6438,7 @@ public function sendPoweredByHeader(bool $value = true): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $setPasswordPath
* @since 4.2.0
Expand Down Expand Up @@ -6445,6 +6466,7 @@ public function setPasswordPath(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $setPasswordRequestPath
* @since 4.2.0
Expand All @@ -6465,6 +6487,7 @@ public function setPasswordRequestPath(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $setPasswordSuccessPath
* @since 4.2.0
Expand Down Expand Up @@ -6608,6 +6631,7 @@ public function showFirstAndLastNameFields(bool $value = true): self
*
* @group Garbage Collection
* @defaultAlt 30 days
* @param mixed $value
* @return self
* @see $softDeleteDuration
* @since 4.2.0
Expand Down Expand Up @@ -6984,6 +7008,7 @@ public function useSslOnTokenizedUrls(string|bool $value): self
*
* @group Session
* @defaultAlt 1 hour
* @param mixed $value
* @return self
* @see $userSessionDuration
* @since 4.2.0
Expand Down Expand Up @@ -7030,6 +7055,7 @@ public function useFileLocks(?bool $value): self
*
* @group Security
* @defaultAlt 1 day
* @param mixed $value
* @return self
* @see $verificationCodeDuration
* @since 4.2.0
Expand All @@ -7050,6 +7076,7 @@ public function verificationCodeDuration(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $verifyEmailPath
* @see getVerifyEmailPath()
Expand All @@ -7071,6 +7098,7 @@ public function verifyEmailPath(mixed $value): self
* ```
*
* @group Routing
* @param mixed $value
* @return self
* @see $verifyEmailSuccessPath
* @see getVerifyEmailSuccessPath()
Expand Down
1 change: 1 addition & 0 deletions src/console/controllers/SetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ private function _outputCommand(string $command): void
* Sets an environment variable value in the project’s `.env` file.
*
* @param string $name
* @param mixed $value
* @return bool
*/
private function _setEnvVar(string $name, mixed $value): bool
Expand Down
1 change: 1 addition & 0 deletions src/console/controllers/utils/RepairController.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ public function actionProjectConfig(): int
*
* @param ProjectConfig $projectConfigService
* @param string $path
* @param mixed $value
* @return mixed
*/
private function _repairProjectConfigItem(ProjectConfig $projectConfigService, string $path, mixed $value): mixed
Expand Down
1 change: 1 addition & 0 deletions src/controllers/ElementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public function beforeAction($action): bool

/**
* @param string $name
* @param mixed $default
* @return mixed
*/
private function _param(string $name, mixed $default = null): mixed
Expand Down
Loading

0 comments on commit 4f79c7a

Please sign in to comment.