generated from ibexa/bundle-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added rector rule to replace ContentType::isContainer property to met…
…hod (#25)
- Loading branch information
Showing
10 changed files
with
295 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...ib/Sets/Ibexa50/Fixture/change_property_to_method_content_type_draft_is_container.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Core\Repository\Values\ContentType\ContentTypeDraft; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(ContentTypeDraft $contentTypeDraft): array | ||
{ | ||
return [$contentTypeDraft->isContainer]; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Core\Repository\Values\ContentType\ContentTypeDraft; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(ContentTypeDraft $contentTypeDraft): array | ||
{ | ||
return [$contentTypeDraft->isContainer()]; | ||
} | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
tests/lib/Sets/Ibexa50/Fixture/change_property_to_method_content_type_is_container.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(ContentType $contentType): array | ||
{ | ||
return [$contentType->isContainer]; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(ContentType $contentType): array | ||
{ | ||
return [$contentType->isContainer()]; | ||
} | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
...exa50/Fixture/change_property_to_method_contracts_content_type_draft_is_container.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(ContentTypeDraft $contentTypeDraft): array | ||
{ | ||
return [$contentTypeDraft->isContainer]; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(ContentTypeDraft $contentTypeDraft): array | ||
{ | ||
return [$contentTypeDraft->isContainer()]; | ||
} | ||
} | ||
|
||
?> |
29 changes: 29 additions & 0 deletions
29
tests/lib/Sets/Ibexa50/Fixture/rename_class_update_serializer.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Solr\Gateway\UpdateSerializer; | ||
|
||
readonly class Foo | ||
{ | ||
public function __construct(UpdateSerializer $updateSerializer) | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Solr\Gateway\UpdateSerializer\XmlUpdateSerializer; | ||
|
||
readonly class Foo | ||
{ | ||
public function __construct(XmlUpdateSerializer $updateSerializer) | ||
{ | ||
} | ||
} | ||
|
||
?> |
32 changes: 32 additions & 0 deletions
32
tests/lib/Sets/Ibexa50/Fixture/rename_const_content_type_identifier.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Migration\ValueObject\ContentType\Matcher; | ||
|
||
readonly class Foo | ||
{ | ||
public function fooBar(): string | ||
{ | ||
return Matcher::CONTENT_TYPE_IDENTIFIER; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Migration\StepExecutor\ContentType\IdentifierFinder; | ||
use Ibexa\Migration\ValueObject\ContentType\Matcher; | ||
|
||
readonly class Foo | ||
{ | ||
public function fooBar(): string | ||
{ | ||
return IdentifierFinder::CONTENT_TYPE_IDENTIFIER; | ||
} | ||
} | ||
|
||
?> |
32 changes: 32 additions & 0 deletions
32
tests/lib/Sets/Ibexa50/Fixture/rename_const_tree_root.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Bundle\FormBuilder\DependencyInjection\Configuration; | ||
|
||
readonly class Foo | ||
{ | ||
public function fooBar(): string | ||
{ | ||
return Configuration::TREE_ROOT; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Bundle\FormBuilder\DependencyInjection\IbexaFormBuilderExtension; | ||
use Ibexa\Bundle\FormBuilder\DependencyInjection\Configuration; | ||
|
||
readonly class Foo | ||
{ | ||
public function fooBar(): string | ||
{ | ||
return IbexaFormBuilderExtension::EXTENSION_NAME; | ||
} | ||
} | ||
|
||
?> |
29 changes: 29 additions & 0 deletions
29
tests/lib/Sets/Ibexa50/Fixture/rename_field_namespace_content_to_common.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Solr\Query\Content\CriterionVisitor\Field; | ||
|
||
readonly class Foo | ||
{ | ||
public function __construct(Field $field) | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Solr\Query\Common\CriterionVisitor\Field; | ||
|
||
readonly class Foo | ||
{ | ||
public function __construct(Field $field) | ||
{ | ||
} | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
tests/lib/Sets/Ibexa50/Fixture/rename_property_searchresult_count.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\Content\Trash\SearchResult; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(SearchResult $searchResult): string | ||
{ | ||
return $searchResult->count; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\Content\Trash\SearchResult; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(SearchResult $searchResult): string | ||
{ | ||
return $searchResult->totalCount; | ||
} | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
tests/lib/Sets/Ibexa50/Fixture/rename_property_searchresult_spell_suggestion.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(SearchResult $searchResult): array | ||
{ | ||
return [$searchResult->spellSuggestion]; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ReplaceCartMoneyFactoryRector\Fixture; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult; | ||
|
||
readonly class Foo | ||
{ | ||
public function foo(SearchResult $searchResult): array | ||
{ | ||
return [$searchResult->spellcheck]; | ||
} | ||
} | ||
|
||
?> |