Skip to content

Commit

Permalink
Updated Rector to commit b0c89a98a0eb4a62d3141d950484d6e3ea7fdbda
Browse files Browse the repository at this point in the history
rectorphp/rector-src@b0c89a9 fix: Convert DateTime to Carbon properly when hours/minutes/seconds are used (#6176)
  • Loading branch information
TomasVotruba committed Jul 23, 2024
1 parent dd8c5b5 commit cecbffb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
32 changes: 31 additions & 1 deletion rules/Carbon/NodeFactory/CarbonCallFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,45 @@ final class CarbonCallFactory
* @see https://regex101.com/r/6VUUQF/1
*/
private const PLUS_MONTH_COUNT_REGEX = '#\\+(\\s+)?(?<count>\\d+)(\\s+)?(month|months)#';
/**
* @var string
* @see https://regex101.com/r/dWRjk5/1
*/
private const PLUS_HOUR_COUNT_REGEX = '#\\+(\\s+)?(?<count>\\d+)(\\s+)?(hour|hours)#';
/**
* @var string
* @see https://regex101.com/r/dfK0Ri/1
*/
private const PLUS_MINUTE_COUNT_REGEX = '#\\+(\\s+)?(?<count>\\d+)(\\s+)?(minute|minuts)#';
/**
* @var string
* @see https://regex101.com/r/o7QDYL/1
*/
private const PLUS_SECOND_COUNT_REGEX = '#\\+(\\s+)?(?<count>\\d+)(\\s+)?(second|seconds)#';
/**
* @var string
* @see https://regex101.com/r/IvyT7w/1
*/
private const MINUS_MONTH_COUNT_REGEX = '#-(\\s+)?(?<count>\\d+)(\\s+)?(month|months)#';
/**
* @var string
* @see https://regex101.com/r/bICKg6/1
*/
private const MINUS_HOUR_COUNT_REGEX = '#-(\\s+)?(?<count>\\d+)(\\s+)?(hour|hours)#';
/**
* @var string
* @see https://regex101.com/r/WILFvX/1
*/
private const MINUS_MINUTE_COUNT_REGEX = '#-(\\s+)?(?<count>\\d+)(\\s+)?(minute|minutes)#';
/**
* @var string
* @see https://regex101.com/r/FwCUup/1
*/
private const MINUS_SECOND_COUNT_REGEX = '#-(\\s+)?(?<count>\\d+)(\\s+)?(second|seconds)#';
/**
* @var array<self::*_REGEX, string>
*/
private const REGEX_TO_METHOD_NAME_MAP = [self::PLUS_DAY_COUNT_REGEX => 'addDays', self::MINUS_DAY_COUNT_REGEX => 'subDays', self::PLUS_MONTH_COUNT_REGEX => 'addMonths', self::MINUS_MONTH_COUNT_REGEX => 'subMonths'];
private const REGEX_TO_METHOD_NAME_MAP = [self::PLUS_DAY_COUNT_REGEX => 'addDays', self::MINUS_DAY_COUNT_REGEX => 'subDays', self::PLUS_MONTH_COUNT_REGEX => 'addMonths', self::MINUS_MONTH_COUNT_REGEX => 'subMonths', self::PLUS_HOUR_COUNT_REGEX => 'addHours', self::MINUS_HOUR_COUNT_REGEX => 'subHours', self::PLUS_MINUTE_COUNT_REGEX => 'addMinutes', self::MINUS_MINUTE_COUNT_REGEX => 'subMinutes', self::PLUS_SECOND_COUNT_REGEX => 'addSeconds', self::MINUS_SECOND_COUNT_REGEX => 'subSeconds'];
/**
* @return \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '29e926608b0008df286370f94cf5c26b4aa86226';
public const PACKAGE_VERSION = 'b0c89a98a0eb4a62d3141d950484d6e3ea7fdbda';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-07-22 22:16:46';
public const RELEASE_DATE = '2024-07-23 18:02:45';
/**
* @var int
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/scoper-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Restore the backup and ensure the excluded files are properly marked as loaded
$GLOBALS['__composer_autoload_files'] = \array_merge(
$existingComposerAutoloadFiles,
\array_fill_keys(['5928a00fa978807cf85d90ec3f4b0147', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a'], true)
\array_fill_keys(['0e6d7bf4a5811bfa5cf40c5ccd6fae6a', '5928a00fa978807cf85d90ec3f4b0147'], true)
);

return $loader;
Expand Down

0 comments on commit cecbffb

Please sign in to comment.