Skip to content
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

[Laravel-5.0] Add the support for Laravel 5 paginator #153

Merged

Conversation

maximebeaudoin
Copy link
Contributor

Related to the issue #150

@GrahamCampbell
Copy link
Member

This doesn't work on php 5.3. The dependencies don't install.

@maximebeaudoin
Copy link
Contributor Author

@GrahamCampbell I know that, it's because illumintate/contracts need php 5.4 if you check at https://github.com/illuminate/contracts/blob/master/composer.json#L12. Unfortunately, we need the Illuminate\Contracts\Pagination\LengthAwarePaginator if we want this to work with laravel 5.

@GrahamCampbell
Copy link
Member

Composer has a flag you can run it with to get around this you know. :)

@GrahamCampbell
Copy link
Member

Edit the travis file to run composer with --ignore-platform-reqs.

@maximebeaudoin
Copy link
Contributor Author

Good to know, should i replace travis_retry composer install --no-interaction --prefer-source --dev by this travis_retry composer install --no-interaction --prefer-source --ignore-platform-reqs --dev from the file https://github.com/thephpleague/fractal/blob/master/.travis.yml#L12 ?

@GrahamCampbell
Copy link
Member

Yeh, remove --dev from it too. It's deprecated, and is enabled by default.

@maximebeaudoin
Copy link
Contributor Author

Humm, The command "phpunit --coverage-text --coverage-clover=coverage.clover" exited with 255. when travis try to build one PHP 5.3. Any idea ?

@GrahamCampbell
Copy link
Member

Probably because it's scanning files with only php 5.4 valid syntax. :/

@maximebeaudoin
Copy link
Contributor Author

This weird because i don't see any php 5.4 syntax in illuminate/contracts

Edit: no i see php 5.4 array []

@hipsterjazzbo
Copy link

What is left to be done before this can be merged? Is it just figuring out how to make travis do it's thing?

@maximebeaudoin
Copy link
Contributor Author

@hipsterjazzbo Unfortunately, the package illumintate/contracts require php 5.4 and we can't run the test on travis php 5.3 environment because of this. So, i don't know how to deal with this at the moment.

@hipsterjazzbo
Copy link

Hmm. It's not really a matter of just getting travis to pass tests thought right? Like, if a dependency has 5.4 requirement, you won't be able to use it on 5.3 anyway?

In that case, you either have to bump the PHP version requirement, or get rid of the dependency, right?

@GrahamCampbell
Copy link
Member

I think we should just drop php 5.3 support totally. It's eol anyway. That would simplify this.

// cc @philsturgeon

@philsturgeon
Copy link
Member

philsturgeon commented Feb 14, 2015 via email

@GrahamCampbell
Copy link
Member

@philsturgeon Sounds like a plan. @maximebeaudoin Are you able to update your pull request, or should I send a new one?

@maximebeaudoin
Copy link
Contributor Author

@GrahamCampbell I'll update mine in few minutes.

@GrahamCampbell
Copy link
Member

Great. :)

@@ -24,6 +24,7 @@
"phpunit/phpunit": "~4.0",
"mockery/mockery": "~0.9",
"illuminate/pagination": "~4.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to make this ~5.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even remove it if the contracts repo does the job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove "illuminate/pagination".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggests block probably need updating too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh, i think we should still "suggest" the pagination component itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, i'll keep it

@maximebeaudoin maximebeaudoin force-pushed the feature/laravel-5-paginator branch from efdaefd to c0cf402 Compare February 14, 2015 15:57
@GrahamCampbell
Copy link
Member

I don't think we should rename the paginator class btw.

@maximebeaudoin
Copy link
Contributor Author

@GrahamCampbell Yea, i'm wondering too because we have two different type of paginator into Laravel 5, but we can only support LengthAwarePaginator because some method implementation missing in default paginator

@philsturgeon
Copy link
Member

Yeah im ok with just supporting length aware. It sounds like the other one would fit in as a cursor better anyway

@maximebeaudoin
Copy link
Contributor Author

So i keep the name IlluminatePaginatorAdapteror IlluminateLengthAwarePaginatorAdapter ?

@GrahamCampbell
Copy link
Member

IlluminatePaginatorAdapter is better imo. I see no reason to change it. The old one was length aware too.

@maximebeaudoin maximebeaudoin force-pushed the feature/laravel-5-paginator branch from c0cf402 to 33fac71 Compare February 14, 2015 16:18
Also bump php version from 5.3 to 5.4 and remove the old paginator adapter. Laravel 4 paginator is no longer supported.
@maximebeaudoin maximebeaudoin force-pushed the feature/laravel-5-paginator branch from 33fac71 to 07272ca Compare February 14, 2015 16:21
@maximebeaudoin
Copy link
Contributor Author

I think this is it !

@GrahamCampbell
Copy link
Member

You need to bump the minor version in the branch alias too since this is a breaking change.

@GrahamCampbell
Copy link
Member

Otherwise, 👍.

@philsturgeon
Copy link
Member

IlluminatePaginatorAdapteror please

@philsturgeon
Copy link
Member

Sorry my email client is f**ked up.

philsturgeon added a commit that referenced this pull request Feb 14, 2015
@philsturgeon philsturgeon merged commit 391d2da into thephpleague:master Feb 14, 2015
@philsturgeon
Copy link
Member

I'll do that. Thank you!

@maximebeaudoin maximebeaudoin deleted the feature/laravel-5-paginator branch August 19, 2015 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants