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

Feature: Zend Coding Standard 2 #52

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Feature: Zend Coding Standard 2 #52

wants to merge 2 commits into from

Conversation

geerteltink
Copy link
Member

No description provided.

@geerteltink geerteltink added this to In progress in Zend Coding Standard 2 Nov 18, 2018
@geerteltink geerteltink changed the title Zend Coding Style 2 Feature: Zend Coding Standard 2 Nov 18, 2018
@@ -31,7 +31,9 @@
"require-dev": {
"malukenho/docheader": "^0.1.5",
"phpunit/phpunit": "^7.0.2",
"zendframework/zend-coding-standard": "~1.0.0"
"squizlabs/php_codesniffer": "^3.3.2",
"webimpress/coding-standard": "dev-master",
Copy link
Member Author

Choose a reason for hiding this comment

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

Once webimpress/coding-standard#3 has a stable release, these lines can be removed.

@@ -110,7 +111,7 @@ public function __invoke(ContainerInterface $container) : TwigEnvironment
}
try {
$timezone = new DateTimeZone($timezone);
} catch (\Exception $e) {
} catch (Throwable $e) {
Copy link
Member

Choose a reason for hiding this comment

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

This change is not safe as it changes behavior and as such it is not up to a CS tool to decide. Intercepting exceptions is not quite the same as intercepting catchable php errors.

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case you actually want to catch everything. But most cases you catch specific component exceptions like Zend\Expressive\Exception\RuntimeException.

For the few exceptions the sniff can be disabled. Disabling sniffs is documented and so are the sniffs.

xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">

<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be added to gitignore?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. Either remove it or add it to .gitignore.

@@ -101,8 +100,8 @@ public function testCanSpecifyCacheDirectoryViaConfiguration()
public function testAddsTwigExtensionIfRouterIsInContainer()
{
$twigExtensionFactory = new TwigExtensionFactory();
$serverUrlHelper = $this->prophesize(ServerUrlHelper::class)->reveal();
$urlHelper = $this->prophesize(UrlHelper::class)->reveal();
$serverUrlHelper = $this->prophesize(ServerUrlHelper::class)->reveal();
Copy link
Member

Choose a reason for hiding this comment

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

@weierophinney
Copy link
Member

This repository has been closed and moved to mezzio/mezzio-twigrenderer; a new issue has been opened at mezzio/mezzio-twigrenderer#2.

@weierophinney
Copy link
Member

This repository has been moved to mezzio/mezzio-twigrenderer. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:

  • Squash all commits in your branch (git rebase -i origin/{branch})
  • Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
  • Run the laminas/laminas-migration tool on the code.
  • Clone mezzio/mezzio-twigrenderer to another directory.
  • Copy the files from the second bullet point to the clone of mezzio/mezzio-twigrenderer.
  • In your clone of mezzio/mezzio-twigrenderer, commit the files, push to your fork, and open the new PR.
    We will be providing tooling via laminas/laminas-migration soon to help automate the process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Zend Coding Standard 2
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants