Skip to content

Commit

Permalink
Fix coding standard issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jun 1, 2023
1 parent 1881f31 commit 724f8b4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/WpBuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
$build_dir,
];

if ( $slug !== null ) {
if ( null !== $slug ) {
$command[] = '--slug=' . $slug;
}

Expand All @@ -211,7 +211,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
$build_dir,
];

if ( $slug !== null ) {
if ( null !== $slug ) {
$command[] = '--plugin-dirname=' . $slug;
}

Expand Down
25 changes: 25 additions & 0 deletions src/WpProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,27 @@
* @since 1.0.0
*/
class WpProject {
/**
* Directory.
*
* @var string
*/
private $directory;

/**
* Construct WordPress project.
*
* @param string $directory Directory.
*/
public function __construct( $directory ) {
$this->directory = $directory;
}

/**
* Get slug.
*
* @return null|string
*/
public function get_slug() {
$slug = null;

Expand All @@ -42,6 +57,11 @@ public function get_slug() {
return $slug;
}

/**
* Get version.
*
* @return null|string
*/
public function get_version() {
$version = null;

Expand All @@ -60,6 +80,11 @@ public function get_version() {
return $version;
}

/**
* Get changelog.
*
* @return Changelog
*/
public function get_changelog() {
$changelog_file = $this->directory . '/CHANGELOG.md';

Expand Down
2 changes: 1 addition & 1 deletion tests/src/ChangelogEntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function test_render() {
[1.0.0]: /releases/tag/v1.0.0
END;

$expected = \str_replace( '2023-03-30', \date( 'Y-m-d' ), $expected );
$expected = \str_replace( '2023-03-30', \gmdate( 'Y-m-d' ), $expected );

$this->assertEquals( $expected, $render );
}
Expand Down

0 comments on commit 724f8b4

Please sign in to comment.