Skip to content

Commit ad7a004

Browse files
committed
Lint fix.
1 parent 449e1e9 commit ad7a004

File tree

21 files changed

+45
-52
lines changed

21 files changed

+45
-52
lines changed

config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'service_providers' => [
1515
App\Services\Meta\ServiceProvider::class,
1616
],
17-
'hook_providers' => [
17+
'hook_providers' => [
1818
App\Providers\Assets\Admin::class,
1919
App\Providers\Assets\Editor::class,
2020
App\Providers\Assets\Login::class,

phpcs.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
<!-- Rules: WordPress Coding Standards - see
3535
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
3636
<rule ref="WordPress-Extra"><!-- Includes WordPress-Core -->
37+
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
38+
<exclude name="Generic.Formatting.MultipleStatementAlignment"/>
3739
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing"/>
40+
<exclude name="WordPress.Arrays.MultipleStatementAlignment"/>
3841
</rule>
3942
<!-- For help in understanding these custom sniff properties:
4043
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
@@ -45,8 +48,6 @@
4548
<property name="strict_class_file_names" value="false"/>
4649
</properties>
4750
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
48-
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
49-
<exclude name="Squiz.PHP.CommentedOutCode"/>
5051
</rule>
5152

5253
<rule ref="WordPress.WP.I18n">
@@ -57,12 +58,6 @@
5758
</properties>
5859
</rule>
5960

60-
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
61-
<properties>
62-
<property name="blank_line_check" value="true"/>
63-
</properties>
64-
</rule>
65-
6661
<rule ref="SlevomatCodingStandard.Namespaces">
6762
<properties>
6863
<property name="namespacesRequiredToUse" type="array">
@@ -92,5 +87,6 @@
9287
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
9388
<exclude name="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
9489
<exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion"/>
90+
<exclude name="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable"/>
9591
</rule>
9692
</ruleset>

resources/scripts/admin/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// eslint-disable-next-line no-unused-vars
2-
import config from "@config";
3-
import "@styles/admin";
2+
import config from '@config';
3+
import '@styles/admin';
44
// import 'airbnb-browser-shims'; // Uncomment if needed
55

66
// Your code goes here ...

resources/scripts/editor/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// eslint-disable-next-line no-unused-vars
2-
import config from "@config";
3-
import "@styles/editor";
2+
import config from '@config';
3+
import '@styles/editor';
44
// import 'airbnb-browser-shims'; // Uncomment if needed
55

66
// Your code goes here ...

resources/scripts/login/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// eslint-disable-next-line no-unused-vars
2-
import config from "@config";
3-
import "@styles/login";
2+
import config from '@config';
3+
import '@styles/login';
44
// import 'airbnb-browser-shims'; // Uncomment if needed
55

66
// Your code goes here ...

resources/scripts/theme/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import "@styles/theme";
2-
import "airbnb-browser-shims";
1+
import '@styles/theme';
2+
import 'airbnb-browser-shims';
33
// eslint-disable-next-line no-unused-vars
4-
import config from "@config";
4+
import config from '@config';
55

6-
import "./vendor/*.js";
6+
import './vendor/*.js';
77

88
// Your code goes here ...

src/Providers/Example/PostMeta.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PostMeta extends AbstractHookProvider {
1515

1616
public function __construct( Repository $repository, Logger $logger ) {
1717
$this->repository = $repository;
18-
$this->logger = $logger;
18+
$this->logger = $logger;
1919
}
2020

2121
/**
@@ -42,11 +42,11 @@ protected function register(): void {
4242
Entity::POST_TYPE,
4343
'address',
4444
[
45-
'type' => 'string',
45+
'type' => 'string',
4646
'sanitize_callback' => 'sanitize_text_field',
47-
'single' => true,
48-
'show_in_rest' => true,
49-
'description' => __( 'Endereço.', 'app' ),
47+
'single' => true,
48+
'show_in_rest' => true,
49+
'description' => __( 'Endereço.', 'app' ),
5050
],
5151
);
5252
}

src/Providers/Example/PostType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ class PostType extends AbstractPostType {
1515
*/
1616
public function get_args(): array {
1717
return [
18-
'labels' => $this->get_labels(
18+
'labels' => $this->get_labels(
1919
__( 'Exemplo', 'app' ),
2020
__( 'Exemplos', 'app' ),
2121
),
22-
'public' => true,
22+
'public' => true,
2323
'show_in_rest' => true,
24-
'menu_icon' => 'dashicons-smiley',
25-
'supports' => [ 'title', 'custom-fields' ],
24+
'menu_icon' => 'dashicons-smiley',
25+
'supports' => [ 'title', 'custom-fields' ],
2626
];
2727
}
2828

src/Providers/ExampleCategory/Taxonomy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class Taxonomy extends AbstractTaxonomy {
1616
*/
1717
public function get_args(): array {
1818
return [
19-
'labels' => $this->get_labels(
19+
'labels' => $this->get_labels(
2020
__( 'Categoria', 'app' ),
2121
__( 'Categorias', 'app' ),
2222
),
23-
'public' => true,
23+
'public' => true,
2424
'show_in_rest' => true,
2525
'hierarchical' => true,
2626
];

src/Repositories/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public function find_one_by_term_id( int $term_id ): ?Entity {
2121
public function find_all(): Categories {
2222
$terms = $this->get_terms(
2323
[
24-
'taxonomy' => Entity::TAXONOMY,
24+
'taxonomy' => Entity::TAXONOMY,
2525
'hide_empty' => false,
2626
],
2727
);
2828

2929
return new Categories(
30-
...array_map( static fn( $term ) => ( new Entity() )->set_term( $term ), $terms ),
30+
...array_map( static fn ( $term ) => ( new Entity() )->set_term( $term ), $terms ),
3131
);
3232
}
3333

src/Repositories/Example.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public function find_by_author_id( int $author_id, int $quantity ): Examples {
2525
$posts = $this->get_posts(
2626
[
2727
'numberposts' => $quantity,
28-
'author' => $author_id,
28+
'author' => $author_id,
2929
],
3030
);
3131

3232
return new Examples(
33-
...array_map( static fn( $post ) => ( new Entity() )->set_post( $post ), $posts ),
33+
...array_map( static fn ( $post ) => ( new Entity() )->set_post( $post ), $posts ),
3434
);
3535
}
3636

src/Repositories/Tag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public function find_one_by_term( \WP_Term $term ): ?Entity {
2121
public function find_all(): Tags {
2222
$terms = $this->get_terms(
2323
[
24-
'taxonomy' => Entity::TAXONOMY,
24+
'taxonomy' => Entity::TAXONOMY,
2525
'hide_empty' => false,
2626
],
2727
);
2828

2929
return new Tags(
30-
...array_map( static fn( $term ) => ( new Entity() )->set_term( $term ), $terms ),
30+
...array_map( static fn ( $term ) => ( new Entity() )->set_term( $term ), $terms ),
3131
);
3232
}
3333

src/Services/Meta/ServiceProvider.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ class ServiceProvider extends \League\Container\ServiceProvider\AbstractServiceP
2424

2525
/**
2626
* {@inheritDoc}
27-
*
28-
* @link https://github.com/thephpleague/container/issues/159
2927
*/
3028
public function register(): void {
31-
$this->getContainer()
32-
->/* @scrutinizer ignore-call */ share( PostInterface::class, Post::class );
29+
$this->getLeagueContainer()
30+
->share( PostInterface::class, Post::class );
3331

34-
$this->getContainer()
35-
->/* @scrutinizer ignore-call */ share( TermInterface::class, Term::class );
32+
$this->getLeagueContainer()
33+
->share( TermInterface::class, Term::class );
3634
}
3735

3836
}

tests/Entities/CategoriesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class CategoriesTest extends \PHPUnit\Framework\TestCase {
1919
private Categories $categories;
2020

2121
public function setUp(): void {
22-
$this->entity = new Entity();
22+
$this->entity = new Entity();
2323
$this->categories = new Categories(
2424
$this->entity,
2525
);

tests/Entities/PostsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class PostsTest extends \PHPUnit\Framework\TestCase {
1919
private Posts $categories;
2020

2121
public function setUp(): void {
22-
$this->entity = new Entity();
22+
$this->entity = new Entity();
2323
$this->categories = new Posts(
2424
$this->entity,
2525
);

tests/Entities/TagsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class TagsTest extends \PHPUnit\Framework\TestCase {
1919
private Tags $categories;
2020

2121
public function setUp(): void {
22-
$this->entity = new Entity();
22+
$this->entity = new Entity();
2323
$this->categories = new Tags(
2424
$this->entity,
2525
);

tests/Repositories/CategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class CategoryTest extends \PHPUnit\Framework\TestCase {
2020
private Repository $repository;
2121

2222
public function setUp(): void {
23-
$this->term = $this->getMockBuilder( 'WP_Term' )->getMock();
23+
$this->term = $this->getMockBuilder( 'WP_Term' )->getMock();
2424
$this->repository = $this->getMockBuilder( Repository::class )
2525
->disableOriginalConstructor()
2626
->setMethods( ['get_term', 'get_terms'] )

tests/Repositories/PageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class PageTest extends \PHPUnit\Framework\TestCase {
2222
private Repository $repository;
2323

2424
public function setUp(): void {
25-
$this->post = $this->getMockBuilder( 'WP_Post' )->getMock();
25+
$this->post = $this->getMockBuilder( 'WP_Post' )->getMock();
2626
$this->repository = $this->getMockBuilder( Repository::class )
2727
->disableOriginalConstructor()
2828
->setMethods( ['get_post'] )

tests/Repositories/PostTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class PostTest extends \PHPUnit\Framework\TestCase {
2222
private Repository $repository;
2323

2424
public function setUp(): void {
25-
$this->post = $this->getMockBuilder( 'WP_Post' )->getMock();
25+
$this->post = $this->getMockBuilder( 'WP_Post' )->getMock();
2626
$this->repository = $this->getMockBuilder( Repository::class )
2727
->disableOriginalConstructor()
2828
->setMethods( ['get_post', 'get_posts'] )

tests/Repositories/TagTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class TagTest extends \PHPUnit\Framework\TestCase {
2020
private Repository $repository;
2121

2222
public function setUp(): void {
23-
$this->term = $this->getMockBuilder( 'WP_Term' )->getMock();
23+
$this->term = $this->getMockBuilder( 'WP_Term' )->getMock();
2424
$this->repository = $this->getMockBuilder( Repository::class )
2525
->disableOriginalConstructor()
2626
->setMethods( ['get_term', 'get_terms'] )

wpsteak.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
/**
2626
* Retrieve the main plugin instance.
27-
*
28-
* @return \Cedaro\WP\Plugin
2927
*/
3028
function wpsteak(): Plugin {
3129
static $instance;
@@ -44,7 +42,8 @@ function wpsteak(): Plugin {
4442
( new League\Container\ReflectionContainer() )->cacheResolutions(),
4543
);
4644

47-
$plugin = wpsteak(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride
45+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride
46+
$plugin = wpsteak();
4847

4948
$plugin->set_container( $container );
5049
$plugin->register_hooks( $container->get( Cedaro\WP\Plugin\Provider\I18n::class ) );

0 commit comments

Comments
 (0)