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

Update build process to use stages and PHPCS #817

Merged
merged 9 commits into from Sep 2, 2017
Merged

Conversation

lcobucci
Copy link
Member

@lcobucci lcobucci commented Aug 30, 2017

Applying the same things we have on the other projects

@@ -2,11 +2,11 @@

namespace Doctrine\Tests\Common\Reflection;

use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks useless since you're using FQCN.

@@ -23,7 +23,7 @@
use Doctrine\Common\Proxy\Proxy;
use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks useless since you're using FQCN.

@@ -52,7 +52,7 @@ public function getClassNamespace($className)
{
$namespace = '';
if (strpos($className, '\\') !== false) {
$namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 ));
$namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\')+1));
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be spaces around +?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should indeed. We need to find the sniff and add it to doctrine/coding-standard then. Could you do it?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is Squiz.WhiteSpace.OperatorSpacing, but it wasn't compatible with declare(strict_types=1) and reports it as violation. Ended up with a hack to ignore declare in our private CS. :/


const foo = \stdClass::class;
const FOO = \stdClass::class;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing visibility, maybe Doctrine CS should enforce it for 7.1+?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds like an awesome addition, since we have PHP 7.1+ on our packages I think we should enforce people to make things explicit. We should find/build the sniff to do that though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Have a look at slevomat/coding-standard, they provide a bunch of very interesting 7.1+ sniffs; I'm happily using them elsewhere. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems neat, could you send a PR to doctrine/coding-standard?

@@ -80,37 +78,36 @@ function (Proxy $proxy, $method, $params) use (&$counter) {
$proxy->__setInitializer(null);

$proxy->publicField = 'modifiedPublicField';
$counter += 1;
$counter += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering whether this alignment is correct? = are aligned, but + is not, it looks strange.

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK that's our standard. Maybe we can discuss that on doctrine/coding-standard

@Majkl578
Copy link
Contributor

The PHPStan error on Travis is strange (job 844.3), why is it looking for generated files? :/

@lcobucci
Copy link
Member Author

The PHPStan error on Travis is strange (job 844.3), why is it looking for generated files? :/

@Majkl578 no clue at all, it works just fine if you create the directory, quite weird.

@lcobucci
Copy link
Member Author

lcobucci commented Sep 2, 2017

@Majkl578 you were too fast HAHAHA I was about to add that commit 😜

@Majkl578
Copy link
Contributor

Majkl578 commented Sep 2, 2017

:trollface:
Yep, generated was previously created by running the tests before PHPStan, it's not valid now with stages. :)
Green now. 🎉

@lcobucci
Copy link
Member Author

lcobucci commented Sep 2, 2017

@Majkl578 feel free to merge it 😉

@Majkl578
Copy link
Contributor

Majkl578 commented Sep 2, 2017

Very well. :shipit:

@Majkl578 Majkl578 merged commit a3e240f into master Sep 2, 2017
@Majkl578 Majkl578 deleted the update-build-process branch September 2, 2017 17:52
@Majkl578
Copy link
Contributor

Majkl578 commented Sep 2, 2017

I'll let you know when the changes to doctrine/coding-standard are ready. 👍

@lcobucci
Copy link
Member Author

lcobucci commented Sep 2, 2017

@Majkl578 awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants