Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9635df0

Browse files
ruddellclaude
andcommitted
Replace Travis CI with GitHub Actions
- Add .github/workflows/tests.yml running PHP 8.2, 8.3, 8.4 - Remove .travis.yml - Drop codecov and psalm --shepherd - Widen illuminate/* and lumen-framework constraints to support Laravel 13 - Bump php requirement to ^7.4 to match graham-campbell/manager ^5.0 - Fix test compatibility with updated graham-campbell packages and PHPUnit 10 - Fix Psalm errors for updated package versions Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 1572bd9 commit 9635df0

11 files changed

Lines changed: 65 additions & 40 deletions

File tree

.github/workflows/tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
php: ['8.2', '8.3', '8.4']
15+
16+
name: PHP ${{ matrix.php }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
26+
- name: Install dependencies
27+
run: composer install --no-interaction
28+
29+
- name: Run tests
30+
run: vendor/bin/phpunit
31+
32+
- name: Run Psalm
33+
run: vendor/bin/psalm

.travis.yml

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

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^7.2|^8.0",
22+
"php": "^7.4|^8.0",
2323
"illuminate/contracts": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
2424
"illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
2525
"graham-campbell/manager": "^5.0",
@@ -32,7 +32,7 @@
3232
"mockery/mockery": "^1.0",
3333
"phpunit/phpunit": "^7.0|^9.5.10|^10.5|^11.0",
3434
"psalm/plugin-laravel": "^1.4.0|^1.1|^2.7|^3.0",
35-
"laravel/lumen-framework": "^5.7",
35+
"laravel/lumen-framework": "^5.7|^9.0|^10.0|^11.0",
3636
"vimeo/psalm": "^3.17|^4.19|^5.6|^6.8"
3737
},
3838
"autoload": {

src/Facades/Vimeo.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* This is the Vimeo facade class.
2626
*
2727
* @author Vincent Klaiber <[email protected]>
28+
*
29+
* @psalm-api
2830
*/
2931
class Vimeo extends Facade
3032
{
@@ -33,6 +35,7 @@ class Vimeo extends Facade
3335
*
3436
* @return string
3537
*/
38+
#[\Override]
3639
protected static function getFacadeAccessor(): string
3740
{
3841
return 'vimeo';

src/VimeoFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
* The is the Vimeo factory class.
2828
*
2929
* @author Vincent Klaiber <[email protected]>
30+
*
31+
* @psalm-api
3032
*/
3133
class VimeoFactory
3234
{

src/VimeoManager.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
* This is the Vimeo manager class.
2828
*
2929
* @author Vincent Klaiber <[email protected]>
30+
*
31+
* @psalm-api
3032
*/
3133
class VimeoManager extends AbstractManager
3234
{
@@ -57,8 +59,11 @@ public function __construct(Repository $config, VimeoFactory $factory)
5759
*
5860
* @param array $config
5961
*
62+
* @psalm-suppress MethodSignatureMismatch
63+
*
6064
* @return \Vimeo\Vimeo
6165
*/
66+
#[\Override]
6267
protected function createConnection(array $config): Vimeo
6368
{
6469
/** @var string[] $config */
@@ -70,16 +75,13 @@ protected function createConnection(array $config): Vimeo
7075
*
7176
* @return string
7277
*/
78+
#[\Override]
7379
protected function getConfigName(): string
7480
{
7581
return 'vimeo';
7682
}
7783

78-
/**
79-
* Get the factory instance.
80-
*
81-
* @return \Vimeo\Laravel\VimeoFactory
82-
*/
84+
/** @psalm-api */
8385
public function getFactory(): VimeoFactory
8486
{
8587
return $this->factory;

src/VimeoServiceProvider.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
* This is the Vimeo service provider class.
3030
*
3131
* @author Vincent Klaiber <[email protected]>
32+
*
33+
* @psalm-api
3234
*/
3335
class VimeoServiceProvider extends ServiceProvider
3436
{
@@ -51,7 +53,7 @@ protected function setupConfig()
5153
{
5254
$source = realpath(__DIR__.'/../config/vimeo.php');
5355

54-
if (!$source) {
56+
if ($source === false) {
5557
throw new \UnexpectedValueException('Could not locate config');
5658
}
5759

@@ -69,6 +71,7 @@ protected function setupConfig()
6971
*
7072
* @return void
7173
*/
74+
#[\Override]
7275
public function register()
7376
{
7477
$this->registerFactory();
@@ -99,9 +102,9 @@ protected function registerManager()
99102
{
100103
$this->app->singleton('vimeo', function (Container $app) : VimeoManager {
101104
/** @var \Illuminate\Contracts\Config\Repository */
102-
$config = $app['config'];
105+
$config = $app->make('config');
103106
/** @var \Vimeo\Laravel\VimeoFactory */
104-
$factory = $app['vimeo.factory'];
107+
$factory = $app->make('vimeo.factory');
105108

106109
return new VimeoManager($config, $factory);
107110
});
@@ -118,7 +121,7 @@ protected function registerBindings()
118121
{
119122
$this->app->bind('vimeo.connection', function (Container $app) : Vimeo {
120123
/** @var VimeoManager */
121-
$manager = $app['vimeo'];
124+
$manager = $app->make('vimeo');
122125

123126
/** @var Vimeo */
124127
return $manager->connection();
@@ -132,6 +135,7 @@ protected function registerBindings()
132135
*
133136
* @return string[]
134137
*/
138+
#[\Override]
135139
public function provides(): array
136140
{
137141
return [

tests/AbstractTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class AbstractTestCase extends AbstractPackageTestCase
3636
*
3737
* @return string
3838
*/
39-
protected function getServiceProviderClass($app)
39+
protected static function getServiceProviderClass(): string
4040
{
4141
return VimeoServiceProvider::class;
4242
}

tests/AnalysisTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AnalysisTest extends TestCase
3737
*
3838
* @return string[]
3939
*/
40-
protected function getPaths()
40+
protected static function getPaths(): array
4141
{
4242
return [
4343
realpath(__DIR__.'/../config'),
@@ -51,7 +51,7 @@ protected function getPaths()
5151
*
5252
* @return string[]
5353
*/
54-
protected function getIgnored()
54+
protected static function getIgnored()
5555
{
5656
return [Application::class];
5757
}

tests/Facades/VimeoTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class VimeoTest extends AbstractTestCase
3838
*
3939
* @return string
4040
*/
41-
protected function getFacadeAccessor()
41+
protected static function getFacadeAccessor(): string
4242
{
4343
return 'vimeo';
4444
}
@@ -48,7 +48,7 @@ protected function getFacadeAccessor()
4848
*
4949
* @return string
5050
*/
51-
protected function getFacadeClass()
51+
protected static function getFacadeClass(): string
5252
{
5353
return Vimeo::class;
5454
}
@@ -58,7 +58,7 @@ protected function getFacadeClass()
5858
*
5959
* @return string
6060
*/
61-
protected function getFacadeRoot()
61+
protected static function getFacadeRoot(): string
6262
{
6363
return VimeoManager::class;
6464
}

0 commit comments

Comments
 (0)