Skip to content

Commit

Permalink
Merge pull request #83 from webhdx/EZEE-1446_phpcs
Browse files Browse the repository at this point in the history
EZEE-1446: Fix .php_cs config in EZEE repositories
  • Loading branch information
lserwatka authored Apr 11, 2017
2 parents 1d30bde + 9203b42 commit 9ee1821
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
38 changes: 21 additions & 17 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
<?php

return Symfony\CS\Config\Config::create()
->setUsingLinter(false)
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'concat_with_spaces',
'-concat_without_spaces',
'-empty_return',
'-phpdoc_params',
'-phpdoc_separation',
'-phpdoc_to_comment',
'-spaces_cast',
'-blankline_after_open_tag',
'-single_blank_line_before_namespace',
return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'concat_space' => ['spacing' => 'one'],
'array_syntax' => false,
'simplified_null_return' => false,
'phpdoc_align' => false,
'phpdoc_separation' => false,
'phpdoc_to_comment' => false,
'cast_spaces' => false,
'blank_line_after_opening_tag' => false,
'single_blank_line_before_namespace' => false,
'phpdoc_annotation_without_dot' => false,
'phpdoc_no_alias_tag' => false,
'space_after_semicolon' => false,
])
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude([
'vendor',
])
->files()->name('*.php')
)
;
;
6 changes: 1 addition & 5 deletions Client/YooChooseNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class YooChooseNotifier implements RecommendationClient
{
/** @var string */
/** @var array */
protected $options;

/** @var \GuzzleHttp\ClientInterface */
Expand Down Expand Up @@ -131,12 +131,10 @@ public function updateContent($contentId)
{
try {
if (!in_array($this->getContentTypeIdentifier($contentId), $this->options['included-content-types'])) {

// this Content is not intended to be submitted because ContentType was excluded
return;
}
} catch (NotFoundException $e) {

// this is most likely a internal draft, or otherwise invalid, ignoring
return;
}
Expand Down Expand Up @@ -164,12 +162,10 @@ public function deleteContent($contentId)
{
try {
if (!in_array($this->getContentTypeIdentifier($contentId), $this->options['included-content-types'])) {

// this Content is not intended to be submitted because ContentType was excluded
return;
}
} catch (NotFoundException $e) {

// this is most likely a internal draft, or otherwise invalid, ignoring
return;
}
Expand Down
10 changes: 4 additions & 6 deletions EventListener/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ public function setCustomerId($value)
$this->options['customerId'] = $value;
}

/**
* {@inheritdoc}
*/
public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
{
if ($this->authorizationChecker->isGranted('IS_AUTHENTICATED_FULLY') || // user has just logged in
$this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED')) { // user has logged in using remember_me cookie

if (
$this->authorizationChecker->isGranted('IS_AUTHENTICATED_FULLY') // user has just logged in
|| $this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED') // user has logged in using remember_me cookie
) {
$notificationUri = sprintf($this->getNotificationEndpoint() . '%s/%s/%s',
'login',
$this->session->get('yc-session-id'),
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 1999-2016 eZ Systems AS. All rights reserved.
Copyright (C) 1999-2017 eZ Systems AS. All rights reserved.
This source code is provided under the following license:


Expand Down
2 changes: 1 addition & 1 deletion Rest/Controller/ExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ private function authenticate($filePath, ServerBag $server)
$user = $server->get('PHP_AUTH_USER');
$pass = crypt($server->get('PHP_AUTH_PW'), md5($server->get('PHP_AUTH_PW')));

return ($user == $auth['user'] && $pass == $auth['pass']);
return $user == $auth['user'] && $pass == $auth['pass'];
}
}
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "ezsystems/recommendation-bundle",
"description": "Integration of the YooChoose recommender engine into eZ Publish Platform",
"license": "GPL-2.0",
"type": "ezplatform-bundle",
"authors": [
{
"name": "eZ Systems",
Expand All @@ -15,7 +16,8 @@
},
"require-dev": {
"ezsystems/ezpublish-kernel": "~6.0.0 | ~5.1",
"phpunit/phpunit": "~4.7"
"phpunit/phpunit": "~4.7",
"friendsofphp/php-cs-fixer": "^2.1"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 9ee1821

Please sign in to comment.