Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -1,14 +1,8 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\Attribute.
*/
namespace Drupal\Core\Template;
use Drupal\Component\Render\PlainTextOutput;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\MarkupInterface;
/**
@ -139,7 +133,7 @@ class Attribute implements \ArrayAccess, \IteratorAggregate, MarkupInterface {
$value = new AttributeBoolean($name, $value);
}
// As a development aid, we allow the value to be a safe string object.
elseif (SafeMarkup::isSafe($value)) {
elseif ($value instanceof MarkupInterface) {
// Attributes are not supposed to display HTML markup, so we just convert
// the value to plain text.
$value = PlainTextOutput::renderFromHtml($value);
@ -318,7 +312,7 @@ class Attribute implements \ArrayAccess, \IteratorAggregate, MarkupInterface {
/**
* Implements the magic __clone() method.
*/
public function __clone() {
public function __clone() {
foreach ($this->storage as $name => $value) {
$this->storage[$name] = clone $value;
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\AttributeArray.
*/
namespace Drupal\Core\Template;
use Drupal\Component\Utility\Html;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\AttributeBoolean.
*/
namespace Drupal\Core\Template;
use Drupal\Component\Utility\Html;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\AttributeString.
*/
namespace Drupal\Core\Template;
use Drupal\Component\Utility\Html;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\AttributeValueBase.
*/
namespace Drupal\Core\Template;
use Drupal\Component\Utility\Html;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\Loader\FilesystemLoader.
*/
namespace Drupal\Core\Template\Loader;
use Drupal\Core\Extension\ModuleHandlerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\Loader\StringLoader.
*/
namespace Drupal\Core\Template\Loader;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\Loader\ThemeRegistryLoader.
*/
namespace Drupal\Core\Template\Loader;
use Drupal\Core\Theme\Registry;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\TwigEnvironment.
*/
namespace Drupal\Core\Template;
use Drupal\Core\Cache\CacheBackendInterface;

View file

@ -1,21 +1,10 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\TwigExtension.
*
* This provides a Twig extension that registers various Drupal specific
* extensions to Twig.
*
* @see \Drupal\Core\CoreServiceProvider
*/
namespace Drupal\Core\Template;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Core\Datetime\DateFormatter;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Render\RenderableInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Routing\UrlGeneratorInterface;
@ -25,7 +14,8 @@ use Drupal\Core\Url;
/**
* A class providing Drupal Twig extensions.
*
* Specifically Twig functions, filter and node visitors.
* This provides a Twig extension that registers various Drupal-specific
* extensions to Twig, specifically Twig functions, filter, and node visitors.
*
* @see \Drupal\Core\CoreServiceProvider
*/
@ -55,7 +45,7 @@ class TwigExtension extends \Twig_Extension {
/**
* The date formatter.
*
* @var \Drupal\Core\Datetime\DateFormatter
* @var \Drupal\Core\Datetime\DateFormatterInterface
*/
protected $dateFormatter;
@ -118,7 +108,7 @@ class TwigExtension extends \Twig_Extension {
*
* @return $this
*/
public function setDateFormatter(DateFormatter $date_formatter) {
public function setDateFormatter(DateFormatterInterface $date_formatter) {
$this->dateFormatter = $date_formatter;
return $this;
}
@ -438,7 +428,7 @@ class TwigExtension extends \Twig_Extension {
$return = (string) $arg;
}
// You can't throw exceptions in the magic PHP __toString() methods, see
// http://php.net/manual/en/language.oop5.magic.php#object.tostring so
// http://php.net/manual/language.oop5.magic.php#object.tostring so
// we also support a toString method.
elseif (method_exists($arg, 'toString')) {
$return = $arg->toString();
@ -450,7 +440,7 @@ class TwigExtension extends \Twig_Extension {
// We have a string or an object converted to a string: Autoescape it!
if (isset($return)) {
if ($autoescape && SafeMarkup::isSafe($return, $strategy)) {
if ($autoescape && $return instanceof MarkupInterface) {
return $return;
}
// Drupal only supports the HTML escaping strategy, so provide a
@ -487,13 +477,13 @@ class TwigExtension extends \Twig_Extension {
* @param mixed $arg
* String, Object or Render Array.
*
* @return mixed
* The rendered output or an Twig_Markup object.
*
* @throws \Exception
* When $arg is passed as an object which does not implement __toString(),
* RenderableInterface or toString().
*
* @return mixed
* The rendered output or an Twig_Markup object.
*
* @see render
* @see TwigNodeVisitor
*/
@ -521,7 +511,7 @@ class TwigExtension extends \Twig_Extension {
return (string) $arg;
}
// You can't throw exceptions in the magic PHP __toString() methods, see
// http://php.net/manual/en/language.oop5.magic.php#object.tostring so
// http://php.net/manual/language.oop5.magic.php#object.tostring so
// we also support a toString method.
elseif (method_exists($arg, 'toString')) {
return $arg->toString();

View file

@ -1,8 +1,9 @@
<?php
namespace Drupal\Core\Template;
/**
* @file
* Contains \Drupal\Core\Template\TwigNodeTrans.
* A class that defines the Twig 'trans' tag for Drupal.
*
* This Twig extension was originally based on Twig i18n extension. It has been
* severely modified to work properly with the complexities of the Drupal
@ -11,12 +12,6 @@
* @see http://twig.sensiolabs.org/doc/extensions/i18n.html
* @see https://github.com/fabpot/Twig-extensions
*/
namespace Drupal\Core\Template;
/**
* A class that defines the Twig 'trans' tag for Drupal.
*/
class TwigNodeTrans extends \Twig_Node {
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\TwigNodeVisitor.
*/
namespace Drupal\Core\Template;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\TwigPhpStorageCache.
*/
namespace Drupal\Core\Template;
use Drupal\Core\Cache\CacheBackendInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\TwigSandboxPolicy.
*/
namespace Drupal\Core\Template;
use Drupal\Core\Site\Settings;
@ -57,6 +52,7 @@ class TwigSandboxPolicy implements \Twig_Sandbox_SecurityPolicyInterface {
'bundle',
'get',
'__toString',
'toString',
]);
$this->whitelisted_methods = array_flip($whitelisted_methods);

View file

@ -1,13 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\Template\TwigTransTokenParser.
*
* @see http://twig.sensiolabs.org/doc/extensions/i18n.html
* @see https://github.com/fabpot/Twig-extensions
*/
namespace Drupal\Core\Template;
/**
@ -18,6 +10,8 @@ namespace Drupal\Core\Template;
* into PHP code usable for runtime execution of the template.
*
* @see \Twig_TokenParser
* @see http://twig.sensiolabs.org/doc/extensions/i18n.html
* @see https://github.com/fabpot/Twig-extensions
*/
class TwigTransTokenParser extends \Twig_TokenParser {