Skip to content
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

SCA: minor code tweaks #30653

Merged
merged 1 commit into from Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -96,11 +96,7 @@ private function getKernel()
->expects($this->atLeastOnce())
->method('has')
->will($this->returnCallback(function ($id) {
if ('console.command_loader' === $id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this applies to 3.4 also - maybe others too? they should be submitted against 3.4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll re-check the PR changes against 3.4, thanks for reminding =)

return false;
}

return true;
return 'console.command_loader' !== $id;
}))
;
$container
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Cache/Adapter/SimpleCacheAdapter.php
Expand Up @@ -13,13 +13,12 @@

use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\PruneableInterface;
use Symfony\Component\Cache\ResettableInterface;
use Symfony\Component\Cache\Traits\ProxyTrait;

/**
* @author Nicolas Grekas <p@tchwork.com>
*/
class SimpleCacheAdapter extends AbstractAdapter implements PruneableInterface, ResettableInterface
class SimpleCacheAdapter extends AbstractAdapter implements PruneableInterface
{
use ProxyTrait;

Expand Down
11 changes: 5 additions & 6 deletions src/Symfony/Component/Dotenv/Dotenv.php
Expand Up @@ -33,7 +33,6 @@ final class Dotenv
private $lineno;
private $data;
private $end;
private $state;
private $values;

/**
Expand Down Expand Up @@ -111,27 +110,27 @@ public function parse($data, $path = '.env')
$this->lineno = 1;
$this->cursor = 0;
$this->end = \strlen($this->data);
$this->state = self::STATE_VARNAME;
$state = self::STATE_VARNAME;
$this->values = [];
$name = '';

$this->skipEmptyLines();

while ($this->cursor < $this->end) {
switch ($this->state) {
switch ($state) {
case self::STATE_VARNAME:
$name = $this->lexVarname();
$this->state = self::STATE_VALUE;
$state = self::STATE_VALUE;
break;

case self::STATE_VALUE:
$this->values[$name] = $this->lexValue();
$this->state = self::STATE_VARNAME;
$state = self::STATE_VARNAME;
break;
}
}

if (self::STATE_VALUE === $this->state) {
if (self::STATE_VALUE === $state) {
$this->values[$name] = '';
}

Expand Down
Expand Up @@ -105,7 +105,7 @@ public function configure(Event $event = null)
if (method_exists($kernel = $event->getKernel(), 'terminateWithException')) {
$request = $event->getRequest();
$hasRun = &$this->hasTerminatedWithException;
$this->exceptionHandler = function (\Exception $e) use ($kernel, $request, &$hasRun) {
$this->exceptionHandler = static function (\Exception $e) use ($kernel, $request, &$hasRun) {
if ($hasRun) {
throw $e;
}
Expand Down
Expand Up @@ -215,7 +215,7 @@ private function storeRelativeAgeDirective($directive, $value, $age)
}

if (false !== $this->ageDirectives[$directive]) {
$value = $value - $age;
$value -= $age;
$this->ageDirectives[$directive] = null !== $this->ageDirectives[$directive] ? min($this->ageDirectives[$directive], $value) : $value;
}
}
Expand Down
Expand Up @@ -47,7 +47,7 @@ public function __construct(UserInterface $user, $providerKey, array $roles)

// this token is meant to be used after authentication success, so it is always authenticated
// you could set it as non authenticated later if you need to
parent::setAuthenticated(true);
$this->setAuthenticated(true);
}

/**
Expand Down
Expand Up @@ -16,6 +16,6 @@
*
* @author Matt Johnson <matj1985@gmail.com>
*/
class InvalidTokenConfigurationException extends LogicException implements ExceptionInterface
class InvalidTokenConfigurationException extends LogicException
{
}