-
Notifications
You must be signed in to change notification settings - Fork 14
Feature: Zend Coding Standard 2 #52
base: develop
Are you sure you want to change the base?
Conversation
@@ -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", |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh god, we went for alignment of assignments.
Context:
https://discourse.zendframework.com/t/poll-zend-coding-standard-2-aligning-statements-arrays-and-comment-tags/729
This repository has been closed and moved to mezzio/mezzio-twigrenderer; a new issue has been opened at mezzio/mezzio-twigrenderer#2. |
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:
|
No description provided.