improved code styles #158 (#172)

* use php-cs-fixer instead of phpcodesniffer
* updated scrutinizer config
* adjusted code yules to all files
* updated CONTRIBUTING guidelines
This commit is contained in:
Kevin Papst
2018-06-22 21:09:10 +02:00
committed by GitHub
parent 773d27bb0e
commit cd7cbeae88
142 changed files with 775 additions and 467 deletions

View File

@@ -50,7 +50,7 @@ class NavbarShowUserSubscriber implements EventSubscriberInterface
*/
public function onShowUser(ShowUserEvent $event)
{
if ($this->storage->getToken() === null) {
if (null === $this->storage->getToken()) {
return;
}

View File

@@ -22,7 +22,6 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
*/
class ThemeOptionsSubscriber implements EventSubscriberInterface
{
/**
* @var TokenStorageInterface
*/
@@ -69,11 +68,11 @@ class ThemeOptionsSubscriber implements EventSubscriberInterface
$skin = '';
foreach ($user->getPreferences() as $ref) {
$name = $ref->getName();
if ($name === UserPreference::SKIN) {
if (UserPreference::SKIN === $name) {
$skin = 'skin-' . $ref->getValue();
}
if (strpos($name, 'theme.') !== false) {
if (false !== strpos($name, 'theme.')) {
$this->helper->setOption(str_replace('theme.', '', $name), $ref->getValue());
}
}
@@ -97,7 +96,7 @@ class ThemeOptionsSubscriber implements EventSubscriberInterface
}
// ignore events like the toolbar where we do not have a token
if ($this->storage->getToken() === null) {
if (null === $this->storage->getToken()) {
return false;
}

View File

@@ -27,7 +27,6 @@ use Symfony\Component\Validator\Constraints\Range;
*/
class UserPreferenceSubscriber implements EventSubscriberInterface
{
/**
* @var EventDispatcherInterface
*/
@@ -127,7 +126,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface
foreach ($event->getPreferences() as $preference) {
if (isset($prefs[$preference->getName()])) {
/** @var UserPreference $pref */
/* @var UserPreference $pref */
$prefs[$preference->getName()]
->setType($preference->getType())
->setConstraints($preference->getConstraints())
@@ -152,7 +151,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface
}
// ignore events like the toolbar where we do not have a token
if ($this->storage->getToken() === null) {
if (null === $this->storage->getToken()) {
return false;
}