8000 Random fixes by nicolas-grekas · Pull Request #24855 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Random fixes #24855

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

Merged
merged 1 commit into from
Nov 7, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private function extractSupportedLoaders(array $loaders)
if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) {
$supportedLoaders[] = $loader;
} elseif ($loader instanceof LoaderChain) {
$supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getDelegatedLoaders()));
$supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getLoaders()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function extractSupportedLoaders(array $loaders)
if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) {
$supportedLoaders[] = $loader;
} elseif ($loader instanceof LoaderChain) {
$supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getDelegatedLoaders()));
$supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getLoaders()));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Cache/Adapter/PdoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Adapter;

use Doctrine\DBAL\Connection;
use Symfony\Component\Cache\Traits\PdoTrait;

class PdoAdapter extends AbstractAdapter
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/RedisTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function init($redisClient, $namespace = '', $defaultLifetime = 0)
throw new InvalidArgumentException(sprintf('RedisAdapter namespace contains "%s" but only characters in [-+_.A-Za-z0-9] are allowed.', $match[0]));
}
if ($redisClient instanceof \RedisCluster) {
$this->enableversioning();
$this->enableVersioning();
} elseif (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \Predis\Client) {
throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, is_object($redisClient) ? get_class($redisClient) : gettype($redisClient)));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Config/ResourceCheckerConfigCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ public function write($content, array $metadata = null)
$mode = 0666;
$umask = umask();
$filesystem = new Filesystem();
$filesystem->dumpFile($this->file, $content, null);
$filesystem->dumpFile($this->file, $content);
try {
$filesystem->chmod($this->file, $mode, $umask);
} catch (IOException $e) {
// discard chmod failure (some filesystem may not support it)
}

if (null !== $metadata) {
$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null);
$filesystem->dumpFile($this->getMetaFile(), serialize($metadata));
try {
$filesystem->chmod($this->getMetaFile(), $mode, $umask);
} catch (IOException $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
private $alternatives;

/**
* @param string $message Exception message to throw
* @param array $alternatives List of similar defined names
* @param int $code Exception code
* @param Exception $previous previous exception used for the exception chaining
* @param string $message Exception message to throw
* @param array $alternatives List of similar defined names
* @param int $code Exception code
* @param \Exception $previous Previous exception used for the exception chaining
*/
public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ private function addServiceInstance($id, Definition $definition, $isSimpleInstan
*
* @return bool
*/
private function isSimpleInstance($id, Definition $definition)
private function isSimpleInstance($id, Definition $definition, array $inlinedDefinitions)
{
foreach (array_merge(array($definition), $this->getInlinedDefinitions($definition)) as $sDefinition) {
foreach (array_merge(array($definition), $inlinedDefinitions) as $sDefinition) {
if ($definition !== $sDefinition && !$this->hasReference($id, $sDefinition->getMethodCalls())) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private function getContainerCompilerLogs()
private function sanitizeLogs($logs)
{
$sanitizedLogs = array();
$silencedLogs = array();

foreach ($logs as $log) {
if (!$this->isSilencedOrDeprecationErrorLog($log)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,12 @@ public function loadClassMetadata(ClassMetadataInterface $metadata)

return $success;
}

/**
* @return LoaderInterface[]
*/
public function getLoaders()
{
return $this->loaders;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@ public function loadClassMetadata(ClassMetadata $metadata)

return $success;
}

/**
* @return LoaderInterface[]
*/
public function getLoaders()
{
return $this->loaders;
}
}
48 changes: 24 additions & 24 deletions src/Symfony/Component/VarDumper/Caster/XmlReaderCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@
class XmlReaderCaster
{
private static $nodeTypes = array(
\XmlReader::NONE => 'NONE',
\XmlReader::ELEMENT => 'ELEMENT',
\XmlReader::ATTRIBUTE => 'ATTRIBUTE',
\XmlReader::TEXT => 'TEXT',
\XmlReader::CDATA => 'CDATA',
\XmlReader::ENTITY_REF => 'ENTITY_REF',
\XmlReader::ENTITY => 'ENTITY',
\XmlReader::PI => 'PI (Processing Instruction)',
\XmlReader::COMMENT => 'COMMENT',
\XmlReader::DOC => 'DOC',
\XmlReader::DOC_TYPE => 'DOC_TYPE',
\XmlReader::DOC_FRAGMENT => 'DOC_FRAGMENT',
\XmlReader::NOTATION => 'NOTATION',
\XmlReader::WHITESPACE => 'WHITESPACE',
\XmlReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE',
\XmlReader::END_ELEMENT => 'END_ELEMENT',
\XmlReader::END_ENTITY => 'END_ENTITY',
\XmlReader::XML_DECLARATION => 'XML_DECLARATION',
\XMLReader::NONE => 'NONE',
\XMLReader::ELEMENT => 'ELEMENT',
\XMLReader::ATTRIBUTE => 'ATTRIBUTE',
\XMLReader::TEXT => 'TEXT',
\XMLReader::CDATA => 'CDATA',
\XMLReader::ENTITY_REF => 'ENTITY_REF',
\XMLReader::ENTITY => 'ENTITY',
\XMLReader::PI => 'PI (Processing Instruction)',
\XMLReader::COMMENT => 'COMMENT',
\XMLReader::DOC => 'DOC',
\XMLReader::DOC_TYPE => 'DOC_TYPE',
\XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT',
\XMLReader::NOTATION => 'NOTATION',
\XMLReader::WHITESPACE => 'WHITESPACE',
\XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE',
\XMLReader::END_ELEMENT => 'END_ELEMENT',
\XMLReader::END_ENTITY => 'END_ENTITY',
\XMLReader::XML_DECLARATION => 'XML_DECLARATION',
);

public static function castXmlReader(\XmlReader $reader, array $a, Stub $stub, $isNested)
public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $isNested)
{
$props = Caster::PREFIX_VIRTUAL.'parserProperties';
$info = array(
Expand All @@ -49,17 +49,17 @@ public static function castXmlReader(\XmlReader $reader, array $a, Stub $stub, $
'nodeType' => new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType),
'depth' => $reader->depth,
'isDefault' => $reader->isDefault,
'isEmptyElement' => \XmlReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement,
'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement,
'xmlLang' => $reader->xmlLang,
'attributeCount' => $reader->attributeCount,
'value' => $reader->value,
'namespaceURI' => $reader->namespaceURI,
'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI,
$props => array(
'LOADDTD' => $reader->getParserProperty(\XmlReader::LOADDTD),
'DEFAULTATTRS' => $reader->getParserProperty(\XmlReader::DEFAULTATTRS),
'VALIDATE' => $reader->getParserProperty(\XmlReader::VALIDATE),
'SUBST_ENTITIES' => $reader->getParserProperty(\XmlReader::SUBST_ENTITIES),
'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD),
'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS),
'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE),
'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
),
);

Expand Down
0