-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated to run with Laravel 5.8 #194
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,10 @@ | |
"description": "Eloquent syntax for DynamoDB", | ||
"keywords": ["laravel", "dynamodb", "aws"], | ||
"require": { | ||
"php": "^7.1.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would happen if people are using Laravel 5.2 with older PHP version and they want to upgrade this library for bug fixes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The semantic versioning in the composer.json should stop them from using the newer version. Hence the suggestion of a new major version to stop any accidental breaking changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like them to be able to use the newer version of this library though because there are some bug fixes. We can improve on versioning later. Why do you think people using older PHP version should not upgrade this library? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyone that is using a currently supported version of PHP will be able to use this version. Laravel 5.8 requires PHP 7.1 and above - you can’t support both Laravel 5.8 and PHP versions less than 7.1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm talking about people who are using Laravel 5.2 for example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like you need to start a new v5 release with this PR, while maintaining v4 with bugfixes only for older versions of Laravel. Old Laravel users can easily restrict this package to I understand the concerns about those older Laravel users. That said, there are a lot of us that really need to upgrade to Laravel 5.8 and this is a blocker. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @footballencarta You could remove the PHP version requirement here since Laravel will have already enforced that. However, I see you've also added a bunch of PHP 7.1 specific code, like function return types. IMHO these are unnecessary and preventing this from getting merged quickly. I would suggest backing off the PHP requirement (anyone installing this in Laravel 5.8 will have already dealt with Laravel's PHP 7.1 requirement) and removing your function return types. A simple composer.json change to allow illuminate/support and illuminate/database at 5.8 will enable this package to be installed in Laravel 5.8 without breaking older versions as well. Seems like a simple and quick fix. Later if @baopham decides to have a separate major release for new versions of PHP & Laravel, PHP 7.1 specific function return types could be added. ...unless I'm missing something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return types are enforced by the version of PHPUnit that ships with Laravel 5.8 - in that it expects a return type to be added, otherwise it fails the entire test set for invalid code (PHPUnit 8+). I understand the issue with supporting older versions - which is why all along I’ve suggest merging this into a new major version, as it contains breaking changes. This will allow the package to be developed to keep pace with Laravel’s standards, while also backporting big fixes to “legacy” versions of Laravel / PHP if needed. Honestly, we’re in 2019 now, and PHP 7.1 has been around since the end of 2016. I get some people can’t upgrade for whatever reasons (hell we have some guys where I work that refuse to switch from 5.6) - but making this as a new major version supporting the next generation of Laravel applications is better than trying to maintain backwards compatibility with everything and eventually being left vastly far behind. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/laravel/laravel/blob/master/composer.json#L22 https://github.com/laravel/framework/blob/master/composer.json#L88 I'm seeing PHPUnit 7.5 in laravel/laravel master, and either 7.5 or 8 in laravel/framework. Are you sure PHPUnit 8 is a hard requirement? Not seeing it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you follow @jszobody's suggestion, then we can go ahead with this PR. I don't think forcing the PHP version should be in this PR. Why do you need this line to unblock you? |
||
"aws/aws-sdk-php": "^3.0.0", | ||
"illuminate/support": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.*", | ||
"illuminate/database": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.*" | ||
"illuminate/support": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.*", | ||
"illuminate/database": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.*" | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
|
@@ -19,7 +20,6 @@ | |
"BaoPham\\DynamoDb\\": "src/" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"require-dev": { | ||
"orchestra/testbench": "~3.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
*/ | ||
class DynamoDbClientServiceTest extends TestCase | ||
{ | ||
public function setUp() | ||
public function setUp(): void | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the type returns necessary? Would it be possible to remove these and drop the explicit php 7.1.3 requirement in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are required by PHPUnit 8 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For development, I'm ok with the requirement of php7.1 and above. |
||
{ | ||
parent::setUp(); | ||
|
||
|
@@ -75,7 +75,7 @@ public function testUnsetDynamoDbClientService() | |
/** | ||
* Make sure we are not leaving any values set on the DynamoDbModel | ||
*/ | ||
public function tearDown() | ||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did travis drop support for 5.6 and 7.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Laravel 5.8 did. PHP 5.6 and PHP 7.0 is EOL and doesn’t receive any updates anymore.
The new void return declarations with Laravel 5.8 will only work with PHP 7.1 and above.