-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined index: scope_closer UseStatementHelper.php #644
Comments
So i removed this three fixer causing the issue: <exclude name="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<exclude name="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseSpacing"/> Now I have:
Related file: <?php
declare(strict_types=1);
namespace AppBundle\Listener;
use AppBundle\Entity\User;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\OnFlushEventArgs;
final class UsernameChangeListener implements EventSubscriber
{
/**
* {@inheritdoc}
*/
public function getSubscribedEvents()
{
return [
'onFlush',
];
}
public function onFlush(OnFlushEventArgs $eventArgs): void
{
$em = $eventArgs->getEntityManager();
$uow = $em->getUnitOfWork();
foreach ($uow->getScheduledEntityUpdates() as $entity) {
if ($entity instanceof User && \array_key_exists('username', $uow->getEntityChangeSet($entity))) {
[$oldUsername, $newUsername] = $uow->getEntityChangeSet($entity)['username'];
$queryFormat = <<<'SQL'
UPDATE revisions SET username = '%s' WHERE username = '%s'
SQL;
$em->getConnection()->exec(\sprintf($queryFormat, $newUsername, $oldUsername));
}
}
}
} |
I'm sorry I'm not able to reproduce the error. Please provide failing test and then reopen the issue. |
@theofidry I see you had a similar problem in #526. Did you find any clue? |
Nope, couldn't find the time to dig into it at all :/ |
@soullivaneuh @theofidry It's probably bug in PHPCS itself. |
Here is a dump of
|
Yes, it's really bug in PHPCS itself. |
@kukulich Maybe. The |
Yes, because you cannot write class definition without |
Right, I think I found the related issue: squizlabs/PHP_CodeSniffer#2142 (comment) Thanks for your time @kukulich! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The file crashing the fixer:
The text was updated successfully, but these errors were encountered: