forked from wallabag/wallabag
@ -52,7 +52,7 @@ class ListUserCommand extends ContainerAwareCommand
|
||||
'%s/%s%s user(s) displayed.',
|
||||
count($users),
|
||||
$nbUsers,
|
||||
$input->getArgument('search') === null ? '' : ' (filtered)'
|
||||
null === $input->getArgument('search') ? '' : ' (filtered)'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ class ShowUserCommand extends ContainerAwareCommand
|
||||
sprintf('Email: %s', $user->getEmail()),
|
||||
sprintf('Display name: %s', $user->getName()),
|
||||
sprintf('Creation date: %s', $user->getCreatedAt()->format('Y-m-d H:i:s')),
|
||||
sprintf('Last login: %s', $user->getLastLogin() !== null ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'),
|
||||
sprintf('Last login: %s', null !== $user->getLastLogin() ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'),
|
||||
sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'yes' : 'no'),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ class ConfigController extends Controller
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if (count($tag->getEntries()) === 0) {
|
||||
if (0 === count($tag->getEntries())) {
|
||||
$em->remove($tag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ class EntryController extends Controller
|
||||
public function showUnreadAction(Request $request, $page)
|
||||
{
|
||||
// load the quickstart if no entry in database
|
||||
if ((int) $page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) {
|
||||
if (1 === (int) $page && 0 === $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId())) {
|
||||
return $this->redirect($this->generateUrl('quickstart'));
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ class ExportController extends Controller
|
||||
$methodBuilder = 'getBuilderFor' . $method . 'ByUser';
|
||||
$repository = $this->get('wallabag_core.entry_repository');
|
||||
|
||||
if ($category === 'tag_entries') {
|
||||
if ('tag_entries' === $category) {
|
||||
$tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
|
||||
|
||||
$entries = $repository->findAllByTagId(
|
||||
|
||||
@ -65,7 +65,7 @@ class TagController extends Controller
|
||||
$em->flush();
|
||||
|
||||
// remove orphan tag in case no entries are associated to it
|
||||
if (count($tag->getEntries()) === 0) {
|
||||
if (0 === count($tag->getEntries())) {
|
||||
$em->remove($tag);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class TablePrefixSubscriber implements EventSubscriber
|
||||
$classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]);
|
||||
|
||||
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
|
||||
if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
|
||||
if (ClassMetadataInfo::MANY_TO_MANY === $mapping['type'] && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
|
||||
$mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
|
||||
$classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ class StringToListTransformer implements DataTransformerInterface
|
||||
*/
|
||||
public function reverseTransform($string)
|
||||
{
|
||||
if ($string === null) {
|
||||
if (null === $string) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
|
||||
{
|
||||
// required by credentials below
|
||||
$host = strtolower($host);
|
||||
if (substr($host, 0, 4) === 'www.') {
|
||||
if ('www.' === substr($host, 0, 4)) {
|
||||
$host = substr($host, 4);
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
|
||||
|
||||
$extraFields = [];
|
||||
foreach ($extraFieldsStrings as $extraField) {
|
||||
if (strpos($extraField, '=') === false) {
|
||||
if (false === strpos($extraField, '=')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ class ContentProxy
|
||||
$date = $value;
|
||||
|
||||
// is it a timestamp?
|
||||
if (filter_var($date, FILTER_VALIDATE_INT) !== false) {
|
||||
if (false !== filter_var($date, FILTER_VALIDATE_INT)) {
|
||||
$date = '@' . $date;
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ class Matches
|
||||
{
|
||||
public function __invoke($subject, $pattern)
|
||||
{
|
||||
if ($pattern[0] === "'") {
|
||||
if ("'" === $pattern[0]) {
|
||||
$pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1));
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ class NotMatches
|
||||
{
|
||||
public function __invoke($subject, $pattern)
|
||||
{
|
||||
if ($pattern[0] === "'") {
|
||||
if ("'" === $pattern[0]) {
|
||||
$pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1));
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,6 @@ class Matches
|
||||
{
|
||||
public function __invoke($subject, $pattern)
|
||||
{
|
||||
return stripos($subject, $pattern) !== false;
|
||||
return false !== stripos($subject, $pattern);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,6 @@ class NotMatches
|
||||
{
|
||||
public function __invoke($subject, $pattern)
|
||||
{
|
||||
return stripos($subject, $pattern) === false;
|
||||
return false === stripos($subject, $pattern);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user