Skip to content

Commit

Permalink
Add support for Symfony 5 (#35)
Browse files Browse the repository at this point in the history
* Add support for Symfony 5

* Remove 5.1

* Add return code to commands
  • Loading branch information
angelsk authored May 5, 2020
1 parent db3ccea commit b4b0c7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ matrix:
env: SYMFONY_VERSION="3.4.*"
- php: 7.3
env: SYMFONY_VERSION="4.4.*"
- php: 7.3
env: SYMFONY_VERSION="5.0.*"
- php: 7.4
env: SYMFONY_VERSION="3.4.*"
- php: 7.4
env: SYMFONY_VERSION="4.4.*"
- php: 7.4
env: SYMFONY_VERSION="5.0.*"

before_install:
- composer self-update
Expand Down
2 changes: 2 additions & 0 deletions Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$output->writeln('<info>We would have put the following in cron</info>');
$output->write($content = $cron->format());

return 0;
}
}
2 changes: 2 additions & 0 deletions Command/ReplaceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
} catch (\RuntimeException $e) {
$output->writeln(sprintf('<comment>Cron cannot be updated - %s</comment>', $e->getMessage()));
}

return 0;
}

private function getExportKey()
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/mybuilder/cronos-bundle.svg?branch=master)](https://travis-ci.org/mybuilder/cronos-bundle)

A bundle for Symfony 3/4 that allows you to use `@Cron` annotations to configure when cron should run your console commands.
A bundle for Symfony 3/4/5 that allows you to use `@Cron` annotations to configure when cron should run your console commands.

Uses the [Cronos](https://github.com/mybuilder/cronos) library to do the actual output and updating.

Expand All @@ -29,7 +29,7 @@ public function registerBundles(): array
}
```

Enable the bundle in the `config/bundles.php` for Symfony 4:
Enable the bundle in the `config/bundles.php` for Symfony 4/5:

```php
return [
Expand All @@ -39,7 +39,7 @@ return [

### Configure the bundle

You can add the following to your `config.yml` (Symfony 3) / `packages/my_builder_cronos.yaml` (Symfony 4) to configure the package.
You can add the following to your `config.yml` (Symfony 3) / `packages/my_builder_cronos.yaml` (Symfony 4/5) to configure the package.

```yaml
my_builder_cronos:
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mybuilder/cronos-bundle",
"description": "Symfony 3/4 bundle which allows you to use @Cron annotations to configure cron to run your console commands.",
"description": "Symfony 3/4/5 bundle which allows you to use @Cron annotations to configure cron to run your console commands.",
"keywords": ["cron", "cronos"],
"minimum-stability": "stable",
"license": "MIT",
Expand All @@ -17,10 +17,10 @@
"require": {
"mybuilder/cronos": "~2.0",
"doctrine/annotations": "1.*",
"symfony/console": "~3.0||^4.0",
"symfony/framework-bundle": "~3.0||^4.0",
"symfony/yaml": "3.0||^4.0",
"symfony/property-access": "~3.0||^4.0",
"symfony/console": "~3.0||^4.0||^5.0",
"symfony/framework-bundle": "~3.0||^4.0||^5.0",
"symfony/yaml": "3.0||^4.0||^5.0",
"symfony/property-access": "~3.0||^4.0||^5.0",
"php": ">=7.3"
},
"require-dev": {
Expand Down

0 comments on commit b4b0c7f

Please sign in to comment.