From d73bb15fdad0d0ad1dcf42a9b2b9a7e513d77d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Thu, 2 Feb 2017 13:15:28 +0100 Subject: [PATCH 1/3] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 332b522..7c94fca 100644 --- a/LICENSE +++ b/LICENSE @@ -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: From 87532967d5fd7abeb43c54498e00205fc6b19e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Fri, 3 Mar 2017 10:35:18 +0100 Subject: [PATCH 2/3] Update composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 3307512..cee0e49 100644 --- a/composer.json +++ b/composer.json @@ -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", From 9203b42d585dbf4ea393e99283ce476c1890867a Mon Sep 17 00:00:00 2001 From: Maciej Kobus Date: Thu, 30 Mar 2017 11:56:59 +0200 Subject: [PATCH 3/3] EZEE-1446: Fix .php_cs config in EZEE repositories --- .php_cs | 38 +++++++++++++++------------- Client/YooChooseNotifier.php | 6 +---- EventListener/Login.php | 10 +++----- Rest/Controller/ExportController.php | 2 +- composer.json | 3 ++- 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.php_cs b/.php_cs index e58d5a2..e0f95af 100644 --- a/.php_cs +++ b/.php_cs @@ -1,25 +1,29 @@ 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') ) -; + ; diff --git a/Client/YooChooseNotifier.php b/Client/YooChooseNotifier.php index 68f3fca..1ed758c 100644 --- a/Client/YooChooseNotifier.php +++ b/Client/YooChooseNotifier.php @@ -19,7 +19,7 @@ */ class YooChooseNotifier implements RecommendationClient { - /** @var string */ + /** @var array */ protected $options; /** @var \GuzzleHttp\ClientInterface */ @@ -110,12 +110,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; } @@ -143,12 +141,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; } diff --git a/EventListener/Login.php b/EventListener/Login.php index 6d1dfad..86fbf58 100644 --- a/EventListener/Login.php +++ b/EventListener/Login.php @@ -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'), diff --git a/Rest/Controller/ExportController.php b/Rest/Controller/ExportController.php index c4ed911..abfb176 100644 --- a/Rest/Controller/ExportController.php +++ b/Rest/Controller/ExportController.php @@ -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']; } } diff --git a/composer.json b/composer.json index cee0e49..bdece24 100644 --- a/composer.json +++ b/composer.json @@ -16,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": {