diff --git a/bin/console b/bin/console index fc788d6..22a8464 100755 --- a/bin/console +++ b/bin/console @@ -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( diff --git a/src/Application.php b/src/Cli/Application.php similarity index 93% rename from src/Application.php rename to src/Cli/Application.php index 56ed721..dcfbd66 100644 --- a/src/Application.php +++ b/src/Cli/Application.php @@ -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; diff --git a/src/Banner.php b/src/Cli/Banner.php similarity index 99% rename from src/Banner.php rename to src/Cli/Banner.php index acab12b..1460d14 100644 --- a/src/Banner.php +++ b/src/Cli/Banner.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Igancev\WorkReporter; +namespace Igancev\WorkReporter\Cli; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/InitCommand.php b/src/Cli/InitCommand.php similarity index 98% rename from src/InitCommand.php rename to src/Cli/InitCommand.php index 991780f..68e3ba2 100644 --- a/src/InitCommand.php +++ b/src/Cli/InitCommand.php @@ -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; diff --git a/src/WorkReportCommand.php b/src/Cli/WorkReportCommand.php similarity index 98% rename from src/WorkReportCommand.php rename to src/Cli/WorkReportCommand.php index f3c65bf..d6ae7f8 100644 --- a/src/WorkReportCommand.php +++ b/src/Cli/WorkReportCommand.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Igancev\WorkReporter; +namespace Igancev\WorkReporter\Cli; use DateTimeImmutable; use Igancev\WorkReporter\Config\ConfigException; @@ -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; diff --git a/tests/Unit/ApplicationTest.php b/tests/Unit/ApplicationTest.php index 54f832d..90c4d99 100644 --- a/tests/Unit/ApplicationTest.php +++ b/tests/Unit/ApplicationTest.php @@ -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; diff --git a/tests/Unit/BannerTest.php b/tests/Unit/BannerTest.php index 42c5a37..712a956 100644 --- a/tests/Unit/BannerTest.php +++ b/tests/Unit/BannerTest.php @@ -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; diff --git a/tests/Unit/InitCommandTest.php b/tests/Unit/InitCommandTest.php index 083b865..396544f 100644 --- a/tests/Unit/InitCommandTest.php +++ b/tests/Unit/InitCommandTest.php @@ -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; diff --git a/tests/Unit/WorkReportCommandTest.php b/tests/Unit/WorkReportCommandTest.php index 5c02e31..d24dd62 100644 --- a/tests/Unit/WorkReportCommandTest.php +++ b/tests/Unit/WorkReportCommandTest.php @@ -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; @@ -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; diff --git a/~/.config/work-reporter/config.yaml b/~/.config/work-reporter/config.yaml new file mode 100644 index 0000000..e71a770 --- /dev/null +++ b/~/.config/work-reporter/config.yaml @@ -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 \ No newline at end of file