Skip to content

Commit 94927f0

Browse files
authored
Merge pull request #204 from mmoreram/5
fixes #197
2 parents 7472c73 + 5c777ff commit 94927f0

File tree

80 files changed

+1285
-2509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1285
-2509
lines changed

.github/workflows/test.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
8+
runs-on: ubuntu-18.04
9+
strategy:
10+
matrix:
11+
php-version: ['7.4','8.0','8.1']
12+
symfony-version: ['4.4','5.4']
13+
coverage: ['none']
14+
include:
15+
- php-version: '7.4'
16+
symfony-version: '4.4'
17+
coverage: xdebug
18+
- php: "8.0"
19+
php-version: "8.0"
20+
symfony-version: "6.0"
21+
- php: "8.1"
22+
php-version: "8.1"
23+
symfony-version: "6.0"
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
coverage: ${{ matrix.coverage }}
32+
ini-values: "memory_limit=-1"
33+
php-version: ${{ matrix.php-version }}
34+
extensions: gearman
35+
tools: composer,flex
36+
37+
- name: Validate composer.json
38+
run: composer validate --no-check-lock
39+
40+
- name: Install Composer dependencies
41+
uses: ramsey/composer-install@v1
42+
with:
43+
composer-options: "--prefer-dist"
44+
env:
45+
SYMFONY_REQUIRE: "${{ matrix.symfony-version }}.*"
46+
47+
- name: Setup problem matchers for PHP
48+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
49+
50+
- name: Setup problem matchers for PHPUnit
51+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
52+
53+
- name: Run PHPUnit
54+
if: matrix.coverage == 'none'
55+
run: vendor/bin/phpunit
56+
57+
- name: Run PHPUnit with coverage
58+
if: matrix.coverage != 'none'
59+
run: vendor/bin/phpunit --coverage-clover=coverage.clover
60+
61+
- name: Run PHPStan
62+
run: vendor/bin/phpstan analyse
63+
64+
- name: Upload Scrutinizer coverage
65+
if: matrix.coverage != 'none'
66+
continue-on-error: true
67+
uses: sudo-bot/action-scrutinizer@latest
68+
with:
69+
cli-args: "--format=php-clover coverage.clover"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ composer.phar
55
phpcs.log
66
vendor
77
phpunit.xml
8+
var

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

Command/Abstracts/AbstractGearmanCommand.php

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,16 @@
11
<?php
22

3-
/**
4-
* Gearman Bundle for Symfony2
5-
*
6-
* For the full copyright and license information, please view the LICENSE
7-
* file that was distributed with this source code.
8-
*
9-
* Feel free to edit as you please, and have fun.
10-
*
11-
* @author Marc Morera <[email protected]>
12-
*/
13-
143
namespace Mmoreram\GearmanBundle\Command\Abstracts;
154

165
use Symfony\Component\Console\Command\Command;
176
use Symfony\Component\HttpKernel\KernelInterface;
187

19-
/**
20-
* Class AbstractGearmanCommand
21-
*
22-
* @since 2.3.1
23-
*/
8+
249
abstract class AbstractGearmanCommand extends Command
2510
{
26-
/**
27-
* @var KernelInterface
28-
*
29-
* Kernel
30-
*/
31-
protected $kernel;
11+
protected KernelInterface $kernel;
3212

33-
/**
34-
* Set kernel
35-
*
36-
* @param KernelInterface $kernel Kernel
37-
*
38-
* @return AbstractGearmanCommand self Object
39-
*/
40-
public function setKernel(KernelInterface $kernel)
13+
public function setKernel(KernelInterface $kernel): self
4114
{
4215
$this->kernel = $kernel;
4316

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
<?php
22

3-
/**
4-
* Gearman Bundle for Symfony2
5-
*
6-
* For the full copyright and license information, please view the LICENSE
7-
* file that was distributed with this source code.
8-
*
9-
* Feel free to edit as you please, and have fun.
10-
*
11-
* @author Marc Morera <[email protected]>
12-
*/
13-
143
namespace Mmoreram\GearmanBundle\Command;
154

165
use Symfony\Component\Console\Input\InputInterface;
@@ -19,57 +8,27 @@
198
use Mmoreram\GearmanBundle\Command\Abstracts\AbstractGearmanCommand;
209
use Mmoreram\GearmanBundle\Service\GearmanCacheWrapper;
2110

22-
/**
23-
* Clears all cache data
24-
*
25-
* @since 2.3.1
26-
*/
2711
class GearmanCacheClearCommand extends AbstractGearmanCommand
2812
{
29-
/**
30-
* @var GearmanCacheWrapper
31-
*
32-
* GearmanCacheWrapper
33-
*/
34-
protected $gearmanCacheWrapper;
13+
protected GearmanCacheWrapper $gearmanCacheWrapper;
3514

36-
/**
37-
* Set the GearmanCacheWrapper instance
38-
*
39-
* @param GearmanCacheWrapper $gearmanCacheWrapper GearmanCacheWrapper
40-
*
41-
* @return GearmanCacheWarmupCommand self Object
42-
*/
43-
public function setGearmanCacheWrapper(GearmanCacheWrapper $gearmanCacheWrapper)
15+
public function setGearmanCacheWrapper(GearmanCacheWrapper $gearmanCacheWrapper): self
4416
{
4517
$this->gearmanCacheWrapper = $gearmanCacheWrapper;
4618

4719
return $this;
4820
}
4921

50-
/**
51-
* Console Command configuration
52-
*/
5322
protected function configure()
5423
{
5524
$this
5625
->setName('gearman:cache:clear')
57-
->setAliases(array(
58-
'cache:gearman:clear'
59-
))
26+
->setAliases([
27+
'cache:gearman:clear',
28+
])
6029
->setDescription('Clears gearman cache data on current environment');
6130
}
6231

63-
/**
64-
* Executes the current command.
65-
*
66-
* @param InputInterface $input An InputInterface instance
67-
* @param OutputInterface $output An OutputInterface instance
68-
*
69-
* @return integer 0 if everything went fine, or an error code
70-
*
71-
* @throws \LogicException When this abstract class is not implemented
72-
*/
7332
protected function execute(InputInterface $input, OutputInterface $output)
7433
{
7534
if (
@@ -87,4 +46,4 @@ protected function execute(InputInterface $input, OutputInterface $output)
8746

8847
return 0;
8948
}
90-
}
49+
}
Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
<?php
22

3-
/**
4-
* Gearman Bundle for Symfony2
5-
*
6-
* For the full copyright and license information, please view the LICENSE
7-
* file that was distributed with this source code.
8-
*
9-
* Feel free to edit as you please, and have fun.
10-
*
11-
* @author Marc Morera <[email protected]>
12-
*/
13-
143
namespace Mmoreram\GearmanBundle\Command;
154

165
use Symfony\Component\Console\Input\InputInterface;
@@ -19,60 +8,27 @@
198
use Mmoreram\GearmanBundle\Command\Abstracts\AbstractGearmanCommand;
209
use Mmoreram\GearmanBundle\Service\GearmanCacheWrapper;
2110

22-
/**
23-
* Warms up all cache data
24-
*
25-
* @since 2.3.1
26-
*/
2711
class GearmanCacheWarmupCommand extends AbstractGearmanCommand
2812
{
29-
/**
30-
* @var GearmanCacheWrapper
31-
*
32-
* GearmanCacheWrapper
33-
*/
34-
protected $gearmanCacheWrapper;
13+
protected GearmanCacheWrapper $gearmanCacheWrapper;
3514

36-
/**
37-
* Set the GearmanCacheWrapper instance
38-
*
39-
* @param GearmanCacheWrapper $gearmanCacheWrapper GearmanCacheWrapper
40-
*
41-
* @return GearmanCacheWarmupCommand self Object
42-
*/
43-
public function setGearmanCacheWrapper(GearmanCacheWrapper $gearmanCacheWrapper)
15+
public function setGearmanCacheWrapper(GearmanCacheWrapper $gearmanCacheWrapper): self
4416
{
4517
$this->gearmanCacheWrapper = $gearmanCacheWrapper;
4618

4719
return $this;
4820
}
4921

50-
/**
51-
* Set the kernel environment
52-
53-
/**
54-
* Console Command configuration
55-
*/
5622
protected function configure()
5723
{
5824
$this
5925
->setName('gearman:cache:warmup')
60-
->setAliases(array(
61-
'cache:gearman:warmup'
62-
))
26+
->setAliases([
27+
'cache:gearman:warmup',
28+
])
6329
->setDescription('Warms up gearman cache data');
6430
}
6531

66-
/**
67-
* Executes the current command.
68-
*
69-
* @param InputInterface $input An InputInterface instance
70-
* @param OutputInterface $output An OutputInterface instance
71-
*
72-
* @return integer 0 if everything went fine, or an error code
73-
*
74-
* @throws \LogicException When this abstract class is not implemented
75-
*/
7632
protected function execute(InputInterface $input, OutputInterface $output)
7733
{
7834
if (
@@ -91,4 +47,4 @@ protected function execute(InputInterface $input, OutputInterface $output)
9147

9248
return 0;
9349
}
94-
}
50+
}

0 commit comments

Comments
 (0)