Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Start using PSR-2 #2

Merged
merged 22 commits into from
Sep 12, 2018
Merged

Start using PSR-2 #2

merged 22 commits into from
Sep 12, 2018

Conversation

thewilkybarkid
Copy link
Contributor

No description provided.

public function bar ( $baz ,&$qux, bool$quux, ? string $quuz =null , string...$corge ):
void
{
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't include an abstract example yet, waiting for squizlabs/PHP_CodeSniffer#2148 to be merged/released.

<properties>
<property name="spacesCountBeforeColon" value="1"/>
</properties>
</rule>
<rule ref="Squiz.Classes.ClassFileName"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No example for traits yet, waiting for squizlabs/PHP_CodeSniffer#2140 to the merged/released.


namespace Vendor;

use Foo, Bar;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No function and const examples yet, waiting for squizlabs/PHP_CodeSniffer#2143 to be released.

Choose a reason for hiding this comment

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

How does this deal with PHP 7s grouped statements

use some\namespace\{ClassA, ClassB, ClassC as C};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was going to forbid them later, but looks like it already transforms them. Will add a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

ah nice it does it for the functions and consts too 👍

@thewilkybarkid thewilkybarkid changed the title [WIP] Start using PSR-2 Start using PSR-2 Sep 10, 2018
@thewilkybarkid
Copy link
Contributor Author

(Quick reviews would be useful, but will merge later this week otherwise.)

yield $file->getRelativePathname() => [
$parts['filename'] ?? 'test.php',
"{$file->getRelativePathname()}/{$parts['filename']}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's some caching inside Slevomat Coding Standard so we need to make sure these are all considered unique.

@@ -127,7 +144,7 @@ private function createFile(string $filename, string $content) : File
}

$file = new DummyFile(
"phpcs_input_file:${filename}\n{$content}",
"phpcs_input_file:before/${filename}\n{$content}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

---CONTENTS---
<?php

$foo = '890123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789';

Choose a reason for hiding this comment

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

Is there a fixed out there for splitting this across more than one line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not aware of one, probably quite a difficult task!

@thewilkybarkid thewilkybarkid merged commit 7c081e3 into libero:master Sep 12, 2018
@thewilkybarkid thewilkybarkid deleted the psr-2 branch September 12, 2018 13:37
@thewilkybarkid thewilkybarkid added this to the 0.1.0 milestone Sep 13, 2018
@thewilkybarkid thewilkybarkid added the feature New feature or request label Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants