Skip to content

Conversation

TomasVotruba
Copy link
Contributor

@TomasVotruba TomasVotruba commented Nov 13, 2017

Why?

What do you think?

@TomasVotruba
Copy link
Contributor Author

TomasVotruba commented Nov 13, 2017

Tests pass, fail is related to Scrutinzer.

I'd recommend moving to Coveralls and local coding standard checkers, since Scrutinizer is doing too much and failing with it quite often.

@jaapio
Copy link
Member

jaapio commented Nov 13, 2017

I agree with you that we should investigate moving to an other code style checker. I think we should split up service usage. So I would like to start using Coverall. For code style I'm still looking for a service that works well. Problem is that most services are equal to Scrutinizer. But we should consider a reconfiguration.

@TomasVotruba
Copy link
Contributor Author

TomasVotruba commented Nov 13, 2017

So I would like to start using Coverall

Awesome! I've added config and badge for coverage, just register repository there: https://coveralls.io/ - and disable "comments" and save, otherwise it will spam every PR and we will hate it :)

Problem is that most services are equal to Scrutinizer. But we should consider a reconfiguration.

I've been using Scrutinizer for years, but it didn't actually help much. I've seen many errors and fails I had to debug with support. Since then I try to use prefferable CI I tools I know how they work, are open-source and can fix my code locally = no extra work.

Thus, I moved from Scrutinizer to PHPStan and EasyCodingStandard (as in ReflectionDocBlock PR).

It's all I need and it handles most of important codes checks that could possibly exist. Even Cyclomatic Complexity that you know from phpmd.

Both easy to setup and easy to maintain. EasyCodingStandard even working for you with --fix

@TomasVotruba
Copy link
Contributor Author

Scrutinizer probably also needs to be removed from settings of this repository: https://github.com/phpDocumentor/TypeResolver/settings/installations

@jaapio
Copy link
Member

jaapio commented Nov 14, 2017

could you rebase this PR please. I'm missing the overview since I just merged #46 which had some overlap with this PR.

@jaapio
Copy link
Member

jaapio commented Nov 14, 2017

I have added this and other reflection repos to coversall.

@TomasVotruba
Copy link
Contributor Author

Sure, I'll get to that tomorrow

@TomasVotruba
Copy link
Contributor Author

TomasVotruba commented Nov 15, 2017

Rebased ✅

@TomasVotruba
Copy link
Contributor Author

Scrutinizer needs to be disabled in settings of this repository, or it will keep pinging every PR.

Copy link
Member

@jaapio jaapio left a comment

Choose a reason for hiding this comment

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

No real blocking changes but some minor details that would be nice to have resolved be for merging

@@ -47,7 +47,7 @@ public function createFromReflector(\Reflector $reflector)
$fileName = $reflector->getFileName();
$namespace = $reflector->getNamespaceName();

if (file_exists($fileName)) {
if ($fileName && file_exists($fileName)) {
Copy link
Member

Choose a reason for hiding this comment

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

could you make this more explicit, I generally don't trust the php casting model to booleans.
$fileName !== false

I think it would be nice to have a test for this as well.

Copy link
Contributor Author

@TomasVotruba TomasVotruba Nov 15, 2017

Choose a reason for hiding this comment

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

Well more correct would be is_strict(), since file_exists(true) fails as well.
I think test is not neccesary, it's php internal logic.

@@ -98,7 +98,7 @@ public function testReadsAliasesFromProvidedNamespaceAndContent()
*/
public function testTraitUseIsNotDetectedAsNamespaceUse()
{
$php = '<?php
$php = '<?php declare(strict_types=1);
Copy link
Member

Choose a reason for hiding this comment

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

Think this change was unintended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intended, this is consistent (tested) with the rest of the code.

@@ -120,7 +120,7 @@ class FooClass {
*/
public function testAllOpeningBracesAreCheckedWhenSearchingForEndOfClass()
{
$php = '<?php
$php = '<?php declare(strict_types=1);
Copy link
Member

Choose a reason for hiding this comment

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

Think this change was unintended?

@jaapio
Copy link
Member

jaapio commented Nov 15, 2017

Scrutinizer needs to be disabled in settings of this repository, or it will keep pinging every PR.

Done

@TomasVotruba
Copy link
Contributor Author

Done

@jaapio jaapio merged commit 7159da1 into phpDocumentor:master Nov 15, 2017
@TomasVotruba TomasVotruba deleted the php7 branch November 15, 2017 21:56
@TomasVotruba
Copy link
Contributor Author

Awesome! Thanks

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.

2 participants