Sets which partial view script to use for rendering tweets

@param  string|array $partial
@return \UthandoTwitter\View\TweetFeed
181
public function setPartial($partial)
    {
        if (null === $partial || is_string($partial) || is_array($partial)) {
            $this->partial = $partial;
        }

        return $this;
    }
1362216
public function renderPartial($partialName, $sectionName, array $variables)
    {
        if (!isset($this->partialIdentifierCache[$partialName])) {
            $this->partialIdentifierCache[$partialName] = $this->getPartialIdentifier($partialName);
        }
        $partialIdentifier = $this->partialIdentifierCache[$partialName];

        if ($this->templateCompiler->has($partialIdentifier)) {
            $parsedPartial = $this->templateCompiler->get($partialIdentifier);
        } else {
            $this->templateParser->setConfiguration($this->buildParserConfiguration());
            $parsedPartial = $this->templateParser->parse($this->getPartialSource($partialName));
            if ($parsedPartial->isCompilable()) {
                $this->templateCompiler->store($partialIdentifier, $parsedPartial);
            }
        }

        /** @var $variableContainer TemplateVariableContainer **/
        $variableContainer = $this->objectManager->get(\TYPO3\Fluid\Core\ViewHelper\TemplateVariableContainer::class, $variables);
        $renderingContext = clone $this->getCurrentRenderingContext();
        $renderingContext->injectTemplateVariableContainer($variableContainer);

        $this->startRendering(self::RENDERING_PARTIAL, $parsedPartial, $renderingContext);
        if ($sectionName !== null) {
            $output = $this->renderSection($sectionName, $variables);
        } else {
            $output = $parsedPartial->render($renderingContext);
        }
        $this->stopRendering();

        return $output;
    }
138418
public static function getLimit($partial = true) {
		if ($partial) {
			$limit = elgg_get_plugin_setting('comments_limit', 'hypeInteractions');
			return $limit ?: 3;
		} else {
			$limit = elgg_get_plugin_setting('comments_load_limit', 'hypeInteractions');
			return min(max((int) $limit, 20), 200);
		}
	}
733925
public function registerPartial($name, $partial = false)
    {
        $partials = [];
        if (is_array($name)) {
            $partials = $name;
        } elseif (is_object($name)) {
            $partials = get_object_vars($name);
        }

        if (count($partials)) {
            $this->registerPhpArray('partial', $partials);
        } elseif ($partial === false) {
            $this->registerJavascriptObject('partial', $name);
        } else {
            $this->register('partial', $name, $partial);
        }
    }
930326
public function partial( $args = null ) {
		if ( is_null( $args ) ) {
			return $this->partial;
		} elseif ( is_array( $args ) ) {
			$this->partial = new Partial( $this->get_id(), $args );
		}
	}
1278809
public function setTwitterUrl($twitterUrl, $locale = null)
    {
        $this->translate($locale, false)->setTwitterUrl($twitterUrl);
        $this->mergeNewTranslations();

        return $this;
    }
976388
public function pushTweet($tweet)
    {
        if ($this->maxPushesPerHour > 0 && $this->cache) {
            $hourAgo = new \DateTime('- 1 hour');
            /** @var \DateTime[] $tweetTimes */
            $tweetTimes = $this->cache->fetch(static::CACHE_KEY) ?: [];
            foreach ($tweetTimes as $k => $time) {
                if ($time < $hourAgo) {
                    unset($tweetTimes[$k]);
                }
            }
            if (($count = count($tweetTimes)) >= $this->maxPushesPerHour) {
                throw new MaxPushesPerHourException("Cannot send push, $count have already been sent. The limit is {$this->maxPushesPerHour}");
            }
            $tweetTimes[] = new \DateTime();
            $this->cache->save(static::CACHE_KEY, $tweetTimes, 3600);
        }

        $m = $this->getMessageForTweet($tweet);

        if ($this->topicArn) {
            $this->messages->send($m, $this->topicArn);
        } else {
            $this->messages->broadcast($m);
        }
    }
640823
private function processResults($results)
        {
            if (!empty($results->errors))
            {
                throw new ErrorFetchingTwitter();
            }

            $response = [];

            foreach ($results->statuses as $tweet)
            {
                $response[] = $tweet->text;
            }

            return $response;
        }
919702
public function tweetUrl($msg, $shortenUrls = false) {
        $url = 'http://twitter.com/?status=';
        if ($shortenUrls) {
            $msg = preg_replace_callback(
                '~https?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?~i',
                function ($matches) {
                    $_this = new G_View_Helper_Social();
                    return $_this->tinyUrl($matches[0]);
                },
                $msg
            );
        }
        $url .= urlencode($msg);
        return $url;
    }
975279
public function partial($view)
    {
        $path = '../App/' . $this->viewsDir . $view . '.phtml';
        if (file_exists($path)) {
            require $path;

        } else {
            die('No partial view file ' . $view . ' present in view directory.');
        }
    }
50219
public function script($url, $attributes = [], $secure = null)
    {
        $attributes['src'] = $this->url->asset($url, $secure);

        return $this->toHtmlString('<script' . $this->attributes($attributes) . '></script>');
    }
618232
public function getSearchTweets(array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->get('search/tweets', $parameters, $multipart, $appOnlyAuth);
    }
1141410
public function partial($file, array $variables = array())
    {
        extract($variables);

        if (substr($file, -4) !== '.php') {
            $file .= '.php';
        }

        $view = '';

        if ($tmpl = locate_template($file)) {
            ob_start();
            include($tmpl);
            $view = ob_get_contents();
            ob_end_clean();
        }

        return $view;
    }
1230427
public function setScripts(array $scripts): self
    {
        $this->_params = [];
        foreach ($scripts as $name => $script) {
            $this->addScript($name, $script);
        }

        return $this;
    }
1176922
public function setStatus($status)
    {
        $allowed_values = array('active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted');
        if ((!in_array($status, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted'");
        }
        $this->container['status'] = $status;

        return $this;
    }
704198
public static function getSource(array $compiledTemplates)
	{
		$map         = ['dynamic' => [], 'php' => [], 'static' => []];
		$tagNames    = [];
		$unsupported = [];

		// Ignore system tags
		unset($compiledTemplates['br']);
		unset($compiledTemplates['e']);
		unset($compiledTemplates['i']);
		unset($compiledTemplates['p']);
		unset($compiledTemplates['s']);

		foreach ($compiledTemplates as $tagName => $php)
		{
			$renderings = self::getRenderingStrategy($php);
			if (empty($renderings))
			{
				$unsupported[] = $tagName;
				continue;
			}

			foreach ($renderings as $i => list($strategy, $replacement))
			{
				$match = (($i) ? '/' : '') . $tagName;
				$map[$strategy][$match] = $replacement;
			}

			// Record the names of tags whose template does not contain a passthrough
			if (!isset($renderings[1]))
			{
				$tagNames[] = $tagName;
			}
		}

		$php = [];
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	public $enableQuickRenderer=true;';
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected $static=' . self::export($map['static']) . ';';
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected $dynamic=' . self::export($map['dynamic']) . ';';

		$quickSource = '';
		if (!empty($map['php']))
		{
			$quickSource = SwitchStatement::generate('$id', $map['php']);
		}

		// Build a regexp that matches all the tags
		$regexp  = '(<(?:(?!/)(';
		$regexp .= ($tagNames) ? RegexpBuilder::fromList($tagNames) : '(?!)';
		$regexp .= ')(?: [^>]*)?>.*?</\\1|(/?(?!br/|p>)[^ />]+)[^>]*?(/)?)>)s';
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected $quickRegexp=' . var_export($regexp, true) . ';';

		// Build a regexp that matches tags that cannot be rendered with the Quick renderer
		if (!empty($unsupported))
		{
			$regexp = '(<(?:[!?]|' . RegexpBuilder::fromList($unsupported) . '[ />]))';
			$php[]  = '	/** {@inheritdoc} */';
			$php[]  = '	protected $quickRenderingTest=' . var_export($regexp, true) . ';';
		}

		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected function renderQuickTemplate($id, $xml)';
		$php[] = '	{';
		$php[] = '		$attributes=$this->matchAttributes($xml);';
		$php[] = "		\$html='';" . $quickSource;
		$php[] = '';
		$php[] = '		return $html;';
		$php[] = '	}';

		return implode("\n", $php);
	}
15757
public function registerPartial(string $name, string $partial): Handlebars
    {
        $this->runtime->addPartial($name, $partial);
        return $this;
    }