Skip to content

Commit a7a1011

Browse files
rotimirotimi
authored andcommitted
Rector tweaks
1 parent af664c0 commit a7a1011

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

src/GenericPermissionableEntitiesCollection.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ public function has(PermissionableEntityInterface $entity): bool {
4646
* Adds an instance of PermissionableEntityInterface to an instance of this class
4747
*
4848
* @param PermissionableEntityInterface $permissionEntity
49-
* @psalm-suppress MethodSignatureMismatch
5049
*
50+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
5151
* @return $this
5252
*/
53-
public function add(PermissionableEntityInterface $permissionEntity): self {
53+
public function add(PermissionableEntityInterface $permissionEntity): PermissionableEntitiesCollectionInterface {
5454

5555
if( !$this->has($permissionEntity) ) {
5656

@@ -87,11 +87,11 @@ public function getKey(PermissionableEntityInterface $entity) {
8787
* Removes an instance of PermissionableEntityInterface from an instance of this class.
8888
*
8989
* @param PermissionableEntityInterface $permissionEntity
90-
* @psalm-suppress MethodSignatureMismatch
9190
*
91+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
9292
* @return $this
9393
*/
94-
public function remove(PermissionableEntityInterface $permissionEntity): self {
94+
public function remove(PermissionableEntityInterface $permissionEntity): PermissionableEntitiesCollectionInterface {
9595

9696
$key = $this->getKey($permissionEntity);
9797

@@ -105,11 +105,10 @@ public function remove(PermissionableEntityInterface $permissionEntity): self {
105105
/**
106106
* Remove all items in the collection and return $this
107107
*
108-
* @psalm-suppress MethodSignatureMismatch
109-
*
108+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
110109
* @return $this
111110
*/
112-
public function removeAll(): self {
111+
public function removeAll(): PermissionableEntitiesCollectionInterface {
113112

114113
$this->storage = [];
115114

@@ -121,10 +120,11 @@ public function removeAll(): self {
121120
*
122121
* @param PermissionableEntityInterface $permissionEntity
123122
* @param string $key specified key for $permissionEntity in the collection
124-
* @psalm-suppress MethodSignatureMismatch
123+
*
124+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
125125
* @return $this
126126
*/
127-
public function put(PermissionableEntityInterface $permissionEntity, string $key): self {
127+
public function put(PermissionableEntityInterface $permissionEntity, string $key): PermissionableEntitiesCollectionInterface {
128128

129129
$this->storage[$key] = $permissionEntity;
130130

@@ -160,11 +160,10 @@ public function get(string $key): ?PermissionableEntityInterface {
160160
* considered to be respectively less than, equal to,
161161
* or greater than the second.
162162
*
163-
* @psalm-suppress MethodSignatureMismatch
164-
*
163+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
165164
* @return $this
166165
*/
167-
public function sort(callable $comparator = null): self {
166+
public function sort(callable $comparator = null): PermissionableEntitiesCollectionInterface {
168167

169168
if( $comparator === null ) {
170169

src/GenericPermissionsCollection.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ public function isAllowed(string $action, string $resource, callable $additional
9292
* Adds an instance of PermissionInterface to an instance of this class.
9393
*
9494
* @param PermissionInterface $permission
95-
* @psalm-suppress MethodSignatureMismatch
9695
*
96+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
9797
* @return $this
9898
*/
99-
public function add(PermissionInterface $permission): self {
99+
public function add(PermissionInterface $permission): PermissionsCollectionInterface {
100100

101101
if( !$this->hasPermission($permission) ) {
102102

@@ -134,11 +134,11 @@ public function getKey(PermissionInterface $permission) {
134134
* Removes an instance of PermissionInterface from an instance of this class.
135135
*
136136
* @param PermissionInterface $permission
137-
* @psalm-suppress MethodSignatureMismatch
138137
*
138+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
139139
* @return $this
140140
*/
141-
public function remove(PermissionInterface $permission): self {
141+
public function remove(PermissionInterface $permission): PermissionsCollectionInterface {
142142

143143
$key = $this->getKey($permission);
144144

@@ -150,11 +150,11 @@ public function remove(PermissionInterface $permission): self {
150150

151151
/**
152152
* Remove all items in the collection and return $this
153-
* @psalm-suppress MethodSignatureMismatch
154153
*
154+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
155155
* @return $this
156156
*/
157-
public function removeAll(): self {
157+
public function removeAll(): PermissionsCollectionInterface {
158158

159159
$this->storage = [];
160160

@@ -166,11 +166,11 @@ public function removeAll(): self {
166166
*
167167
* @param PermissionInterface $permission
168168
* @param string $key specified key for $permission in the collection
169-
* @psalm-suppress MethodSignatureMismatch
170169
*
170+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
171171
* @return $this
172172
*/
173-
public function put(PermissionInterface $permission, string $key): self {
173+
public function put(PermissionInterface $permission, string $key): PermissionsCollectionInterface {
174174

175175
$this->storage[$key] = $permission;
176176

@@ -209,10 +209,9 @@ public function get(string $key): ?PermissionInterface {
209209
* considered to be respectively less than, equal to,
210210
* or greater than the second.
211211
*
212-
* @noRector
212+
* @noRector \Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector
213213
* @return $this
214214
* @noinspection PhpDocSignatureInspection
215-
* @psalm-suppress MethodSignatureMismatch
216215
*/
217216
public function sort(callable $comparator = null): PermissionsCollectionInterface {
218217

0 commit comments

Comments
 (0)