Skip to content

Commit

Permalink
Merge branch 'codeigniter4:develop' into refactor-session-constant-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
pjsde authored Oct 1, 2023
2 parents 189e1a7 + 0cd3993 commit 2b4ef45
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1 || ^2.0",
"rector/rector": "0.18.3",
"rector/rector": "0.18.4",
"vimeo/psalm": "^5.0"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public static function request(?App $config = null, bool $getShared = true)
}

// @TODO remove the following code for backward compatibility
return static::incomingrequest($config, $getShared);
return AppServices::incomingrequest($config, $getShared);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/libraries/email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Class Reference
:returns: Attachment Content-ID or false if not found
:rtype: string

Sets and returns an attachment's Content-ID, which enables your to embed an inline
Sets and returns an attachment's Content-ID, which enables you to embed an inline
(picture) attachment into HTML. First parameter must be the already attached file name.

.. literalinclude:: email/022.php
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ as the second parameter of the ``setStatusCode()`` method:
.. literalinclude:: response/002.php

You can set format an array into either JSON or XML and set the content type header to the appropriate mime with the
``setJSON`` and ``setXML`` methods. Typically, you will send an array of data to be converted:
``setJSON()`` and ``setXML()`` methods. Typically, you will send an array of data to be converted:

.. literalinclude:: response/003.php

Expand Down
13 changes: 13 additions & 0 deletions utils/Rector/RemoveVarTagFromClassConstantRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,23 @@
use PhpParser\Node;
use PhpParser\Node\Stmt\ClassConst;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

final class RemoveVarTagFromClassConstantRector extends AbstractRector
{
private PhpDocInfoFactory $phpDocInfoFactory;
private DocBlockUpdater $docBlockUpdater;

public function __construct(PhpDocInfoFactory $phpDocInfoFactory, DocBlockUpdater $docBlockUpdater)
{
$this->phpDocInfoFactory = $phpDocInfoFactory;
$this->docBlockUpdater = $docBlockUpdater;
}

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('Remove @var tag from class constant', [
Expand Down Expand Up @@ -64,6 +75,8 @@ public function refactor(Node $node): ?Node

$phpDocInfo->removeByType(VarTagValueNode::class);

$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);

return $node;
}
}

0 comments on commit 2b4ef45

Please sign in to comment.