Skip to content

Commit

Permalink
Merge pull request #3016 from TysonAndre/release-2.2.7
Browse files Browse the repository at this point in the history
Release Phan 2.2.7
  • Loading branch information
TysonAndre committed Jul 27, 2019
2 parents 6483476 + b9e9f04 commit bc684dd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
@@ -1,6 +1,6 @@
Phan NEWS

??? ?? 2019, Phan 2.2.7 (dev)
Jul 27 2019, Phan 2.2.7
-----------------------

New features(CLI, Configs):
Expand Down
26 changes: 15 additions & 11 deletions internal/dump_html_styles.php
Expand Up @@ -8,11 +8,13 @@
/**
* A utility to dump the terminal color codes as HTML styles
*/
class DumpHTMLStyles {
class DumpHTMLStyles
{
/**
* Given a terminal color name such as 'light_red', return 'style: LightRed'
*/
public static function generateCssForColor(string $color) : string {
public static function generateCssForColor(string $color) : string
{
$combination = [];
foreach (explode(',', $color) as $color_component) {
if ($color_component === 'none') {
Expand All @@ -24,12 +26,12 @@ public static function generateCssForColor(string $color) : string {
$name = 'background-color';
}
switch ($color_component) {
case 'yellow':
$color_component = 'orange';
break;
case 'light_red':
$color_component = 'orangered';
break;
case 'yellow':
$color_component = 'orange';
break;
case 'light_red':
$color_component = 'orangered';
break;
}
$combination[] = sprintf('%s: %s;', $name, str_replace('_', '', ucwords($color_component, '_')));
}
Expand All @@ -38,7 +40,8 @@ public static function generateCssForColor(string $color) : string {
/**
* Returns the colorscheme name as an HTML scheme.
*/
public static function generateHTMLStyle(string $color_scheme_name) : string {
public static function generateHTMLStyle(string $color_scheme_name) : string
{
$scheme = Colorizing::loadColorScheme($color_scheme_name);
if (!is_array($scheme)) {
throw new TypeError("Expected loadColorScheme to return an array");
Expand All @@ -57,7 +60,7 @@ public static function generateHTMLStyle(string $color_scheme_name) : string {
if ($color_name === 'none') {
continue;
}
$css_selector = implode(', ', array_map(function (string $template_name) : string {
$css_selector = implode(', ', array_map(static function (string $template_name) : string {
return '.phan_' . strtolower($template_name);
}, $template_names));
$entries[] = sprintf("%s {\n %s\n}", $css_selector, self::generateCssForColor($color_name));
Expand All @@ -69,7 +72,8 @@ public static function generateHTMLStyle(string $color_scheme_name) : string {
* Dumps all styles
* @suppress PhanAccessClassConstantInternal
*/
public static function main() : void {
public static function main() : void
{
foreach (Colorizing::COLOR_SCHEMES as $name => $_) {
$contents = self::generateHTMLStyle($name);
$background_color = stripos($name, 'light') !== false ? 'light' : 'dark';
Expand Down
3 changes: 2 additions & 1 deletion src/Phan/AST/Parser.php
Expand Up @@ -115,7 +115,8 @@ public static function parseCode(
}


private static function parseCodeHandlingDeprecation(CodeBase $code_base, Context $context, string $file_contents, string $file_path) : Node {
private static function parseCodeHandlingDeprecation(CodeBase $code_base, Context $context, string $file_contents, string $file_path) : Node
{
global $__no_echo_phan_errors;
// Suppress errors such as "declare(encoding=...) ignored because Zend multibyte feature is turned off by settings" (#1076)
// E_COMPILE_WARNING can't be caught by a PHP error handler,
Expand Down
2 changes: 1 addition & 1 deletion src/Phan/CLI.php
Expand Up @@ -62,7 +62,7 @@ class CLI
/**
* This should be updated to x.y.z-dev after every release, and x.y.z before a release.
*/
const PHAN_VERSION = '2.2.7-dev';
const PHAN_VERSION = '2.2.7';

/**
* List of short flags passed to getopt
Expand Down

0 comments on commit bc684dd

Please sign in to comment.