Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';

use Igancev\WorkReporter\Application;
use Igancev\WorkReporter\Cli\Application;
use Igancev\WorkReporter\Cli\InitCommand;
use Igancev\WorkReporter\Cli\WorkReportCommand;
use Igancev\WorkReporter\Config\YamlConfigProvider;
use Igancev\WorkReporter\Destination\ConcreteDestinationFactory;
use Igancev\WorkReporter\InitCommand;
use Igancev\WorkReporter\Source\ConcreteSourceFactory;
use Igancev\WorkReporter\Version;
use Igancev\WorkReporter\WorkReportCommand;

$configProvider = new YamlConfigProvider();
$workReportCommand = new WorkReportCommand(
Expand Down
2 changes: 1 addition & 1 deletion src/Application.php → src/Cli/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Igancev\WorkReporter;
namespace Igancev\WorkReporter\Cli;

use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -15,7 +15,7 @@
if (true === $input->hasParameterOption(['--version', '-V'], true)) {
Banner::render($output, $this->getVersion());

return 0;

Check warning on line 18 in src/Cli/Application.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "ReturnRemoval": @@ @@ { if (true === $input->hasParameterOption(['--version', '-V'], true)) { Banner::render($output, $this->getVersion()); - return 0; + } return parent::doRun($input, $output); } }
}

return parent::doRun($input, $output);
Expand Down
2 changes: 1 addition & 1 deletion src/Banner.php → src/Cli/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Igancev\WorkReporter;
namespace Igancev\WorkReporter\Cli;

use Symfony\Component\Console\Output\OutputInterface;

Expand Down Expand Up @@ -42,14 +42,14 @@
self::WORK_START_RGB,
self::WORK_END_RGB,
);
$line .= "\033[0m" . self::SEPARATOR_LINES[$row];

Check warning on line 45 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "Concat": @@ @@ $output->writeln(''); for ($row = 0; $row < count(self::WORK_LINES); $row++) { $line = self::colorize(self::WORK_LINES[$row], self::WORK_START_RGB, self::WORK_END_RGB); - $line .= "\x1b[0m" . self::SEPARATOR_LINES[$row]; + $line .= self::SEPARATOR_LINES[$row] . "\x1b[0m"; $line .= self::colorize(self::REPORTER_LINES[$row], self::REPORTER_START_RGB, self::REPORTER_END_RGB); $output->writeln($line . "\x1b[0m"); }

Check warning on line 45 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ $output->writeln(''); for ($row = 0; $row < count(self::WORK_LINES); $row++) { $line = self::colorize(self::WORK_LINES[$row], self::WORK_START_RGB, self::WORK_END_RGB); - $line .= "\x1b[0m" . self::SEPARATOR_LINES[$row]; + $line .= self::SEPARATOR_LINES[$row]; $line .= self::colorize(self::REPORTER_LINES[$row], self::REPORTER_START_RGB, self::REPORTER_END_RGB); $output->writeln($line . "\x1b[0m"); }
$line .= self::colorize(
self::REPORTER_LINES[$row],
self::REPORTER_START_RGB,
self::REPORTER_END_RGB,
);

$output->writeln($line . "\033[0m");

Check warning on line 52 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ $line = self::colorize(self::WORK_LINES[$row], self::WORK_START_RGB, self::WORK_END_RGB); $line .= "\x1b[0m" . self::SEPARATOR_LINES[$row]; $line .= self::colorize(self::REPORTER_LINES[$row], self::REPORTER_START_RGB, self::REPORTER_END_RGB); - $output->writeln($line . "\x1b[0m"); + $output->writeln($line); } self::renderTagline($output, $version); }

Check warning on line 52 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "Concat": @@ @@ $line = self::colorize(self::WORK_LINES[$row], self::WORK_START_RGB, self::WORK_END_RGB); $line .= "\x1b[0m" . self::SEPARATOR_LINES[$row]; $line .= self::colorize(self::REPORTER_LINES[$row], self::REPORTER_START_RGB, self::REPORTER_END_RGB); - $output->writeln($line . "\x1b[0m"); + $output->writeln("\x1b[0m" . $line); } self::renderTagline($output, $version); }
}

self::renderTagline($output, $version);
Expand All @@ -72,7 +72,7 @@

private static function renderTagline(OutputInterface $output, string $version): void
{
$bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]);

Check warning on line 75 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ } private static function renderTagline(OutputInterface $output, string $version): void { - $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); + $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::REPORTER_LINES[0]); $repoUrl = 'https://' . self::REPO_URL; $ghLink = self::terminalLink('GitHub', $repoUrl); $starLink = self::terminalLink('⭐ Please star us if you find it useful!', $repoUrl);

Check warning on line 75 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ } private static function renderTagline(OutputInterface $output, string $version): void { - $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); + $bannerWidth = mb_strlen(self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); $repoUrl = 'https://' . self::REPO_URL; $ghLink = self::terminalLink('GitHub', $repoUrl); $starLink = self::terminalLink('⭐ Please star us if you find it useful!', $repoUrl);

Check warning on line 75 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "Concat": @@ @@ } private static function renderTagline(OutputInterface $output, string $version): void { - $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); + $bannerWidth = mb_strlen(self::SEPARATOR_LINES[0] . self::WORK_LINES[0] . self::REPORTER_LINES[0]); $repoUrl = 'https://' . self::REPO_URL; $ghLink = self::terminalLink('GitHub', $repoUrl); $starLink = self::terminalLink('⭐ Please star us if you find it useful!', $repoUrl);

Check warning on line 75 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "IncrementInteger": @@ @@ } private static function renderTagline(OutputInterface $output, string $version): void { - $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); + $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[1] . self::REPORTER_LINES[0]); $repoUrl = 'https://' . self::REPO_URL; $ghLink = self::terminalLink('GitHub', $repoUrl); $starLink = self::terminalLink('⭐ Please star us if you find it useful!', $repoUrl);

Check warning on line 75 in src/Cli/Banner.php

View workflow job for this annotation

GitHub Actions / Mutation testing

Escaped Mutant for Mutator "IncrementInteger": @@ @@ } private static function renderTagline(OutputInterface $output, string $version): void { - $bannerWidth = mb_strlen(self::WORK_LINES[0] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); + $bannerWidth = mb_strlen(self::WORK_LINES[1] . self::SEPARATOR_LINES[0] . self::REPORTER_LINES[0]); $repoUrl = 'https://' . self::REPO_URL; $ghLink = self::terminalLink('GitHub', $repoUrl); $starLink = self::terminalLink('⭐ Please star us if you find it useful!', $repoUrl);
$repoUrl = 'https://' . self::REPO_URL;
$ghLink = self::terminalLink('GitHub', $repoUrl);
$starLink = self::terminalLink('⭐ Please star us if you find it useful!', $repoUrl);
Expand Down
2 changes: 1 addition & 1 deletion src/InitCommand.php → src/Cli/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Igancev\WorkReporter;
namespace Igancev\WorkReporter\Cli;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
6 changes: 5 additions & 1 deletion src/WorkReportCommand.php → src/Cli/WorkReportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Igancev\WorkReporter;
namespace Igancev\WorkReporter\Cli;

use DateTimeImmutable;
use Igancev\WorkReporter\Config\ConfigException;
Expand All @@ -12,8 +12,12 @@
use Igancev\WorkReporter\Destination\Destination;
use Igancev\WorkReporter\Destination\DestinationException;
use Igancev\WorkReporter\Destination\DestinationFactory;
use Igancev\WorkReporter\Duration;
use Igancev\WorkReporter\InvalidDurationException;
use Igancev\WorkReporter\Source\SourceException;
use Igancev\WorkReporter\Source\TimeEntriesSourceFactory;
use Igancev\WorkReporter\TimeEntry;
use Igancev\WorkReporter\TimeEntryCollection;
use InvalidArgumentException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tests\Unit;

use Igancev\WorkReporter\Application;
use Igancev\WorkReporter\Cli\Application;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArgvInput;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tests\Unit;

use Igancev\WorkReporter\Banner;
use Igancev\WorkReporter\Cli\Banner;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Output\BufferedOutput;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/InitCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tests\Unit;

use Igancev\WorkReporter\InitCommand;
use Igancev\WorkReporter\Cli\InitCommand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/WorkReportCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use ArrayIterator;
use DateTimeImmutable;
use Exception;
use Igancev\WorkReporter\Cli\WorkReportCommand;
use Igancev\WorkReporter\Config\Config;
use Igancev\WorkReporter\Config\ConfigException;
use Igancev\WorkReporter\Config\ConfigProvider;
Expand All @@ -24,7 +25,6 @@
use Igancev\WorkReporter\Source\TimeEntriesSource;
use Igancev\WorkReporter\Source\TimeEntriesSourceFactory;
use Igancev\WorkReporter\TimeEntry;
use Igancev\WorkReporter\WorkReportCommand;
use Laravel\Prompts\ConfirmPrompt;
use Laravel\Prompts\Prompt;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
Expand Down
19 changes: 19 additions & 0 deletions ~/.config/work-reporter/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Work Reporter configuration file
# Documentation: https://github.com/igancev/work-reporter

# Source type: superProductivity | plainJson
source: plainJson

# Destination type: youTrack
destination: youTrack

sources:
plainJson:
filePath: /path/to/time-entries.json
# superProductivity:
# syncFilePath: /path/to/sync-file.json

destinations:
youTrack:
url: https://youtrack.example.com
token: your-api-token
Loading