Skip to content

Commit

Permalink
Upgrade PHP Code Sniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
cookieguru committed Apr 13, 2024
1 parent fdfc304 commit d24a3d4
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"league/commonmark": "^2.3",
"nette/php-generator": "^4.0.0",
"psr/log": "^3.0.0",
"squizlabs/php_codesniffer": "3.*",
"squizlabs/php_codesniffer": "^3.9.1",
"symfony/console": "^6.1",
"twig/markdown-extra": "^3.4",
"twig/twig": "^3.0.0"
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Builder/MeetupCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function count(): int
return count($this->array);
}

public function append(MeetupEntry $meetup)
public function append(MeetupEntry $meetup): void
{
$this->array[] = $meetup;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/Processor/HTMLProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

abstract class HTMLProcessor extends AbstractProcessor
{
protected function writeHtml(string $html, string $filename, DateTimeImmutable $modifiedTime = null)
protected function writeHtml(string $html, string $filename, DateTimeImmutable $modifiedTime = null): void
{
$destination = "$this->outputDirectory/$filename";
$path = substr($destination, 0, strlen(basename($destination)) * -1);
Expand Down
1 change: 0 additions & 1 deletion src/Builder/Processor/HomepageProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use DateTimeImmutable;
use MergePHP\Website\Builder\MeetupCollection;
use MergePHP\Website\Meetups;
use Psr\Log\LoggerInterface;
use Twig\Environment;

Expand Down
1 change: 0 additions & 1 deletion src/Builder/Processor/MissingLinkProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function __construct(
public function run(): void
{
$this->logger->info('Checking for missing YouTube links');
$buckets = [];

foreach ($this->meetups->withOnlyPast() as $meetup) {
if ($meetup->instance->getYouTubeLink() === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/SiteBuilderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class SiteBuilderService
{
protected const APP_ROOT = __DIR__ . '/../..';
protected const string APP_ROOT = __DIR__ . '/../..';
private Environment $twig;

public function __construct(protected string $outputDirectory, protected LoggerInterface $logger)
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/MeetupGeneratorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(public string $directory)
}
}

protected const SUGGESTED_DATE_FORMAT = 'Y-m-d';
protected const string SUGGESTED_DATE_FORMAT = 'Y-m-d';

public function getSuggestedDate(string $baseDate = 'now'): string
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Builder/Processor/RssFeedProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

class RssFeedProcessorTest extends TestCase
{
private const MEETUP_DATE_STRING = '2000-01-01T00:00:00+00:00';
private const MODIFIED_DATE_STRING = '2000-01-02T00:00:00+00:00';
private const EXPECTED_FILENAME = 'vfs://root/atom.xml';
private const FIXTURES_DIR = __DIR__ . '/../../fixtures/';
private const string MEETUP_DATE_STRING = '2000-01-01T00:00:00+00:00';
private const string MODIFIED_DATE_STRING = '2000-01-02T00:00:00+00:00';
private const string EXPECTED_FILENAME = 'vfs://root/atom.xml';
private const string FIXTURES_DIR = __DIR__ . '/../../fixtures/';

public function setUp(): void
{
Expand Down
24 changes: 19 additions & 5 deletions tests/Generator/MeetupGeneratorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,26 @@
class MeetupGeneratorCommandTest extends TestCase
{
// generate args simulate what the user types in to the command line
private const GENERATE_1_ARGS = ['Title', 'Description', null , 'Name', 'Bio', null];
private const GENERATE_2_ARGS = ['Title', 'Description', '2023-01-01', 'Name', 'Bio', null];
private const GENERATE_3_ARGS = ['Title', 'Description', '2023-01-01', 'Name', 'Bio', 'https://example.com/f.jpg'];
private const array GENERATE_1_ARGS = ['Title', 'Description', null , 'Name', 'Bio', null];
private const array GENERATE_2_ARGS = ['Title', 'Description', '2023-01-01', 'Name', 'Bio', null];
private const array GENERATE_3_ARGS = [
'Title',
'Description',
'2023-01-01',
'Name',
'Bio',
'https://example.com/f.jpg'
];
// command args are what the generator command expects to be called with given a certain set of generate args
private const COMMAND_1_2_ARGS = ['Title', 'Description', '2023-01-01', 'Name', 'Bio', null];
private const COMMAND_3_ARGS = ['Title', 'Description', '2023-01-01', 'Name', 'Bio', 'https://example.com/f.jpg'];
private const array COMMAND_1_2_ARGS = ['Title', 'Description', '2023-01-01', 'Name', 'Bio', null];
private const array COMMAND_3_ARGS = [
'Title',
'Description',
'2023-01-01',
'Name',
'Bio',
'https://example.com/f.jpg'
];

private CommandTester $commandTester;

Expand Down
2 changes: 1 addition & 1 deletion tests/Generator/MeetupGeneratorServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class MeetupGeneratorServiceTest extends TestCase
{
private MeetupGeneratorService $generator;
private const FIXTURES_DIR = __DIR__ . '/../fixtures/';
private const string FIXTURES_DIR = __DIR__ . '/../fixtures/';

public function setUp(): void
{
Expand Down

0 comments on commit d24a3d4

Please sign in to comment.