Skip to content

Commit

Permalink
Merge pull request #186 from magento-commerce/develop
Browse files Browse the repository at this point in the history
Version 24 master update
  • Loading branch information
sivaschenko authored Jun 14, 2022
2 parents dba4d2b + 1fc3c9d commit ab5a8ca
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 130 deletions.
11 changes: 6 additions & 5 deletions Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0);
$commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0);
if (!$commentStartPtr) {
$phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments');
return;
}

if ($this->PHPDocFormattingValidator->hasDeprecatedWellFormatted($commentStartPtr, $tokens) !== true) {
$phpcsFile->addWarning(
Expand All @@ -62,11 +67,7 @@ public function process(File $phpcsFile, $stackPtr)
'InvalidDeprecatedTagUsage'
);
}
$commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0);
if (!$commentStartPtr) {
$phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments');
return;
}

$commentCloserPtr = $tokens[$commentStartPtr]['comment_closer'];
$functionPtrContent = $tokens[$stackPtr + 2]['content'];
if (preg_match('/(?i)__construct/', $functionPtrContent)) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"AFL-3.0"
],
"type": "phpcodesniffer-standard",
"version": "23",
"version": "24",
"require": {
"php": ">=7.3",
"webonyx/graphql-php": "^14.9",
Expand Down
148 changes: 33 additions & 115 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions phpunit-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
define('PHP_CODESNIFFER_VERBOSITY', 0);
}

/**
* Define PHP 8.1 tokens
*/
if (!defined('T_READONLY')) {
define('T_READONLY', 42401);
}

$ds = DIRECTORY_SEPARATOR;

// Get the PHPCS dir from an environment variable.
Expand Down
14 changes: 5 additions & 9 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,21 @@

use Magento2\Rector\Src\ReplaceMbStrposNullLimit;
use Magento2\Rector\Src\ReplaceNewDateTimeNull;
use Rector\Core\Configuration\Option;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php80\Rector\Class_\StringableForToStringRector;
use Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector;
use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector;
use Rector\Php80\Rector\ClassMethod\SetStateToStaticRector;
use Rector\Php81\Rector\FuncCall\Php81ResourceReturnToObjectRector;
use Magento2\Rector\Src\ReplacePregSplitNullLimit;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();

$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_81);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(PhpVersion::PHP_80);
$rectorConfig->phpVersion(PhpVersion::PHP_81);

// get services (needed for register a single rule)
$services = $containerConfigurator->services();
$services = $rectorConfig->services();

// register a single rule
$services->set(FinalPrivateToPrivateVisibilityRector::class);
Expand Down

0 comments on commit ab5a8ca

Please sign in to comment.